Debian: Disable IPv6

Step-by-Step descriptions of how to do things.

Debian: Disable IPv6

Postby ^rooker » Thu Aug 21, 2014 4:40 pm

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.
  • 0

Jumping out of an airplane is not a basic instinct. Neither is breathing underwater. But put the two together and you're traveling through space!
User avatar
^rooker
Site Admin
 
Posts: 1444
Joined: Fri Aug 29, 2003 8:39 pm
Reputation: 0

IPv6: use "/etc/sysctl.d"

Postby ^rooker » Sun Mar 29, 2020 5:26 pm

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
  • 0

Jumping out of an airplane is not a basic instinct. Neither is breathing underwater. But put the two together and you're traveling through space!
User avatar
^rooker
Site Admin
 
Posts: 1444
Joined: Fri Aug 29, 2003 8:39 pm
Reputation: 0


Return to HowTo's

Who is online

Users browsing this forum: No registered users and 2 guests

Who is online over last 24 hours

Users browsed this forum in the last 24 hours: Bing [Bot] and 5 guests

Reputation System ©'