What it is¶
ethtool reads and changes the settings of Ethernet interfaces: link state, negotiated speed and duplex, driver and firmware, offload features, and hardware counters.
Is the cable connected?¶
sudo ethtool eth0
Settings for eth0:
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Supports auto-negotiation: Yes
Speed: 1000Mb/s
Duplex: Full
Auto-negotiation: on
Link detected: yes
Link detected: no at the bottom means nothing is plugged in, or the far end is down. A link negotiating at 100Mb/s on a gigabit port usually points at a bad cable or patch, since gigabit needs all four pairs. ip -br link shows the same state as UP/NO-CARRIER.
Driver and firmware¶
sudo ethtool -i eth0
driver: e1000e
version: 5.15.0
firmware-version: 0.9-4
bus-info: 0000:00:1f.6
Statistics¶
sudo ethtool -S eth0 # NIC hardware counters (names vary by driver)
sudo ethtool -S eth0 | grep -Ei 'err|drop|crc|miss'
Rising CRC or error counters generally mean a physical problem. Rising rx_missed/fifo counters mean the host is not draining the ring buffer fast enough (see ethtool -g below).
Which physical port is eth0?¶
sudo ethtool -p eth0 30 # blink the port LED for 30 seconds
Hardware self-test¶
sudo ethtool -t eth0 online # non-disruptive tests
sudo ethtool -t eth0 offline # more thorough, but takes the link down
Changing speed and duplex¶
sudo ethtool -s eth0 speed 1000 duplex full autoneg on
Forcing speed with auto-negotiation off is a common way to break a link: both ends must agree, and gigabit requires auto-negotiation by specification. Do this from a console, not over the interface you are changing. Settings made this way do not persist across reboots; put them in NetworkManager (802-3-ethernet.speed/.duplex) or a udev/systemd .link file.
Offloads and ring buffers¶
ethtool -k eth0 # offload features (tso, gso, gro, tc-offload ...)
sudo ethtool -K eth0 gro off # toggle one
ethtool -g eth0 # ring buffer sizes (current vs maximum)
sudo ethtool -G eth0 rx 4096 # enlarge the receive ring
Turn offloads off when debugging with tcpdump on the sending host, or checksums will look wrong.
Wake-on-LAN¶
sudo ethtool eth0 | grep Wake-on # 'g' = wake on magic packet, 'd' = disabled
sudo ethtool -s eth0 wol g