How to Disable IPv6 in Ubuntu 24.04 LTS How to Disable IPv6 in Ubuntu 24.04 LTS

How to Disable IPv6 in Ubuntu 24.04 LTS

How to Disable IPv6 in Ubuntu 24.04

Looking for the  solution to disable IPv6 in Ubuntu 24.04 LTS then this step by step beginner’s guide to disable IPv6 in Ubuntu 24.04 LTS is for you.

How To Disable IPv6 In Ubuntu 24.04 LTS

Disable IPv6 using Network Manager in Ubuntu

In this method, we will disable IPv6 using network manager in Ubuntu 24.04 LTS. Run the following command to list down the connections:

nmcli connection show

Our Output looks like this:

wifi_ctwn_5 d65a3713-a5cc-4620-9874-5c1a4f44ce63 wifi wlp0s20f3 
lo 9bc4395e-1fb9-40ca-8f3c-3bdc4532a81f loopback lo

As the ouput above,  I have wlp0s20f3 wifi device connected to wifi_ctwn_5 wifi network

nmcli device modify wlp0s20f3 ipv6.method "disabled"

Then now verify by running  ip addr to check all network interfaces

To disable ipv6 on per connection basis, wifi_ctwn_5 wifi network for example, use command:

nmcli connection modify wifi_ctwn_5 ipv6.method "disabled"

Important Note: In this method, you are only able to disable ipv6 for selected connection, while the network device is still having ipv6 address assigned.

Disable IPv6 using Kernel Parameters in Ubuntu

Use sysctl to disable IPv6 without reboot

Run the following command to disable IPv6 without reboot. With the help of following command, IPv6 will be disabled immediately and persist until you reboot the machine.

sudo sysctl --write net.ipv6.conf.all.disable_ipv6=1

Use Grub to load kernel with ipv6 disabled

In this method, you can configure Grub bootloader to load kernel with IPv6 disabled.

Run the following command to open the configuration file for Grub:

sudo nano /etc/default/grub

After opening the file, you need to add either ipv6.disable=1 or ipv6.disable_ipv6=1 as value of GRUB_CMDLINE_LINUX_DEFAULT and then press Ctrl+S to save and Ctrl+X to exit.

Now run the following command to update the grub.

sudo update-grub

			

Leave a Reply

Your email address will not be published. Required fields are marked *