How to Use ethtool for Network Management in Linux


Mastering the ethtool Command in Linux

The ethtool command is an essential utility in Linux for displaying and modifying Network Interface Controller (NIC) parameters. It provides valuable insights into your network interfaces and helps configure various network settings. Whether you’re looking to diagnose issues, optimize performance, or simply understand your network hardware better, ethtool is a powerful tool at your disposal.

Key Features of ethtool

  1. Display Current Settings
    To view the current settings for a specific interface, use the following command:

    ethtool eth0

    Replace eth0 with the appropriate interface name as needed.

  2. Driver Information
    If you need to see the driver information for a specific interface, you can run:

    ethtool --driver eth0

    This command provides insights into the driver managing the network interface.

  3. Supported Features
    To find out which features your network interface supports, use:

    ethtool --show-features eth0

    This is particularly useful for understanding capabilities like offloading and checksum support.

  4. Network Statistics
    Monitoring your network usage is vital for maintaining optimal performance. To display network usage statistics, execute:

    ethtool --statistics eth0

    This will give you a comprehensive breakdown of the interface’s performance metrics.

  5. LED Identification
    If you’re troubleshooting or need to physically locate a network interface, you can blink one or more LEDs on the interface. This can be done with:

    ethtool --identify eth0 10

    The 10 specifies the duration in seconds for which the LED will blink.

  6. Setting Link Speed and Duplex Mode
    Configuring the link speed and duplex mode for a network interface is crucial for optimal communication.

    You can set these parameters with the following command:

    ethtool -s eth0 speed 10|100|1000 duplex half|full autoneg on|off

    Here, you specify the desired speed (in Mbps) and whether to operate in half or full duplex mode, in addition to enabling or disabling auto-negotiation.

Further Reading

For more detailed information and advanced usage, visit the official man page at manned.org.

By mastering ethtool, you can better manage your network interfaces, troubleshoot issues more effectively, and optimize your network performance.

See Also