ethtool
2 min read
ethtool is a Linux command-line utility used for querying and controlling network driver and hardware settings, particularly for Ethernet devices. It allows administrators to view and modify network interface parameters such as speed, duplex mode, auto-negotiation settings, and more.
Usage
The general syntax for ethtool commands is:
bash
ethtool [options] <network_interface>
Examples
Display Ethernet device information
bash
ethtool eth0
Shows a summary of supported and current settings including speed, duplex, auto-negotiation, port type, link status, etc.
Display driver and bus information
bash
ethtool -i eth0
Shows the driver name, version, firmware version, and bus information.
Show statistics for a network interface
bash
ethtool -S eth0
Displays detailed network statistics, useful for diagnosing problems.
Show supported link modes and features
bash
ethtool -s eth0
Without additional options, this only shows current link settings. To see all supported modes, use:
bash
ethtool eth0
Changing Interface Settings
Set speed and duplex mode
Set interface speed to 100 Mbps and duplex mode to full:
bash
sudo ethtool -s eth0 speed 100 duplex full
Enable or disable auto-negotiation
Disable auto-negotiation:
bash
sudo ethtool -s eth0 autoneg off speed 100 duplex full
Enable auto-negotiation:
bash
sudo ethtool -s eth0 autoneg on
Turn on or off Wake-on-LAN
Enable Wake-on-LAN with the g flag (magic packet):
bash
sudo ethtool -s eth0 wol g
Disable Wake-on-LAN:
bash
sudo ethtool -s eth0 wol d