Interfaces and addresses
ethtool
Shows and sets a card's physical link (speed, duplex, auto-negotiation) and prints its driver's own counters.
ethtool CARD prints what the card and the other end agreed: speed, duplex, whether it auto-negotiated, and
whether a link is detected. ethtool -s forces them (as speed and duplex under an IOS interface).
ethtool -S prints the driver's statistics, beyond the standard counters of ip -s link: on real hardware CRC
errors, oversize frames, pause frames and per-queue drops; on a virtual card only what software can count.
ethtool command usage
ethtool CARD ethtool -S CARD ethtool -s CARD speed MBPS duplex half|full autoneg on|off
Options
-
-S - the driver's statistics
-
-s - set speed, duplex or auto-negotiation
-
-i - the driver and firmware versions
ethtool examples
-
ethtool eth0 - Shows the link's speed, duplex and whether a link is detected.
-
ethtool -S eth0 | grep -i err - Shows the driver's error counters.
Pitfalls
- A virtual card (veth, a container's card) reports a fixed speed and full duplex and answers
Not supportedto-s: there is no physical link to negotiate.