How to disable ipv6 on an interface in Debian

When you start Debian 10, IPv6 networking is enabled by default. But in most cases, you need to disable the default IPV6 setting. However, we will give you a complete demo on how to disable the IPV6 interface on a Debian 10 system.

To execute all commands, you must have rights to execute system administrator commands.

First check if ipv6 is enabled on your Debian system or not. Open a terminal by typing “terminal” in the search bar and then click the displayed terminal icon in the search results. Use the following command to check your IP address:

$ ip a

The following result will display on your terminal to determine if IPV6 is enabled.

Disable IPV6 via systemctl:

Using the following three input commands, you can disable IPV6 on your system:

$ sudo sysctl -w net.ipv6.conf.all.disable_ipv6 = 1
$ sudo sysctl -w net.ipv6.conf.default.disable_ipv6 = 1
$ sudo sysctl -w net.ipv6.conf.lo.disable_ipv6 = 1

After running the above commands, IPV6 services will be disabled on your Debian system, but this is only a temporary solution. When you restart your system, it will turn it back on. Check the status by typing the “ip a” command.

ip a

To disable these IPV6 connections, you need to use the /etc/sysctl.conf file. Open this configuration file in any available editor. Here we use the nano editor to modify this file as shown in the following command:

$ sudo nano /etc/sysctl.conf

Now paste the following lines into this file and save it:

net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1

Paste the line below if you have a specific network interface adapter such as “enp0s3”:

net.ipv6.conf.enp0s3.disable_ipv6 = 1

To test your settings changes, enter the following command:

$ sudo sysctl -p

Method 1: Using the sysctl.d directory

Create a file in the /etc/sysctl.d directory using the following command:

$ sudo nano /etc/sysctl.d/disable-ipv6.conf

Paste the following line into this file:

net.ipv6.conf.all.disable_ipv6 = 1

Save and press Ctrl + X to exit this window.

Now check the effect of the changes using the following command:

$ sudo sysctl -p -f /etc/sysctl.d/disable-ipv6.conf

Run the following command to check the results:

$ ip a

As you can see from the above output, the IPV6 connections are disabled on this system.


We have provided you with a quick guide on how you can disable the IPv6 interface on your Debian 10 system. All of these commands can also be executed on an Ubuntu system. If you find this article helpful, let us know by leaving your feedback.

Related Posts