LinuxCommandLibrary

ip-stats

Show network device statistics

TLDR

Show all interface statistics across all network devices

$ ip [[st|stats]]
copy

Show statistics for a specific network interface
$ ip [[st|stats]] show dev [network_interface]
copy

Show link-layer statistics (same as ip -statistics link show)
$ ip [[st|stats]] show group link
copy

Show hardware offload statistics for all devices
$ ip [[st|stats]] show group offload
copy

Show offload statistics for a specific interface
$ ip [[st|stats]] show dev [network_interface] group offload
copy

Show a specific offload subgroup
$ ip [[st|stats]] show dev [network_interface] group offload subgroup [l3_stats|cpu_hit|hw_stats_info]
copy

Show address-family specific statistics (e.g. MPLS)
$ ip [[st|stats]] show group afstats subgroup [mpls]
copy

Enable Layer 3 hardware statistics collection on a device
$ ip [[st|stats]] set dev [network_interface] l3_stats on
copy

SYNOPSIS

ip-stats [OPTIONS] [INTERFACE]

PARAMETERS

-h, --help
    Display help message and exit

-i, --interface=IFACE
    Specify network interface for stats (if supported)

-r, --reset
    Reset statistics counters (requires privileges)

-v, --verbose
    Increase output verbosity

DESCRIPTION

The ip-stats command is not a recognized standard utility in mainstream Linux distributions or the iproute2 package. It may refer to a custom script, third-party tool, or a misremembered syntax for displaying network interface and IP protocol statistics. In standard Linux, similar functionality is provided by options like ip -s link show for interface stats, nstat for general network counters, or parsing files like /proc/net/netstat and /proc/net/snmp which contain detailed IP, TCP, UDP, and ICMP statistics from the kernel.

These kernel stats include packets received/sent, errors, drops, and fragments for IPv4/IPv6. For example, ip -s appends statistics to commands like ip -s addr or ip -s neigh. Tools like ss -s give socket summaries, while netstat -s (deprecated) or sar -n provide historical data. If ip-stats exists in a specific environment (e.g., embedded systems or custom networking suites), it likely dumps cumulative or per-interface IP traffic metrics for monitoring and troubleshooting network performance issues such as high error rates or packet loss.

Users seeking IP stats should verify with man ip or install iproute2 for robust alternatives.

CAVEATS

Not a standard Linux command; likely custom or erroneous. Use ip -s, nstat instead. Requires root for some operations. Stats may not persist across reboots.

KERNEL FILES

Raw stats in /proc/net/netstat, /proc/net/snmp, /proc/net/netstat for IP/TCP/UDP metrics.

ALTERNATIVES

watch -n1 'ip -s link show' for real-time monitoring; vnstat for traffic accounting.

HISTORY

No official history as non-standard. IP stats exposure via /proc/net since Linux 2.2; iproute2 stats options added around 2001 with kernel netlink support.

SEE ALSO

ip(8), nstat(8), ss(8), netstat(8), cat(1)

Copied to clipboard