HTTP generate_204 检测网络连接是否正常

generate_204 是一个网络请求的特殊 URL,通常用于检测网络连接是否正常。当设备连接到一个需要认证的网络时,例如公共 Wi-Fi 或企业网络,设备会在浏览器中请求 generate_204 页面,以验证网络连接是否成功。

具体来说,当设备连接到一个需要认证的网络时,设备会尝试访问一个特定的 URL(通常是 generate_204)来检测网络连接状态。如果网络连接正常,服务器会返回一个非空的 HTTP 响应,通常是一个空白页面或一个特定的响应码(如 204 No Content)。这表明设备已成功连接到网络,并且可以正常访问互联网。

阅读全文»

VYOS 开源路由简易编译教程/镜像构建

这是一篇简短的文章,展示了如何构建自己的 VyOS LTS iso 映像。已经在 Debian Buster(Debian 10)通过测试!~

安装 Docker

$ sudo apt-get update
$ sudo apt-get install -y apt-transport-https ca-certificates curl gnupg2 software-properties-common
$ curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
$ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable"
$ sudo apt-get update
$ sudo apt-get install -y docker-ce

$ sudo usermod -aG docker <Your username>

注:国内网络环境可参考 https://mirror.tuna.tsinghua.edu.cn/help/docker-ce/

阅读全文»

VYOS 安装与基础命令

安装

vyos@vyos:~$ install image
Welcome to the VyOS install program.  This script
will walk you through the process of installing the
VyOS image to a local hard drive.
Would you like to continue? (Yes/No) [Yes]: Yes
Probing drives: OK
Looking for pre-existing RAID groups...none found.
The VyOS image will require a minimum 2000MB root.
Would you like me to try to partition a drive automatically
or would you rather partition it manually with parted?  If
you have already setup your partitions, you may skip this step
 
Partition (Auto/Parted/Skip) [Auto]:
 
I found the following drives on your system:
 sda    4294MB
 
Install the image on? [sda]:
 
This will destroy all data on /dev/sda.
Continue? (Yes/No) [No]: Yes
 
How big of a root partition should I create? (2000MB - 4294MB) [4294]MB:
 
Creating filesystem on /dev/sda1: OK
Done!
Mounting /dev/sda1...
What would you like to name this image? [1.2.0-rolling+201809210337]:
OK.  This image will be named: 1.2.0-rolling+201809210337
Copying squashfs image...
Copying kernel and initrd images...
Done!
I found the following configuration files:
    /opt/vyatta/etc/config.boot.default
Which one should I copy to sda? [/opt/vyatta/etc/config.boot.default]:
 
Copying /opt/vyatta/etc/config.boot.default to sda.
Enter password for administrator account
Enter password for user 'vyos':
Retype password for user 'vyos':
I need to install the GRUB boot loader.
I found the following drives on your system:
 sda    4294MB
 
Which drive should GRUB modify the boot partition on? [sda]:
 
Setting up grub: OK
Done!



vyos@vyos:~$ reboot
Proceed with reboot? (Yes/No) [No] Yes

阅读全文»

IPv4 / IPv6 双栈网络优先使用 IPv4 协议栈 Windows / Linux 设置方法

最近这几年国内网络基本都普及了 IPv4 / IPv6 双栈网络,可是在使用过程中,却经常发现 IPv6 的路由比较差,无论是响应速度还是质量都堪忧,就目前阶段而言国内 IPv6 的 Peer 还不能和 IPv4 相比。

根据 RFC3484 规定在双栈网络的情况下,默认都是优先使用 v6 协议,如果无法连接或超时则会回落 v4 这个时间大概是 300ms 左右。不过在实际使用过程中发现,使用 v6 访问时异常缓慢,原因如文章开头所述。例如在更新 Linux 软件包时如果使用优先的 v6 协议栈,那你就慢慢等吧。

阅读全文»