Detecting and using wired network when available

Kareem Shehata kshehata-XAaQGU7qChDQT0dZR+AlfA at public.gmane.org
Wed Jul 7 18:46:02 UTC 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-XAaQGU7qChDQT0dZR+AlfA at public.gmane.org
Aeryon Labs Inc
519-489-6726 x254

--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list