0

I have a linux box with two NICS:

eth0 192.168.11.14

eth1 192.168.12.14

My routing table is as follows:

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         192.168.11.1    0.0.0.0         UG    100    0        0 eth0
192.168.11.0    *               255.255.255.0   U     0      0        0 eth0
192.168.12.0    *               255.255.255.0   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 192.168.12.14 iif eth1 lookup tbl_eth1 
32766:  from all lookup main 
32767:  from all lookup default

#ip route show table tbl_eth1
default via 192.168.12.1 dev eth1 

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

192.168.1.0    interface ip 192.168.1.1
192.168.11.0   interface ip 192.168.11.1
192.168.12.0   interface ip 192.168.12.1

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

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

Here are the traceroute results:

#traceroute 192.168.12.14
traceroute to 192.168.12.14 (192.168.12.14), 30 hops max, 60 byte packets
1  192.168.1.1 (192.168.1.1)  0.532 ms  0.911 ms  1.074 ms
2  * * *
3  * * *
4  * * *
etc..

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

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.

David Semeria
  • 219
  • 2
  • 8
  • 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 09: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 192.168.1.0 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
  • @DennisNolte After disabling eth0, the traceroute command gave the same results. This is not a surprise because even with eth0 enabled the first hop is the switch interface at 192.168.12.1 which is correct for eth1. – David Semeria May 15 '14 at 10:39

1 Answers1

0

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

David Semeria
  • 219
  • 2
  • 8