Think before you speak, read before you think.

CentOS6禁用ipv6

1.修改/etc/sysconfig/network,添加:

NETWORKING_IPV6=no

2.修改/etc/hosts,将ipv6的那句本地主机名解析的也注释掉:

#::1 localhost localhost6 localhost6.localdomain6

3.让系统不加载ipv6相关模块,这需要修改modprobe相关设定文件,可以新建一个/etc/modprobe.d/ipv6off.conf,添加

alias net-pf-10 off
options ipv6 disable=1

4.重启系统,使用如下命令确认已经生效:

[root@test ~]# lsmod | grep -i ipv6
[root@test ~]# ifconfig | grep -i inet6

参考:http://www.litvip.com/499/


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *