2

There are probably lots of situation when this can happen, but this is a big mistery for me. Some tools can use the network just fine (wget, dig, apt-get, ...), but some tools are just failing (ping, traceroute, the browser, ...).

For example, I can download a file with wget:

gonvaled@pegasus ~ » wget archive.ubuntu.com
--2014-10-02 10:52:34--  http://archive.ubuntu.com/
Resolving archive.ubuntu.com (archive.ubuntu.com)... 2001:67c:1360:8c01::18, 2001:67c:1360:8c01::19, 91.189.91.14, ...
Connecting to archive.ubuntu.com (archive.ubuntu.com)|2001:67c:1360:8c01::18|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 671 [text/html]
Saving to: ‘index.html.2’

100%[========================================================================================================================================================>] 671         --.-K/s   in 0s      

2014-10-02 10:52:34 (30,8 MB/s) - ‘index.html.2’ saved [671/671]

I can resolve the domain with dig:

gonvaled@pegasus ~ » dig archive.ubuntu.com

; <<>> DiG 9.9.5-3-Ubuntu <<>> archive.ubuntu.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 36593
;; flags: qr rd ra ad; QUERY: 1, ANSWER: 7, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;archive.ubuntu.com.        IN  A

;; ANSWER SECTION:
archive.ubuntu.com. 572 IN  A   91.189.92.200
archive.ubuntu.com. 572 IN  A   91.189.91.15
archive.ubuntu.com. 572 IN  A   91.189.91.14
archive.ubuntu.com. 572 IN  A   91.189.91.13
archive.ubuntu.com. 572 IN  A   91.189.88.153
archive.ubuntu.com. 572 IN  A   91.189.88.149
archive.ubuntu.com. 572 IN  A   91.189.92.201

;; Query time: 2 msec
;; SERVER: 10.11.0.1#53(10.11.0.1)
;; WHEN: Thu Oct 02 10:58:00 CEST 2014
;; MSG SIZE  rcvd: 148

But I can not ping the site (not because the site is not replying to pings, but because Network is unreachable):

gonvaled@pegasus ~ » ping archive.ubuntu.com
connect: Network is unreachable

Traceroute is also failing:

gonvaled@pegasus ~ » traceroute archive.ubuntu.com
traceroute to archive.ubuntu.com (91.189.88.149), 30 hops max, 60 byte packets
connect: Network is unreachable

This is my network config (nothing out of the ordinary!):

gonvaled@pegasus ~ » ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 2c:76:8a:e0:b0:6b  
          inet addr:10.11.44.84  Bcast:10.11.255.255  Mask:255.255.0.0
          inet6 addr: 2001:4dd0:fff4:11:2c3f:5f86:f975:579f/64 Scope:Global
          inet6 addr: fe80::2e76:8aff:fee0:b06b/64 Scope:Link
          inet6 addr: 2001:4dd0:fff4:11:2e76:8aff:fee0:b06b/64 Scope:Global
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:37502 errors:0 dropped:0 overruns:0 frame:0
          TX packets:14119 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:13558552 (13.5 MB)  TX bytes:3533448 (3.5 MB)

gonvaled@pegasus ~ » route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.11.0.0       *               255.255.0.0     U     0      0        0 eth0
link-local      *               255.255.0.0     U     1000   0        0 eth0

What else could I check to narrow down this issue?

EDIT

There seem to be two things at play here: IPv6 and default gateway. Whenever I enable wlan, I get these routes:

gonvaled@pegasus ~ » route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         10.11.0.1       0.0.0.0         UG    0      0        0 wlan0
10.11.0.0       *               255.255.0.0     U     0      0        0 eth0
10.11.0.0       *               255.255.0.0     U     9      0        0 wlan0
link-local      *               255.255.0.0     U     1000   0        0 eth0

Which has a default gateway, and makes IPv4 work fine.

So now I still have two open questions:

  1. Why don't I get a default gateway with my eth0? (this is the real issue at hand)
  2. Why does IPv6 does not need a default gateway? (this is what was confusing me all along)
7
  • Your wget used IPv6, your ping IPv4. Maybe your IPv4 networking isn't working at all?
    – faker
    Oct 2, 2014 at 9:03
  • That is a very good hint. I'll check that in a minute but ... how do you know that wget used IP6 from the output I pasted?
    – blueFast
    Oct 2, 2014 at 9:06
  • It shows that it's connecting to 2001:67c:1360:8c01::18|:80 which is via IPv6. You can force it to use v4 like wget -4 ....
    – faker
    Oct 2, 2014 at 9:08
  • The IPv6 notation is a dead giveaway ...
    – thanasisk
    Oct 2, 2014 at 9:08
  • @faker: bingo! IPv4 is indeed broken: wget -4 just fails. I was not seeing the forest because of so many trees :). Thanks. Now I wonder if that is an issue with my interface configuration (I have indeed been playing with it recently) or if it has something to do with the network itself.
    – blueFast
    Oct 2, 2014 at 9:11

1 Answer 1

1

There are two things going on:

1) For your IPv4 settings you do not have a default route configured. It should look something like this:

$ route  
Kernel IP routing table  
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface  
default         10.11.0.0       0.0.0.0         UG    100    0        0 eth0  
10.11.0.0       *               255.255.0.0     U     0      0        0 eth0  

Since you do not have an IPv4 route specified you cannot route out of your local network.

2) Since you are using IPv6 and IPv4 you are able to get some traffic out when you're using IPv6. If you did a route -A inet6 or ip -6 route you would most likely see a default route specified.

5
  • Thanks, I have just got to that conclusion with the help of @faker. I wonder why I do not get a default gateway (eth0 is just setup with ` iface eth0 inet dhcp`)
    – blueFast
    Oct 2, 2014 at 9:21
  • I just saw your update. You also have a wlan interface that you're configuring up? You can't have two default routes configured. If you are using DHCP on eth0 and wlan0 they will conflict with each other.
    – Gene
    Oct 2, 2014 at 9:22
  • Sure, but I am turning off wlan and restarting eth0 (I do this because the wlan in my workplace is sometimes flaky, and I need a reliable connection to my servers for long-running tasks). This has worked fine for me in the past, but somehow now it is broken.
    – blueFast
    Oct 2, 2014 at 9:24
  • Can't say for sure. Perhaps the route that was added with wlan0 wasn't fully removed before eth0 was restarted. When you're switching things around are you doing it through the command line, through a GUI interface, or through fn keys on your keyboard?
    – Gene
    Oct 2, 2014 at 9:27
  • 1
    So, never mind, I was apparently lying. If I do: wlan off, eth off, eth on, the default gateway is set correctly. So you are right, it was a matter of two interfaces with a default gateway. But I am sure this has never caused a problem before. Somehow I have taken the interfaces out of the control of the OS (I have been playing with VMs and bridges lately), so it seems now the OS is not able to set the default gateway properly by itself, and needs some help.
    – blueFast
    Oct 2, 2014 at 9:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .