Ethtool - Linux Network Interface Configuration

Configure and display Ethernet device settings with ethtool. Learn to manage speed, duplex, auto-negotiation, WoL, and more for Linux network interfaces.

Ethtool - Linux Network Interface Configuration

The ethtool command is a powerful utility for Linux systems used to configure and display information about network interface controllers (NICs). It allows administrators to fine-tune various aspects of Ethernet device settings, monitor performance, and diagnose network issues.

Display Ethernet Settings

To view the current configuration and capabilities of an Ethernet interface, use the basic ethtool command followed by the interface name.

# Display Ethernet settings for a specific interface
ethtool eth0

Configure Speed and Duplex

You can manually set the speed and duplex mode for an interface, which is useful when auto-negotiation is not working correctly or specific settings are required.

# Change the speed to 1000Mb/s and set full-duplex mode
ethtool -s eth0 speed 1000 duplex full

Manage Auto-Negotiation

Disabling auto-negotiation can sometimes resolve connectivity problems, but it requires manual configuration of speed and duplex on both ends of the link.

# Turn off auto-negotiation on the specified interface
ethtool -s eth0 autoneg off

Retrieve Driver Information

Understanding the network card's driver can be crucial for troubleshooting and compatibility checks.

# Get the driver information for a specific interface
ethtool -i eth0

Monitor Interface Statistics

ethtool -S provides detailed statistics about the network interface's operation, including packet counts, errors, and dropped packets.

# Display statistics for a specific interface
ethtool -S eth0

Configure Pause Parameters

Pause frames are used for flow control to prevent buffer overflows. You can view and configure these settings.

# Display the current pause parameter for a specific interface
ethtool -a eth0

Wake-on-LAN (WoL) Configuration

Wake-on-LAN allows you to power on a computer remotely over the network. ethtool can be used to enable or disable this feature.

# Enable or disable Wake-on-LAN (WoL)
ethtool -s eth0 wol g    # Enable
ethtool -s eth0 wol d    # Disable

Adjust Ring Buffer Settings

The ring buffer size affects how many packets the NIC can buffer. Adjusting these can impact performance.

# Change the ring buffer settings
ethtool -G eth0 rx 4096 tx 4096

Transceiver Information

For interfaces that use pluggable transceivers (like SFP/SFP+), ethtool can display detailed information about them.

# Display all transceiver information for an interface
ethtool -m eth0

Supported Features and Offloads

ethtool -k shows the supported features and offload capabilities of the network card, and allows you to enable or disable them.

# Display supported features and their statuses
ethtool -k eth0

# Change an offload parameter for a specific interface
ethtool -K eth0 tso off

For more in-depth information and advanced configurations, consult the official ethtool man page or the documentation for your specific network card driver.

External Resources: