problem with two interfaces on the same subnet: route selection does not consider link state
From: Clem Taylor
Date: Thu Jul 31 2008 - 18:25:13 EST
I'm having a problem on a MIPS-LE 2.6.24 embedded box where I have two
interfaces (one wired and one wireless) that are both on the same
subnet. The wired interface is up but not running (cable unplugged)
and the wireless interface is up and running. The device receives
packets over the wireless interface, but can't seem to send responses
back.
For example, an external host 192.168.50.23 pings 192.168.50.16
(wireless interface) and does not get a response. tcpdump on the
device shows that the ping is received, but it doesn't respond:
IP 192.168.50.23 > 192.168.50.16: ICMP echo request, id 4934, seq 994, length 64
IP 192.168.50.16 > 192.168.50.16: ICMP host 192.168.50.23 unreachable, length 92
The arp cache shows that it knows how to reach the host on ath0, but
not on eth0, as expected:
? (192.168.50.23) at 00:11:11:64:49:D6 [ether] on ath0
? (192.168.50.23) at <incomplete> on eth0
If the device tries to ping the host, it does not get a response, but
if I send the ping to an explicit interface, it works:
ping -I ath0 192.168.50.23
PING 192.168.50.23 (192.168.50.23): 56 data bytes
64 bytes from 192.168.50.23: seq=0 ttl=64 time=27.895 ms
64 bytes from 192.168.50.23: seq=1 ttl=64 time=14.274 ms
64 bytes from 192.168.50.23: seq=2 ttl=64 time=18.143 ms
If I bring the wired interface down (ifconfig eth0 down), then it
(instantly) starts responding to pings. For this device, the wired
interface is normally only used for setup and is configured to use
DHCP. It is only when the user makes the wired interface static that
we have a problem.
Destination Gateway Genmask Flags MSS Window irtt Iface
192.168.50.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
192.168.50.0 0.0.0.0 255.255.255.0 U 0 0 0 ath0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
224.0.0.0 0.0.0.0 224.0.0.0 U 0 0 0 ath0
224.0.0.0 0.0.0.0 224.0.0.0 U 0 0 0 eth0
0.0.0.0 192.168.50.1 0.0.0.0 UG 0 0 0 ath0
0.0.0.0 192.168.50.1 0.0.0.0 UG 0 0 0 eth0
ath0 Link encap:Ethernet HWaddr xx:xx:xx:80:00:EC
inet addr:192.168.50.16 Bcast:192.168.50.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:5770 errors:0 dropped:0 overruns:0 frame:0
TX packets:107 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:493209 (481.6 KiB) TX bytes:6521 (6.3 KiB)
eth0 Link encap:Ethernet HWaddr xx:xx:xx:00:00:EC
inet addr:192.168.50.236 Bcast:192.168.50.255 Mask:255.255.255.0
UP BROADCAST MULTICAST MTU:1500 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)
I thought that the IP routing decision would take link state into
account and not select an interface that is not currently running. Is
there an easy way to make the routing table aware of the local link
state?
Thanks,
Clem Taylor
--
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html