[clug] Ethernet Link Status

Brad Hards bradh at frogmouth.net
Thu Jun 1 07:46:45 GMT 2006

On Thursday 01 June 2006 10:05 am, Brett Worth wrote:
> How can I check the link status of ethernet in Linux?
The SIOCETHTOOL ioctl might be useful, or something using it, such as ethtool 
and friends, I think.

> I'd like to write a script that will down the eth0 interface of my notebook
> if its not plugged in so the wireless can come up.  Currently I have the
> eth0 coming up automatically at boot.  If I plug my PCMCIA wireless card in
> it comes up but the default route is not applied because the eth0 interface
> stops it for some reason.  To fix I have to down the eth0 interface
> manually then down and up the wifi interface.
or a GUI option with something like:
http://www.gnome.org/projects/NetworkManager/ (which isn't Gnome specific, 
despite the URL).

> I see that the "link up" and "link down" messages go into syslog when the
> ethernet cable is plugged and unplugged but I cant work out how to examine
> this status.
Possibly netlink as well as the above.

> I'd like to be able to sit at my desk with the ethenet plugged in an be
> able to unplug the ethernet and plug in the wireless card and have the
> interfaces configured properly without me doing anything.
Perhaps Networkmanager is the best bet.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.samba.org/archive/linux/attachments/20060601/d98054a6/attachment.bin

More information about the linux mailing list