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:
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.
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
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.
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.
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:
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
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.