Hubbry Logo
EthtoolEthtoolMain
Open search
Ethtool
Community hub
Ethtool
logo
7 pages, 0 posts
0 subscribers
Be the first to start a discussion here.
Be the first to start a discussion here.
Contribute something
Ethtool
Ethtool
from Wikipedia
ethtool
Original authorDavid S. Miller
DeveloperMichal Kubecek
Initial release1998; 28 years ago (1998)
Stable release
6.15 / 23 June 2025; 7 months ago (2025-06-23)
Repository
Written inC
Operating systemLinux
TypeNetworking
LicenseGPLv2
Websitewww.kernel.org/pub/software/network/ethtool/

ethtool is the primary means in Linux kernel-based operating systems (primarily Linux and Android) for displaying and modifying the parameters of network interface controllers (NICs) and their associated device driver software from application programs running in userspace.

ethtool consists of two components, an API within the Linux kernel through which NICs can send and receive parameters through their device driver software, and a userspace API based on the Linux SIOCETHTOOL ioctl mechanism through which application programs can communicate with the kernel to send and receive NIC and NIC driver parameters.

Most Linux distributions provide a standard utility program called ethtool that can be used from a shell to control, or gather information from NICs using the ethtool userspace API. In the Information technology community, the term ethtool is usually used to refer to this utility program.

The ethtool userspace API can be accessed from programs written in the C and C++ programming languages through the C standard library or C++ standard library respectively.

Several scripting languages such as Perl and Python provide ethtool API bindings that allow programmers using these languages to write scripts that can control NIC's.

The macOS and FreeBSD operating systems provide utility programs that have a user interface similar to the Linux ethtool utility, but that use fundamentally different APIs to communicate with their operating system kernels and NIC's.

Usage

[edit]

The command is useful for:

Examples

[edit]

To display the current parameters of the first network port (eth0):

$ ethtool eth0
Settings for eth0:
       Supported ports: [ TP MII ]
       Supported link modes: 10baseT/Half 10baseT/Full
                               100baseT/Half 100baseT/Full
       Supports auto-negotiation: Yes
       Advertised link modes: 10baseT/Half 10baseT/Full
                               100baseT/Half 100baseT/Full
       Advertised auto-negotiation: No
       Speed: 100Mb/s
       Duplex: Full
       Port: MII
       PHYAD: 1
       Transceiver: internal
       Auto-negotiation: off
       Supports Wake-on: g
       Wake-on: g
       Current message level: 0x00000007 (7)
       Link detected: yes

[1]

To configure it with the 1000 Mb/s speed and duplex, in 1000BASE-T:

$ ethtool -s eth0 speed 1000 duplex full autoneg off

To let the link light of the device eth0 flash for two minutes:

$ ethtool -p eth0 120

To print the driver info of the interface eth0:

$ ethtool -i eth0
driver: mlx5_core
version: 4.9-2.2.4
firmware-version: 14.28.2006 (MT_2420110034)
expansion-rom-version: 
bus-info: 0000:65:00.1
supports-statistics: yes
supports-test: yes
supports-eeprom-access: no
supports-register-dump: no
supports-priv-flags: yes

mii-tool

[edit]

mii-tool is an older program performing a similar function to ethtool. Since 2003,[2] it's considered obsolete and replaced by ethtool.

Example

[edit]

To display the current parameters:

$ mii-tool
eth0: no autonegotiation, 100baseTx-HD, link ok

To force the network speed to 1 Gbit/s, and the duplex in full on the port 1 (eth0):

$ mii-tool -F 1000baseTx-FD eth0
$ mii-tool
eth0: 1 000 Mbit, full duplex, link ok

See also

[edit]

References

[edit]
[edit]
Revisions and contributorsEdit on WikipediaRead on Wikipedia
from Grokipedia
Ethtool is a command-line utility for systems used to query and control and hardware settings, particularly for wired Ethernet devices. It allows users to inspect and modify parameters of a specified interface, such as eth0 or enp0s3, enabling precise management of . The tool provides a wide range of commands for viewing device information, including current link speed, duplex mode, auto-negotiation status, and supported protocols, as well as for altering configurable options like interrupt coalescing, receive/transmit pause frames, and offload features such as TCP segmentation offload (TSO) or generic receive offload (GRO), provided the supports them. For diagnostics, ethtool can display statistics, perform hardware self-tests, and dump contents, making it invaluable for troubleshooting connectivity issues and optimizing performance. Originally written by David S. Miller and first released in 1998, ethtool is maintained by the kernel community under the leadership of Michal Kubecek and is hosted on , with its available via . It has become a standard component in most distributions, evolving alongside kernel developments to support modern networking hardware and features, with the latest stable release being version 6.15 as of June 2025. This utility primarily targets system and network administrators, offering a straightforward interface to interact with the kernel's ethtool subsystem without requiring kernel recompilation.

Introduction

Purpose and Functionality

Ethtool is a command-line utility designed for querying, displaying, and modifying parameters associated with network interface controllers (NICs) and their drivers, with a primary focus on wired Ethernet devices. It serves as a key tool in Linux-based , enabling administrators to inspect and adjust low-level hardware and driver configurations that influence network performance and behavior. Among its core functionalities, ethtool retrieves essential details such as the driver version, firmware version, current link status, negotiated speed, duplex mode, and supported features including offload capabilities like TCP segmentation offload (TSO) and checksum offloading. It also supports modifications to operational settings, such as manually setting link speed and duplex mode, enabling or disabling , and configuring (WoL) to allow remote wake-up of the system over the network. These operations facilitate , optimization, and customization of Ethernet interfaces to match specific network requirements. The utility depends on the ethtool kernel API, which primarily utilizes generic sockets for communication between userspace and the kernel, with a fallback to traditional interfaces if netlink is unavailable; full functionality requires implementation support within the specific NIC driver. Hardware-level interactions are possible, such as triggering LED blinking on the physical to aid in identification during maintenance, provided the driver exposes the necessary controls. Ethtool operates on kernels and extends to Android, which shares the foundation. For programmatic integration, bindings exist in languages like Python via the python-ethtool module, allowing scripts to access the same API for automated network management. The software is distributed under the GNU General Public License version 2 (GPLv2).

History and Development

Ethtool was initially developed by David S. Miller in 1998 as part of the early networking tools suite, providing a command-line utility for querying and configuring Ethernet network interface controllers (NICs). The tool's core interface, defined in the 's ethtool.h header, originated from Miller's work to enable userspace control over kernel networking drivers. Maintenance of ethtool transitioned over time, with the project now hosted in a repository under and currently led by Michal Kubecek since around 2010. Kubecek has overseen significant refactoring efforts, including the progressive shift from ioctl-based communication to a more extensible interface starting with 5.6 in late 2019. Key release milestones reflect ethtool's alignment with evolution: early versions in the late 1990s were closely tied to the kernel 2.x series, offering basic device queries and settings changes. Major updates in the 2.6 kernel (starting 2003) introduced support for emerging hardware features, such as advanced driver offloads and statistics reporting. More recent versions have expanded compatibility; the latest stable release, version 6.15 on June 23, 2025, includes enhancements and fixes for contemporary NICs, such as improved handling of high-speed Ethernet controllers. Over its history, ethtool has evolved from a simple query tool for basic NIC parameters like speed and duplex mode into a comprehensive supporting advanced kernel APIs for features like checksum offloads, hashing, and hardware diagnostics. This progression mirrors the maturation of networking, with ongoing adaptations to new driver capabilities and hardware generations. The development process relies on community contributions submitted via the netdev mailing list, with bug reports directed to the maintainer for integration into upstream releases.

Installation

Using Package Managers

Ethtool is available as a standard package in most major distributions, facilitating easy installation through their respective package managers. On Debian-based systems such as , users can install it using the Advanced Package Tool (APT) with the command sudo apt install ethtool. Similarly, on RPM-based distributions like and (RHEL), the DNF or YUM package manager handles installation via sudo dnf install ethtool (or sudo yum install ethtool on older versions). For , the package manager provides ethtool through sudo pacman -S ethtool. Distribution packages typically align closely with upstream releases but may lag slightly due to testing and integration cycles; for instance, 24.04 includes version 6.7, while 2025 updates in distributions like and Arch incorporate version 6.15 or later. After installation, verify the setup by running ethtool --version to display the installed version and confirm functionality. On Android, ethtool is integrated into some Android Open Source Project (AOSP) builds as part of the platform's external tools, or it can be installed via using its package repository for rooted or emulated environments. For custom or bleeding-edge versions, compiling from source serves as an alternative, as detailed in the relevant section.

Compiling from Source

Compiling ethtool from source provides advanced users with the ability to incorporate the most recent upstream changes, integrate custom patches for specific hardware or features, or address scenarios where distribution-provided packages lag behind kernel updates. The process begins by downloading the latest stable release tarball from the official Archives. As of June 23, 2025, this is ethtool-6.15.tar.xz, available at https://www.kernel.org/pub/software/network/ethtool/.[](https://www.kernel.org/pub/software/network/ethtool/) Before building, ensure the system has the necessary prerequisites: a C compiler such as GCC, the GNU Make tool, and the libmnl development library (libmnl-dev on Debian-based systems) to enable interface support, which is essential for advanced querying and configuration capabilities. Extract the downloaded archive with the command:

tar -xf ethtool-6.15.tar.xz

tar -xf ethtool-6.15.tar.xz

Then, change into the resulting directory ([cd](/page/.cd) ethtool-6.15) and run the configuration script:

./configure

./configure

This autotools-based script detects the build environment; optional flags can customize the build, such as --enable-pretty-dump to activate formatted output for register and dumps, improving readability in diagnostic scenarios, or --disable-netlink to bypass libmnl dependency if features are not needed. Proceed to compile the source with:

make

make

Optimization flags like -O2 can be used during this step to verify for compiler warnings, ensuring a robust build. Finally, install the compiled binary system-wide as root:

sudo make install

sudo make install

This places ethtool typically in /usr/local/sbin/, overriding any existing installation if present. To verify the successful build and installation, execute ethtool --version to display the ethtool version, confirming it matches 6.15. Additionally, test functionality and kernel driver compatibility by running ethtool -i <interface>, where <interface> is a network device like eth0; this command outputs details such as the driver name, version, firmware version, and bus information, indicating proper integration with the running kernel.

Command-Line Interface

Basic Syntax and Options

The general syntax of the ethtool command follows the structure ethtool [options] <interface>, where <interface> specifies the target network device, such as eth0 or enp0s3. This format allows users to query or modify settings for wired Ethernet devices by combining global options with device-specific parameters. Several global options provide utility without requiring extensive device interaction. The -V or --version option displays the version of ethtool installed on the system. Similarly, -h or --help outputs a brief usage summary and list of available options. For driver details, -i or --driver retrieves information about the kernel driver associated with the specified interface. The -d or --register-dump option fetches a hexadecimal dump of the device's hardware registers, useful for low-level diagnostics. Network interface names for ethtool are typically obtained from system tools like ip link show, which lists all available devices with their states and identifiers. Examples include legacy names like eth0 or modern predictable names like enp0s3, depending on the system's naming scheme. While ethtool operates on a single interface per invocation, shell scripts can loop over multiple interfaces—sourced from ip link show output—to apply consistent operations across devices. Error handling in ethtool often manifests as messages like "Operation not supported," which indicate that a requested feature is unavailable due to limitations in the device's or hardware capabilities. Such errors highlight the tool's dependence on underlying kernel support, requiring users to verify compatibility. For a complete enumeration of options and detailed usage, consult the ethtool(8) manual page.

Querying Device Information

ethtool provides several read-only commands to retrieve information about network interface controllers (NICs), enabling users to inspect current status, capabilities, and statistics without modifying device settings. These queries are essential for diagnostics, monitoring, and scripting, as they output human-readable or parseable data on aspects like link parameters, driver details, and error counters. Most query operations do not require privileges, making them accessible for standard users, though some driver-specific outputs may vary. The basic query command, ethtool <interface>, displays core link information for the specified network device, such as the current speed (e.g., 1000Mb/s), duplex mode (full or half), type, status, and whether the link is detected. For example, running ethtool eth0 might output details like "Speed: 1000Mb/s", "Duplex: Full", "Auto-negotiation: on", and "Link detected: yes", helping administrators verify connectivity without altering configurations. This command relies on the device's to report accurate real-time status. To obtain driver and firmware details, the ethtool -i <interface> option queries the 's version, version, and bus information, such as PCI slot details. An example output for ethtool -i eth0 could include "driver: igb", "version: 5.6.0-k", ": 0x80000a5c", and "bus-info: 0000:03:00.0", aiding in compatibility checks and hardware issues. For accessing non-volatile memory, ethtool -e <interface> dumps the contents in format, optionally with raw on/off, offset, and length parameters to limit the output. This is useful for reading manufacturer-specific data stored on the NIC, though care must be taken as not all devices support full access. Querying supported features includes ethtool -a <interface> for (WoL) capabilities, which reports whether WoL is enabled and the supported wake-up modes (e.g., magic packet or broadcast). For physical identification, ethtool -p <interface> [seconds] blinks the NIC's LEDs for the specified duration (defaulting to indefinite until interrupted), facilitating hardware location in server racks or multi-port setups. Statistics retrieval via ethtool -S <interface> provides a comprehensive list of packet counters, including transmitted and received frames, errors (e.g., CRC errors, collisions), and drop events, with options like --all-groups to include all statistic groups if supported by the driver. For instance, output might show "rx_packets: 12345678" and "tx_errors: 0", enabling performance analysis. Permissions for these queries are generally permissive, with no root access needed for standard reads on most distributions, though certain drivers may restrict sensitive data like . Output from these commands is typically , suitable for parsing in scripts using tools like or ; recent versions support --json for structured output where the driver allows, improving automation. Users should consult the specific NIC driver's documentation for any variations in reported fields.

Setting Device Parameters

ethtool allows users to configure basic network interface card (NIC) parameters such as link speed, duplex mode, and through the -s option. The syntax for setting these involves specifying the interface name followed by the desired values, for example, ethtool -s <interface> speed 1000 duplex full autoneg off, where speed can be set to supported values like 10, 100, 1000, or higher depending on the hardware, duplex to full or half, and autoneg to on or off to enable or disable automatic . These changes take effect immediately but require the settings to match the connected device's capabilities to avoid issues. Wake-on-LAN (WoL) functionality can be enabled or configured using the same -s option with the wol parameter, specifying modes such as g for , p for PHY activity, u for packets, m for , a for ARP requests, or d to disable. For instance, ethtool -s <interface> wol g activates MagicPacket wake-up, though support varies by NIC hardware and driver. SecureOn password can be set with sopass for enhanced security in compatible modes. Interrupt moderation, which balances CPU utilization and latency by delaying interrupts, is adjusted via the -C option, primarily using parameters like rx-usecs to set the receive interrupt delay in microseconds. An example command is ethtool -C <interface> rx-usecs 100, which postpones RX interrupts until the specified time or frame count is reached, with typical values ranging from 0 (no moderation) to several hundred microseconds based on workload needs. Similar settings apply to transmit (tx-usecs) for symmetric control. All modifications made with ethtool are runtime and do not persist across reboots; to make them permanent, administrators must use rules or integrate commands into network initialization scripts such as those in /etc/network/interfaces on Debian-based systems or configurations on . For validation after setting parameters, users can query the interface using ethtool's diagnostic commands to confirm the applied changes. Incompatible settings, such as forcing a speed unsupported by the link partner, may result in the link going down temporarily until corrected.

Advanced Configuration

Offload and Feature Controls

ethtool provides mechanisms to query and configure hardware offload features and protocol accelerations supported by network device drivers, allowing administrators to optimize performance by delegating tasks to the network interface card (NIC). These features include segmentation offloads, checksum computations, and flow control, which are essential for high-throughput networking while minimizing host CPU involvement. To query the current state of offload features for a network interface, the -k or --show-offload option is used, as in ethtool -k <interface>, which displays a list of features such as TCP Segmentation Offload (TSO), Generic Segmentation Offload (GSO), Large Receive Offload (LRO), Generic Receive Offload (GRO), and receive/transmit offloads. TSO enables the NIC to segment large TCP packets into smaller ones compliant with the (MTU), reducing the number of packets processed by the CPU. GSO generalizes this by handling segmentation in software for protocols beyond TCP, ensuring compatibility across diverse network paths. On the receive side, LRO coalesces multiple incoming packets into larger ones before passing them to the stack, while GRO performs similar aggregation in a more protocol-agnostic manner, both aiming to decrease per-packet overhead. offloads for receive (rx-checksumming) and transmit (tx-checksumming) allow the NIC to verify or compute packet checksums, offloading this routine calculation from the host. Configuration of these features is achieved via the -K or --offload option, specifying the interface, feature name, and state, for example, ethtool -K <interface> tso off to disable TSO. Not all features are universally supported; availability depends on the driver and hardware, which can be verified through the -k query output. For instance, (PTP) hardware timestamping, used for precise , is configurable via the -T or --show-time-stamping option to check capabilities, and is commonly supported in Ethernet drivers like ixgbe for devices such as the X550 series. Flow control, which mitigates by pausing transmission, is managed separately with the -A or --pause option, such as ethtool -A <interface> rx on tx off, enabling receive pause frames while disabling transmit ones, with optionally toggled. Enabling these offloads generally reduces CPU utilization by shifting processing to the NIC, potentially increasing throughput in high-bandwidth scenarios. However, implementation bugs in drivers or hardware can lead to issues like , incorrect segmentation, or discarded header data, particularly with aggressive coalescence in LRO, necessitating careful testing and occasional disabling for reliability.

Performance Tuning Options

Interrupt coalescing parameters allow administrators to optimize network interrupt handling by throttling the frequency of generated by the network interface card (NIC), thereby reducing CPU overhead at the potential cost of increased latency. The ethtool -C <interface> rx-usecs <value> rx-frames <value> tx-usecs <value> command sets the receive (RX) and transmit (TX) coalescing values, where rx-usecs specifies the maximum time in microseconds to delay an RX interrupt after a packet arrives, rx-frames defines the number of RX frames to receive before triggering an interrupt, and analogous parameters apply to TX operations. These adjustments are particularly useful in high-throughput environments, as enabling adaptive coalescing (adaptive-rx on or adaptive-tx on) dynamically tunes parameters based on traffic load to balance . Ring parameters control the depth of RX and TX queues, influencing buffer capacity and potential under bursty traffic. Using ethtool -G <interface> rx <size> tx <size>, the RX and TX ring sizes can be adjusted up to driver-imposed limits, such as a maximum of 4096 entries for many common NIC drivers like those from or , to accommodate higher data rates without overwhelming system . Larger rings enhance throughput by allowing more packets to be queued before processing but may increase latency and memory usage, requiring careful tuning based on workload characteristics. Channel configuration enables multi-queue support to distribute traffic across multiple CPU cores via Receive Side Scaling (), improving parallelism on multi-core systems. The ethtool -L <interface> combined <N> option sets the number of combined RX/TX/other channels, directing flows to specific queues for better load balancing, especially beneficial for high-speed links where single-queue bottlenecks can limit . This complements offload features by scaling queue distribution, though it requires RSS to be enabled on the NIC. To evaluate the impact of these tunings, administrators can monitor statistics with ethtool -S <interface>, which reports metrics such as packets received/transmitted, errors, and drops before and after adjustments, revealing trade-offs like reduced CPU interrupts (saving cycles) against higher per-packet latency. For instance, aggressive coalescing might lower CPU utilization by 20-30% in high-traffic scenarios. Ethtool supports advanced features for modern high-speed network interface cards (NICs) such as 100G+ devices, including flow director filters for precise packet steering to queues on hardware like the E810 or ConnectX series adapters. These capabilities leverage the interface for control over high-bandwidth flows.

Practical Examples

Diagnostic Commands

Ethtool provides several query commands essential for diagnosing network interface issues, allowing administrators to inspect link status, error counters, hardware registers, physical port identification, and software versions without altering configurations. These tools are particularly valuable in data centers or server environments where rapid identification of cabling faults, hardware failures, or software incompatibilities can minimize . To check link detection, the basic ethtool <interface> command displays the current media settings, including the "Link detected" status, which indicates whether a physical connection is established. A "Link detected: no" result often points to issues such as unplugged or faulty cables, incompatible or improperly seated SFP modules, or defective hardware on the NIC or switch port; troubleshooting typically involves verifying cable connections, inspecting SFPs for compatibility, and using ip link show <interface> to confirm the absence of "NO-CARRIER" state before escalating to hardware replacement. For analyzing error statistics, ethtool -S <interface> retrieves NIC-specific counters, including receive (rx) and transmit () errors, drops, and detailed breakdowns like CRC errors or overruns. Rx_errors aggregate bad packets received, often due to problems; CRC errors specifically signal data corruption from faulty cables, connectors, or , while overruns indicate buffer overflows from high traffic or insufficient interrupt handling. Tx_errors reflect transmission failures, such as collisions or aborts, commonly linked to duplex mismatches or switch issues; interpreting these involves comparing rates over time—if errors exceed 1% of total packets, it typically warrants hardware inspection rather than software tweaks. Hardware-level debugging uses ethtool -d <interface>, which dumps the device's internal registers in format (or decoded if the driver supports it), enabling cross-referencing with vendor-specific documentation to identify misconfigurations or faults like incorrect PHY settings. This output is crucial for advanced , such as verifying register values against driver or errata sheets during suspected firmware glitches. To physically locate a port in a rack-mounted setup, ethtool -p <interface> [seconds] activates the identify function, typically blinking the port's LED for the specified duration (default 3 seconds, e.g., 60 for a full minute), aiding in cable tracing without disrupting operations. Version mismatches can be diagnosed with ethtool -i <interface>, which outputs the driver name, kernel module version, firmware version, and bus information; discrepancies here, such as outdated firmware relative to the driver, may cause instability, requiring updates from the vendor to ensure compatibility per release notes.

Configuration Scenarios

In practical network configurations, ethtool is often used to force specific link speeds and duplex modes on Ethernet interfaces connected to legacy switches that do not support modern auto- protocols. For instance, to configure an interface named eth0 to operate at 1000 Mbps in full duplex mode without auto-negotiation, the command ethtool -s eth0 speed 1000 duplex full autoneg off can be executed, ensuring stable connectivity in environments where hardware limitations prevent dynamic speed detection. This approach is particularly useful in older setups or industrial networks, where mismatched negotiation can lead to link failures, and the setting takes effect immediately upon execution. Enabling Wake-on-LAN (WoL) allows remote powering of devices over the network, a common requirement in server farms for maintenance without physical access. The command ethtool -s eth0 wol g activates MagicPacket support on the eth0 interface, where 'g' specifies the MagicPacket mode that responds to a broadcast packet containing the device's MAC address. To make this persistent across reboots in systems using ifupdown, such as Debian or Ubuntu derivatives, a script can be placed in /etc/network/if-up.d/, for example, a file named wol-enable containing #!/bin/sh -e\nethtool -s $IFACE wol g and made executable with chmod +x, ensuring the setting applies every time the interface comes up. This integration automates WoL in boot processes, reducing manual intervention in remote server optimization scenarios. For high-throughput servers handling heavy traffic loads, such as web proxies or database clusters, configuring multi-queue support distributes packet processing across multiple CPU cores to enhance parallelism and reduce bottlenecks. The command ethtool -L eth0 combined 8 sets eight combined receive/transmit queues on the eth0 interface, allowing the NIC to incoming packets to different queues for balanced load distribution. Verification can be performed with ethtool -l eth0, which displays the current queue configuration, confirming the allocation for improved in multi-core environments. This setup is essential for server optimization, as it leverages (Receive Side Scaling) to achieve higher packet rates without overwhelming single queues. In VLAN-integrated networks, such as those using for traffic segmentation in enterprise or cloud setups, ethtool enables toggling of VLAN tagging offloads to offload header insertion and stripping from the CPU to the NIC hardware. Using ethtool -K eth0 rxvlan on txvlan on activates receive and transmit VLAN acceleration, allowing the interface to efficiently handle 802.1Q-tagged frames by parsing or adding the 4-byte VLAN tag directly in hardware. Disabling these with ethtool -K eth0 rxvlan off txvlan off may be necessary in certain bridging configurations to prevent premature tag removal, ensuring compatibility with virtual switches or aggregated links. This offload reduces latency and CPU utilization in VLAN-heavy deployments, such as virtualized hosts with multiple tenants. To achieve persistent ethtool configurations across system restarts, integration with network management tools like NetworkManager (via nmcli) or systemd-networkd is recommended for modern Linux distributions. For example, with nmcli, settings can be applied to a connection profile using nmcli connection modify <connection-name> 802-3-ethernet.wake-on-lan magic ethtool.feature-rxvlan on, where <connection-name> is the active profile (e.g., "Wired connection 1"), making changes survive reboots through NetworkManager's persistent storage. Similarly, in systemd-networkd setups, WakeOnLan can be specified in .link files under the [Link] section, such as WakeOnLan=magicpacket in /etc/systemd/network/10-eth0.link, ensuring automated application during interface activation for consistent server or VLAN environments. For other ethtool options, custom commands can be applied via drop-in units. These methods provide a declarative way to maintain configurations without relying on temporary scripts.

Legacy Tools

mii-tool Overview

mii-tool is a utility designed to query and set the status of a network interface's (MII) unit, primarily used on early Ethernet adapters to manage basic parameters such as link speed and duplex mode. It facilitates between the network interface and the , allowing users to check the current negotiated settings or manually force specific configurations like 10baseT half-duplex or 100baseTx full-duplex. This tool emerged as part of the net-tools suite to support the MII standard introduced in the 1990s for (100 Mbps) connections. The basic command mii-tool displays the status of the specified interface, such as eth0, reporting details like the negotiated speed, duplex mode, and link state—for example, "eth0: negotiated 100baseTx-FD, link ok". For more detailed output, the -v option provides verbose information, including transceiver registers and advertisement capabilities. To configure settings, users can employ the -F option to force a mode, as in mii-tool -F 100baseTx-FD eth0, or -A to advertise specific media types during . Additional options include -r to restart and -w to continuously monitor link status at one-second intervals. mii-tool is limited to interfaces equipped with or Gigabit MII (GMII) transceivers, focusing solely on basic link parameters without support for advanced features such as offload capabilities, detailed statistics, or modern Ethernet standards beyond . It does not handle newer PHY types or provide comprehensive diagnostics, making it unsuitable for contemporary network hardware. Although still available in the net-tools package across many distributions, mii-tool has been deprecated in favor of more capable tools like ethtool, with upstream development of net-tools being sporadic—the last release (version 2.10) occurring on January 7, 2021—though distributions have applied patches since earlier versions.

Differences and

ethtool supersedes mii-tool by leveraging the full ethtool kernel API, enabling comprehensive support for modern network interface controllers (NICs) that include advanced offload features, detailed diagnostics, and higher-speed interfaces beyond 100 Mbps, whereas mii-tool is restricted to basic (MII) negotiation primarily for 10/100 Mbps Ethernet cards. mii-tool was marked obsolete around the introduction of the 2.6 kernel series in 2003, with its limitations highlighted in documentation and recommendations to migrate to ethtool; by the , it had been removed or made optional in major distributions such as and , as part of broader efforts to deprecate the net-tools package. For migration, commands like mii-tool -F 100baseTx-FD eth0 can be directly replaced with ethtool -s eth0 speed 100 duplex full, and existing scripts can be updated using tools such as or to parse and convert mii-tool syntax to ethtool equivalents for compatibility. ethtool offers advantages including broader hardware compatibility for Gigabit and faster Ethernet, more parseable and scripting-friendly output formats that facilitate , and independence from the deprecated net-tools suite, making it suitable for contemporary tasks. As of 2025, mii-tool is retained only for legacy systems with older NICs, while ethtool serves as the primary utility, handling the vast majority of network configuration and diagnostic needs in modern environments.

Integration and Alternatives

Kernel Integration

Ethtool interacts with the Linux kernel's networking subsystem primarily through the SIOCETHTOOL , defined in the kernel's socket interface, which enables user-space applications to send commands for querying and configuring network device parameters. This dispatches requests to the driver's implementation of the ethtool_ops structure, a set of callbacks registered via the net_device operations that expose hardware-specific settings, including link negotiation, offload capabilities, and diagnostic information. The ethtool_ops framework ensures that drivers can handle a standardized set of operations while allowing vendor-specific extensions. Support for ethtool is integral to modern network drivers, which must implement ethtool_ops as part of their net_device registration to enable full feature exposure. For instance, Intel's igb driver for controllers and ixgbe driver for 10 Gigabit controllers provide comprehensive ethtool integration, supporting operations like ring buffer sizing and interrupt moderation directly through kernel callbacks. This driver-level requirement ensures compatibility and across diverse hardware in the ecosystem. Recent enhancements in the , beginning with version 6.10 released in July 2024, have expanded the ethtool netlink interface to offer more robust user-space control, reducing reliance on traditional ioctls for certain operations. The family, using generic netlink with the ETHTOOL_GENL_NAME, now supports features such as (PoE) status and configuration via new attributes like ETHTOOL_A_PSE, alongside improved handling for multi-PHY devices. These updates, further refined in subsequent releases through 2025, enable asynchronous notifications and support for monitoring changes without polling ioctls. From a perspective, ethtool commands necessitate elevated privileges, typically executed as , with the kernel validating CAP_NET_ADMIN capability for all "set" and "action" requests to safeguard network device modifications. This enforcement prevents unprivileged processes from altering hardware states, such as enabling or flashing , while allowing read-only queries for most users. For extensibility, kernel drivers can define private flags—driver-specific bitmasks accessible via the ETHTOOL_GPFLAGS and ETHTOOL_SPFLAGS ioctls, queried and modified using the ethtool -k command—to expose custom hardware controls not covered by standard operations. Additionally, ethtool integrates with the devlink subsystem for advanced hardware management, such as querying firmware versions or reloading device configurations, bridging ethtool's ioctl-based model with devlink's netlink API for more complex scenarios.

Other Network Utilities

The iproute2 suite offers a collection of command-line utilities for advanced network configuration and monitoring on systems, serving as a modern complement to ethtool by handling aspects like interface state and . Specifically, the ip link command enables users to bring network interfaces up or down, configure maximum transmission units (MTU), and manage basic link properties, providing essential control over device activation without delving into hardware-specific features. Meanwhile, the tc (traffic control) tool within iproute2 allows for shaping, scheduling, and policing network traffic, which overlaps with ethtool's capabilities in configuring receive and transmit queues on network interface cards (NICs) by adjusting software-based queuing disciplines that interact with hardware offloads. NetworkManager, a widely used daemon for network configuration, integrates ethtool features through its nmcli, enabling persistent application of settings across reboots in desktop and server environments. Administrators can use commands like nmcli dev set <interface> ethtool.<feature> <value> to configure hardware parameters such as or offload states directly within connection profiles, ensuring these changes survive system restarts unlike transient ethtool invocations. This integration simplifies management in dynamic setups, combining ethtool's low-level tweaks with NetworkManager's higher-level persistence and GUI support via tools like nmtui. Several alternatives address network tasks beyond ethtool's primary focus on wired Ethernet interfaces. The deprecated ifconfig utility from the net-tools package once handled basic interface configuration but has been superseded by iproute2's ip commands due to its lack of support for modern kernel features. For wireless networks, where ethtool's functionality is limited to basic driver queries, the iw tool provides comprehensive management of Wi-Fi interfaces, including scanning, association, and station configuration. Additionally, devlink serves as a specialized alternative for switchdev-enabled devices, allowing configuration of hardware offloads in network switches and NICs, such as port splitting or firmware updates, through a netlink-based interface that extends beyond ethtool's scope. For programmatic access, the libnl suite provides libraries to interact with netlink interfaces, including the ethtool netlink family for querying and controlling NIC settings without direct ethtool binary calls. This enables developers to build custom applications that leverage netlink for efficient, kernel-direct communication on features like link modes and statistics. In Python scripting environments, the ethtool module offers bindings to the kernel interface, allowing scripts to retrieve or modify interface parameters such as speed, duplex, and offloads in an object-oriented manner. Administrators typically select ethtool for low-level, hardware-centric NIC diagnostics and tuning on wired interfaces, while turning to iproute2 for routing, addressing, and broader traffic engineering. In scenarios involving wireless hardware, ethtool proves insufficient, necessitating tools like iw for spectrum management and association control, ensuring the right utility matches the network layer and device type.

References

Add your contribution
Related Hubs
Contribute something
User Avatar
No comments yet.