'IP statistics per interface
Linux kernel collects a lot of IP level counters (e.g. InReceives, InDiscards, FragFails etc.), available in /proc/net/snmp or /proc/net/snmp6, however they're system-wide stats. I know there exists /proc/net/dev_snmp6/ giving IPv6 and ICMPv6 counters per interface, but I have not found the same for IPv4.
Is there a way to obtain per-interface IPv4 level stats? I'm thinking (but have not a clear idea yet) of adding a netfilter extension module, which can intercept those stats somehow (stats are pegged by __IP_INC_STATS macro at certain points in IP stack), and this module could be placed in INPUT, FORWARD and OUTPUT hooks. However the main problem is that the stats are collected in percpu objects system-wide, so I'm not sure my idea would work.
I'd be appreciate any suggestions!
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
