HowTo Disable ipv6

Share your own howto's etc. Not for support questions!

HowTo Disable ipv6

Postby julian67 » 2009-09-18 06:50

This subject comes up a lot and often the methods/advice offered are erroneous, so here is a reliable howto.

First if you suspect ipv6 is causing problems (usually it's timeouts on DNS so pages fail to load/load slowly or you find apt can't resolve some repositories) then you can quickly check if it's the case using Iceweasel/Firefox or Epiphany.

Open a new tab and type about:config and hit return. Go past any dire warnings and you'll see a filter box. Enter ipv6 and you'll see this:

Image

Double click on the line to toggle the setting to 'true'

Image

If you run a dnscache (dnscache-run, djbdns etc) you'll need to restart it. If you don't know if you run a dnscache then you almost certainly do not.

Close the tab, open a new one and go to some of the pages you had trouble with. If they now resolve then you can go ahead and disable ipv6 systemwide.

Here's how:

As root create a file /etc/modprobe.d/00local.conf and edit it to look as follows

Code: Select all
install ipv6 /bin/true
alias net-pf-10 off
alias ipv6 off


Save the file.

Reboot. You now have a system which doesn't use ipv6. You can verify this by checking if the ipv6 driver is loaded

Code: Select all
$ lsmod |grep ipv6

which will produce no output. On a system with ipv6 enabled you would see something like

Code: Select all
$ lsmod |grep ipv6
ipv6                  236036  18


How Not To Do It

Often it's advised to edit /etc/modprobe.d/aliases.conf or /etc/modprobe.d/blacklist.conf

In the case of blacklist.conf it simply won't work. ipv6 is a kernel module, a driver. From /etc/modprobe.d/blacklist.conf
# This file lists modules which will not be loaded as the result of
# alias expansion, with the purpose of preventing the hotplug subsystem
# to load them. It does not affect autoloading of modules by the kernel.
# This file is provided by the udev package.


From /etc/modprobe.d/aliases.conf

# These are the standard aliases for devices and kernel drivers.
# This file does not need to be modified.


So you possibly can disable ipv6 via aliases.conf but your changes will be not be persistent, that is a package/system upgrade will overwrite them. The advantage of creating /etc/modprobe.d/00local.conf is that it will be persistent. Nothing will automatically overwrite or delete it, it will continue to work even after dist-upgrading from release to release.

If you compile your own kernels you can easily build them with no ipv6 support.
Wisdom from my inbox: "do not mock at your pottenocy"
User avatar
julian67
 
Posts: 4648
Joined: 2007-04-06 14:39
Location: Just hanging around

Re: HowTo Disable ipv6

Postby milomak » 2009-09-18 21:11

On 2.6.31 (which I think is the same with at least 2.6.28 and onwards), the kernel path is:

Code: Select all
   Location:                                                                                                                                                                      │
  │     -> Networking support (NET [=y])                                                                                                                                             │
  │       -> Networking options                                                                                                                                                      │
  │         -> TCP/IP networking (INET [=y])                                                                                                                                         │
  │           -> The IPv6 protocol (IPV6 [=n])
Laptop (64-bit) - Debian Sid and Win8
Desktop (64-bit) - Debian Sid, ArchLinux, Win8 and Fedora 19
MythTV BE/FE - Debian Stable
MythTV FE - Debian Sid
milomak
 
Posts: 1436
Joined: 2009-06-09 22:20

Re: HowTo Disable ipv6

Postby register88 » 2009-09-27 01:24

Add below line in /etc/sysctl.conf

net.ipv6.conf.all.disable_ipv6 = 0
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 0
register88
 
Posts: 17
Joined: 2009-09-27 01:22

Re: HowTo Disable ipv6

Postby julian67 » 2009-09-27 01:43

That is fine but can be overwritten by package or dist-upgrade (if you don't pay close attention). The reason I outlined the method in the first post is that it is guaranteed to be persistent even if the user is forgetful or makes a mistake.
Wisdom from my inbox: "do not mock at your pottenocy"
User avatar
julian67
 
Posts: 4648
Joined: 2007-04-06 14:39
Location: Just hanging around

Re: HowTo Disable ipv6

Postby Jackiebrown » 2009-10-03 06:20

julian67 wrote:That is fine but can be overwritten by package or dist-upgrade (if you don't pay close attention). The reason I outlined the method in the first post is that it is guaranteed to be persistent even if the user is forgetful or makes a mistake.


I know you mentioned paying attention...

With that said, dpkg should not overwrite anything in /etc without prompting
User avatar
Jackiebrown
 
Posts: 1275
Joined: 2007-01-02 04:46
Location: San Antonio, TX

Re: HowTo Disable ipv6

Postby julian67 » 2009-10-03 07:10

It seems as easy to me to put three short lines of text somewhere they work perfectly but cannot get overwritten as it is to put them somewhere they work perfectly but can get overwritten. Sod's law says if something can go wrong it will go wrong. But when I develop perfect recall and finally shake off this annoying tendency to make mistakes and bad decisions I'll do it some other way. I'd like to be richer too.

I like to use methods which don't require me having my brain switched on.

Last time I dist-upgraded there were quite a lot of changes I was prompted to examine. I couldn't remember exactly what they all were. I wasn't sure in every case which differences were due to my edits and which were due to changes in the default files. Looking at the diffs didn't enlighten me in every case, only gave an uncomfortable feeling along the lines of "it looks familiar but....oh shit what did I do that for? Or did I? And why is the new one different?" I do keep extensive docs of pretty much everything but sometimes that's about as useful as someone asking "where did you last have it?" when you lost something. I keep a tarred backup of /etc and /usr/local and make sure it's up to date before making any big changes, so I can pick through it later and restore any edits if needed, but I much prefer it when I don't need to. Some of the changes that might be made to a file like /etc/sysctl.conf are not blindingly obvious (to me anyway), may include things which are not mentioned in the default comments (you have to read the man pages) and are likely to be the result of struggling through some truly uninspiring reading matter, maybe some trial and error too.

I said in the first post of this howto "The advantage of creating /etc/modprobe.d/00local.conf is that it will be persistent."

That's still true, and the best part is it will be persistent even if you are inconsistent :wink:
Wisdom from my inbox: "do not mock at your pottenocy"
User avatar
julian67
 
Posts: 4648
Joined: 2007-04-06 14:39
Location: Just hanging around

Re: HowTo Disable ipv6

Postby hkoster1 » 2009-10-03 10:41

I agree with your approach to the problem at hand, i.e. disabling ipv6 in the browser or even
system-wide. Now, for the larger problem: how to get there (general use of ipv6) from here
(still using ipv4)? Would your approach be helpful, or would temporary slow resolving of dns
be the small price we pay for progress? Just asking... :wink:
Real Debian users don't do chat...
hkoster1
 
Posts: 1256
Joined: 2006-12-18 10:10

Re: HowTo Disable ipv6

Postby julian67 » 2009-10-03 11:01

First thing to note is that adoption of ipv6 is S.E.P - Someone Else's Problem.

I have however developed a completely foolproof personal strategy - waiting.

It's something that can't be driven by the domestic consumer or small business user, but by ISPs, major hosting companies, operating system suppliers, very large enterprises, major hardware manufacturers, regulatory bodies, governments and so on.
Wisdom from my inbox: "do not mock at your pottenocy"
User avatar
julian67
 
Posts: 4648
Joined: 2007-04-06 14:39
Location: Just hanging around

Re: HowTo Disable ipv6

Postby hkoster1 » 2009-10-03 20:06

Hmmm... apart from that S.S.A - Self-Serving Attitude, I've spent some time since your post
researching what would be required to implement IPV6. Good grief! My own ISP (XS4ALL.NL)
makes free IPV6 tunneling available on an experimental basis... after studying the available
info and the Debian Howto at http://wiki.debian.org/DebianIPv6 I'm still not much
wiser. Seems they added so much new stuff to the IPV6 specification that one almost needs
a Ph.D. in Computer Science to understand what's going on. That rules me out (sadly, I'm
more of the Soul Singin' ilk...). Looks like the change-over, if and when it comes, is going
to be a Y2K-like event.

So, I quickly reverted to IPV4 system-wide, thanks to your Howto; and did the same on my
other computers running Mac OS X. A noticeable improvement! :P
Real Debian users don't do chat...
hkoster1
 
Posts: 1256
Joined: 2006-12-18 10:10

Re: HowTo Disable ipv6

Postby oOarthurOo » 2010-04-13 23:35

Tip works for me. And I like that it won't be accidentally over-ridden.

Thanks Julien 8)
oOarthurOo
 
Posts: 545
Joined: 2008-10-25 12:00
Location: Canada

Re: HowTo Disable ipv6

Postby AdrianTM » 2010-04-13 23:42

Is there a real need to disable ipv6? What is the status of ipv6 adoption are there ipv6 sites?
Ubuntu hate is a mental derangement.
User avatar
AdrianTM
 
Posts: 2520
Joined: 2004-09-19 01:08

Re: HowTo Disable ipv6

Postby oOarthurOo » 2010-04-13 23:53

AdrianTM wrote:Is there a real need to disable ipv6? What is the status of ipv6 adoption are there ipv6 sites?

Here's a list of sites, though it was last updated in 2003, so I would assume there are more now.

http://www.ipv6.org/v6-www.html

I think the real bottleneck is ISPs. Mine doesn't have any information at all about ipv6, may as well not exist as far as they're concerned. When I asked IT last time I talked with them (3 months past), it went something like this:

Arthur: Do you guys support ipv6?
MTS Tech: We use the latest server technology to provide the fastest internet connection speed to our customers.
Arthur: Yeah, it's pretty fast, I'm not complaining, I'm just wondering if you know anything about ipv6 specifically?
MTS Tech: If it was invented in the last 3 years we have it.
Arthur: So you've probably got the ipv6 dongle on all your connections?
MTS Tech: I'd be very surprised if we didn't or won't soon.
Arthur: Thanks. That about answers my question.
oOarthurOo
 
Posts: 545
Joined: 2008-10-25 12:00
Location: Canada

Re: HowTo Disable ipv6

Postby AdrianTM » 2010-04-14 00:14

oOarthurOo wrote:
AdrianTM wrote:Is there a real need to disable ipv6? What is the status of ipv6 adoption are there ipv6 sites?

Here's a list of sites, though it was last updated in 2003, so I would assume there are more now.

http://www.ipv6.org/v6-www.html

I think the real bottleneck is ISPs. Mine doesn't have any information at all about ipv6, may as well not exist as far as they're concerned. When I asked IT last time I talked with them (3 months past), it went something like this:

Arthur: Do you guys support ipv6?
MTS Tech: We use the latest server technology to provide the fastest internet connection speed to our customers.
Arthur: Yeah, it's pretty fast, I'm not complaining, I'm just wondering if you know anything about ipv6 specifically?
MTS Tech: If it was invented in the last 3 years we have it.
Arthur: So you've probably got the ipv6 dongle on all your connections?
MTS Tech: I'd be very surprised if we didn't or won't soon.
Arthur: Thanks. That about answers my question.


ROFL
Ubuntu hate is a mental derangement.
User avatar
AdrianTM
 
Posts: 2520
Joined: 2004-09-19 01:08

Re: HowTo Disable ipv6

Postby AdrianTM » 2010-04-14 02:59

Question, why is this line needed?
install ipv6 /bin/true

I think I was using successfully only:
alias net-pf-10 off
alias ipv6 off
Ubuntu hate is a mental derangement.
User avatar
AdrianTM
 
Posts: 2520
Joined: 2004-09-19 01:08

Re: HowTo Disable ipv6

Postby ComputerBob » 2010-04-14 03:37

Same here. I've never heard of or used that install line before, yet lsmod confirms that ipv6 is disabled on my systems.
ComputerBob - Making Geek-Speak Chic (TM)
ComputerBob.com
My New Ministry
User avatar
ComputerBob
 
Posts: 1189
Joined: 2007-11-30 04:49
Location: The Beautiful Sunshine State

Next

Return to Docs, Howtos, Tips & Tricks

Who is online

Users browsing this forum: jlambrecht, timbgo and 9 guests

fashionable