绝对有效的 Centos 5.5 关闭IPV6方法!【2011年4月22日修正版本】

5.4及其以上版本的CentOS系统应该如下方法禁用ipv6:

可以修改下面两个文件以阻止IPv6内核模块的加载:
/etc/modprobe.conf – 内核模块配置文件
/etc/sysconfig/network – 网络配置文件

第一步:

vim /etc/modprobe.conf

在其中加入下面这一行,

install ipv6 /bin/true

保存并退出。

第二步:

vim /etc/sysconfig/network

在其中加入下面配置项:

NETWORKING_IPV6=no
IPV6INIT=no

保存并退出文件,重启网络与服务器:

service network restart
reboot

如果想检查当前IPv6是否已禁用,可以使用下列命令:

lsmod | grep ipv6
ifconfig -a

注:以上方法在CentOS5.5验证通过,同样适用于RHEL和Fedora。