IP-STATS(8)
๐ IP-STATS(8) ๐
okay bestie, welcome to ip-stats, straight out of the iproute2 crew, sitting pretty in section 8 of the Linux manuals. this is the one that handles interface statistics โ showing them, managing them, the whole vibe. let's get into it ๐ซถ
โจ NAME โจ
ip-stats โ manage and show interface statistics ๐
๐ธ SYNOPSIS ๐ธ
ip stats { COMMAND | help }
ip stats show [ dev DEV ] [ group GROUP [ subgroup SUBGROUP [ suite
SUITE ] ... ] ... ] ...
ip stats set dev DEV l3_stats { on | off }
๐ฆ DESCRIPTION ๐ฆ
ip stats set ๐ง
so this one is for toggling whether a certain HW statistics suite gets collected on a given netdevice. it's giving on/off switch energy, no cap.
these are the statistics suites that are supported:
l3_statsโ L3 stats reflect traffic that takes place in a HW device on an object that corresponds to the given software netdevice. literally the L3 traffic, mirrored onto your soft netdev. slay.
ip stats show ๐
this is for showing stats on a given netdevice, or dumping statistics across all netdevices. by default, all stats are requested โ it wants everything, main character energy fr fr. but you can filter which stats get requested by using the group and subgroup keywords.
you can also specify several groups, or several subgroups for one group. and here's the tea: when no subgroups are given for a group, all the subgroups are requested. generous of it honestly ๐
these are the groups it recognizes:
group linkโ Link statistics. the same suite thatip -s link showshows. yes, that one.group offloadโ a group that contains a number of HW-oriented statistics. see below for the individual subgroups hanging out inside this group.group xstatsโ Extended statistics. a subgroup identifies the type of netdevice to show the statistics for.group xstats_slaveโ Extended statistics for the slave of a netdevice of a given type. a subgroup identifies the type of master netdevice.group afstatsโ a group for address-family specific netdevice statistics.
๐ group offload subgroups ๐
subgroup cpu_hitโ thecpu_hitstatistics suite is useful on hardware netdevices. the link statistics on these devices reflect both the hardware- and software-datapath traffic. thecpu_hitstatistics then only reflect software-datapath traffic. so it's the lil slice of truth underneath ๐subgroup hw_stats_infoโ this suite does not include traffic statistics, it's more of a vibe check ๐ โ it communicates the state of other statistics. through this subgroup, it's possible to discover whether a given statistic was enabled, and when it was, whether any device driver actually configured its device to collect these statistics. for example,l3_statswas enabled in the following case, but no driver has installed it:
# ip stats show dev swp1 group offload subgroup hw_stats_info
56: swp1: group offload subgroup hw_stats_info
l3_stats on used off
after an L3 address is added to the netdevice, the counter will be installed:
# ip addr add dev swp1 192.0.2.1/28
# ip stats show dev swp1 group offload subgroup hw_stats_info
56: swp1: group offload subgroup hw_stats_info
l3_stats on used on
see?? used off becomes used on. character development ๐
subgroup l3_statsโ these statistics reflect L3 traffic that takes place in HW on an object that corresponds to the netdevice. note that this suite is disabled by default and needs to be first enabled throughip stats set. do not skip that step bestie, it will not work ๐
for example:
# ip stats show dev swp2.200 group offload subgroup l3_stats
112: swp2.200: group offload subgroup l3_stats on used on
RX: bytes packets errors dropped mcast
8900 72 2 0 3
TX: bytes packets errors dropped
7176 58 0 0
note how the l3_stats_info for the selected group is also part of the dump. it just comes along, it's invited ๐
๐ group xstats and group xstats_slave subgroups ๐
subgroup bridgeโ various statistics on bridges and their slaves.suite stpโ STP statisticssuite mcastโ IGMP / MLD statisticssuite vlanโ per-VLAN traffic statistics
subgroup bond [ suite 802.3ad ]โ statistics for LACP traffic on bond devices and their slaves.
โญ group afstats subgroups โญ
subgroup mplsโ statistics for MPLS traffic seen on the netdevice. for example:
# ip stats show dev veth01 group afstats subgroup mpls
3: veth01: group afstats subgroup mpls
RX: bytes packets errors dropped noroute
0 0 0 0 0
TX: bytes packets errors dropped
216 2 0 0
๐ EXAMPLES ๐
# ip stats set dev swp1 l3_stats onโ enables collection of L3 HW statistics onswp1. turning it ON bestie โจ# ip stats show group offloadโ shows all offload statistics on all netdevices. everything, everywhere, all at once ๐ซถ# ip stats show dev swp1 group linkโ shows link statistics on the given netdevice. just the one. focused. iconic.
๐ SEE ALSO ๐
๐ AUTHOR ๐
Manpage by Petr Machata. thank you king ๐
and that's the whole page bestie, no notes ๐
okay so this little masterpiece lives in iproute2 and it's dated 16 Mar 2022 โ go forth and read your stats, you've absolutely got this ๐ฆ๐ธโจ
๐ฆ where this page comes from
- alpine 3.23: iproute2-doc 6.17.0-r0 ยท GPL-2.0-or-later
- alpine 3.24: iproute2-doc 7.0.0-r0 ยท GPL-2.0-or-later
- arch rolling: iproute2 7.2.0-1
- arch rolling: iproute2 7.3.0-1 ยท GPL-2.0-or-later
- centos-stream 10: iproute 7.0.0-2.el10 ยท GPL-2.0-or-later AND NIST-PD
- centos-stream 9: iproute 6.17.0-3.el9 ยท GPL-2.0-or-later AND NIST-PD
- fedora 44: iproute 6.17.0-2.fc44 ยท GPL-2.0-or-later AND NIST-PD
- nixos 26.05: iproute2 7.0.0
- nixpkgs unstable: iproute2 7.2.0
- ubuntu resolute: iproute2 6.19.0-1ubuntu1 ยท GPL-2.0-only
- ubuntu resolute: iproute2 6.19.0-1ubuntu1.1 ยท GPL-2.0-only
- ubuntu stonking: iproute2 7.2.0-1ubuntu1 ยท GPL-2.0-only
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms