VPS 启用&禁用 IPv6

August 28, 2023 133hotness 0likes 0comments

vps ipv6

启用 IPv6 命令:

sysctl -w net.ipv6.conf.all.disable_ipv6=0
sysctl -w net.ipv6.conf.default.disable_ipv6=0

禁用 IPv6 命令:

sysctl -w net.ipv6.conf.all.disable_ipv6=1
sysctl -w net.ipv6.conf.default.disable_ipv6=1

永久禁用执行以下命令:

echo 'net.ipv6.conf.all.disable_ipv6=1' >> /etc/sysctl.conf
echo 'net.ipv6.conf.default.disable_ipv6=1' >> /etc/sysctl.conf

重新载入 sysctl 配置

sysctl --system # reload sysctl

如果重载, 还无效果, 可能要 reboot 重启下.

查看  IPv6 信息

 ip -6 addr show scope global
 curl ipv6.ip.sb

 

IPv6 缺点
启用 IPv6 地址, 网络协议规定优先使用 IPv6, IPv6 的线路质量可能无优化, 还有很多网站目前不支持 IPv6.

IPv6 用处
突破封锁(有些站点仅能 ipv6 访问, 或 ipv4 被封, 或者用 ipv6 解锁流媒体等)
突破限制(某些网络 ipv6 表现更优)

admin

Full Stack Developer

Comments