一、查看VPS是否具有IPv6
输入命令: ip -6 addr show scope global
或者 curl ipv6.ip.sb
二、禁用或启用IPv6
禁用VPS的IPv6命令:
sysctl -w net.ipv6.conf.all.disable_ipv6=1; sysctl -w net.ipv6.conf.default.disable_ipv6=1
启用VPS的IPv6命令:
sysctl -w net.ipv6.conf.all.disable_ipv6=0; sysctl -w net.ipv6.conf.default.disable_ipv6=0
重新载入sysctl配置
sysctl --system # reload sysctl
如果重载, 还无效果, 可能要 reboot 重启下.
三、永久禁用IPV6的方法:
在/etc/sysctl.conf中添加以下行后,即可永久禁用IPv6:
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
然后运行此命令以加载更改
sudo sysctl -p
© 版权声明
本站资源大多来自网络,如有侵犯权益请联系管理员,我们会第一时间审核删除。站内资源仅供学习测试,未经许可禁止商用,请在24小时内删除。
THE END





