On Wed, Jul 7, 2010 at 2:46 PM, Kareem Shehata <span dir="ltr"><<a href="mailto:kshehata@aeryon.com">kshehata@aeryon.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hey everyone,<br>
<br>
Has anyone run into the following problem, and have any solutions?<br>
<br>
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.<br>

<br>
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?<br></blockquote></div><br>Kareem<br><br>I don't have a direct answer, but the wicd package in Ubuntu does that. <br>
<br>Wicd is a wireless (and wired) network management utility with a GUI, command<br>line and Curses interfaces. It is written entirely in Python and that is something<br>that you are familiar with.<br><br>You can tell it to switch to a wired connection when available.<br>
<br>This being an embedded system, getting this particular package installed may be<br>not possible/practical. You can inspect the source and see how it is done.<br><br><a href="http://packages.ubuntu.com/source/lucid/wicd">http://packages.ubuntu.com/source/lucid/wicd</a><br>
<a href="http://wicd.sourceforge.net/">http://wicd.sourceforge.net/</a><br>-- <br>Khalid M. Baheyeldin<br><a href="http://2bits.com">2bits.com</a>, Inc.<br><a href="http://2bits.com">http://2bits.com</a><br>Drupal optimization, development, customization and consulting.<br>
Simplicity is prerequisite for reliability. --  Edsger W.Dijkstra<br>Simplicity is the ultimate sophistication. --   Leonardo da Vinci<br>