27

I know there's a wiki entry http://wiki.debian.org/DebianIPv6#How_to_turn_off_IPv6 that shows how to disable IPv6 in Debian Squeeze, but that's a 2.6.* kernel.

What about 3.2.* kernels running Wheezy?

2

3 Answers 3

32

If you do sysctl -p, the reboot isn't necessary. It worked for me, but I prefer to keep params in single file, so I put the line above in the sysctl.conf file.

Just to be sure, I put a line about every device, so my solution is adding the following lines to /etc/sysctl.conf:

net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
net.ipv6.conf.eth0.disable_ipv6 = 1
net.ipv6.conf.eth1.disable_ipv6 = 1
net.ipv6.conf.ppp0.disable_ipv6 = 1
net.ipv6.conf.tun0.disable_ipv6 = 1
3
  • 13
    Isn't net.ipv6.conf.all.disable_ipv6 = 1 enough? At least iIt did the trick for all interfaces on my machine. Apr 16, 2015 at 23:14
  • 2
    Thanks for this! For some reason, on my Raspberry Pi just disabling via net.ipv6.conf.all.disable_ipv6 didn't work; adding an explicit line for my adapter did the trick!
    – Doktor J
    Jun 12, 2016 at 19:05
  • Same here: it didn't work using net.ipv6.conf.all.disable_ipv6; had to use a line specific for my adapter like this: net.ipv6.conf.enp6s0.disable_ipv6 = 1
    – Bruno
    Aug 24, 2018 at 16:13
14

Disabling IPv6 on more recent systems works the same way as described in the Debian wiki:

Disable ipv6 in kernel : echo net.ipv6.conf.all.disable_ipv6=1 > /etc/sysctl.d/disableipv6.conf will disable ipv6 at next reboot.

Keep in mind that, whatever problem you are having, this should be an absolute last resort after you have exhausted all other options for fixing the problem. IPv6 is not optional and you will have to turn it back on sooner or later.

6
  • Interestingly I still have ipv6 showing up after following the instructions and verifying the settings listed on the wiki pages persisted after reboots. It might have something to do with the fact that this is running on a vm hosted by someone else. Dec 6, 2013 at 16:44
  • @hobs Yes, some VM providers restrict what changes can be made to the guest's network configuration. Typically OpenVZ based ones. In this case, you definitely should forget about disabling IPv6 and instead try to resolve the actual problem. Feb 4, 2014 at 14:40
  • Definitely. I had no interest in doing this but as you may know, many legacy pieces of software with no future development have issues, and that is what I was working with. So, I wish! Feb 4, 2014 at 14:46
  • This didn't work for me. Jawa's approach did work though. I'm using BAMT1.1, not really sure which version of debian it's based on.
    – womp
    Feb 27, 2014 at 6:16
  • @MichaelHampton OpenVZ isn't a VM system, it's a container/chroot jail-based system, which is probably why you can't mess with its network settings like this...
    – Jules
    Apr 10, 2016 at 1:27
0

The most effective way to disable IPv6 is to add the kernel parameter ipv6.disable=1.

This is typically done in /etc/default/grub in the following line:

GRUB_CMDLINE_LINUX_DEFAULT="quiet ipv6.disable=1"

You need to run update-grub after you have changed the file.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .