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

    This entry was posted on Tuesday, April 5th, 2005 at 9:52 am and is filed under Data and Technology. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
  • 6 Comments

    Take a look at some of the responses we've had to this article.

    1. Dec 9th
      Reply

      Thanks for posting the interface setup for ce. My solaris is rusty but coming back.

    2. Kelvin
      Mar 13th
      Reply

      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.

    3. james
      Mar 9th
      Reply

      greatly stated. It takes away my headache of the weird Solaris nic settings. Strongly recommended.

    4. Sep 2nd
      Reply

      Garimpando Gold and Diamond…

      Vejo o longínquo horizonte / Cheio de sol posto ou nado …/ E, ainda que seja ilusão / … Nada mais quero nem peço. Entrego-lhe o coração. Fernando Pessoa
      ……

    5. zlumix
      Nov 4th
      Reply

      Thanks for the article. As I am new to Solaris, it helps me a lot.

  • Leave a Reply

    Let us know what you thought.

  • Name (required):

    Email (required):

    Website:

    Message:

Visitors have tagged this post: t (447) - ndd eri0 (181) - eri0 full duplex (152) - bge full-duplex (128) - eri "full duplex" (101) - solaris full duplex (69) - ndd eri (65) - solaris 8 full duplex (63) - bge 100 full (51) - 100 full duplex (49) - bge0 full duplex (49) - sun eri0 (43) - eri duplex (42) - all (39) - Force 100 Full Duplex (37) - bge duplex (36) - ndd bge (34) - solaris 9 full duplex (34) - eri0 duplex (33) - sun eri interface (32) - f (32) - "sun" +"bge" (31) - sun full duplex (31) - sun bge0 (31) - solaris force duplex (30) - solaris 100 full duplex (29) - solaris eri duplex (28) - bge ndd (27) - mss (26) - eri0 100 full duplex (25) - solaris 10 full duplex (25) - solaris 10 force full duplex (25) - solaris eri0 full-duplex (24) - bge + 100 full duplex (23) - sun duplex (22) - sun ce interface (21) - solaris eri0 duplex (21) - full duplex bge (21) - solaris network duplex (20) - eri interface (20) - bge sun (20) - solaris 10 eri duplex (19) - solaris 10 network duplex (18) - Solaris force full duplex (17) - full duplex solaris 8 (17) - ce0 full duplex (17) - sun bge duplex (17) - full-duplex eri (17) - solaris 10 eri full duplex (17) - full-duplex solaris (16) - solaris eri (16) - eri0 ndd (16) - solaris ce0 full duplex (16) - full duplex solaris 9 (16) - eri0 sun (16) - solaris eri full duplex (16) - solaris network full duplex (16) - eri0 100 full (16) - solaris 10 100 full duplex (16) - sun half duplex (16) - Solaris bge duplex (15) - sun "bge" full duplex (15) - sun ndd duplex (15) - 100/full duplex (15) - eri full duplex (15) - solaris force 100 full-duplex (14) - sun eri full duplex (13) - force bge full duplex (13) - set bge full duplex (13) - ndd 100-full-duplex (13) - bge force 100-full (13) - solaris 10 ndd full duplex (13) - full duplex eri0 (12) - solaris bge full-duplex (12) - ndd duplex (12) - ce interface full duplex (12) - force duplex solaris (12) - bge0 100 full duplex (12) - bge force full duplex (12) - set full duplex solaris 10 (12) - bge 100FULL (11) - solaris 9 force full duplex (11) - eri0 speed (11) - set bge 100 full (11) - set eri0 full duplex (11) - solaris force full duplex bge (11) - bge0 100 full (11) - solaris full duplex eri (11) - force bge 100 full (10) - ndd full-duplex (10) - solaris bge 100 full (10) - sun eri0 speed (10) - force full duplex (10) - force eri 100 full (10) - solaris 10 bge full duplex (10) - solaris ndd eri0 (10) - full duplex bge0 (10) - sun ce interfaces (10) - setting bge to full duplex (10) - SUNW,eri0 : 100 Mbps half duplex link up (10) - force 100 full duplex solaris 10 (10) - eri force 100 full (9) - Solaris ce full duplex (9) - eri0 solaris duplex (9) - set full duplex solaris (9) - force bge0 full duplex (9) - solaris 10 force 100 full (9) - solaris force 100 full (9) - solaris 10 set full duplex (9) - solaris bge force full duplex (9) - Sun Network Interfaces (9) - solaris 10 interface duplex (9) - tag/Solaris (8) - "duplex eri0" (8) - eri0 FULLDUPLEX (8) - sun 100 full duplex (8) - ndd bge0 (8) - eri 100 full (8) - solaris eri0 (8) - sun interface duplex (8) - solaris 8 force full duplex (8) - ndd 100 full (8) - solaris network interface full duplex (8) - ce 100 full duplex (8) - solaris ndd full duplex (8) - force full-duplex solaris (8) - ndd network (8) - solaris full duplex eri0 (8) - eri force full duplex (8) - solaris network half-duplex (8) - sun 100 full (8) - sun ce0 (8) - solaris 10 force 100 full duplex (8) - Solaris 10 eri (8) - solaris duplex eri (8) - eri 100 full duplex (7) - solaris full duplex ce (7) - bge fullduplex (7) - sun network full duplex (7) - sun network duplex (7) - force 100 full duplex solaris (7) - sun ndd (7) - solaris 100 full (7) - set bge to 100 full (7) - force full duplex solaris 10 (7) - ndd 100 (7) - force eri full duplex (7) - force 100 full eri (7) - eri interface speed (7) - solaris 10 force 100/full (7) -