Centos6.x完全禁用IPv6的方法

一、centos6.x完全禁用IPv6的方法

1.修改/etc/sysconfig/network,追加:
echo "NETWORKING_IPV6=no" >>/etc/sysconfig/network

2.修改/etc/hosts,把ipv6的那句本地主机名解析的也注释掉:
#::1   localhost localhost6 localhost6.localdomain6

3.在/etc/modprobe.d/dist.conf结尾添加:
echo "alias net-pf-10 off" >>/etc/modprobe.d/dist.conf
echo "alias ipv6 off" >>/etc/modprobe.d/dist.conf

4、重启系统

reboot

5、查看网卡

ip a

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 00:0c:29:55:92:db brd ff:ff:ff:ff:ff:ff
inet 192.168.3.22/24 brd 192.168.3.255 scope global eth0

posted @ 2019-03-20 08:57  努力哥  阅读(2785)  评论(0编辑  收藏  举报