🎁 New User? Get 20% off your first purchase with code NEWUSER20 Register Now β†’
Menu

Categories

Linux Ethtool: Complete Guide to Network Interface Diagnostics and NIC Tuning

Linux Ethtool: Complete Guide to Network Interface Diagnostics and NIC Tuning

When you're managing Linux servers β€” whether in a datacenter, cloud environment, or even a home lab β€” understanding your network interfaces at a deep level is critical. While tools like ip link and ifconfig give you surface-level information, ethtool provides the low-level diagnostics that network engineers and sysadmins need to troubleshoot performance issues, verify hardware capabilities, and optimize NIC configurations.

In this comprehensive guide, we'll walk through everything ethtool can do, from checking link speed and duplex settings to configuring offload features and diagnosing hardware issues. We'll also introduce dargslan-ethtool-check, a Python CLI tool that automates these checks across all your interfaces with a single command.

What is Ethtool?

Ethtool is a standard Linux utility for querying and controlling network driver and hardware settings. It works by communicating directly with the kernel's network driver through ioctl calls, giving you access to information that higher-level tools simply cannot provide. Every serious Linux administrator should have ethtool in their toolkit.

The tool has been part of the Linux ecosystem since the early 2000s and is maintained as part of the standard net-tools package. It supports virtually every Ethernet NIC driver in the kernel, from Intel's igb and ixgbe drivers to Broadcom's bnxt and Mellanox's mlx5.

Installing Ethtool

On most distributions, ethtool is either pre-installed or available in the base repositories:

# Debian/Ubuntu
sudo apt install ethtool

# RHEL/CentOS/Fedora
sudo dnf install ethtool

# Arch Linux
sudo pacman -S ethtool

# Alpine
apk add ethtool

You can verify the installation with ethtool --version. Most modern distributions ship ethtool 5.x or newer.

Checking Interface Speed and Link Status

The most basic and most commonly used ethtool command is simply running it against an interface name. This reveals critical information about the physical connection:

$ ethtool eth0
Settings for eth0:
    Supported ports: [ TP ]
    Supported link modes:   10baseT/Half 10baseT/Full
                            100baseT/Half 100baseT/Full
                            1000baseT/Full
    Supported pause frame use: Symmetric
    Supports auto-negotiation: Yes
    Supported FEC modes: Not reported
    Advertised link modes:  10baseT/Half 10baseT/Full
                            100baseT/Half 100baseT/Full
                            1000baseT/Full
    Advertised pause frame use: Symmetric
    Advertised auto-negotiation: Yes
    Speed: 1000Mb/s
    Duplex: Full
    Auto-negotiation: on
    Link detected: yes

This output tells you several important things. The Speed field shows the current negotiated link speed. If you're expecting Gigabit but seeing 100Mb/s, you might have a bad cable, a misconfigured switch port, or a hardware issue. The Duplex field should always be "Full" in modern networks β€” half duplex causes collisions and dramatically reduces throughput. The Link detected field tells you if there's actually a physical connection to the switch.

Identifying the NIC Driver and Firmware

Knowing which driver your NIC uses is essential for troubleshooting. The -i flag gives you driver details:

$ ethtool -i eth0
driver: e1000e
version: 5.15.0-generic
firmware-version: 0.13-4
bus-info: 0000:00:1f.6
supports-statistics: yes
supports-test: yes
supports-eeprom-access: yes
supports-register-dump: yes
supports-priv-flags: no

This information is invaluable when you need to file bug reports, check for driver updates, or verify that the correct driver is loaded. The bus-info field maps directly to the PCI bus address, which you can cross-reference with lspci output.

NIC Statistics β€” The Deep Dive

For performance analysis, ethtool -S is your best friend. It shows per-NIC statistics that go far beyond what ip -s link provides:

$ ethtool -S eth0
NIC statistics:
     rx_packets: 1234567
     tx_packets: 987654
     rx_bytes: 1876543210
     tx_bytes: 876543210
     rx_errors: 0
     tx_errors: 0
     rx_dropped: 12
     tx_dropped: 0
     rx_length_errors: 0
     rx_over_errors: 0
     rx_crc_errors: 0
     rx_frame_errors: 0
     rx_missed_errors: 0
     tx_aborted_errors: 0
     tx_carrier_errors: 0
     tx_fifo_errors: 0
     tx_heartbeat_errors: 0

Pay special attention to error counters. rx_crc_errors often indicate a bad cable or electromagnetic interference. rx_missed_errors and rx_over_errors suggest the NIC ring buffer is too small and packets are being dropped before the kernel can process them. tx_carrier_errors might indicate a flapping link.

Understanding and Configuring Offload Features

Modern NICs can offload certain network processing tasks from the CPU to the NIC hardware. This is crucial for high-throughput servers. View current offload settings with:

$ ethtool -k eth0
Features for eth0:
rx-checksumming: on
tx-checksumming: on
scatter-gather: on
tcp-segmentation-offload: on
generic-segmentation-offload: on
generic-receive-offload: on
large-receive-offload: off
rx-vlan-offload: on
tx-vlan-offload: on

Each of these features serves a specific purpose:

  • TCP Segmentation Offload (TSO) β€” The NIC handles breaking large TCP segments into MTU-sized packets. This dramatically reduces CPU usage on servers sending large amounts of data.
  • Generic Receive Offload (GRO) β€” Combines multiple received packets into larger buffers before passing them to the kernel, reducing per-packet processing overhead.
  • Checksum Offloading β€” The NIC calculates TCP/UDP/IP checksums in hardware instead of software. This is almost always beneficial and should be left enabled.
  • Scatter-Gather (SG) β€” Allows the NIC to assemble packets from non-contiguous memory regions, avoiding costly memory copies.

To enable or disable features:

# Enable TSO
sudo ethtool -K eth0 tso on

# Disable GRO (sometimes needed for bridging/routing)
sudo ethtool -K eth0 gro off

# Enable all checksum offloads
sudo ethtool -K eth0 rx-checksumming on tx-checksumming on

Be careful when disabling offload features in production. In some cases (like when using Linux as a bridge or running certain VPN software), you may need to disable specific offloads, but this should always be tested first.

Ring Buffer Tuning

One of the most impactful performance tuning options is the NIC ring buffer size. Ring buffers are circular queues in kernel memory where the NIC places incoming packets. If your server is dropping packets under load, increasing the ring buffer can help:

# Check current and maximum ring buffer sizes
$ ethtool -g eth0
Ring parameters for eth0:
Pre-set maximums:
RX:    4096
TX:    4096
Current hardware settings:
RX:    256
TX:    256

# Increase ring buffers
sudo ethtool -G eth0 rx 4096 tx 4096

Larger ring buffers give the kernel more time to process packets before they're overwritten, but they also consume more memory. On a busy web server or database server, maximizing the ring buffer is usually the right call.

Multi-Queue and RSS Configuration

Modern NICs support multiple hardware queues, allowing packets to be distributed across multiple CPU cores. This is called Receive Side Scaling (RSS):

# Show number of channels
$ ethtool -l eth0
Channel parameters for eth0:
Pre-set maximums:
RX:    0
TX:    0
Other: 0
Combined: 8
Current hardware settings:
RX:    0
TX:    0
Other: 0
Combined: 4

# Set to use all available queues
sudo ethtool -L eth0 combined 8

Setting the number of combined queues to match your CPU core count ensures that network processing is distributed evenly across all cores, preventing any single core from becoming a bottleneck.

Wake-on-LAN Configuration

Wake-on-LAN (WoL) allows you to power on a server remotely by sending a special "magic packet" to its NIC. This is useful in datacenter environments where physical access is limited:

# Enable WoL with magic packet
sudo ethtool -s eth0 wol g

# Disable WoL
sudo ethtool -s eth0 wol d

# Check WoL status
ethtool eth0 | grep -i wake

Note that WoL settings are typically reset on reboot. To make them persistent, you need to add the ethtool command to a systemd service or network configuration file.

NIC Self-Test and LED Identification

When troubleshooting hardware, two lesser-known features are extremely useful. The self-test runs built-in diagnostics on the NIC:

# Run NIC self-test (may briefly interrupt traffic)
sudo ethtool -t eth0

# Blink the NIC LED for 5 seconds (identify which port)
sudo ethtool -p eth0 5

The LED blink command is incredibly useful in datacenters where you need to identify which physical port corresponds to a particular Linux interface, especially in servers with multiple NICs.

Reading Information from Sysfs

Not all systems have ethtool installed, but you can still get basic interface information from the Linux sysfs filesystem:

# Link speed in Mbps
cat /sys/class/net/eth0/speed

# Duplex mode
cat /sys/class/net/eth0/duplex

# Interface state
cat /sys/class/net/eth0/operstate

# MAC address
cat /sys/class/net/eth0/address

# MTU
cat /sys/class/net/eth0/mtu

# Traffic statistics
cat /sys/class/net/eth0/statistics/rx_bytes
cat /sys/class/net/eth0/statistics/tx_bytes
cat /sys/class/net/eth0/statistics/rx_errors

These sysfs files are always available without any additional packages and can be read by unprivileged users, making them useful in scripts and monitoring systems.

Automating with dargslan-ethtool-check

While ethtool is powerful, running it across multiple interfaces and interpreting the output can be tedious. That's why we created dargslan-ethtool-check, a Python CLI tool that automates the entire process:

# Install
pip install dargslan-ethtool-check

# Check all interfaces
dargslan-ethtool-check

# Check specific interface with verbose stats
dargslan-ethtool-check -i eth0 -v

# JSON output for monitoring integration
dargslan-ethtool-check --json

# Show only interfaces with errors
dargslan-ethtool-check --errors-only

# Summary table
dargslan-ethtool-check --summary

The tool combines information from ethtool, sysfs, and driver introspection into a single, clean output. It automatically detects all network interfaces, checks their link status, speed, duplex, driver information, and traffic statistics. The JSON output mode makes it easy to integrate with monitoring systems like Prometheus, Grafana, or Nagios.

For the complete toolkit of 108 Linux admin tools, install everything with a single command:

pip install dargslan-toolkit

Common Troubleshooting Scenarios

Slow Network Performance

If you're experiencing lower-than-expected throughput, check these things in order:

  1. Verify link speed and duplex with ethtool eth0. A 100Mbps link when you expect Gbps is a common issue.
  2. Check for errors with ethtool -S eth0. CRC errors mean a cable problem. Dropped packets mean buffer issues.
  3. Verify offload settings with ethtool -k eth0. Disabled TSO or GRO can dramatically impact throughput.
  4. Check ring buffer utilization with ethtool -g eth0 and increase if needed.

Intermittent Connectivity

Flapping links often show up as changing link detected status. Monitor it with:

watch -n 1 "ethtool eth0 | grep -E 'Speed|Duplex|Link'"

If the link keeps going up and down, try forcing a specific speed and disabling auto-negotiation:

sudo ethtool -s eth0 speed 1000 duplex full autoneg off

High CPU Usage from Network

If network processing is consuming too much CPU, enable all offload features and increase the number of queues:

sudo ethtool -K eth0 tso on gso on gro on
sudo ethtool -L eth0 combined $(nproc)
sudo ethtool -G eth0 rx 4096 tx 4096

Making Ethtool Settings Persistent

Ethtool settings are lost on reboot. To make them permanent, create a systemd service:

# /etc/systemd/system/ethtool-settings.service
[Unit]
Description=Apply ethtool settings
After=network-online.target

[Service]
Type=oneshot
ExecStart=/sbin/ethtool -G eth0 rx 4096 tx 4096
ExecStart=/sbin/ethtool -K eth0 tso on gro on
ExecStart=/sbin/ethtool -L eth0 combined 8

[Install]
WantedBy=multi-user.target

Then enable the service with systemctl enable ethtool-settings.

On systems using NetworkManager, you can also use nmcli to set ethtool options that persist across reboots:

nmcli connection modify eth0 ethtool.feature-tso on
nmcli connection modify eth0 ethtool.ring-rx 4096

Conclusion

Ethtool is one of the most powerful yet underutilized tools in the Linux networking toolkit. Whether you're diagnosing a slow connection, optimizing a high-throughput server, or simply trying to identify which cable goes where in a datacenter rack, ethtool gives you the low-level visibility you need.

Combined with the dargslan-ethtool-check CLI tool, you can automate these diagnostics across all your servers and integrate them into your monitoring pipeline. Download the free cheat sheet PDF below for a quick reference you can keep at your desk.

Get the Complete Linux Admin Toolkit

108 professional CLI tools for system monitoring, security auditing, networking, and DevOps.

pip install dargslan-toolkit

Download 380+ Free Cheat Sheets | Browse Linux & DevOps eBooks

Share this article:
Dargslan Editorial Team (Dargslan)
About the Author

Dargslan Editorial Team (Dargslan)

Collective of Software Developers, System Administrators, DevOps Engineers, and IT Authors

Dargslan is an independent technology publishing collective formed by experienced software developers, system administrators, and IT specialists.

The Dargslan editorial team works collaboratively to create practical, hands-on technology books focused on real-world use cases. Each publication is developed, reviewed, and...

Programming Languages Linux Administration Web Development Cybersecurity Networking

Stay Updated

Subscribe to our newsletter for the latest tutorials, tips, and exclusive offers.