1. Home
  2. Linux

How to disable IPv6 on Linux

IPv6 has been around for a while, and slowly but surely, the tech community is starting to embrace it. Still, even though techies are beginning to get on board with IPv6, it doesn’t mean that consumers are in love with the protocol. A lot of consumer-grade routers and networking equipment still don’t work with the protocol or even support it 100% of the time. For this reason, many consumers are looking to disable the IPv6 protocol at all costs.

One of the best places to disable IPv6 is on your computer. The main reason? It’s much easier to turn off, and best of all, no tinkering with your router is required.

The IPv6 protocol can be disabled on all of the big three operating systems. With that said, in this guide, we’ll only be covering how to disable IPv6 on Linux. Let’s get started!

Disable IPv6 via the terminal

Tweaking and changing the networking settings on Linux is usually reserved for the network icon on the panel. However, some might not be aware that it’s entirely possible to change how your machine handles the IPv6 protocol directly from the terminal by using the sysctl command.

Before we attempt to disable IPv6 on Linux through the sysctl command, we need to gain root access in the terminal. To gain root, go to the Linux terminal (by pressing Ctrl + Alt + T or Ctrl + Shift + T) and enter the su command.

Note: not able to use the su command on your Linux computer? Don’t worry! Try out sudo -s instead!

su -

Now that the shell has root access, it’s possible to use system-level commands with no issues. To disable IPv6, run the following command(s) below in the terminal window.

Fedora/OpenSUSE and other RedHat OSes

sysctl -w net.ipv6.conf.all.disable_ipv6=1

Ubuntu/Debian-based OSes

echo ' ' >> /etc/sysctl.conf
echo 'net.ipv6.conf.all.disable_ipv6 = 1' >> /etc/sysctl.conf

After you’ve executed the first command, the process isn’t done. Finish up by running these next commands. If they’re successful, your Linux machine should no longer have the ability to use IPv6.

Fedora/OpenSUSE and other RedHat OSes

sysctl -w net.ipv6.conf.default.disable_ipv6=1

Ubuntu/Debian-based OSes

echo 'net.ipv6.conf.default.disable_ipv6 = 1' >> /etc/sysctl.conf

echo 'net.ipv6.conf.lo.disable_ipv6 = 1' >> /etc/sysctl.conf

Disable IPv6 in Gnome Shell GUI

Those using the Gnome Shell desktop environment may choose to disable IPv6 through the network manager. It’s a good idea to do it this way if you’re a Gnome user and you’re not a fan of messing with the terminal and want a quick fix. Thankfully, shutting off the IPv6 settings in Gnome is just a couple of clicks.

Turning off this setting in Gnome is done with the Network Manager. To access the Network Manager, go to the top panel on the desktop and click on the network icon.

After selecting the Network Manager icon in the panel, locate either “Wired settings” or “Wi-Fi settings” and select it with the mouse to open up the networking settings for Gnome.

Selecting the Network settings will launch a settings window in Gnome. In this window, select the gear icon next to the network connection you use to access the internet.

Once you’ve selected the gear icon, a new window will appear labeled “Wired” or “Wi-Fi”. In this window, locate the “IPv6” tab and click on it.

Inside the IPv6 tab, find “IPv6 Method” and set it to disable, so that Gnome and Network Manager no longer have access to IPv6 connections.

Disable IPv6 in KDE Plasma 5 GUI

Like Gnome Shell, the KDE Plasma 5 Desktop environment gives users the ability to disable IPv6 right from the network interface settings.

To disable IPv6 through KDE, start by clicking on the network icon on the panel. Once selected, you’ll see a pop-up with network information appear, along with your current connection. Using the mouse, click on the gear icon.

Selecting the gear icon in the network window will bring up Plasma 5’s network connection settings. In this window, locate the “IPv6” tab.

Inside the “IPv6” tab in the connections window, find “Method” and set it to “Ignored” to tell the network connection to disregard IPv6 connections.

Disable IPv6 on GTK+ desktop environments

Using a light-weight GTK+ desktop environment such as Mate, XFCE, LXDE or something similar and looking to disable IPv6? Here’s what to do.

First, locate the network connection icon on the panel and click on it. From there, find the “Edit Connections” option and select it to open up the networking settings for your computer.

Locate the connection that you use to connect to the internet and select it with the mouse. Then, click the gear icon at the bottom right to access its settings.

After selecting the gear icon, find the “IPv6 Settings” tab and click it. Disable IPv6 by changing the menu next to “Method” to the “Ignore” mode and click “save” to apply the changes.

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.