ethtool

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:

ethtool [options] <network_interface>

Examples

Display Ethernet device information

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

ethtool -i eth0

Shows the driver name, version, firmware version, and bus information.

Show statistics for a network interface

ethtool -S eth0

Displays detailed network statistics, useful for diagnosing problems.

ethtool -s eth0

Without additional options, this only shows current link settings. To see all supported modes, use:

ethtool eth0

Changing Interface Settings

Set speed and duplex mode

Set interface speed to 100 Mbps and duplex mode to full:

sudo ethtool -s eth0 speed 100 duplex full

Enable or disable auto-negotiation

Disable auto-negotiation:

sudo ethtool -s eth0 autoneg off speed 100 duplex full

Enable auto-negotiation:

sudo ethtool -s eth0 autoneg on

Turn on or off Wake-on-LAN

Enable Wake-on-LAN with the g flag (magic packet):

sudo ethtool -s eth0 wol g

Disable Wake-on-LAN:

sudo ethtool -s eth0 wol d