查看VPS的IPv6信息 输入命令: ip -6 addr show scope global 或者 curl ipv6.ip.sb 禁用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
是否应该关闭ipv6 如果没特殊用途, 建议直接关掉.