Sunday, June 24, 2007

Check Link Mode, Link Status, and Link Speed for Ethernet Interface

The ndd command is also used to check for link mode, link status, and link speed of an Ethernet interface. Here's an example.

# ifconfig -a
lo0: flags=1000849 mtu 8232 index 1
inet netmask ff000000
hme0: flags=1000843 mtu 1500 index 2
inet netmask ffffff00 broadcast
ether 8:0:20:xx:xx:xx

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

What do the return values mean?
mode: 0 is half duplex and 1 is full duplex
status: 0 is down and 1 is up
speed: 0 is 10 megabits and 1 is 100 megabits

No comments: