[kwlug-disc] Detecting and using wired network when available

Kareem Shehata kshehata at aeryon.com
Wed Jul 7 14:46:00 EDT 2010


Hey everyone,

Has anyone run into the following problem, and have any solutions?

I have an embedded system that has both a wireless link and a wired ethernet connection to the outside world.  Normally, we just use the wireless link and set the default gateway to be the router on the wireless side.  When the ethernet cable is plugged in, we'd like it to direct traffic by default over the wired connection that isn't destined for a local subnet.  I've tried adding both gateways and giving the wireless connection a higher metric number.  That works really well when the system is on the wire, but it doesn't adjust the routing when the cable is unplugged.  Dmesg shows that the OS detects the cable unplugged, and ethtool shows the state correctly, but it doesn't seem to adjust the state of the interface nor the routing to reflect that.

In Mac and Windows it's as easy as giving each interface a gateway and a metric, and the system just figures out which one to use.  Any idea how to get Linux to do this?

Thanks!

Kareem

--
Kareem Shehata
kshehata at aeryon.com
Aeryon Labs Inc
519-489-6726 x254





More information about the kwlug-disc mailing list