Detecting and using wired network when available

Lennart Sorensen lsorense-1wCw9BSqJbv44Nm34jS7GywD8/FfD2ys at public.gmane.org
Thu Jul 8 20:48:32 UTC 2010


On Thu, Jul 08, 2010 at 12:54:45PM -0700, Daniel Hedlund wrote:
> 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")

I think network-manager seems pretty good at switching interfaces on
demand if you let if manage all the interfaces.  It allows profiles
for different interfaces to be setup for when you need a static IP in
a certain place, and dhcp for normal use.

-- 
Len Sorensen
--
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