Detecting and using wired network when available

Daniel Hedlund daniel-fKF+LmlhkCtg9hUCZPvPmw at public.gmane.org
Thu Jul 8 19:54:45 UTC 2010


On Wed, Jul 7, 2010 at 11:46, Kareem Shehata <kshehata-XAaQGU7qChDQT0dZR+AlfA at public.gmane.org> wrote:
> Has anyone run into the following problem, and have any solutions?

> That works really well when the system is on the wire, but it doesn't adjust the routing when the cable is unplugged.

I'm assuming that the you don't have any programs that are monitoring
the wired network interface for changes in state; it's just a static
IP address that has been created with ifconfig/ip and is never removed
or brought down automatically.

Are you running any particular distribution/project on the embedded
device?  I'm not sure what tools are available to you, but check if
'ifplugd' is availabl.  It's designed to detect and configure devices
when the cable is plugged in and unconfigure it when unplugged.  In
newer desktop-based distros, ifplugd has been mostly superseded by
NetworkManager which I assume won't be available.

If you can't find ifplugd, perhaps you can create a script that
monitors the network status via ethtool the /sys filesystem (depending
on kernel version):
/sys/class/net/<DEVICE>/carrier ("0" or "1")
/sys/class/net/<DEVICE>/operstate ("up", "down" or "unknown")


Cheers,

Daniel Hedlund
daniel-fKF+LmlhkCtg9hUCZPvPmw at public.gmane.org
--
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