lost and found ( for me ? )

Ubuntu 11.04 Server , CentOS5.6 : How to disable IPv6

Here’s an explanation of how to disable IPv6 on Ubuntu Server 11.04 or CentOS 5.6.

[ Ubuntu 11.04 Server : disable IPv6 temporarily ]

You can disable IPv6 all NICs or per NIC by editing under /proc/sys/.. or sysctl.conf

disable IPv6 on all NICs
root@ubuntu-1:~# cat /proc/sys/net/ipv6/conf/all/disable_ipv6
0


0 means IPv6 is enabled
1 means IPv6 is disabled

disable IPv6 per NIC ( /proc/sys/net/ipv6/conf/ethX/disable_ipv6 )
root@ubuntu-1:~# cat /proc/sys/net/ipv6/conf/eth1/disable_ipv6
0


disable IPv6
root@ubuntu-1:~# ifconfig eth2 | grep inet6
         inet6アドレス: fe80::226:55ff:fee1:e83a/64 範囲:リンク
root@ubuntu-1:~#

root@ubuntu-1:~# echo 1 > /proc/sys/net/ipv6/conf/eth2/disable_ipv6
root@ubuntu-1:~#
root@ubuntu-1:~# ifconfig eth2 | grep inet6
root@ubuntu-1:~#

avahi-daemon[961]: Withdrawing address record for fe80::226:55ff:fee1:e83a on eth2.


enable IPv6 again
root@ubuntu-1:~# echo 0 > /proc/sys/net/ipv6/conf/eth2/disable_ipv6
root@ubuntu-1:~# ifconfig eth2 | grep inet6
         inet6アドレス: fe80::226:55ff:fee1:e83a/64 範囲:リンク


[ Ubuntu 11.04 Server: disable IPv6 permanently ]

edit /etc/sysctl.conf
root@ubuntu-1:~# tail -6 /etc/sysctl.conf
# disable IPv6 on all NICs
net.ipv6.conf.all.disable_ipv6=1

# disable IPv6 on eth0
net.ipv6.conf.eth0.disable_ipv6=1


[ CentOS5.6  ]
# ifconfig eth0 | grep inet6
         inet6 addr: fe80::6ab5:99ff:fe7c:9490/64 Scope:Link


at first , edit /etc/sysconfig/network file.
# cat /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no


second , make /etc/modprobe.d/disable-ipv6.conf file n’ add the following line.
# echo "options ipv6 disable=1" >> /etc/modprobe.d/disable-ipv6.conf


finally , reboot OS

After booting OS , IPv6 will be disabled.
# ifconfig eth0 | egrep -i inet6
#

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.