Disabling IPv6 on Ubuntu can be essential for users who face compatibility issues, experience network-related bugs, or want to simplify their network configuration. While IPv6 is a modern protocol intended to replace IPv4, not all environments fully support it. In some cases, especially in enterprise networks and development environments, it becomes necessary to fully turn off IPv6 to ensure smoother operations.
TL;DR
To disable IPv6 on Ubuntu, edit system configuration files to instruct the kernel and network interfaces to ignore IPv6. This can be done through modifying sysctl settings and, in some cases, adjusting GRUB settings. These steps help ensure IPv6 is completely deactivated even after system reboots. Be sure to run all commands with root or sudo privileges to apply changes successfully.
Why Disable IPv6?
Before diving into the step-by-step process, it’s important to understand why a user might want to disable IPv6. Here are a few common reasons:
- Compatibility Issues: Some older applications or network hardware may not fully support IPv6.
- Network Troubleshooting: Disabling IPv6 can help isolate and solve connectivity problems in dual-stack (IPv4 and IPv6) environments.
- Security: Disabling unused protocols can be part of security hardening.
- Internal Policy: Organizations may enforce the exclusive use of IPv4 for uniformity.
Step-by-Step Guide to Disable IPv6 on Ubuntu
The instructions provided here apply to current versions of Ubuntu, including Ubuntu 18.04, 20.04, and 22.04. The process involves three primary steps:
Step 1: Check if IPv6 is Enabled
Begin by checking the current status of IPv6 on your system. Open a terminal and run:
ip a | grep inet6
If you see IPv6 addresses in the output, it means IPv6 is currently enabled on some of your interfaces.
Step 2: Disable IPv6 Using sysctl
This is the recommended and most straightforward method. The sysctl utility allows dynamic modification of kernel parameters at runtime. Perform the following steps:
- Edit the sysctl configuration file:
sudo nano /etc/sysctl.confAdd these lines at the end of the file:
net.ipv6.conf.all.disable_ipv6 = 1 net.ipv6.conf.default.disable_ipv6 = 1 net.ipv6.conf.lo.disable_ipv6 = 1 - Apply the changes:
sudo sysctl -pThis command reloads the sysctl configuration and disables IPv6 system-wide.
Step 3: (Optional) Disable IPv6 via GRUB Bootloader
Although the sysctl method works in most situations, some users may still observe snippets of IPv6 activity. To entirely block IPv6 from being initialized by the kernel, you can also disable it in the GRUB configuration.
- Edit the GRUB file:
sudo nano /etc/default/grub - Find the line:
GRUB_CMDLINE_LINUX=""Modify it to include the following parameter:
GRUB_CMDLINE_LINUX="ipv6.disable=1" - Update GRUB:
sudo update-grub - Reboot the system:
sudo reboot
Verifying That IPv6 is Disabled
After restarting your system, verify that no IPv6 addresses are assigned to your network interfaces. Run:
ip a | grep inet6
If nothing is returned, IPv6 has been successfully disabled.
You can also double-check the current system settings:
cat /proc/sys/net/ipv6/conf/all/disable_ipv6
If the output is 1, IPv6 is disabled.
Alternative Method: Using Network Manager (GUI)
For users who prefer working with a graphical interface, the Network Manager in Ubuntu provides a simple way to turn off IPv6 per interface.
- Click on the network icon in the system tray.
- Select Settings or Network Settings.
- Choose the network interface (Wi-Fi or Ethernet) you want to configure.
- Go to the IPv6 tab.
- Set the IPv6 method to Ignore.
- Click Apply, then restart your network or reboot the system for changes to take effect.
Undoing the Changes (Re-enabling IPv6)
If you need to re-enable IPv6 at any point, simply reverse the steps:
- In
/etc/sysctl.conf, set thedisable_ipv6values back to 0. - In GRUB, remove
ipv6.disable=1if it was added. - Re-run
sudo sysctl -pandsudo update-grub. - Reboot your device.
Benefits of Disabling IPv6
- More Predictable Networking: By standardizing on IPv4, users eliminate quirks and connection issues related to dual-stack setups.
- Lower Attack Surface: Less complexity in the network stack can mean fewer potential vulnerabilities.
- Reduced Troubleshooting Time: Disabling IPv6 can help narrow down network diagnostics.
Risks and Considerations
Despite its advantages in some environments, disabling IPv6 isn’t always advisable. Here are a few things to keep in mind:
- Some modern applications expect IPv6 functionality and may perform slower or fail without it.
- Disabling IPv6 may conflict with future software updates or ISP requirements that use IPv6 by default.
- It’s best to disable IPv6 only when there is a clear reason and a proper fallback setup in place.
Frequently Asked Questions (FAQ)
- Q: Will disabling IPv6 affect my internet connection?
- A: In most cases, no. Most networks still rely on IPv4. However, if your ISP or services depend on IPv6, some functionality may be affected.
- Q: How do I know if IPv6 has been successfully disabled?
- A: Run
ip a | grep inet6after a reboot. If no output is shown, IPv6 has been disabled. - Q: Can I disable IPv6 only for specific interfaces?
- A: Yes, by modifying sysctl settings per interface, such as
net.ipv6.conf.eth0.disable_ipv6 = 1. - Q: Is there a command-line way to check GRUB parameters?
- A: You can use
cat /proc/cmdlineto check ifipv6.disable=1is being passed to the kernel. - Q: Does Network Manager override sysctl settings?
- A: Sometimes. It is best to use one method consistently throughout to avoid conflicts.
Disabling IPv6 on Ubuntu requires only a few configuration adjustments but provides significant benefits in some environments. Whether for troubleshooting, maintaining legacy support, or streamlining network performance, it’s a sought-after tweak that gives administrators more control.

