IPv6, Internet Protocol version 6 is the most recent version of the Internet Protocol (IP). It is a communications protocol which is used for identification and location for computers on networks. Its purpose it to route traffic across the Internet. This tutorial will show you how to temporarily or permanently disable IPv6 on Ubuntu 22.04 LTS Jammy Jellyfish.
In this tutorial you will learn:
- How to temporarily disable IPv6
- How to permanently disable IPv6
|Category||Requirements, Conventions or Software Version Used|
|System||Ubuntu 22.04 Jammy Jellyfish|
|Other||Privileged access to your Linux system as root or via the
# – requires given linux commands to be executed with root privileges either directly as a root user or by use of
$ – requires given linux commands to be executed as a regular non-privileged user
Disabling IPv6 address on Ubuntu 22.04 LTS Jammy Jellyfish step by step instructions
IPv6 networking can be disabled through systemd, but the change will not be permanent. To permanently disable IPv6 on Ubuntu 22.04, we will need to edit the kernel boot parameters.
Temporarily disable IPv6
To temporarily disable IPv6 address on Ubuntu 22.04 Jammy Jellyfish execute the following commands:
$ 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. In case you need more permanent solution to disable IPv6 even after system reboot follow the steps below:
Permanently disable IPv6
- Start by opening a command line terminal and using
nanoor your favorite text editor to open the following GRUB configuration file with root permissions.
$ sudo nano /etc/default/grub
- Next, change the following line. If your line already has some boot parameters configured such as
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.
$ sudo update-grub
In case you need to re-enable the IPv6 network addresses simply remove the
ipv6.disable=1 from the
/etc/default/grub file and run the
In this tutorial, you saw how to disable IPv6 networking on Ubuntu 22.04 Jammy Jellyfish Linux. This included a temporary solution with systemd and a permanent solution by editing the kernel boot parameters. You should no longer be able to use IPv6 addresses once these changes have been made, so your system will be stuck with only IPv4.