How can I completely disable IPv6 on Debian (squeeze)?

1

I'm running Debian Squeeze (with a stock 2.6.32 kernel). I'd like to completely disable any kind of IPv6 traffic. Can I do this? There doesn't seem to be any relevant module loaded. Perhaps some setting in /sys or /proc?

I read this, but my /etc/modprobe.d/aliases doesn't have a

alias net-pf-10 ipv6

line, it's commented-out already.

einpoklum

Posted 2013-03-08T22:03:18.530

Reputation: 5 032

I realize this is old but I just inherited a WMWare Debian 6.0 install and the IPv6 is throwing issues all over the network. I've read on various VMWare sites that the solution is to disable IPv6 on VMs, which has already been done on the windows VMs. And as you may have guessed, this is an old VMWare install 5.0. – htm11h – 2018-02-02T18:15:30.613

That's not IPv6 traffic. SRC=192.168.2.100 DST=192.168.2.255 – Michael Hampton – 2013-03-09T03:49:04.437

@MichaelHampton: You're right. But the question is still generally relevant. – einpoklum – 2013-03-10T05:10:55.827

In that case, I will have to remind future readers that disabling IPv6 is generally a really bad idea, and should not be done except as a last resort, as it will cause you problems later when you have to use IPv6. – Michael Hampton – 2013-03-10T05:16:50.113

@MichaelHampton It's a simple process to re-enable it, assumng you remember. I disabled it as a quick fix (I've since changed the preference properly) on openSUSE a while ago, because it preferred IPv6 which would take a while to time out - giving me a not-so-nice several second delay on every request... But, yea, there's almost alwys a better way than flat out disabling it. – Bob – 2013-03-10T05:21:57.080

FYI: A working solution is at http://askubuntu.com/a/337736/164798

– Tino – 2014-05-29T07:51:31.763

Answers

4

You can find the answer in Debian's Wiki:

# echo net.ipv6.conf.all.disable_ipv6=1 > /etc/sysctl.d/disableipv6.conf

But be aware that this disables IPv6 globally, so anything that needs it wont work properly.

1ace

Posted 2013-03-08T22:03:18.530

Reputation: 228

Note that you need to restart your computer for this to be applied, but you probably already knew that. – 1ace – 2013-03-09T00:22:25.483

To avoid a restart, you can load the configuration file with sysctl -p /etc/sysctl.d/disableipv6.conf (I'm not too sure about this - I normally only use it on /etc/sysctl.conf) or directly set the value (non-persistent) with echo 1 > /proc/sys/net/ipv6/conf/all/disable_ipv6 or sysctl -w net.ipv6.conf.all.disable_ipv6=1 – Bob – 2013-03-10T05:18:28.810

With Kernel 3.2.x this does not completely disable IPv6. It only disables IPv6 Kernel autoconfiguration. The IPv6 interface then is unconfigured and can induce major problems in IPv4-only-boxes. – Tino – 2014-05-29T07:26:39.333