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:
#ethtool eth0:
This should give you something like:
Settings for eth0::
Supported ports: [ TP ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Advertised auto-negotiation: Yes
Speed: 1000Mb/s
Duplex: Full
Port: Twisted Pair
PHYAD: 1
Transceiver: internal
Auto-negotiation: on
Supports Wake-on: g
Wake-on: g
Current message level: 0x000000ff (255)
Link detected: yes
Step 3: Force the speed to say, 100Full (just for grins):
Edit /etc/sysconfig/networking-scripts/ifcfg-eth0
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.