Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

HowTo Disable ipv6

Share your HowTo, Documentation, Tips and Tricks. Not for support questions!.
Message
Author
User avatar
julian67
Posts: 4633
Joined: 2007-04-06 14:39
Location: Just hanging around
Been thanked: 7 times

HowTo Disable ipv6

#1 Post by julian67 »

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"

milomak
Posts: 2158
Joined: 2009-06-09 22:20
Been thanked: 1 time

Re: HowTo Disable ipv6

#2 Post by milomak »

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])
Desktop: A320M-A PRO MAX, AMD Ryzen 5 3600, GALAX GeForce RTX™ 2060 Super EX (1-Click OC) - Sid, Win10, Arch Linux, Gentoo, Solus
Laptop: hp 250 G8 i3 11th Gen - Sid
Kodi: AMD Athlon 5150 APU w/Radeon HD 8400 - Sid

register88
Posts: 17
Joined: 2009-09-27 01:22

Re: HowTo Disable ipv6

#3 Post by register88 »

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

User avatar
julian67
Posts: 4633
Joined: 2007-04-06 14:39
Location: Just hanging around
Been thanked: 7 times

Re: HowTo Disable ipv6

#4 Post by julian67 »

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
Jackiebrown
Posts: 1246
Joined: 2007-01-02 04:46
Location: San Antonio, TX

Re: HowTo Disable ipv6

#5 Post by Jackiebrown »

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
julian67
Posts: 4633
Joined: 2007-04-06 14:39
Location: Just hanging around
Been thanked: 7 times

Re: HowTo Disable ipv6

#6 Post by julian67 »

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 crap 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"

hkoster1
Posts: 1264
Joined: 2006-12-18 10:10

Re: HowTo Disable ipv6

#7 Post by hkoster1 »

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

User avatar
julian67
Posts: 4633
Joined: 2007-04-06 14:39
Location: Just hanging around
Been thanked: 7 times

Re: HowTo Disable ipv6

#8 Post by julian67 »

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"

hkoster1
Posts: 1264
Joined: 2006-12-18 10:10

Re: HowTo Disable ipv6

#9 Post by hkoster1 »

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

oOarthurOo
Posts: 544
Joined: 2008-10-25 12:00
Location: Canada

Re: HowTo Disable ipv6

#10 Post by oOarthurOo »

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

Thanks Julien 8)

User avatar
AdrianTM
Posts: 2499
Joined: 2004-09-19 01:08

Re: HowTo Disable ipv6

#11 Post by AdrianTM »

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.

oOarthurOo
Posts: 544
Joined: 2008-10-25 12:00
Location: Canada

Re: HowTo Disable ipv6

#12 Post by oOarthurOo »

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.

User avatar
AdrianTM
Posts: 2499
Joined: 2004-09-19 01:08

Re: HowTo Disable ipv6

#13 Post by AdrianTM »

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: 2499
Joined: 2004-09-19 01:08

Re: HowTo Disable ipv6

#14 Post by AdrianTM »

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
ComputerBob
Posts: 1181
Joined: 2007-11-30 04:49
Location: The Mountains of the Sunshine State
Been thanked: 1 time

Re: HowTo Disable ipv6

#15 Post by ComputerBob »

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 - Nearly 6,000 Posts and 23 Million Views
My Massive Stroke
Help! (off-topic)
_________________
Your Life Matters

Bulkley
Posts: 6383
Joined: 2006-02-11 18:35
Has thanked: 2 times
Been thanked: 39 times

Re: HowTo Disable ipv6

#16 Post by Bulkley »

For those who want to go through the effort, it is possible to run IPv6 at home by using 6to4. Here's an explanation. I met a user who has run this for a couple of years. He says it runs fine but, so far, he does not notice any speed advantage.

You can a ton of hits in Google by searching for 6to4. Here's a Wiki.

yoyo42
Posts: 1
Joined: 2010-05-05 14:20

Re: HowTo Disable ipv6

#17 Post by yoyo42 »

I have done the 00local.conf thing and rebooted. However, 'ifconfig -a' still shows my two NICs as having an IPv6 address allocated.

lsmod doesn't have an entry for IPv6 now, but then again it didn't before. /var/log/kern.log reports 'eth0: no IPv6 routers present' and 'eth1: no IPv6 routers present'.

This machine is a VM running on a VMWare ESX server - will that make a difference?

I want to have a totally passive, promiscuous interface to run the Snort IDS on - I can get rid of the IPv4 address but it still has an IPv6 address and I can't make it go away!

oOarthurOo
Posts: 544
Joined: 2008-10-25 12:00
Location: Canada

Re: HowTo Disable ipv6

#18 Post by oOarthurOo »

AdrianTM wrote: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
Here is some more information on why the install ipv6 /bin/true is being used:
http://www.mail-archive.com/debian-bugs ... 51306.html

User avatar
mauser1891
Posts: 85
Joined: 2007-07-22 04:45
Location: Western WA, USA

Re: HowTo Disable ipv6

#19 Post by mauser1891 »

Hello Folks,


I am confused by the "package" note at the bottom of the previous post. I eventually I will learn about that method perhaps.
I know the "lsmod |grep ipv6" shows that ipv6 is disabled via aliases, and I am happy.
For whe I do a IPv6 deb search it only brings up kernel information.
And if I wanted to do some kernel type of stuff, I would just get a kernel source and do my own kernel config.
It has been a longtime since I did some kernel configuration work.

But if somebody could break this method down, and explain it step by step I would appreciate it.
If so, I would like to thank you in advance for your assistance with this topic. i.e. install ipv6 /bin/true
Thank You,
Mauser1891

AMD A6-3400M 8G DDR3 Samsung EVO 120 powered Gateway laptop
FX-8350, 7970, 32G DDR3, 8G RamDisk/SSD/SSHD/HD, Win 8.1 Pro desktop

oOarthurOo
Posts: 544
Joined: 2008-10-25 12:00
Location: Canada

Re: HowTo Disable ipv6

#20 Post by oOarthurOo »

The install stuff, as far as I understand, prevents the modules from being loaded by a process after the initial boot (e.g., hal or udev). This sort of thing can't really happen, or else must happen very rarely with ipv6, so not using the install stuff would not tend to make a difference. However, with something like parport you might prevent it from being loaded at boot, but then fire up cups later on to print something and it is loaded then. The install stuff prevents the latter scenario from happening.

At least, that's how I understood it.

Post Reply