You are not logged in.

#1 2012-09-24 23:52:42

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,131

Need a more effective way to kill ipv6...

In a previous episode, I explained that I needed to kill ipv6. At one point, I did this by blacklisting the relevant module. After support was integrated in the kernel, I switched to using

net.ipv6.conf.all.disable_ipv6 = 1

in sysctl.conf.

This has been enough for most purposes. It allows me to connect to my campus's wireless network, for example.

However, I've been having a separate networking issue (involving ssh) and in an attempt to make absolutely sure that my LAN set up at home was not interfering in any way, I tried to establish a direct, wired connection via my ISP's box (I initially wrote "router" but I'm not sure a cable modem is a router) rather than connecting via the wireless LAN. To be honest, this wasn't the bit I expected not to work. (I also didn't expect to enrage anybody by doing this but apparently I did even though I tried to hide under the piano as much as possible. That's probably not a relevant side-effect, though.)

1) I expected wicd to handle this automatically but that didn't work. wicd has been a bit flaky with wired connections recently and I'm wondering if that flakiness is connected.
2) Eventually, I just stopped wicd.service and got a root prompt.
3) As I understand it, something like the following should work:

ip link set eth0 up
dhcpcd eth0

However, it doesn't. I can bring the interface up just fine but dhcpcd can't get a lease. I also tried passing the -f inet option to ip but that didn't make a difference. Examining the output and the logs, this seems to be because it repeatedly tries ipv6 but never falls back to ipv4:

$ dhcpcd eth0
dhcpcd[13128]: version 5.6.2 starting
dhcpcd[13128]: eth0: sending IPv6 Router Solicitation
dhcpcd[13128]: eth0: sendmsg: Network is unreachable
dhcpcd[13128]: eth0: broadcasting for a lease
dhcpcd[13128]: eth0: sending IPv6 Router Solicitation
dhcpcd[13128]: eth0: sendmsg: Network is unreachable
dhcpcd[13128]: eth0: sending IPv6 Router Solicitation
dhcpcd[13128]: eth0: sendmsg: Network is unreachable
dhcpcd[13128]: eth0: sending IPv6 Router Solicitation
dhcpcd[13128]: eth0: sendmsg: Network is unreachable
dhcpcd[13128]: eth0: no IPv6 Routers available
dhcpcd[13128]: timed out

This was pretty much the behaviour I saw before and ended with the line above in systemctl. It is also pretty much what I get in the log:

Sep 24 23:19:48 <hostname> dhcpcd[13375]: dhcpcd not running
Sep 24 23:19:50 <hostname> dhcpcd[13384]: version 5.6.2 starting
Sep 24 23:19:50 <hostname> dhcpcd[13384]: eth0: sending IPv6 Router Soli...n
Sep 24 23:19:50 <hostname> dhcpcd[13384]: eth0: sendmsg: Network is unre...e
Sep 24 23:19:50 <hostname> dhcpcd[13384]: eth0: broadcasting for a lease
Sep 24 23:19:54 <hostname> dhcpcd[13384]: eth0: sending IPv6 Router Soli...n
Sep 24 23:19:54 <hostname> dhcpcd[13384]: eth0: sendmsg: Network is unre...e
Sep 24 23:19:58 <hostname> dhcpcd[13384]: eth0: sending IPv6 Router Soli...n
Sep 24 23:19:58 <hostname> dhcpcd[13384]: eth0: sendmsg: Network is unre...e
Sep 24 23:20:02 <hostname> dhcpcd[13384]: eth0: sending IPv6 Router Soli...n
Sep 24 23:20:02 <hostname> dhcpcd[13384]: eth0: sendmsg: Network is unre...e
Sep 24 23:20:02 <hostname> dhcpcd[13384]: eth0: no IPv6 Routers available
Sep 24 23:20:20 <hostname> dhcpcd[13384]: timed out

Note that this is not a general problem with wired networking. If I plug in the ethernet cable for my home LAN (so I'm not connecting directly to the ISP's box but, rather, indirectly via a router which is part of my home LAN), wicd has no trouble switching to eth0, getting an ip address and letting me ping www.example.com. From the log:

Sep 25 00:30:44 <hostname> dhcpcd[29164]: version 5.6.2 starting
Sep 25 00:30:44 <hostname> dhcpcd[29164]: eth0: waiting for carrier
Sep 25 00:30:44 <hostname> dhcpcd[29164]: eth0: carrier acquired
Sep 25 00:30:44 <hostname> dhcpcd[29164]: eth0: sending IPv6 Router Solicitation
Sep 25 00:30:44 <hostname> dhcpcd[29164]: eth0: sendmsg: Network is unreachable
Sep 25 00:30:44 <hostname> dhcpcd[29164]: eth0: broadcasting for a lease
Sep 25 00:30:45 <hostname> dhcpcd[29164]: [40B blob data]
Sep 25 00:30:45 <hostname> dhcpcd[29164]: [45B blob data]
Sep 25 00:30:45 <hostname> dhcpcd[29164]: eth0: checking for xx.x.x.x
Sep 25 00:30:48 <hostname> dhcpcd[29164]: eth0: sending IPv6 Router Solicitation
Sep 25 00:30:48 <hostname> dhcpcd[29164]: eth0: sendmsg: Network is unreachable
Sep 25 00:30:50 <hostname> dhcpcd[29164]: eth0: leased xx.x.x.x for 14400 seconds
Sep 25 00:30:50 <hostname> avahi-daemon[415]: Joining mDNS multicast group on interface eth0.IPv4 with address xx.x.x.x.
Sep 25 00:30:50 <hostname> avahi-daemon[415]: New relevant interface eth0.IPv4 for mDNS.
Sep 25 00:30:50 <hostname> avahi-daemon[415]: Registering new address record for xx.x.x.x on eth0.IPv4.
Sep 25 00:30:50 <hostname> dhcpcd[29164]: forked to background, child pid 29213

How do I kill ipv6 support more effectively and/or tell dhcpcd to use ipv4?

Right now, I would love to scrub ipv6 from my machine - I have yet to come across a network which actually supports it. Indeed, having it around just seems to kill networking on every network I use. (Note: this is just frustration - I think it is quite good to have it available in case I ever find somewhere to use it. I just need to kill it off for all practical purposes so I can connect until that happy day arrives.)

I did see that some people have recently had some issues with Atheros ethernet although not precisely my version:

$ lspci -s 08:00.0 -v
08:00.0 Ethernet controller: Atheros Communications Inc. AR8151 v2.0 Gigabit Ethernet (rev c0)
        Subsystem: Atheros Communications Inc. AR8151 v2.0 Gigabit Ethernet
        Flags: bus master, fast devsel, latency 0, IRQ 45
        Memory at d0c00000 (64-bit, non-prefetchable) [size=256K]
        I/O ports at 2000 [size=128]
        Capabilities: [40] Power Management version 3
        Capabilities: [48] MSI: Enable+ Count=1/1 Maskable- 64bit+
        Capabilities: [58] Express Endpoint, MSI 00
        Capabilities: [6c] Vital Product Data
        Capabilities: [100] Advanced Error Reporting
        Capabilities: [180] Device Serial Number xx-xx-xx-xx-xx-xx-xx-xx
        Kernel driver in use: atl1c

However, I'm not using NetworkManager and I'm not seeing anything like the same error - I can bring eth0 up just fine. It is only the getting-a-lease bit where I hit trouble. (And it works fine on the LAN but not directly via the ISP's box.)


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#2 2012-09-24 23:57:35

nomorewindows
Member
Registered: 2010-04-03
Posts: 3,362

Re: Need a more effective way to kill ipv6...

The problem that keeps showing up with ipv6 for me is that it keeps saying that there is a duplicate address on the network.
Linux should be able to sense whether ipv6 is actually working, and it seems to be an automatic dependency of ip nowadays with modern kernel.
IPv6 believe it or not was around or at least some implementations of it as early as about 10-15 years ago. 
The different protocols shouldn't interfere with each other, however, have you tried using tcpdump or wireshark to sniff out possible network problems?


I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.

Offline

#3 2012-09-24 23:58:47

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,449
Website

Re: Need a more effective way to kill ipv6...

A bit tl;dr, but if this is your question: How do I kill ipv6 support more effectively and/or tell dhcpcd to use ipv4?

sudo sysctl net.ipv6.conf.all.disable_ipv6=1 >/dev/null 2>&1

change the 1 for a zero to turn ipv6 back on.  Or if you're as lazy as I am and want it to look nice, see this script.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#4 2012-09-25 01:04:49

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,131

Re: Need a more effective way to kill ipv6...

Thanks, Trilby. That's what I thought but that variable is already set. sysctl -a shows:

net.ipv6.conf.all.disable_ipv6 = 1

I set it at boot via sysctl.conf and I guess this shows that nothing has interfered with that in the meantime...

I've no need of your script at present as I never have reason to turn it on. But I'll bear it in mind in case I need an aesthetically pleasing method in the future smile.

Last edited by cfr (2012-09-25 01:06:49)


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#5 2012-09-25 01:10:30

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: Need a more effective way to kill ipv6...

If you have no use for it at all you can always add ipv6.diable=1 to your kernel command line on boot.  Though ti may be ipv6_disable=1  I can't remember.

Offline

#6 2012-09-25 01:11:36

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,131

Re: Need a more effective way to kill ipv6...

nomorewindows wrote:

Linux should be able to sense whether ipv6 is actually working, and it seems to be an automatic dependency of ip nowadays with modern kernel.

As I understand it, Linux does not play nicely (at least by default) with broken ipv4 networks. (That is, ipv4 networks which don't respond correctly to requests for ipv6.) Given that there are an enormous number of these, this is obviously an issue.

The different protocols shouldn't interfere with each other, however, have you tried using tcpdump or wireshark to sniff out possible network problems?

Thanks for this suggestion but to be honest, I would not have any idea what to do with these and they are large tools. Do you have anything specific in mind? (Or a link?)

Moreover, I know the network itself is almost certainly not behaving well. But that is beyond my control and up to my ISP. (And the choice of ISP is not in my control either in this case.) So I'm not sure how much help this might be.


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#7 2012-09-25 01:21:33

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,131

Re: Need a more effective way to kill ipv6...

WonderWoofy wrote:

If you have no use for it at all you can always add ipv6.diable=1 to your kernel command line on boot.  Though ti may be ipv6_disable=1  I can't remember.

It's the first according to the wiki (with the 's' added). However, the wiki also says it won't stop other programmes trying to use ipv6, including dhcpcd. For that it suggests adding:

noipv6rs

to the conf file. I tried this earlier, I think, but then I just seemed not to get anything at all. However, I'll try again when I can brave the fireworks necessary to try connecting directly to the modem again. Or maybe this in combination with the kernel option - belt and braces?!

I doubt very much this has anything to do with my ssh issues, in any case smile. But I would prefer it to work nonetheless!


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#8 2012-09-25 01:26:50

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: Need a more effective way to kill ipv6...

cfr wrote:

Or maybe this in combination with the kernel option - belt and braces?!

Well, from all of our back and forth, I have gathered that you are the type that if you were building a wall you would use brick, but also steel rebar just in case.

Offline

#9 2012-09-25 23:18:22

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,217
Website

Re: Need a more effective way to kill ipv6...

cfr wrote:

However, I've been having a separate networking issue (involving ssh) and in an attempt to make absolutely sure that my LAN set up at home was not interfering in any way, I tried to establish a direct, wired connection via my ISP's box (I initially wrote "router" but I'm not sure a cable modem is a router) rather than connecting via the wireless LAN.

Is this the connection that you're talking about and having all the trouble with; connecting directly via the cable modem?

IME with cable modems, they do NOT provide router services (as you've hinted at). That includes NOT providing any kind of IP services - IPv4 or IPv6. They are purely a modem (modulator/demodulator) to translate between the ethernet side of the modem and the ISP's cable side of the modem.

With that in mind, I would not expect any kind of DHCP request to be responded to. The device connected to the modem (a computer or dedicated router) needs to perform the authentication etc to the ISP and establish a connection over the cable network first, via the modem. THEN you can make DHCP requests which the new connection will transport to the ISP to be honoured.

Sorry if I've misread what you're actually trying to do when you have the issue, and as I said, this is just IME. I could be wrong.

Last edited by fukawi2 (2012-09-25 23:19:13)

Offline

#10 2012-09-25 23:22:35

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: Need a more effective way to kill ipv6...

I think you are right that a cable modem is definitely not a router.  Though I have seen ISP's provide cable modems w/ ghetto routers built in.

Offline

#11 2012-09-27 00:20:07

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,131

Re: Need a more effective way to kill ipv6...

fukawi2 wrote:
cfr wrote:

However, I've been having a separate networking issue (involving ssh) and in an attempt to make absolutely sure that my LAN set up at home was not interfering in any way, I tried to establish a direct, wired connection via my ISP's box (I initially wrote "router" but I'm not sure a cable modem is a router) rather than connecting via the wireless LAN.

Is this the connection that you're talking about and having all the trouble with; connecting directly via the cable modem?

IME with cable modems, they do NOT provide router services (as you've hinted at). That includes NOT providing any kind of IP services - IPv4 or IPv6. They are purely a modem (modulator/demodulator) to translate between the ethernet side of the modem and the ISP's cable side of the modem.

With that in mind, I would not expect any kind of DHCP request to be responded to. The device connected to the modem (a computer or dedicated router) needs to perform the authentication etc to the ISP and establish a connection over the cable network first, via the modem. THEN you can make DHCP requests which the new connection will transport to the ISP to be honoured.

Sorry if I've misread what you're actually trying to do when you have the issue, and as I said, this is just IME. I could be wrong.

Thanks. That's not how this ISP does it. It did used to be that way but not now. Basically, the modem is authenticated. If you need a new one, a technician has to come out, install it and then call somebody to authorise that modem to connect to their network. There's no additional authentication done from the computer side of it. I've connected a computer plenty of times direct to the modem in the past and I've always got a lease. What's happening is that my computer never even tries for ipv4. You can watch it trying and it never falls back from ipv6.


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#12 2012-09-27 01:10:18

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: Need a more effective way to kill ipv6...

So I am curious if the above mentioned method has disabled ipv6 to your liking?  It is of interest to me to be able to achieve this w/o fully disabling the module like I am doing currently.

Offline

#13 2012-09-27 21:24:20

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,131

Re: Need a more effective way to kill ipv6...

I'm afraid that testing this is somewhat fraught and I won't have a useful report until I'm able to find a suitable opportunity. Sorry about that. I will test it when I can.


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#14 2012-09-27 23:14:15

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,217
Website

Re: Need a more effective way to kill ipv6...

cfr wrote:

Thanks. That's not how this ISP does it.

I'm out of ideas then tongue
Sorry sad

Offline

Board footer

Powered by FluxBB