一、在/etc/modprobe.d/目录下增长一个新的配置文件ipv6.conf网络
cat << EOF > /etc/modprobe.d/ipv6.conf
alias net-pf-10 off
alias ipv6 off
EOF
此步能够禁用ipv6可是重启网络报错:FATAL: Module off not found.因此建议使用下面更新的内容:
cat << EOF > /etc/modprobe.d/ipv6.conf
alias net-pf-10 off
options ipv6 disable=1
EOF
二、在 /etc/sysconfig/network新增一行内容:
NETWORKING_IPV6=off
三、禁止服务ip6tables随系统启动
#chkconfig ip6tables off
四、而后重启系统
#reboot
五、确认禁用ip是否禁用成功,运行以下命令,无内容输出便可
#ip -6 addr show
#lsmod |grep ipv6