LinuxCommandLibrary

ethtool

Display or change Ethernet card settings

TLDR

Display the current settings for an interface

$ ethtool [eth0]
copy

Display the driver information for an interface
$ ethtool [[-i|--driver]] [eth0]
copy

Display all supported features for an interface
$ ethtool [[-k|--show-features]] [eth0]
copy

Display the network usage statistics for an interface
$ ethtool [[-S|--statistics]] [eth0]
copy

Blink one or more LEDs on an interface for 10 seconds
$ ethtool [[-p|--identify]] [eth0] [10]
copy

Set the link speed, duplex mode, and parameter auto-negotiation for a given interface
$ ethtool [[-s|--change]] [eth0] speed [10|100|1000] duplex [half|full] autoneg [on|off]
copy

SYNOPSIS

ethtool interface
ethtool [ -h | --help ]
ethtool [ --version ]
ethtool [ -a | --show-pause interface ]
ethtool [ -A | --pause interface [ autoneg on|off ] [ rx on|off ] [ tx on|off ] ]
ethtool [ -c | --show-coalesce interface ]
ethtool [ -C | --coalesce interface [ adaptive-rx on|off ] [ adaptive-tx on|off ] [ rx-usecs value ] [ rx-frames value ] [ rx-usecs-irq value ] [ rx-frames-irq value ] [ tx-usecs value ] [ tx-frames value ] [ tx-usecs-irq value ] [ tx-frames-irq value ] [ stats-block-usecs value ] [ pkt-rate-low value ] [ pkt-rate-high value ] [ sample-interval value ] ]
ethtool [ -g | --show-ring interface ]
ethtool [ -G | --ring interface [ rx value ] [ rx-mini value ] [ rx-jumbo value ] [ tx value ] ]
ethtool [ -i | --driver interface ]
ethtool [ -d | --register-dump interface [ raw on|off ] [ file name ]]
ethtool [ -e | --eeprom-dump interface [ raw on|off ] [ offset value ] [ length value ] [ file name ] ]
ethtool [ -E | --change-eeprom interface [ offset value ] [ value value ] ... ]
ethtool [ -k | --show-features interface [ rx | tx | sg ] ]
ethtool [ -K | --features interface [ rx on|off ] [ tx on|off ] [ sg on|off ] [ lro on|off ] [ gro on|off ] [ tso on|off ] [ ufo on|off ] [ gso on|off ] [ rxvlan on|off ] [ txvlan on|off ] [ encap-offload on|off ] [ rxhash on|off ] [ ntuple on|off ] [ rx-vlan-filter on|off ] [ tx-scatter-gather on|off ] [ tx-tcp-segmentation on|off ] [ udp-fragmentation-offload on|off ] [ generic-segmentation-offload on|off ] ]
ethtool [ -p | --identify interface [ time ] ]
ethtool [ -q | --show-queue interface ]
ethtool [ -r | --negotiate interface ]
ethtool [ -S | --statistics interface ]
ethtool [ -s | --change interface [ speed value ] [ duplex half|full ] [ port tp|aui|bnc|mii ] [ autoneg on|off ] [ advertise value ] [ phy_address value ] [ msglvl value ] ]
ethtool [ -n | --show-ntuple interface [ rx-flow-hash tcp | udp | sctp | ah | esp | ipip ] ]
ethtool [ -N | --config-ntuple interface [ rx-flow-hash tcp | udp | sctp | ah | esp | ipip ] [ delete flow_id ] [ flow-type ether | ip4 | ip6 | tcp4 | tcp6 | udp4 | udp6 ] [ ether dest value [ mask value] ] [ ip4 dest value [ mask value] ] [ ip6 dest value [ mask value] ] [ tcp dest value [ mask value] ] [ udp dest value [ mask value] ] [ user-defined value ] [ action value ] ]
ethtool [ --show-priv-flags interface ]
ethtool [ --set-priv-flags interface flag on|off ]
ethtool [ --show-fec interface ]
ethtool [ --set-fec interface [ encoding rs|baser|off|auto ] ]
ethtool [ --get-channels interface ]
ethtool [ --set-channels interface [ rx value ] [ tx value ] [ other value ] [ combined value ] ]
ethtool [ --show-eee interface ]
ethtool [ --set-eee interface [ eee on|off ] [ tx-lpi on|off ] [ tx-timer value ] [ rx-timer value ] ]
ethtool [ --module-info interface [ raw ] ]
ethtool [ --show-cable-test interface ]
ethtool [ --cable-test interface ]
ethtool [ --reset interface [ flags value ] ]

PARAMETERS

interface
    The network interface to query or configure (e.g., eth0, enp0s3).

-h, --help
    Display help text and exit.

--version
    Display version information and exit.

-a, --show-pause interface
    Queries the pause parameter settings of the specified interface.

-A, --pause interface [ autoneg on|off ] [ rx on|off ] [ tx on|off ]
    Changes the pause parameter settings of the specified interface.

-c, --show-coalesce interface
    Queries the interrupt coalescing settings of the specified interface.

-C, --coalesce interface [ adaptive-rx on|off ] [ adaptive-tx on|off ] [ rx-usecs value ] ...
    Changes the interrupt coalescing settings of the specified interface.

-g, --show-ring interface
    Queries the ring parameter settings of the specified interface.

-G, --ring interface [ rx value ] [ rx-mini value ] [ rx-jumbo value ] [ tx value ]
    Changes the ring parameter settings of the specified interface.

-i, --driver interface
    Displays driver information for the specified interface.

-d, --register-dump interface [ raw on|off ] [ file name ]
    Performs a register dump on the specified interface.

-e, --eeprom-dump interface [ raw on|off ] [ offset value ] [ length value ] [ file name ]
    Dumps the EEPROM content of the specified interface.

-E, --change-eeprom interface [ offset value ] [ value value ] ...
    Changes the EEPROM content of the specified interface.

-k, --show-features interface [ rx | tx | sg ]
    Displays the enabled offload features for the specified interface.

-K, --features interface [ rx on|off ] [ tx on|off ] [ sg on|off ] ...
    Changes the offload features for the specified interface.

-p, --identify interface [ time ]
    Initiates physical identification (e.g., blinking LED) of the specified interface. An optional time argument can be provided to specify for how many seconds the interface should be identified.

-q, --show-queue interface
    Queries the number of hardware transmit and receive queues supported by the specified interface.

-r, --negotiate interface
    Restarts autonegotiation on the specified interface.

-S, --statistics interface
    Displays statistics for the specified interface.

-s, --change interface [ speed value ] [ duplex half|full ] [ port tp|aui|bnc|mii ] [ autoneg on|off ] [ advertise value ] [ phy_address value ] [ msglvl value ]
    Changes settings of the specified interface.

-n, --show-ntuple interface [ rx-flow-hash tcp | udp | sctp | ah | esp | ipip ]
    Displays RX n-tuple filters of the specified interface. Can optionally display RX flow hash indirection table for selected transport protocol.

-N, --config-ntuple interface [ rx-flow-hash tcp | udp | sctp | ah | esp | ipip ] [ delete flow_id ] [ flow-type ether | ip4 | ip6 | tcp4 | tcp6 | udp4 | udp6 ] [ ether dest value [ mask value] ] [ ip4 dest value [ mask value] ] [ ip6 dest value [ mask value] ] [ tcp dest value [ mask value] ] [ udp dest value [ mask value] ] [ user-defined value ] [ action value ]
    Configures RX n-tuple filters of the specified interface.

--show-priv-flags interface
    Displays private flags of the specified interface.

--set-priv-flags interface flag on|off
    Sets private flags of the specified interface.

--show-fec interface
    Displays forward error correction settings of the specified interface.

--set-fec interface [ encoding rs|baser|off|auto ]
    Sets forward error correction settings of the specified interface.

--get-channels interface
    Queries the numbers of channel groups supported by the specified interface.

--set-channels interface [ rx value ] [ tx value ] [ other value ] [ combined value ]
    Sets the numbers of channel groups supported by the specified interface.

--show-eee interface
    Displays energy-efficient ethernet settings of the specified interface.

--set-eee interface [ eee on|off ] [ tx-lpi on|off ] [ tx-timer value ] [ rx-timer value ]
    Sets energy-efficient ethernet settings of the specified interface.

--module-info interface [ raw ]
    Displays pluggable module info of the specified interface.

--show-cable-test interface
    Displays cable test results of the specified interface.

--cable-test interface
    Runs cable test of the specified interface.

--reset interface [ flags value ]
    Resets the specified interface.

DESCRIPTION

ethtool is a command-line utility in Linux used for displaying and modifying network interface settings. It allows users to query and change parameters such as speed, duplex, autonegotiation, offload features (e.g., checksumming, TCP segmentation offload), and Ethernet channel bonding settings. It's an essential tool for network administrators to diagnose network issues, optimize performance, and configure network interfaces to match specific requirements. With ethtool, you can inspect driver information, link status, and other relevant details to understand the health and capabilities of your network interfaces. The tool supports a wide range of network interface card (NIC) models and features, making it a versatile utility for managing network connectivity.

ethtool also allows users to get and set extended interface information such as link parameters, pause parameters, ring parameters, and offload parameter for supported network interfaces. The tool provides many useful statistics and diagnostics for network interfaces and their drivers. It can even trigger self tests on some devices to aid with troubleshooting.

CAVEATS

Some features and parameters might not be supported by all network drivers or network interfaces. Elevated privileges (e.g., root) are usually required to modify network interface settings.

The advertise parameter is used to set the speeds and duplex modes advertised during autonegotiation. Common values include: 0x001 (10baseT Half), 0x002 (10baseT Full), 0x004 (100baseT Half), 0x008 (100baseT Full), 0x010 (1000baseT Half - rare), 0x020 (1000baseT Full), 0x2000 (10000baseT Full). Multiple values can be combined using hexadecimal addition.

MODULE EEPROM ACCESS

The EEPROM access functionality (-e and -E options) is intended to access primarily SFP modules. The tool writes/reads over the I2C bus interface to the module, providing the raw 256 bytes dump, or allowing the user to modify the bytes. This can be used to program the module to support non-standard configurations.

HISTORY

The ethtool utility has been a staple in Linux network administration for many years. It evolved as a replacement and consolidation of older tools such as mii-tool, providing a unified interface for configuring network interfaces. The tool continues to be actively maintained and updated to support new network hardware and features, ensuring its relevance in modern Linux environments.

Originally developed by Donald Becker, the tool has seen contributions from numerous developers over the years to enhance its functionality and support for a wider range of NICs and network technologies. Over time, it has become more sophisticated, adding support for features like offload control, ring buffer management, and advanced statistics gathering.

SEE ALSO

ip(8), ifconfig(8), mii-tool(8)

Copied to clipboard