Disabling IPv6 on Debian, Ubuntu, Centos, Fedora and Redhat Linux

I have no idea why I am posting how-to disable IPv6 on your Linux workstation or server – IPv6 is the only future, but here it goes:

Ubuntu:

Add /etc/sysctl.conf file with the following new lines and execute “sysctl -p” from ROOT shell:

net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1

 

Debian:

Execute the following command from ROOT shell, then reboot the server:

echo net.ipv6.conf.all.disable_ipv6=1 > /etc/sysctl.d/disableipv6.conf

 

Centos, Fedora and Redhat Linux:

Add the following lines to /etc/sysctl.conf, then execute “sysctl -p” from ROOT shell:

net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1

Or you can also execute the following commands in-real time from ROOT shell:

sysctl -w net.ipv6.conf.all.disable_ipv6=1
sysctl -w net.ipv6.conf.default.disable_ipv6=1

Keep in mind that IPv4 IP space is near depletion and IPv6 is the way to go.


Leave a Reply