Page 1 of 1

Debian: Disable IPv6

Posted: Thu Aug 21, 2014 4:40 pm
by ^rooker
For internal network computers, I disable IPv6 in most cases.

This here is basically just a copy of the "How to turn off IPv6" section on the Debian Wiki:

1) Edit /etc/sysctl.conf
and add the following parameters to kernel:

Code: Select all

net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
Note: This disables IPv6 on all network interfaces.
Optional: If you want to only disable it on specific ones, you can use a syntax like this:

Code: Select all

net.ipv6.conf.eth0.disable_ipv6 = 1
(This would apply only to "eth0" for example)

2) Apply changes:
After editing sysctl.conf, you should run sysctl -p to activate changes or reboot system.

That's it.

IPv6: use "/etc/sysctl.d"

Posted: Sun Mar 29, 2020 5:26 pm
by ^rooker
Another option that I now find slightly cleaner than modifying "/etc/sysctl.conf" directly, is to use the "/etc/sysctl.d" folder to keep this config separately (and easier to enable/disable it).

1) Create a file called "/etc/sysctl.d/70-disable-ipv6.conf"

2) Put the same lines in that file as you would into sysctl.conf directly

3) Save it and either reboot or reload sysctl:

Code: Select all

$ sysctl -p -f /etc/sysctl.d/70-disable-ipv6.conf
Feels cleaner :D

Useful IPv6 information

Posted: Sun Jul 26, 2020 4:28 pm
by peter_b