RHEL6关闭IPv6

来源:互联网 发布:淘宝新店装修教程 编辑:程序博客网 时间:2024/05/18 03:10

RHEL6关闭IPv6



1、在/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 
 
2、在 /etc/sysconfig/network新增一行内容:


NETWORKING_IPV6=noIPV6INIT=no 


Save and close the file. Restart networking service
# service network restart
# rmmod ipv6

 
3、禁止服务ip6tables随系统启动
#chkconfig ip6tables off


 
4、然后重启系统
#reboot


 
5、确认禁用ip是否禁用成功,运行如下命令,无内容输出即可
#ip -6 addr show
#lsmod |grep ipv6
原创粉丝点击