Disabling IPv6 under a 2.6 kernel

Posted by chris on Mon 26 Jun 2006 at 08:37

Tags: ,

Sometimes you might have a host which you wish to disable IPv6 upon, this can be useful if you're having DNS timeouts when software attempts to resolve hostnames, and for other reasons.

To disable IPv6 it should be as simple as adding the lines

alias net-pf-10 off
alias ipv6 off

to /etc/modprobe.d/00local (creating the file if it exists).

It is important that this comes in a file earlier in an alphanumeric sort than aliases since that contains aliases that turn this on.

Once you've made this change/addition you will need to restart the box afterwards - since the modules won't unload.

Note: Rumours reach me (thanks Steve) on the following about KDE. Since I don't run KDE I can't confirm this part (it looks like it controls apps in KDE - but if the protocol is not loaded at the kernel level then I can't see why it should be necessary - but just in case ...).

According to this link there is another step: http://ubuntuforums.org/archive/index.php/t-77686.html

"Google finally revealed that you must add 
    KDE_NO_IPV6=true 
    to /etc/environment."

 

 


Posted by Anonymous (212.6.xx.xx) on Mon 26 Jun 2006 at 09:36
echo "install ipv6 /bin/true" > /etc/modprobe.conf

[ Parent | Reply to this comment ]

Posted by chris (217.8.xx.xx) on Mon 26 Jun 2006 at 15:31
[ Send Message | View Weblogs ]
Good link :)

[ Parent | Reply to this comment ]

Posted by Anonymous (89.120.xx.xx) on Sat 7 Oct 2006 at 20:02
It didn't work for me. But it did work with:

blacklist ipv6

in the same file (to prevent changes at upgrades).

[ Parent | Reply to this comment ]

Posted by Anonymous (77.5.xx.xx) on Thu 29 Mar 2007 at 19:30
Currently 00local will only be read first by chance because modprobe is sourcing /etc/modprobe.d in filesystem and not in alphabetical order (see Debian bug #397765).

[ Parent | Reply to this comment ]

Posted by Anonymous (71.118.xx.xx) on Fri 26 Oct 2007 at 21:21
Editing /etc/modprobe.d/aliases making the change:

s/alias net-pf-10 ipv6/alias net-pf-10 off

is equally effective. If not more so.

[ Parent | Reply to this comment ]

Posted by Anonymous (62.177.xx.xx) on Tue 18 Nov 2008 at 10:59
By disabling ipv6, you may experience as in my case a stunning drop of memory usage at bootup of average 200Mbytes in a typical LAMP server.

[ Parent | Reply to this comment ]

Posted by Anonymous (217.255.xx.xx) on Mon 1 Jun 2009 at 12:23
How to disable ipv6 with latest 2.6.26-2 kernels where ipv6 is no longer module but compiled into the kernel?

[ Parent | Reply to this comment ]

Posted by Anonymous (80.216.xx.xx) on Sun 27 Sep 2009 at 19:30
I would be interested in this too, any solution yet (except recompile...)?

[ Parent | Reply to this comment ]

Posted by Anonymous (212.47.xx.xx) on Wed 11 Nov 2009 at 11:34
Execute
sysctl -w net.ipv6.conf.all.disable_ipv6=1
at some suitable time during system startup. For example placing it in a script under /etc/network/if-pre-up.d seems to work.

[ Parent | Reply to this comment ]

Posted by HooGLaNDeR (85.17.xx.xx) on Fri 4 Dec 2009 at 18:01
[ Send Message ]
sysctl -w net.ipv6.conf.all.disable_ipv6=1
error: "net.ipv6.conf.all.disable_ipv6" is an unknown key

[ Parent | Reply to this comment ]

Posted by Anonymous (78.43.xx.xx) on Thu 11 Feb 2010 at 21:59
Wow, thanks a lot! That finally did disable ipv6 in squeeze/testing (kernel 2.6.32-trunk) with ipv6 built in.

[ Parent | Reply to this comment ]

Posted by Anonymous (87.123.xx.xx) on Wed 3 Mar 2010 at 19:30
One could also put net.ipv6.conf.all.disable_ipv6=1 it into /etc/sysctl.conf or into a file within /etc/sysctl.d/

Works with my fresh installed squeezy/sid system.

[ Parent | Reply to this comment ]

Posted by Anonymous (87.162.xx.xx) on Mon 22 Mar 2010 at 04:38
WHY ARE HERE SO MANY DIFFERENT SETTINGS to disable this damn ipv6 ?
AND: WHY IS NONE OF THEM WORKING?????
What kind of SH*T is it to make such a sh*tty system?!
I DON'T WANT THIS SH*TTY IPv6 piece of sh*t!
Why can't I disable it??????????? Why not????????!!!!!!!!

[ Parent | Reply to this comment ]

Posted by Anonymous (87.162.xx.xx) on Mon 22 Mar 2010 at 18:05
Finally solved it by RECOMPILING THE KERNEL!
Of course in 'make menuconfig' disabling ipv6...
A stone-age method...

[ Parent | Reply to this comment ]

Posted by Anonymous (146.182.xx.xx) on Wed 6 Oct 2010 at 13:24
I feel your pain brother.;)

[ Parent | Reply to this comment ]

Posted by Anonymous (80.122.xx.xx) on Thu 7 Oct 2010 at 12:39
+1

[ Parent | Reply to this comment ]

Posted by Anonymous (2a01:0xx:0xx:0xxx:0xxx:0xxx:xx) on Sun 24 Oct 2010 at 05:39
Because we need IPv6 to avoid IPv4 pool exhaust. Visit ipv6.he.net/statistics/ : in less than a year, we will be in big trouble. The end of the world as we know it is not in 2012. It's in 2011 !!! When we can't buy anymore v4, if people have not migrated yet, we may have a worldwide clash. When i read comments like your's, i am worried. In one year, it will be too late.

[ Parent | Reply to this comment ]

Posted by Anonymous (213.98.xx.xx) on Fri 26 Mar 2010 at 17:13
Thanks, that worked for me.

[ Parent | Reply to this comment ]

Posted by Anonymous (81.182.xx.xx) on Wed 26 May 2010 at 22:51
Thanks, worked for me too.

[ Parent | Reply to this comment ]

Posted by Anonymous (86.176.xx.xx) on Thu 30 Sep 2010 at 17:41
No need to recompile the kernel to disable IPV6

Just add this option to your kernel boot line:
ipv6.disable=1 (Press e to edit at the grub boot screen ...)

If you like that, you can put this in /etc/default/grub:

GRUB_CMDLINE_LINUX="ipv6.disable=1"

and then run update-grub

[ Parent | Reply to this comment ]

Posted by Anonymous (81.182.xx.xx) on Tue 26 Oct 2010 at 22:46
how do I know that worked?
ie. in netstat I can still see ipv6

[ Parent | Reply to this comment ]

Posted by Anonymous (91.20.xx.xx) on Mon 21 Feb 2011 at 19:58
The output of /sbin/ifconfig should no longer show an IPv6 address for your ethernet device. Also, in the output of dmesg you should see a line saying the IPv6 was disabled.

[ Parent | Reply to this comment ]

Sign In

Username:

Password:

[Register|Advanced]

 

Flattr

 

Current Poll

Which init system are you using in Debian?






( 1066 votes ~ 7 comments )