Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Original Question

I am running Ubuntu and network manager. I have two different interfaces, eth0 and eth1. Network manager has (as far as I can tell) correctly added this manual route:

~$ ip route

default via dev eth1  proto static via dev eth1  proto static via dev eth1  proto static 
... dev eth1  proto kernel  scope link  src  metric 1 via dev eth1  proto static 

eth0 appears down, but that seems to me to be a separate problem. Even given the above routes, the IP stack seems to be preferring eth0:

~$ ping
PING ( 56(84) bytes of data.
--- ping statistics ---
18 packets transmitted, 0 received, 100% packet loss, time 17132ms

~$ ping -Ieth1
PING ( from eth1: 56(84) bytes of data.
64 bytes from icmp_seq=1 ttl=57 time=210 ms


~$ ip rule
0:  from all lookup local 
32766:  from all lookup main 
32767:  from all lookup default 

~$ netstat -nr
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface         UG        0 0          0 eth1       UG        0 0          0 eth1     UG        0 0          0 eth1
...     U         0 0          0 eth1   UG        0 0          0 eth1

~$ ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 08:00:27:01:b1:f6 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::a00:27ff:fe01:b1f6/64 scope link 
       valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 08:00:27:35:eb:24 brd ff:ff:ff:ff:ff:ff
    inet brd scope global eth1
       valid_lft forever preferred_lft forever
    inet6 fe80::a00:27ff:fe35:eb24/64 scope link 
       valid_lft forever preferred_lft forever

How can I force the IP stack to obey those routes?

Routing Successful

~$ ip route get via dev eth1  src

This situation is getting a little bit more screwy. It seems that the failure in the first ping is temporary, the second ping to eth1 succeeds, and then subsequent pings to eth0 route correctly. It's difficult for me to determine how the IP stack gets into this state, but for now I'm going to try to solve a different DNS-related problem.

share|improve this question
Among the left out lines there is none with eth0? What is the output of ip rule? – Hauke Laging Apr 2 '14 at 17:35
eth0 is not mentioned. See above for ip rule. – Reinderien Apr 2 '14 at 17:53
Please update your port to include netstat -nr output. – Deano Apr 2 '14 at 18:15
Please also add the output of ip addr. – Hauke Laging Apr 2 '14 at 18:15
Please post the whole output of ip route, as well as the output of ip route get – BatchyX Apr 2 '14 at 20:08
up vote 0 down vote accepted

The problem turned out to be that UDP packets were not being passed. I don't know why. TCP DNS works just fine. In the end I used network-manager-openconnect and only retained one virtual adapter in VirtualBox, and it works.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.