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

GIG e 1

Status
Not open for further replies.

Mag0007

MIS
Feb 15, 2005
829
US
How can I verify if my NIC is a 10/100/1000 card?

 
I do see this...
adv_1000fdx_cap (read and write)
adv_1000hdx_cap (read and write)

Does it mean its 1000 compatable?

TIA
 
I found this somewhere on the web. It might have been here at Tek-Tips...
Code:
#!/bin/sh

# Print column header information
/usr/bin/echo "Interface\tSpeed\t\tDuplex"
/usr/bin/echo "---------\t-----\t\t------"

# Determine the speed and duplex for each live NIC on the system
for INTERFACE in `/usr/bin/netstat -i | /usr/bin/egrep -v "^Name|^lo0" \
   | /usr/bin/awk '{print $1}' | /usr/bin/cut -d: -f1 |/usr/bin/sort \
   | /usr/bin/uniq`
do
   # "ce" interfaces
   if [ "`/usr/bin/echo $INTERFACE \
   | /usr/bin/awk '/^ce[0-9]+/ { print }'`" ] ; then
      # Determine the ce interface number
      INSTANCE=`/usr/bin/echo $INTERFACE | cut -c 3-`
      DUPLEX=`/usr/bin/kstat ce:$INSTANCE | /usr/bin/grep link_duplex \
         | /usr/bin/awk '{ print $2 }'`
      case "$DUPLEX" in
         1) DUPLEX="half" ;;
         2) DUPLEX="full" ;;
      esac
      SPEED=`/usr/bin/kstat ce:$INSTANCE | /usr/bin/grep link_speed \
         | /usr/bin/awk '{ print $2 }'`
      case "$SPEED" in
         10) SPEED="10 Mbit/s" ;;
         100) SPEED="100 Mbit/s" ;;
         1000) SPEED="1 Gbit/s" ;;
      esac
   # "bge" interfaces
   elif [ "`/usr/bin/echo $INTERFACE \
   | /usr/bin/awk '/^bge[0-9]+/ { print }'`" ] ; then
      # Determine the bge interface number
      INSTANCE=`/usr/bin/echo $INTERFACE | cut -c 4-`
      DUPLEX=`/usr/bin/kstat bge:$INSTANCE:parameters \
         | /usr/bin/grep link_duplex | /usr/bin/awk '{ print $2 }'`
      case "$DUPLEX" in
         1) DUPLEX="half" ;;
         2) DUPLEX="full" ;;
      esac
      SPEED=`/usr/bin/kstat bge:$INSTANCE:parameters \
         | /usr/bin/grep link_speed | /usr/bin/awk '{ print $2 }'`
      case "$SPEED" in
         10) SPEED="10 Mbit/s" ;;
         100) SPEED="100 Mbit/s" ;;
         1000) SPEED="1 Gbit/s" ;;
      esac
   # "iprb" interfaces
   elif [ "`/usr/bin/echo $INTERFACE \
   | /usr/bin/awk '/^iprb[0-9]+/ { print }'`" ] ; then
      # Determine the iprb interface number
      INSTANCE=`/usr/bin/echo $INTERFACE | cut -c 5-`
      DUPLEX=`/usr/bin/kstat iprb:$INSTANCE \
         | /usr/bin/grep duplex | /usr/bin/awk '{ print $2 }'`
      SPEED=`/usr/bin/kstat iprb:$INSTANCE | /usr/bin/grep ifspeed \
         | /usr/bin/awk '{ print $2 }'`
      case "$SPEED" in
         10000000) SPEED="10 Mbit/s" ;;
         100000000) SPEED="100 Mbit/s" ;;
         1000000000) SPEED="1 Gbit/s" ;;
      esac
   # le interfaces are always 10 Mbit half-duplex
   elif [ "`/usr/bin/echo $INTERFACE \
   | /usr/bin/awk '/^le[0-9]+/ { print }'`" ] ; then
      DUPLEX="half"
      SPEED="10 Mbit/s"
   # All other interfaces
   else
      INTERFACE_TYPE=`/usr/bin/echo $INTERFACE | /usr/bin/sed -e "s/[0-9]*$//"`
      INSTANCE=`/usr/bin/echo $INTERFACE | /usr/bin/sed -e "s/^[a-z]*//"`
      # Only the root user can run /usr/sbin/ndd commands
      if [ "`/usr/bin/id | /usr/bin/cut -c1-5`" != "uid=0" ] ; then
         echo "You must be the root user to determine \
${INTERFACE_TYPE}${INSTANCE} speed and duplex information."
         continue
      fi
      /usr/sbin/ndd -set /dev/$INTERFACE_TYPE instance $INSTANCE
      SPEED=`/usr/sbin/ndd -get /dev/$INTERFACE_TYPE link_speed`
      case "$SPEED" in
         0) SPEED="10 Mbit/s" ;;
         1) SPEED="100 Mbit/s" ;;
         1000) SPEED="1 Gbit/s" ;;
      esac
      DUPLEX=`/usr/sbin/ndd -get /dev/$INTERFACE_TYPE link_mode`
      case "$DUPLEX" in
         0) DUPLEX="half" ;;
         1) DUPLEX="full" ;;
         *) DUPLEX="" ;;
      esac
   fi
   /usr/bin/echo "$INTERFACE\t\t$SPEED\t$DUPLEX"
done
It displays something like this...
Code:
Interface       Speed           Duplex
---------       -----           ------
hme0            100 Mbit/s      full
 
Yes your NIC can run at Gigabit as long as the cable and switch can support it.
 
What kind of NIC are you running (bge, ce, ge)? If you want to hard code it -I have seen issues with autonegotation- you will have to write a script or make a .conf file.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top