Setting speed and duplex of Solaris network interfaces
11 April 2003 02:00
11 Apr 2003
I found today that the network interface on one of the SPARCS I manage today was only set to 100Mb/s, half-duplex. Yuk. So much for autonegotiation. Well, here's how to check and how to fix such a problem, (Solaris OS). To find out what mode you're operating in you can do the following:
# ndd -get /dev/hme link_mode
1
# ndd -get /dev/hme link_status
1
# ndd -get /dev/hme link_speed
1
If you get all '1's you're in good shape. That means the link is up, (link_status=1), running at 100 Mb/s (link_speed=1), and at full-duplex (link_speed=1). If you get any zeros back, that could be an indication of a problem. link_mode=0 indicates half-duplex, link_status=0 means the if is down, and link_speed=0 means you're only running at 10Mb/s (btw, I wonder what you'd get with a GigE interface at 1000Mb/s...2???). Anyways, to fix such a problem you'll want to do something like this:
# ndd -set /dev/hme instance 0
# ndd -set /dev/hme adv_100fdx_cap 1
# ndd -set /dev/hme adv_100hdx_cap 0
# ndd -set /dev/hme adv_10fdx_cap 0
# ndd -set /dev/hme adv_10hdx_cap 0
# ndd -set /dev/hme adv_autoneg_cap 0
This assumes you're dealing with interface hme0. If not change the /dev file, and instance number accordingly, (e.g., ndd -set /dev/qfe instance 1). If you look at the names of the parameters you are setting you should be able to get a good idea of what this all means. To make this permanent across reboots, put the following in /etc/system:
* Force full-duplex operation
set hme:hme_adv_autoneg_cap=0
set hme:hme_adv_100fdx_cap=1
set hme:hme_adv_100hdx_cap=0
set hme:hme_adv_10fdx_cap=0
set hme:hme_adv_10hdx_cap=0
If for some strange reason you need half-duplex or 10Mb/s, you can probably figure out what to do.
One more note. If you're doing this across a remote link, and manipulating the interface over which you've got your shell running, you may be wondering whether your connection will stay up across these changes. Especially if you don't have a serial console connection to bail you out...well, don't fear. After you run the last ndd command (-set adv_autoneg_cap 0...) your connection will hang for a few seconds, but should come back (I'm writing this here, as none of the docs I could find told me what would happen...) after a few seconds.
Comments
|