IPv6 is Internet Protocol version 6. It provides built-in security features, including IPsec. Thus, it encrypts your data to keep it secure and confidential. Through IPv6, your communication is secure across the network.
Additionally, IPv6 supports modern devices, including mobile networks. Compared to IPv4, it offers a more extensive address space and improved modern security features.
This educational post explains the process of disabling IPv6 on an Ubuntu 24.04 system.
How to Disable IPv6 on Ubuntu 24.04?
The following topic will be explained in this article:
How to Disable IPv6 on Ubuntu 24.04?
How to Enable IPv6 on Ubuntu 24.04?
How to Disable IPv6 on Ubuntu 24.04?
Through the following guidelines, you can easily disable IPv6 on your Ubuntu 24.04 system.
Step 1: Update Ubuntu 24.04 Files
Let’s begin with the update command to retrieve and install the latest software and security updates:
sudo apt update

This command is essential to update your Ubuntu machine before making any changes.
Step 2: Check Existing IPv6 Status
Next, view the existing status of IPv6 on your Ubuntu 24.04 system:
ip -6 addr show

The output above shows that IPv6 is already enabled on your Ubuntu 24.04 machine. Let’s proceed to disable IPv6 with a few steps.
Step 3: Update GRUB Configuration
To modify or update the IPv6 status, run this command to open the GRUB configuration file:
sudo nano /etc/default/grub

In the GRUB configuration file, navigate to the “GRUB_CMDLINE_LINUX_DEFAULT” line and add “ipv6.disable=1”, as shown below:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash ipv6.disable=1"

Step 4: Update GRUB Configuration
After making the necessary modifications in the configuration file, execute the command “update-grub” to apply the changes to your Ubuntu machine:
sudo update-grub

Step 5: Reboot the Ubuntu System
To ensure that the changes are completely applied, reboot your system:
reboot

This command will reboot your system from the terminal.
Step 6: Confirm “IPv6” is Disabled
Now, confirm that IPv6 has been disabled on your Ubuntu system:
ip -6 addr show

If the command has no output, it means IPv6 has been successfully disabled on your system.
How to Enable IPv6 on Ubuntu 24.04?
Perform the following steps to successfully enable the IPv6 on your Ubuntu 24.04 system.
Step 1: Enable IPv6
To enable IPv6 again on your Ubuntu system, open the GRUB configuration with this command:
sudo nano /etc/default/grub

Go to the line containing “GRUB_CMDLINE_LINUX_DEFAULT” and change the value, such as “ipv6.disable=0”:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash ipv6.disable=0"

Close the editor window after saving the changes.
To completely apply the changes in the GRUB configuration file, you will need to reboot your machine.
FAQs
How to Disable IPv6 on Ubuntu 24.04?
To disable IPv6, update the GRUB file. You can access the GRUB file with sudo nano /etc/default/grub, and add the line ipv6.disable=1, then update GRUB and reboot.
Can I Enable IPv6 on Ubuntu 24.04?
Yes, you can change “ipv6.disable=1” to “ipv6.disable=0” in the GRUB configuration file, then update the GRUB file and reboot your system.
How to access the GRUB configuration file on Ubuntu 24.04?
To open or access the GRUB file, use the command “sudo nano /etc/default/grub” from the Ubuntu 24.04 terminal.
Conclusion
In Ubuntu 24.04, it is easy to disable IPv6 with a few guided steps. Open the GRUB configuration file using the command sudo nano /etc/default/grub and add this line of code: GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash ipv6.disable=1″. To enable IPv6, change the value to ipv6.disable=0″.