How to Disable IPv6 on Ubuntu 26.04

Disabling IPv6 on Ubuntu 26.04 can resolve compatibility issues with legacy applications, simplify network troubleshooting, and address specific security requirements. While IPv6 is the future of networking, certain environments still require IPv4-only configurations. This guide walks you through the most effective methods to disable IPv6 on Ubuntu 26.04, with specific approaches for Desktop and Server installations.

In this tutorial you will learn:

  • How to check whether IPv6 is currently enabled
  • How to disable IPv6 temporarily for testing
  • How to disable IPv6 on Ubuntu Desktop using GNOME Settings
  • How to completely disable IPv6 on Desktop via GRUB
  • How to disable IPv6 on Ubuntu Server using sysctl
Disabling IPv6 on Ubuntu 26.04 terminal and network settings
Disabling IPv6 on Ubuntu 26.04 using terminal commands and GNOME network settings

Software Requirements

Software Requirements and Linux Command Line Conventions
Category Requirements, Conventions or Software Version Used
System Ubuntu 26.04 Resolute Raccoon (Desktop or Server)
Software GNOME Settings (Desktop), sysctl (Server)
Other Privileged access to your Linux system as root or via the sudo command.
Conventions $ – requires given linux commands to be executed as a regular non-privileged user or with sudo command for elevated privileges
TL;DR
The method to disable IPv6 on Ubuntu 26.04 depends on your installation type. Desktop uses GNOME Settings or GRUB, Server uses sysctl configuration.

Quick Steps to Disable IPv6
Environment Method
Desktop (network interfaces) Settings → Network → IPv6 → Disable
Desktop (complete) Add ipv6.disable=1 to GRUB and reboot
Server Add net.ipv6.conf.all.disable_ipv6 = 1 to /etc/sysctl.d/99-disable-ipv6.conf

Check Current IPv6 Status

Before making any changes, verify whether IPv6 is currently enabled on your Ubuntu 26.04 system. This step helps you confirm the current state and later verify that your changes took effect.

  1. Check IPv6 status via proc filesystem: The kernel exposes IPv6 configuration through the proc filesystem. A value of 0 means IPv6 is enabled, while 1 means disabled.
    $ cat /proc/sys/net/ipv6/conf/all/disable_ipv6

    If the output shows 0, IPv6 is currently active on your system.

  2. Verify with ip command: You can also check for IPv6 addresses assigned to your network interfaces.
    $ ip -6 addr show

    This command displays all IPv6 addresses. If you see addresses starting with fe80:: (link-local) or 2001: (global), IPv6 is functioning.

  3. Check network connectivity: Test IPv6 connectivity to confirm the protocol is operational.
    $ ping -6 -c 3 ipv6.google.com

    Successful replies indicate working IPv6 connectivity.

Checking IPv6 status on Ubuntu 26.04 showing enabled IPv6 addresses on loopback and ens18 interfaces
Terminal output showing IPv6 is enabled with addresses on both loopback (::1) and ens18 (fe80::) interfaces

Disable IPv6 Temporarily

Temporary disabling is useful for testing purposes on both Desktop and Server installations. These changes persist only until the next reboot, making them ideal for troubleshooting without committing to permanent modifications.

  1. Disable IPv6 for all interfaces at runtime: Use sysctl to modify kernel parameters immediately.
    $ sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1
    $ sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1

    These commands instantly disable IPv6 across all network interfaces.

  2. Disable IPv6 for a specific interface: If you only need to disable IPv6 on one interface, specify it by name.
    $ sudo sysctl -w net.ipv6.conf.ens18.disable_ipv6=1

    Replace ens18 with your actual interface name (use ip link show to list interfaces).

  3. Verify the change: Confirm IPv6 is now disabled.
    $ cat /proc/sys/net/ipv6/conf/all/disable_ipv6

    The output should now show 1. Additionally, verify no IPv6 addresses remain:

    $ ip -6 addr show

IMPORTANT
Runtime changes made with sysctl -w are lost after reboot. Use the permanent methods below based on whether you’re running Ubuntu Desktop or Server.

Temporarily disabling IPv6 on Ubuntu 26.04 using sysctl commands
Terminal showing sysctl commands to temporarily disable IPv6 with verification confirming disable_ipv6 is set to 1

Disable IPv6 on Desktop

Ubuntu Desktop uses NetworkManager to manage network connections. The simplest approach is to disable IPv6 through GNOME Settings. This method disables IPv6 on your network interfaces while leaving the loopback interface unchanged. If you require a complete IPv6 disable including loopback, use the GRUB method described below.

Using GNOME Settings GUI

  1. Open Network Settings: Click on the system menu in the top-right corner and select the gear icon next to your network connection, or navigate to Settings → Network.
  2. Access connection settings: Click the gear icon next to your active connection to open its settings.
  3. Disable IPv6: Select the IPv6 tab and change the IPv6 Method from “Automatic” to “Disable”.
  4. Apply changes: Click “Apply” to save the settings. You may need to toggle the connection off and on for changes to take effect.
  5. Verify IPv6 is disabled: Open a terminal and confirm the setting took effect.
    $ ip -6 addr show

    The output should show only the loopback interface with ::1. Your network interface (e.g., ens18) should not have any IPv6 addresses.

GNOME Network Settings on Ubuntu 26.04 showing IPv6 Method set to Disable
GNOME Network Settings dialog with IPv6 tab selected and Disable option enabled for the wired connection

IMPORTANT
The GUI method disables IPv6 on network interfaces but the loopback address (::1) remains active. For most use cases, this is sufficient. If you need to completely disable IPv6 including loopback, use the GRUB method below. The GRUB method also works on Ubuntu Server if you have the convenience to reboot the system.

Complete Disable via GRUB

For a complete IPv6 disable including the loopback interface, modify the kernel boot parameters through GRUB. This method removes IPv6 support entirely from the kernel.

  1. Edit the GRUB configuration: Open the GRUB defaults file.
    $ sudo nano /etc/default/grub
  2. Modify the kernel boot parameters: Find the line starting with GRUB_CMDLINE_LINUX_DEFAULT and add the IPv6 disable parameter.
    GRUB_CMDLINE_LINUX_DEFAULT="quiet splash ipv6.disable=1"
  3. Update GRUB: Regenerate the GRUB configuration file.
    $ sudo update-grub
  4. Reboot to apply: The kernel parameter takes effect on next boot.
    $ sudo reboot
  5. Verify IPv6 is completely disabled: After reboot, confirm the parameter was applied.
    $ cat /proc/cmdline | grep ipv6

    You should see ipv6.disable=1 in the output. Additionally, verify no IPv6 addresses exist:

    $ ip -6 addr show

    This command should return empty output.

Editing GRUB configuration file on Ubuntu 26.04 to add ipv6.disable=1 kernel parameter
Editing /etc/default/grub with nano showing ipv6.disable=1 added to GRUB_CMDLINE_LINUX_DEFAULT

INSTALLATION TIPS
The GRUB method completely removes IPv6 support from the kernel. Some applications may fail if they expect IPv6 to be present, even if unused. Try the GUI method first if possible.

Disable IPv6 on Server

Ubuntu Server typically doesn’t run NetworkManager, so sysctl configuration works reliably. The settings persist across reboots because no service overrides them. You can also disable IPv6 with Netplan for per-interface control.

  1. Create a dedicated configuration file: Best practice is to create a separate file rather than modifying the main sysctl.conf.
    $ sudo nano /etc/sysctl.d/99-disable-ipv6.conf
  2. Add the disable parameters: Insert the following lines into the file:
    net.ipv6.conf.all.disable_ipv6 = 1
    net.ipv6.conf.default.disable_ipv6 = 1
    net.ipv6.conf.lo.disable_ipv6 = 1

    The third line disables IPv6 on the loopback interface, which some applications check specifically.

  3. Apply the configuration: Load the new settings without rebooting.
    $ sudo sysctl --system

    This command reads all sysctl configuration files and applies them.

  4. Verify IPv6 is disabled: Confirm the settings took effect.
    $ cat /proc/sys/net/ipv6/conf/all/disable_ipv6

    The output should show 1. Additionally, verify no IPv6 addresses remain:

    $ ip -6 addr show

    This command should return empty output.

For more detailed network configurations, refer to the official Netplan documentation.

Conclusion

You now have effective methods to disable IPv6 on Ubuntu 26.04 for both Desktop and Server installations. On Ubuntu Desktop, the GNOME Settings GUI provides a quick solution for disabling IPv6 on network interfaces, while the GRUB kernel parameter method offers complete IPv6 removal when needed. On Ubuntu Server, the sysctl configuration method works reliably and persists across reboots.

Remember that IPv6 adoption continues to grow, and many services now prefer or require IPv6 connectivity. Therefore, consider whether disabling IPv6 is truly necessary for your specific situation, or if addressing the underlying compatibility issue might be a better long-term solution.

Frequently Asked Questions

  1. Why does the loopback interface still show IPv6 after using GNOME Settings? The GNOME Settings method only disables IPv6 on network interfaces managed by NetworkManager. The loopback interface (::1) is managed by the kernel directly. For most applications, this doesn’t cause issues. If you need complete IPv6 removal, use the GRUB method instead.
  2. Why doesn’t sysctl work on Ubuntu Desktop? Ubuntu Desktop uses NetworkManager to manage network connections. NetworkManager re-enables IPv6 on interfaces after the system boots, overriding any sysctl settings. Use GNOME Settings or the GRUB method instead.
  3. Will disabling IPv6 break any applications on Ubuntu 26.04? Most applications work fine without IPv6, as they fall back to IPv4. However, some modern services like certain container orchestration tools and newer peer-to-peer applications may require IPv6. Additionally, services configured to listen only on IPv6 addresses will become unreachable. Test your critical applications after making the change.
  4. Does disabling IPv6 improve security or performance? Disabling IPv6 eliminates a potential attack surface if your network doesn’t use IPv6. However, modern firewalls handle IPv6 well, so security benefits are minimal in properly configured systems. Performance impact is negligible either way, as the IPv6 stack consumes minimal resources when idle.
  5. How do I check if my system uses NetworkManager? Run systemctl status NetworkManager. If the service is active and running, your system uses NetworkManager and you should follow the Desktop instructions. Ubuntu Server installations typically don’t have NetworkManager unless manually installed.


Comments and Discussions
Linux Forum