Saturday, March 10, 2012

Disable IPv6 on RHEL5

     On one of my RHEL5 boxes, there where a couple of services that were allergic to IPv6.  Hence I had to disable the IPv6 service, here is a rough how-to:

To disable IPv6 we have to do three things:

1) Disable the IPv6 kernel module
2) Remove / Disable IPv6 related network configuration entries.
3) Turn off IPv6-only services.

To disable kernel module, add following lines to /etc/modprobe.conf

alias net-pf-10 off
options ipv6 disable=1

Now remove ipv6 entries from network configuration file /etc/sysconfig/network

Change the setting NETWORKING_IPV6=yes
                to NETWORKING_IPV6=no

Also, remove any other IPv6 related settings you might find here.  Most probable ones are:
      
       IPV6_DEFAULTGW and IPV6_AUTOCONF

In addition you can also turn off ipv6 per Ethernet interface.  But in my experience, this is optional.

Go to /etc/sysconfig/network-scripts

Find if any interface have ipv6 turned on

      grep -i ipv6 ifcfg*

If enabled, you will find following entries in the ifcfg-INTERFACE files.

     IPV6INIT=yes
     IPV6ADDR=YOUR_IPv6_IP_HERE

Remove those entries.

Now disable any dedicated ipv6 based service.  Currently the only only ipv6 exclusive service I am aware of is iptable for ipv6 ( called ip6tables ).  Turn that off.

     service ip6tables stop
     chkconfig ip6table off

   All set, reboot the host and it will come up with ipv6 turned off.

     reboot