ip-stats
Show network device statistics
TLDR
Show all interface statistics across all network devices
Show statistics for a specific network interface
Show link-layer statistics (same as ip -statistics link show)
Show hardware offload statistics for all devices
Show offload statistics for a specific interface
Show a specific offload subgroup
Show address-family specific statistics (e.g. MPLS)
Enable Layer 3 hardware statistics collection on a device
SYNOPSIS
ip [ OPTIONS ] link show [ DEVICE ] [ -s | -stats ] [ -s | -stats ]
Example: ip -s link show eth0
Example (more detailed): ip -s -s link show
PARAMETERS
-s, -stats
Display statistics for the network interface(s). This is the primary option that enables the 'ip-stats' output.
-s -s
Display more detailed statistics, often including additional error counters like FIFO, frame, compressed, carrier, and collisions.
DEVICE
Specify the name of the network interface (e.g., eth0, enp0s3) for which to show statistics. If omitted, statistics for all interfaces are displayed.
DESCRIPTION
The ip-stats command is not a standalone utility but typically refers to the functionality provided by the ip link show command with the -s (statistics) option. This combination allows users to view detailed network interface statistics on Linux systems. It provides crucial information about the health and performance of network adapters, including received (RX) and transmitted (TX) bytes, packets, errors, dropped packets, FIFO errors, frame errors, compressed packets, carrier errors, and collisions.
These statistics are invaluable for network troubleshooting, identifying bottlenecks, monitoring network traffic, and understanding interface activity. By examining these counters, administrators can diagnose issues like faulty cables, overloaded interfaces, or misconfigured network devices. The output helps in differentiating between software-related packet drops and hardware-related errors.
CAVEATS
The term ip-stats itself does not correspond to a standalone executable command in standard Linux distributions; it refers to a specific output mode of the ip link show command.
The displayed statistics are per-interface and do not provide global IP layer protocol statistics (like those found in netstat -s).
Counters reset upon system reboot or when a network interface is brought down and then up again.
In extremely high traffic environments, the accuracy of some counters might be subject to kernel limitations or update frequencies.
BASIC VS. DETAILED STATISTICS
Using a single -s (or -stats) option provides fundamental statistics like total bytes and packets, along with basic error and drop counts. Doubling the option, -s -s, extends this output to include more granular error types such as FIFO, frame, compressed, carrier, and collisions, offering a deeper insight into potential hardware or link layer issues. The availability and exact meaning of these extended counters can vary slightly between kernel versions and network adapter drivers.
HISTORY
The functionality to display network interface statistics, as implemented within the ip link show command, is a core component of the iproute2 utilities. iproute2 was developed by Alexey Kuznetsov and has progressively replaced the older net-tools suite (which included commands like ifconfig, route, and netstat) as the preferred method for network configuration and monitoring on Linux. This shift began in the late 1990s and has seen iproute2 become the standard in modern distributions due to its more robust and flexible design, better support for advanced networking features, and integration with the Linux kernel's networking stack.


