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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Finding out network setting? 1

Status
Not open for further replies.

mscim

MIS
Feb 25, 2003
22
SG
How do I find the NIC settings of the following:

1. 10 or 100 MBps ?
2. Full or half duplex ?
3. Auto negotiation ON or OFF ?

I'm using Solaris 8
 
Here is a nice script that I use to check my settings.

#!/bin/sh
#
# luisla@essiprojects.com
# v.1.1. 2002, July.
#
# Read status and info of the local and configured server interfaces, using
# ndd commands.
#
# Think about root execution (change permisions file).
#
#
# P.e. ndd -set /dev/hme link_speed 1
# ndd -get /dev/hme link_status 0 = link up, 1 = link down
# ndd -get /dev/hme link_speed 0 = 10MBit, 1 = 100MBit
# ndd -get /dev/hme link_mode 0 = half duplex, 1 = full duplex
# ndd -get /dev/hme adv_autoneg_cap 0 = no autonegotiation, 1 = autoneg.
#
# lp_100T4_cap = 100BASE-T4
# lp_100fdx_cap = 100Mbit/sec full-duplex
# lp_100hdx_cap = 100Mbit/sec half-duplex
# lp_10fdx_cap = 10Mbit/sec full-duplex
# lp_10hdx_cap = 10Mbit/sec half-duplex
#
# In Netra servers dmfe interfaces has a physical device in /dev, so
# it's innecessary to make instance of interfaces as usual with hme
# o qfe... BTW, link_speed it's not based in 1 o 0, but in 10 or 100 Mb
# and lp_autoneg_cap doesn't exists...
#

call_interface () {

if [ $# = 2 ];
then
SET=`ndd -set /dev/$1 instance $2`
fi

GET="ndd -get /dev/$1"

printf "$1$2:\t"

case `$GET link_status` in
'0') echo "KO."
continue ;;
'1') printf "OK.\t" ;;
esac

case `$GET link_speed` in
'0') printf "10Mb.\t" ;;
'1') printf "100Mb.\t" ;;
'10') printf "10Mb.\t" ;;
'100') printf "100Mb.\t" ;;
esac

case `$GET link_mode` in
'0') printf "Half Duplex.\t" ;;
'1') printf "Full Duplex.\t" ;;
esac

case `$GET lp_autoneg_cap` in
'0') printf "LP no autonegotiation." ;;
'1') printf "LP autonegotiation." ;;
esac

case `$GET adv_autoneg_cap` in
'0') echo "No autonegotiation.\t" ;;
'1') echo "Autonegotiation.\t" ;;
esac

}

for DEVICE in `ls /etc/hostname.* | awk -F. '{print $2}'`;
do

INT=`echo $DEVICE | awk '{print substr($1,1,3)}'`
SER=`echo $DEVICE | awk '{print substr($1,4,1)}'`

case $INT in
'dmf')
INT=`echo $DEVICE | awk '{print substr($1,1,5)}'`
call_interface $INT
;;
'le'?)
INT=`echo $DEVICE | awk '{print substr($1,1,2)}'`
SER=`echo $DEVICE | awk '{print substr($1,3,1)}'`
echo "$INT$SER device can't show stats. Sure $INT$SER it runs at 10Mb..."
;;
*)
call_interface $INT $SER
;;
esac
done

echo
echo LP = link partner
echo
echo 'Link partner capable of auto-negotation (lp_autoneg_cap 1)'
echo 'speed and mode information is displayed when you use auto-negotiation'
echo 'and get the link partner capabilities.'
echo
 
There is a new issue here. Some of my server don't respond to the

#ndd -get /dev/hme link_status

I get this error: couldn't push module 'hme', No such device or address

Are there any other ways of finding out?

Should I find that I need to thange the configuration, how should I do it?
 
Do those systems have hme cards configured? Type ifconfig -a to find out what they are on that system. Maybe there are some old /etc/hostname.* files hanging around.

Note that some earlier network drivers don't respond to ndd at all (although hme should).

Annihilannic.
 
Are they hme interfaces? You need to set the instance number before doing the get.

i.e. for hme1

ndd -set /dev/hme instance 1
ndd -get /dev/hme link_speed
etc..

for le0

ndd -set /dev/le instance 0
ndd -get /dev/le link_speed
etc..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top