Fedora

How to Disable IPv6 Completely on Fedora Linux 39

In most home networks, private IPv4 addresses are enough to give all the computers in your network an IP address. IPv4 addresses are easier to remember and work with. If you don’t need the IPv6 addresses for your network, you might consider disabling it on the computers on your network.

In this article, we will show you how to disable IPv6 for good on Fedora Linux 39 using a kernel boot option.

Topic of Contents:

  1. Checking If IPv6 Is Enabled
  2. Disable the IPv6 System-Wide Using the Kernel Boot Parameter
  3. Checking If IPv6 Is Disabled Completely
  4. Re-Enabling IPv6
  5. Conclusion

Checking If IPv6 Is Enabled

IPv6 is enabled by default on most modern Linux distributions including Fedora.

To check whether you have IPv6 enabled, you can use the “nmcli” command. If IPv6 is enabled, you will see a random IPv6 address assigned to each of the network interfaces of your computer.

$ nmcli

Another way to check if IPv6 is enabled is by checking whether you have the IPv6 kernel parameters set on your computer with the following command:

$ sudo sysctl -a | grep ipv6

As you can see, our Fedora 39 system has the IPv6 kernel parameters set. So, IPv6 is enabled in our case.

A screen shot of a computer Description automatically generated

Disable the IPv6 System-Wide Using the Kernel Boot Parameter

To disable IPv6 completely on Fedora 39 using the “ipv6.disable=1” kernel boot parameter, run the following command:

$ sudo grubby --update-kernel ALL --args 'ipv6.disable=1'

The “ipv6.disable=1” kernel boot parameter should be set for all the GRUB boot entries of Fedora 39 as you can see in the following screenshot:

$ sudo grubby --info ALL

A screenshot of a computer program Description automatically generated

For the changes to take effect, you must restart your Fedora 39 system.

$ sudo reboot

Checking If IPv6 Is Disabled Completely

Once IPv6 is disabled completely on your Fedora 39 system, you will see that only the IPv4 addresses are set on each of the network interfaces of your computer, no IPv6 addresses as before.

$ nmcli

A screenshot of a computer Description automatically generated

If IPv6 is disabled from the kernel, you won’t see any IPv6 kernel parameters set on your Fedora 39 system.

$ sudo sysctl -a | grep ipv6

The command returns nothing since IPv6 is completely disabled on our Fedora 39 system.

A black and white text Description automatically generated

Re-Enabling IPv6

If you later change your mind and you want to enable IPv6 again, just run the following command:

$ sudo grubby --update-kernel ALL --remove-args 'ipv6.disable=1'

The “ipv6.disable=1” kernel boot parameter should be removed from all the GRUB boot entries.

A screenshot of a computer Description automatically generated

For the changes to take effect, reboot your Fedora 39 system.

$ sudo reboot

Once your computer boots, you can confirm whether IPv6 is enabled as before using the “nmcli” or “sysctl” command.

Conclusion

In this article, we showed you how to check whether IPv6 is enabled or disabled on your computer. We also showed you how to disable IPv6 completely on Fedora 39 using the “ipv6.disable=1” kernel boot parameter and how to re-enable IPv6 on Fedora 39 in case you need it again.

About the author

Shahriar Shovon

Freelancer & Linux System Administrator. Also loves Web API development with Node.js and JavaScript. I was born in Bangladesh. I am currently studying Electronics and Communication Engineering at Khulna University of Engineering & Technology (KUET), one of the demanding public engineering universities of Bangladesh.