Black Friday Upgrade offer is live! Get 89% off upgrading your PureVPN plan today. Upgrade to 5-year plan now! > Offer valid for existing users only.

How To Disable IPv6 on Linux/Ubuntu?

Jul 01, 2015
Aug 03, 2022
0 Comments
Download PDF

You might be wondering why you would want to disable IPv6 on your Ubuntu device. Perhaps you are having trouble connecting to certain devices or websites. Or maybe you’re just curious about this newer protocol. In any case, this tutorial will show you how to either temporarily or permanently disable IPv6 on Ubuntu 22.04 LTS.

Want more information about IPV6? Great! We have what you are looking for. Follow 👉 this article to read every detail about IPV6.

Disable IPv6 Temporarily on Ubuntu

If you are looking to temporarily disable the IPV6 of your Ubuntu 20.4 device then you can execute the following commands into the terminal.

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

The above commands will temporarily disable IPv6, meaning that the settings will not persist after reboot. To re-enable IPv6 reboot your system or execute the above commands again, however reverse the logic and change 1 to 0.

Disable IPV6 Permenantly on Ubuntu

Incase if you are looking to permenantly disable the IPV6 on your device. Then you can follow the steps provided below 👇

Before you start, open a command line terminal and use nano or your preferred text editor to open the GRUB configuration file with root permissions.

Command:
$ sudo nano /etc/default/grub

Next, change the following line. If your line already has some boot parameters configured such as splash or quiet, just append your change after them.

FROM: GRUB_CMDLINE_LINUX_DEFAULT=””
TO: GRUB_CMDLINE_LINUX_DEFAULT=”ipv6.disable=1″

After you have made that change to the file, save the changes and exit. Then, execute the following command to update GRUB.

Command:
$ sudo update-grub

Note
To re-enable the IPv6 network addresses simply remove the ipv6.disable=1 from the /etc/default/grub file and run the update-grub command.

How helpful did you find this answer?

Comments (0 )