Linux Ethtool Network Hardware Diagnostics
The ethtool utility is a standard Linux command-line
tool designed to query, control, and diagnose network interface
controllers (NICs) and their associated device drivers. It provides
systems administrators with direct access to the physical and data link
layer settings of a network device, making it an essential diagnostic
tool for identifying hardware faults, performance bottlenecks, and
link-level negotiation failures.
Inspecting Physical Link Status and Capabilities
At its most fundamental diagnostic level, ethtool
reveals whether a physical connection exists and displays the negotiated
parameters between the NIC and the switch. By running
ethtool [interface_name], you can immediately verify:
- Link Detection: Confirms whether the interface
detects an active carrier signal (
Link detected: yes/no), isolating physical cabling or transceiver issues. - Speed and Duplex: Displays the operational speed (e.g., 1000Mb/s, 10000Mb/s) and duplex mode (Full/Half).
- Auto-Negotiation: Shows whether auto-negotiation is enabled and supported by both the local interface and the link partner, helping identify duplex mismatches that cause packet loss.
Analyzing Hardware and Driver Statistics
Hardware degradation or physical transmission errors rarely show up
in high-level networking tools like ping or
ip. The command ethtool -S [interface_name]
queries the NIC’s internal counters directly from the hardware
registers. This output helps identify:
- CRC and Frame Errors: High counts usually indicate damaged cabling, faulty transceivers, or electrical interference.
- Dropped Packets and Buffer Overruns: Identifies whether the network card is dropping packets at the hardware FIFO buffer level before the Linux kernel can process them.
Verifying Driver and Firmware Versions
Hardware issues are often tied to outdated firmware or driver bugs.
Running ethtool -i [interface_name] displays device driver
metadata, including:
- The driver name and version currently loaded by the kernel.
- The firmware version running on the network card itself.
- The PCIe bus address of the device, which helps verify that the card is seated correctly and recognized properly by the system bus.
Executing Hardware Self-Tests
Many enterprise-grade NICs support integrated diagnostic routines.
Using ethtool -t [interface_name], administrators can
trigger hardware self-tests. These tests evaluate internal registers,
memory integrity, and loopback functionality, providing an automated
pass/fail report on the physical health of the controller.
Locating Physical Interfaces
In multi-port server environments, identifying which physical port
maps to a logical interface name can be difficult. The diagnostic
command ethtool -p [interface_name] [seconds] physically
blinks the LED on the designated port, allowing technicians to locate
the correct port in a server rack for cable swaps or hardware
replacements.
Monitoring and Tuning Buffers and Offloads
ethtool diagnoses hardware-level throughput limitations
by exposing ring buffer sizes (ethtool -g) and protocol
offload features (ethtool -k). If a system drops packets
under high loads, examining these settings reveals whether the
interface’s receive (RX) and transmit (TX) ring buffers are exhausted,
or if hardware checksum offloading, Large Receive Offload (LRO), or TCP
Segmentation Offload (TSO) are failing or misconfigured.