We ran into an issue with the speed and duplex settings on one of our CentOS boxes during a recent upgrade of our infrastructure to HP ProCurve 8112zl switches. Because I futz with this about once a year I figured I’d write it down so I could look up up next time…
Step 1: Determine what NIC is in your CentOS box so you can see it’s capabilities.
#lspci | grep Ethernet
This should give you something like (excuse the wrap):
0a:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 02)
Step 2: Check how the nic is currently set:
This should give you something like:
Settings for eth0::
Supported ports: [ TP ]
Supported link modes: 10baseT/Half 10baseT/Full
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
Advertised auto-negotiation: Yes
Port: Twisted Pair
Supports Wake-on: g
Current message level: 0x000000ff (255)
Link detected: yes
Step 3: Force the speed to say, 100Full (just for grins):
Add the line:
ETHTOOL_OPTS="speed 100 duplex full autoneg off"
The bounce the network service:
#service network restart
That’s it. Also be sure to check the config on the switch so it matches. And remember… always be consistent on both sides of the setup. If the server is auto, set the switch to auto. If the server is 100Full, force the switch port to 100Full.