[Beowulf] Ethernet Status

Joe Landman landman at scalableinformatics.com
Wed May 25 05:07:11 PDT 2005


Hi Paul:

   There are many ways:  parse /proc entries, parse ifconfig output, or 
use a tool that does all of that for you.  Have a look at ifinfo 
(http://downloads.scalableinformatics.com/downloads/ifinfo/ifinfo-0.90-1.src.rpm 
and related http://downloads.scalableinformatics.com/downloads/ifinfo/)

[root at crunch-r metadot]# ifinfo
device: address/netmask                 MTU        Tx (MB)         Rx (MB)
eth0:   192.168.1.117/255.255.255.0     1500       110.923          37.976
eth1:   192.168.2.117/255.255.255.0     1500         0.001           2.498
eth2:   192.168.3.117/255.255.255.0     1500         0.018           0.021
lo:     127.0.0.1/255.0.0.0             16436       44.286          44.286
sit0:   addr not set/mask not set       1480         0.000           0.000

  [root at crunch-r metadot]# ifinfo --mac
device: MAC             address/netmask                 MTU        Tx 
(MB)         Rx (MB)
eth0:   00E0812DF2C6    192.168.1.117/255.255.255.0     1500 
111.158          38.561
eth1:   00E0812DF2C7    192.168.2.117/255.255.255.0     1500 
0.001           2.524
eth2:   00E0812DF277    192.168.3.117/255.255.255.0     1500 
0.018           0.021
lo:     000000000000    127.0.0.1/255.0.0.0             16436 
44.391          44.391
sit0:   000000000000    addr not set/mask not set       1480 
0.000           0.000

[root at crunch-r metadot]# ifinfo --mask=range
device: address/netmask                 MTU        Tx (MB)         Rx (MB)
eth0:   192.168.1.117/24                1500       111.162          38.568
eth1:   192.168.2.117/24                1500         0.001           2.524
eth2:   192.168.3.117/24                1500         0.018           0.021
lo:     127.0.0.1/8                     16436       44.394          44.394
sit0:   addr not set/mask not set       1480         0.000           0.000

[root at crunch-r metadot]# ifinfo --info=dev,inet_addr,irq
eth0,192.168.1.117,201
eth1,192.168.2.117,209
eth2,192.168.3.117,-
lo,127.0.0.1,-
sit0,addr not set,-

...

Many options,  detailed man page, and the author hangs out here 
(features are easy to request).

Joe
Paul Romero wrote:
> Dear User Group:
> 
> How does one determine the status of a device
> such as eth0.   My initial guess is that once
> you know the device name for eth0, you can
> just open it and use ioctl calls, or perhaps it will
> not successfully open if the hardware device is down.
> 
> My problem is I can't figure out the device name.
> (i.e. My motivation for doing this is to find out if
> my system has physical IP connectivity without referencing
> a particular IP address.)
> 
> Best Regards,
> 
> Paul R.
> 
> 
> --
> Paul Romero
> 
> RCOM Communications Software
> 
> Phone/Fax: (510)339-2628
> E-Mail: paulr at rcom-software.com
> 
> 
> _______________________________________________
> Beowulf mailing list, Beowulf at beowulf.org
> To change your subscription (digest mode or unsubscribe) visit http://www.beowulf.org/mailman/listinfo/beowulf

-- 
Joseph Landman, Ph.D
Founder and CEO
Scalable Informatics LLC,
email: landman at scalableinformatics.com
web  : http://www.scalableinformatics.com
phone: +1 734 786 8423
fax  : +1 734 786 8452
cell : +1 734 612 4615



More information about the Beowulf mailing list