Apr 15

To get the speed and duplex of a NIC in Solaris, use the ndd command.

ndd -get /dev/bge0 link_speed
ndd -get /dev/bge0 link_duplex

Duplex values are 0 (disconnected) 1 (half) and 2 (full)

Apr 8

NICs like to talk to each other at the same speed and duplex. In fact, bad things happen if you have a mismatch in either of those, so a way to view and then set those parameters is important. Let’s start with the viewing. As root, run

ethtool $DEV

Where the $DEV is the network interface. You’ll get output similar to the following

root@Seraph:~# ethtool eth0
Settings for eth0:
Supported ports: [ TP MII ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
Advertised auto-negotiation: Yes
Speed: 10Mb/s
Duplex: Half
Port: MII
PHYAD: 32
Transceiver: internal
Auto-negotiation: on
Supports Wake-on: pumbg
Wake-on: d
Current message level: 0×00000007 (7)
Link detected: no

The fields in bold tell you the capabilities of your interface, the current speed, the current duplex and whether the NIC is set to try to auto-negotiate it’s speed and duplex settings with the switch. While auto-negotiate will work in most cases for clients, when you start talking about servers you really need to hardcode the NIC. Do that with

ethtool -s $DEV speed 100 duplex full

And now $DEV is set to 100Mbs Full Duplex. You can verify that with another run of ethtool. An important tip to remember is to never run this command if you are connected to the server using this interface. If a speed or duplex mismatch occur, the server will become pretty much unavailable over that interface. Always use the serial console, the attached keyboard or a different interface then the one you are working on to connect to the server.