Forcing Sun Network Interfaces to 100/Full Duplex

For one reason or another, many network switches don’t like to negotiate properly with the ethernet cards in Sun servers. This can result in a lot of headaches, and sometimes the problem is difficult to diagnose. Usually the autonegotiation software within the switch can tell that the network card on the server is able to link at 100 Mbs, but is unable to confirm that it can do full duplex. The switch the links up at the lowest common default, and you wind up with a link running at 100/Half Duplex.

Usually the link will seem very slow, and you will see many packet collisions on the interface when you do a:

netstat -i

To resolve this issue, we have to force both the switch and network card to run at 100/Full Duplex. This can be done on the host in three ways. I like to just set it in the /etc/system file, and then I never have to worry about it again. You can do this by editing /etc/system, and adding the following lines:

Please note that this assumes the ethernet card is "eri", and that these lines will apply to all "eri" network cards within this server. If you have a a different type of network card, "hme", for example, simply replace "eri" with "hme" in the lines you add to your /etc/system file.

SNIP
set eri:adv_100fdx_cap = 1
set eri:adv_100hdx_cap = 0
set eri:adv_10fdx_cap = 0
set eri:adv_10hdx_cap = 0
set eri:adv_autoneg_cap = 0
SNIP

Once you’ve added the lines and written out the file, all you have to do is reboot the server, and so long as the switch is forced to 100/Full Duplex as well, you should be all set. Sometimes, however, we can’t just reboot our servers whenever we want, so we will have to force the interface while the system is still up.

To force the eri0 to 100 full duplex from the command line we can use the following commands. Please note, however that the settings will stay active only until the machine is rebooted. If you wish to have the settings stick, you must edit the /etc/system file, as shown above.

Again, these commands, as they are, apply only to an "eri" type ethernet card. If you do not have an”eri” card, replace all instances of “eri” with the name of your card.

COMMANDS

ndd -set /dev/eri instance 0 (select interface; 0=eri0, 1=eri1, etc…)
ndd -set /dev/eri adv_100fdx_cap 1 (enable 100MBit/s in Full Duplex)
ndd -set /dev/eri adv_100hdx_cap 0 (disable 100MBit/s in Half Duplex)
ndd -set /dev/eri adv_10fdx_cap 0 (disable 10MBit/s in Full Duplex)
ndd -set /dev/eri adv_10hdx_cap 0 (disable 10MBit/s in Half Duplex)
ndd -set /dev/eri adv_autoneg_cap 0 (disable auto-negotiation, forcing driver.

COMMANDS

If, for some reason, you really don’t want to edit your /etc/system file, you could always add a script containing the "ndd" commands to your /etc/rc2.d directory, and have them executed at startup. Let’s say we create a script called /etc/rc2.d/S68forceinterface.sh, and add the above commands to it. It would look something like this:

SCRIPT
!/sbin/sh
eri-Interfaces
Forcing eri0 to work at 100mb full duplex.
ndd -set /dev/eri instance 0
ndd -set /dev/eri adv_100fdx_cap 1
ndd -set /dev/eri adv_100hdx_cap 0
ndd -set /dev/eri adv_10fdx_cap 0
ndd -set /dev/eri adv_10hdx_cap 0
ndd -set /dev/eri adv_autoneg_cap 0

SCRIPT
Then we’d just do a:

chmod 755 /etc/rc2.d/S68forceinterface.sh

And the commands would be executed as the machine started up. Again, however, I strongly suggest you simply edit your /etc/system file. It’s a lot easier, and it’s just one less thing to worry about.

6 thoughts on “Forcing Sun Network Interfaces to 100/Full Duplex

  1. Thanks! This worked great.

    FYI for reference, to find out what speed the interface has come up as:

    # ifconfig -a (to find out the active interface name)

    # dmesg | grep eri0 (grep the interface name)
    Mar 1 10:10:30 myserver eri: [ID 517527 kern.info] SUNW,eri0 : 100 Mbps half duplex link up

    After you put in the commands in /etc/system, and then do the commandline, the “ndd -set /dev/eri adv_autoneg_cap 0″ actually “suspends” your remote login session while your ssh/telnet session re-establishes itself. It took about 5 seconds to get the prompt back for me.

  2. Pingback: Careless Ramblings » Solaris 100/full duplex

  3. Pingback: jar.io

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>