Disabling IPv6 on CentOS

I’ve seen a number of online articles on disabling IPv6 and they often involve blacklisting kernel modules, etc. which is a really bad idea.  In most cases it does not really need to be ‘disabled’ from a no support for IPv6 standpoint, typically the real problem is the fact that RedHat Enterprise, and thus CentOS and Scientific Linux, default to having SLAAC (Stateless Auto Configuration) enabled which means if any IPv6 router advertisements are detected on a given network, all the computers with SLAAC enabled are going to give themselves an IPv6 address even if you don’t want them to.  I’m really not sure of the logic behind having that on by default since it can make the eventual addition of IPv6 to an existing network turn into a nightmare, but it is what it is.

So anyway, to disable IPv6, just add the following line to the /etc/sysconfig/network file:

IPV6_AUTOCONF=no

and make sure the following pre-existing (most of the time) line is as shown below:

NETWORKING_IPV6=yes

Yes, that says IPV6=yes, even though we’re disabling it. Otherwise, autoconf keeps going even though you turned it off. Run a ‘service network restart’ and any auto configured address your computer gave itself should be gone; or if you’re getting ready to enable IPv6 on your routers, the computer won’t try to participate.

Leave a Reply

Your email address will not be published. Required fields are marked *