[NBLUG/talk] Ethernet connection status

Barry Stump barry at shrewdlogic.com
Tue Jun 27 15:55:30 PDT 2006


Thanks.  This is an embedded system with only basic tools, and the 
following is works well for me:

ifconfig eth0 | grep RUNNING

-Barry

+--------------------------------------------------------------------+
| Wit levels low.  Attempting to               Barry Stump           |
| compensate.                                  barry at stump.net       |
|                                              barry at shrewdlogic.com |
+--------------------------------------------------------------------+

On Tue, 27 Jun 2006, Eric Eisenhart wrote:

> On Tue, Jun 27, 2006 at 02:29:53PM -0700, Barry Stump wrote:
>> Does anyone know of an easy way to determine the status of an ethernet
>> connection from a shell script?  I'm hoping there's some parameter for
>> ifconfig or possibly something in the /proc filesystem that will do it.
>> I'd like to be able to determine whether or not eth0 is up and connected.
>> A disconnected cable at boot time is easy to detect because eth0 won't
>> initialize and therefore won't show up in the output from ifconfig.
>> However, disconnecting the cable once the box is running doesn't change
>> the output, and I don't want to resort to ping.
>
> Well...  you can look for "UP" and "RUNNING" in "ifconfig eth0", or you can
> look for "Link detected: yes" in "ethtool eth0".
> -- 
> Eric Eisenhart
> NBLUG Co-Founder, Scribe and InstallFest Coordinator
> The North Bay Linux Users Group -- http://nblug.org/
> eric at nblug.org, IRC: Freiheit at fn AIM: falschfreiheit
>
> _______________________________________________
> talk mailing list
> talk at nblug.org
> http://nblug.org/cgi-bin/mailman/listinfo/talk
>



More information about the talk mailing list