How to Disable IPv6 for Redhat and Centos

Some applications or policies require that IPv6 be disabled on the server, since the IPv6 protocol is currently not a requirement. This article will explain how to disable IPv6 for Redhat (Rhel) and CentOS based Linux servers.

Disabling IPV6

Log into the server via SSH.

Verify that IPv6 is indeed running by typing the following;

“lsmod | grep ipv6″

If it returns any output, then IPv6 is enabled and you will need to disable it.

Modify the “modprobe” file by opening it with a text editor. In this example we will use VI.

“vi /etc/modprobe.conf”

In the file you will need to append at the end of the file the following;

“install ipv6 /bin/true”

Be sure to save the changes to the file.

You will also need to modify the “/etc/sysconfig/network-scripts/ifcfg-eth0″ file using VI and append it with the following;

“IPV6INIT=no”

“IPV6_AUTOCONF=no”

Be sure to save the changes to the file.

You will need to reboot the server in order for changes to take affect. Simply restarting the network service will not provide the required results.

Once the server is back online, log in and check to see if IPv6 is running by typing;

“lsmod | grep ipv6″

You will now see that no output is returned, showing that IPv6 is disabled.