一、关闭IPv6地址
echo '# 关闭IPv6地址' >> /etc/sysctl.conf
echo 'net.ipv6.conf.all.disable_ipv6 = 1' >> /etc/sysctl.conf
echo 'net.ipv6.conf.default.disable_ipv6 = 1' >> /etc/sysctl.conf
echo 'net.ipv6.conf.lo.disable_ipv6 = 1' >> /etc/sysctl.conf
echo 'net.ipv6.conf.eth0.disable_ipv6 = 1' >> /etc/sysctl.conf
echo '' >> /etc/sysctl.conf
sysctl -p
二、验证
# 查看是否有IPv6地址
ip addr
# 查看访问外部IP地址
curl ip.sb
原创文章,作者:淡定定定哥,如若转载,请注明出处:https://www.iddddg.com/318.html