ethtool
ethtool displays or changes Ethernet device settings including speed, auto-negotiation, and checksum offload. It queries and controls network driver and hardware settings on many network devices, especially Ethernet.
Description
ethtool is a powerful utility for managing Ethernet device configurations in Linux environments. It allows administrators to query current settings and make changes to parameters such as link speed, duplex mode, auto-negotiation, Wake-on-LAN, and various offload features. This tool is essential for network troubleshooting, performance tuning, and hardware diagnostics.
Common use cases include adjusting interrupt coalescing parameters to optimize CPU usage, configuring RX/TX ring buffer sizes for high-throughput scenarios, enabling or disabling hardware offloads like TCP segmentation offload (TSO), and performing hardware self-tests. ethtool supports a wide range of network interface controllers and provides detailed statistics and diagnostic capabilities.
The tool interacts directly with kernel network drivers through the ethtool ioctl interface, making it a low-level utility for precise network interface control. It's particularly valuable in server environments, embedded systems, and performance-critical networking applications where fine-grained control over NIC behavior is required.
How It Works
ethtool communicates with network drivers via the Linux ethtool kernel interface (SIOCETHTOOL ioctl). It sends commands to query or modify device-specific settings stored in driver private data structures. The tool supports standardized generic options (speed, duplex, autoneg) as well as driver-specific features through extended command sets. Operations like ring parameter changes modify queue depths and buffer allocations, while offload toggles enable/disable hardware acceleration for checksum calculation, packet segmentation, and flow classification. Diagnostic functions access hardware registers, EEPROM contents, and PHY status through MDIO/MDC interfaces.
Installation
sudo apt install ethtoolFlags
Examples
ethtool -hethtool [ FLAGS ] DEVNAMEethtool -i DEVNAMEethtool -s DEVNAME speed 1000 duplex full autoneg offethtool -k DEVNAMEethtool -c DEVNAMEethtool -g DEVNAMEethtool -S DEVNAME