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

Khalid Baheyeldin kb at 2bits.com
Wed Jul 7 14:56:04 EDT 2010


On Wed, Jul 7, 2010 at 2:46 PM, Kareem Shehata <kshehata at aeryon.com> wrote:

> 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?
>

Kareem

I don't have a direct answer, but the wicd package in Ubuntu does that.

Wicd is a wireless (and wired) network management utility with a GUI,
command
line and Curses interfaces. It is written entirely in Python and that is
something
that you are familiar with.

You can tell it to switch to a wired connection when available.

This being an embedded system, getting this particular package installed may
be
not possible/practical. You can inspect the source and see how it is done.

http://packages.ubuntu.com/source/lucid/wicd
http://wicd.sourceforge.net/
-- 
Khalid M. Baheyeldin
2bits.com, Inc.
http://2bits.com
Drupal optimization, development, customization and consulting.
Simplicity is prerequisite for reliability. --  Edsger W.Dijkstra
Simplicity is the ultimate sophistication. --   Leonardo da Vinci
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://kwlug.org/pipermail/kwlug-disc_kwlug.org/attachments/20100707/67354442/attachment.htm>


More information about the kwlug-disc mailing list