The ethtool
command is a Linux utility that allows you to display and modify the configuration of Ethernet network interfaces. It can be used to obtain information about the speed, duplex, and other settings of a network interface, as well as to change these settings if necessary. The ethtool
command is useful for network administrators and system administrators who need to troubleshoot network connectivity issues or optimize network performance.
Overview
The basic syntax of the ethtool
command is as follows:
ethtool [options] [device]
Where device
is the name of the Ethernet network interface you want to view or modify the configuration of. If no device is specified, ethtool
will display information for all available Ethernet interfaces.
Examples
To display information about the configuration of the eth0
network interface, run the following command:
ethtool eth0
This will display information such as the speed, duplex, and link status of the interface.
To change the speed of the eth0
interface to 1000Mbps, run the following command:
ethtool -s eth0 speed 1000 duplex full autoneg off
This will set the speed of the interface to 1000Mbps, the duplex mode to full, and turn off auto-negotiation.
Specific use cases
Here are some specific use cases for the ethtool
command:
- Troubleshooting network connectivity issues: You can use
ethtool
to diagnose network connectivity issues by checking the link status, speed, and duplex settings of a network interface. If the link status is down, for example, you may need to check the physical connection or the network switch configuration. - Optimizing network performance: You can use
ethtool
to optimize network performance by adjusting the speed and duplex settings of a network interface. For example, if you have a gigabit Ethernet network, you may want to set the speed of the interface to 1000Mbps and the duplex mode to full to ensure maximum throughput.
Options
Here are the available options for the ethtool
command:
Option | Description |
---|---|
-a |
Displays the current pause parameter settings for the specified interface. |
-A |
Enables or disables the automatic negotiation of flow control parameters for the specified interface. |
-c |
Displays the current hardware offload settings for the specified interface. |
-C |
Enables or disables the adaptive interrupt coalescing feature for the specified interface. |
-d |
Displays the driver information for the specified interface. |
-e |
Displays the EEPROM contents for the specified interface. |
-g |
Displays the ring buffer settings for the specified interface. |
-h |
Displays a help message for the ethtool command. |
-i |
Displays the bus information for the specified interface. |
-k |
Displays the offload settings for the specified interface. |
-p |
Displays the current pause frame parameter settings for the specified interface. |
-r |
Resets the specified interface. |
-s |
Sets the specified parameter for the specified interface. |
-S |
Displays the statistics for the specified interface. |
-t |
Performs a self-test on the specified interface. |
-T |
Displays the time stamping settings for the specified interface. |
-u |
Displays the wake-on-LAN settings for the specified interface. |
-v |
Displays the version information for the ethtool command. |
Troubleshooting tips
Here are some troubleshooting tips for common issues with the ethtool
command:
- Permission denied errors: If you receive a “Permission denied” error when running the
ethtool
command, make sure you are running it as root or with sudo privileges. - Interface not found: If you receive an “Interface not found” error when running the
ethtool
command, make sure you are specifying the correct name of the network interface. You can use theifconfig
command to check the names of available network interfaces. - Changes not taking effect: If you make changes to the configuration of a network interface using the
ethtool
command, but the changes do not take effect, try resetting the interface using the-r
option.
Notes
- The
ethtool
command requires the ethtool package to be installed on your system. You can install it using your distribution’s package manager. - Some options for the
ethtool
command may not be available for all network interfaces, depending on the capabilities of the hardware and the driver.