I have a linux box with two NICS:



My routing table is as follows:

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         UG    100    0        0 eth0    *        U     0      0        0 eth0    *        U     0      0        0 eth1

The default route (via eth0) works fine but the problems are with the eth1 interface. I have set up a default gateway for eth1 as follows:

#ip rule list
0:  from all lookup local 
32765:  from iif eth1 lookup tbl_eth1 
32766:  from all lookup main 
32767:  from all lookup default

#ip route show table tbl_eth1
default via dev eth1 

The linux box is connected to a layer 3 switch which routes three subnets:    interface ip   interface ip   interface ip

From an address on the first subnet I can ping all the interfaces.

The problems arise when I try to reach from the subnet or vice versa.

Here are the traceroute results:

traceroute to (, 30 hops max, 60 byte packets
1 (  0.532 ms  0.911 ms  1.074 ms
2  * * *
3  * * *
4  * * *

# traceroute -i eth1 -s
traceroute to (, 30 hops max, 60 byte packets
1 (  1.196 ms  1.559 ms  1.739 ms
2  * * *
3  * * *
4  * * *

Now here's the really weird thing: using tshark I can actually see the traceroute packets arriving in each case at their respective destinations. This tells me that both the outgoing and return paths are being routed correctly. But for the life of me I can't work out why both ping and traceroute are failing.

I'm reasonably sure it's not an issue with the switch because if I make eth1 the default gateway on the linux box then it works fine (but then I have the same problem with eth0).

I'm at my wits end on this one -- any help would be greatly appreciated.

  • check the metric values carefully, when you have multiple routes to one destination the one with the lowest metric will be used – Dennis Nolte May 15 '14 at 9:56
  • With what protocol is the switch routing? Static? Can you show us the settings? – Jeroen May 15 '14 at 10:00
  • @Jeroen The the three routes are set up on the switch as VLANS hence the routing table is generated automatically. The switch's routing table is basically that shown in my question. – David Semeria May 15 '14 at 10:19
  • @DennisNolte I see what you mean but I don't think it's a problem with multiple routes. By forcing traceroute to use eth1 on the linux box there is only one possible route to choose. The box on the network only has one NIC and so has only one default route (which is the address of the switch). – David Semeria May 15 '14 at 10:23
  • @DavidSemeria just to make sure: did you try to disable eth0 for the traceroute eth1 test? this way there cannot be another working route. – Dennis Nolte May 15 '14 at 10:28

For future reference, the underlying problem was solved by @kasperd in another SF question

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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