I have two machines that are connected to the same switch. Machines have multiple ethernet interfaces connected to the different networks. Computer A can ping an antenna which is connected to the same switch, but can not ping Computer B using correct interface.(via ping -I eth2 in my case), but Computer B can ping the antenna and can ping Computer A using correct interface ( via ping -I eth9 in my case).
I checked interface details they both have same subnet masks, I tried tracert -i , results were consistent with the problem I mentioned above but it didn't reveal much. tracert on computer A took 30 hops and in the end it couldn't reach computer B. route command showed me routing tables are similar, only difference that I see is computer B have two interfaces defined in subnet but only one is physically connected at the time, can that be causing this weird problem? Any suggestions would be appreciated.
computer A
eth0 Link encap:Ethernet HWaddr 68:05:ca:02:e3:5c
inet addr:16.1.8.61 Bcast:16.1.63.255 Mask:255.255.192.0
inet6 addr: fe80::6a05:caff:fe02:e35c/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:144031 errors:0 dropped:0 overruns:0 frame:0
TX packets:11423 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:11302308 (10.7 MiB) TX bytes:853551 (833.5 KiB)
Memory:fe8e0000-fe900000
eth2 Link encap:Ethernet HWaddr 00:d0:c9:ce:6d:7c
inet addr:192.168.1.15 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::2d0:c9ff:fece:6d7c/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:168 errors:0 dropped:0 overruns:0 frame:0
TX packets:402 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:17398 (16.9 KiB) TX bytes:41787 (40.8 KiB)
Memory:fe9e0000-fea00000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:120 errors:0 dropped:0 overruns:0 frame:0
TX packets:120 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:8480 (8.2 KiB) TX bytes:8480 (8.2 KiB)
computer B
eth7 Link encap:Ethernet HWaddr 00:d0:c9:ce:6c:b2
inet addr:16.1.8.64 Bcast:16.1.63.255 Mask:255.255.192.0
inet6 addr: fe80::2d0:c9ff:fece:6cb2/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:134026 errors:0 dropped:0 overruns:0 frame:0
TX packets:3212 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:10611871 (10.1 MiB) TX bytes:272509 (266.1 KiB)
Memory:fe9e0000-fea00000
eth8 Link encap:Ethernet HWaddr 68:05:ca:02:e1:c2
inet addr:192.168.1.60 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST MULTICAST MTU:8228 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Memory:fe8e0000-fe900000
eth9 Link encap:Ethernet HWaddr 68:05:ca:02:e1:c3
inet addr:192.168.1.57 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::6a05:caff:fe02:e1c3/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:383 errors:0 dropped:0 overruns:0 frame:0
TX packets:157 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:40794 (39.8 KiB) TX bytes:15778 (15.4 KiB)
Memory:fe880000-fe8a0000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:250 errors:0 dropped:0 overruns:0 frame:0
TX packets:250 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:22872 (22.3 KiB) TX bytes:22872 (22.3 KiB)
Routing Table A
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 * 255.255.255.0 U 0 0 0 eth2
localnet * 255.255.192.0 U 0 0 0 eth0
default pfizmir.xxxx 0.0.0.0 UG 0 0 0 eth0
If you have two separate physical interfaces on the same network, connected to the same VLAN, you will need to set up a few specific routing rules, ensuring that the server responds on the same interface that it received the packet on.
With
ip
you can create additional tables, tables that are only used when traffic is received on one of the interfaces.First you will want to create two separate routing tables.
this creates the tables which will decide how to route the packets.
and that should ensure that the packets that arrive on eth9 are responded to on eth9 and so on.
As always, I recommend reading this page, it explains the concepts very well, and also gives you many more examples.