Check hme ethernet link speed, duplex, and status in Solaris

Contributor Icon Contributed by qmchenry Date Icon October 2, 2003  
Tag Icon Tagged: Solaris networking

When troubleshooting networking issues, it is often helpful to determine the state of an ethernet interface. Solaris offers access to many configurable networking parameters through ndd.


To determine the ethernet interface link status, duplex, and speed on hme0, run the following commands as superuser:

ndd -set /dev/hme instance 0
ndd -get /dev/hme link_status
ndd -get /dev/hme link_mode
ndd -get /dev/hme link_speed

If you have only one ethernet interface, you can leave out the instance command. Otherwise, you can specify the hme instance number there. The results of the next three commands are either 1 or 0. In each case, the value means:

link_status: 0=down 1=up
link_mode: 0=half duplex 1=full duplex
link_speed: 0=10Mbps 1=100Mbps

Previous recipe | Next recipe |
 
  • Anonymous
    That's good... But let's loop it up a little. We had huge problems with solaris's autonegotiation algorithm, so I wrote the following scripts:

    getduplex.sh and fixduplex.sh

    Getduplex will loop through each interface defined in ifconfig, and show what the current status is: full or half duplex, 10 or 100 megabit, and will flag any that arn't 100/full.

    Fixduplex will 'fix' them to be 100/full on the fly. It makes networking pause for about 3 seconds (3 scary seconds) but it comes back. :-)

    http://cyberbuzz.gatech.edu/jprice/sun-duplex

    The scripts understands hme, qfe, dfme, and eri interfaces (and only up to 100 mbit. I don't have gig-copper gear to play with).
  • qmchenry
    I had opportunity to use your script today and it is slick! Thanks for sharing it with us!

    Quinn
  • Spamly
    THanks for the scripts! Love 'em!
  • Duck Dood
    Thanks for those, zapman! fixduplex.sh got a little exercise today, and worked like a champ.

    :D
  • Caesar
    This information perfect.

    thaks very much

    caesar
    :wink:
  • Anonymous
    forcing full-duplex is in general a bad idea, because if the switch on the other end of the link is set to auto-negotiate, it will autonegotiate half-duplex. While this may not happen every time, it's the expected behavior:

    http://www.cisco.com/warp/public/473/46.html

    their advice is,
    * use autonegotiation whenever it works
    * if you manually set speed or duplex on either end, then manually set duplex on both ends.
  • Anonymous
    Does anyone still have this script? I'm desperately looking for such a script to check the status.
    The link from above is down.

    Thanks,

    Ed.
  • Anonymous
blog comments powered by Disqus