Ubuntu Disable IPv6 Networking

Categories: Ubuntu

Am not a fan of disabling IPv6 but occasionally, you find software that does not play nice on systems that have dual v4 and v6 stacks running. And this is how to disable it on Ubuntu. These instructions will work on other Linux systems.


Edit /etc/sysctl.conf

Add the following code or simply uncomment them if they already exist.


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

And run the following command to effect these changes immediately. Its also safe to reboot as these changes will survive a reboot


sudo sysctl -p

That should be enough to disable IPv6 but if your applications are still picking it up, you can also edit grub to disable v6 at boot time.

edit /etc/default/grub and make the change below


GRUB_CMDLINE_LINUX_DEFAULT="ipv6.disable=1"

And finally


sudo update-grub

That’s all there is to it.

See also