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.