Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Command for checking speed and duplex 2

Status
Not open for further replies.

misjay01

Technical User
Jun 17, 2003
50
GB
Hello,

I am currently running solaris 2.9 O.S. and am trying to find the command that will show me what current speed and duplex settings have been configured for the NIC cards.

Can someone help ?

TIA
 
Use these:

ndd -get /dev/hme link_speed 0 = 10MBit, 1 = 100MBit
ndd -get /dev/hme link_mode 0 = half duplex, 1 = full duplex

If you have more than one NIC, place the instance next to hme. Like /dev/hme0 and so on.
 
Nice little script for you.

Enjoy !

for i in `ifconfig -a | egrep "^eri" | awk '/^[a-z]*[0-9]*: / {print $1}' | sed s/://`
do
device=`echo $i | sed s/[0-9]*$//`
instance=0
ndd -set /dev/$device instance $instance
duplex=`ndd -get /dev/$device link_mode`
speed=`ndd -get /dev/$device link_speed`
autoneg=`ndd -get /dev/$device adv_autoneg_cap`
case "$speed" in
"0") echo "$i is at 10 mbit \c";;
"1") echo "$i is at 100 mbit \c";;
*) echo "$i is at ??? mbit \c";;
esac
case "$duplex" in
"0") echo "half duplex \c";;
"1") echo "full duplex \c";;
*) echo "??? duplex \c";;
esac
case "$autoneg" in
"0") echo "with auto negotiation";;
"1") echo "without auto negotiation";;
*) echo "??? auto negotiation";;
esac
done

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top