среда, 30 мая 2012 г.

How to disable ipv6 networking in Linux


1.

On up-to-date RHEL5 or CentOS5 (currently that means 5.10 aka 5U10)
Add the following line to /etc/sysctl.conf:
net.ipv6.conf.all.disable_ipv6 = 1
On a live system you can disable it with:
# echo 1 > /proc/sys/net/ipv6/conf/all/disable_ipv6
 On up-to-date RHEL6 or CentOS6 (currently that means 6.4 aka 6U4)
Add the following lines to /etc/sysctl.conf:
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
On a live system you can disable it with:
# echo 1 > /proc/sys/net/ipv6/conf/all/disable_ipv6
# echo 1 > /proc/sys/net/ipv6/conf/default/disable_ipv6

2.

Below listed are the location where you may have to check the entries for ipv6.
/etc/modprobe.conf
/etc/sysconfig/network
/etc/sysconfig/network-scripts/ifcfg-eth0
/etc/hosts
Lets start with /etc/modprobe.conf you may have to add these if they are not included in the files.
The /etc/modprobe.conf file is the first step, you do not need the ‘alias ipv6 off’ line however, but it does not hurt.
 alias net-pf-10 off
 alias ipv6 off

You also need to edit some other files, like /etc/sysconfig/network, /etc/sysconfig/network-scripts/ifcfg-eth0 file and others like maybe ifcfg-wlan0 for example.
# cat /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
NOZEROCONF=yes
HOSTNAME=superman

# cat /etc/sysconfig/network-scripts/ifcfg-eth0
# Please read /usr/share/doc/initscripts-*/sysconfig.txt
# for the documentation of these parameters.
TYPE=Ethernet
DEVICE=eth0
BOOTPROTO=dhcp
USERCTL=yes
IPV6INIT=no
PEERDNS=yes
ONBOOT=no

# cat /etc/sysconfig/network-scripts/ifcfg-wlan0
# Please read /usr/share/doc/initscripts-*/sysconfig.txt
# for the documentation of these parameters.
TYPE=Wireless
DEVICE=wlan0
HWADDR=
BOOTPROTO=dhcp
IPADDR=
NETMASK=
GATEWAY=
DOMAIN=
ONBOOT=yes
ONHOTPLUG=yes
USERCTL=yes
IPV6INIT=no
PEERDNS=no
Also check the /etc/hosts file is configured for IPv4 and not IPv6 only, as below;
# cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 superman localhost.localdomain localhost

Комментариев нет:

Отправить комментарий