CentOS / RHEL 6 : How to disable IPv6

Post describes procedure to disable IPv6 on CentOS/RHEL 6. There are 2 ways to do this :
1. Disable IPv6 in kernel module (requires reboot)
2. Disable IPv6 using sysctl settings (no reboot required)

Method 1 : using /etc/modprobe.d/ipv6.conf

1. Check if IPV6 is enabled:

# ifconfig |grep inet6
  inet6 addr: fe80::d6be:d9ff:fe99:5a77/64 Scope:Link
  inet6 addr: fe80::d6be:d9ff:fe99:5a77/64 Scope:Link

2. Create /etc/modprobe.d/ipv6.conf if not already present with below parameter:

options ipv6 disable=1

3. Disable ipt6tables service

# chkconfig ip6tables off

4. Reboot the server

# shutdown -r now

5. Confirm if IPV6 is disabled:

# ifconfig |grep inet6
#

Method 2 : Using /etc/sysctl.conf

1. Append below line to the file /etc/sysctl.conf.

# IPv6 support in the kernel, set to 0 by default
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1

2. To make the settings affective, execute :

# sysctl -p
Related Post