四行命令搞定:
echo "NETWORKING_IPV6=no" >> /etc/sysconfig/network
echo -e "alias net-pf-10 off\noptions ipv6 disable=1" >> /etc/modprobe.d/dist.conf
sed -i 's/::1/#::1/g' /etc/hosts
chkconfig ip6tables off
完美、彻底关闭了IPv6,重启网络服务也不会报错,验证:
运行ifconfig或者netstat 没有相应的IPv6地址即可
原文链接:https://www.f2er.com/centos/381662.html