ethtool command enables you to query or control the network driver and hardware settings. It takes the device name (like swp1) as an argument. When the device name is the only argument to
ethtool, it prints the current settings of the network device. See
man ethtool(8) for details. Not all options are currently supported on switch port interfaces.
Monitoring Interface Status Using ethtool
To check the status of an interface using
To query interface statistics:
Viewing and Clearing Interface Counters
Interface counters contain information about an interface. You can view this information when you run
cat /proc/net/dev. You can also use
cl-netstat to save or clear this information:
Copies and clears statistics. It does not clear counters in the kernel or hardware.
Deletes saved statistics, either the
|-D||Deletes all saved statistics.|
|-l||Lists saved tags.|
|-r||Displays raw statistics (unmodified output of |
|-t <tag name>||Saves statistics with |
Monitoring Switch Port SFP/QSFP Hardware Information Using ethtool
To see hardware capabilities and measurement information on the SFP or QSFP module installed in a particular port, use the
ethtool -m command. If the SFP/QSFP supports Digital Optical Monitoring (that is, the
Optical diagnostics support field in the output below is set to Yes), the optical power levels and thresholds are also printed below the standard hardware details.
In the sample output below, you can see that this module is a 1000BASE-SX short-range optical module, manufactured by JDSU, part number PLRXPL-VI-S24-22. The second half of the output displays the current readings of the Tx power levels (
Laser output power) and Rx power (
Receiver signal average optical power), temperature, voltage and alarm threshold settings.