Monitor per-user network usage and retrieve that data automatically


I'd like to monitor the network usage on a per-user basage. That sounds possible, right? Almost. I'd like to also retrieve said usage automatically over some kind of program. For instance, something like an HTTP endpoint would be nice. Is there anything like that?

I don't know how to see usage per IP, but it's possible to see usage per network interface at least.

Not quite the same, but you can use MAC address filtering in the firewall to see per device (or group of devices) traffic, so if devices map to users you get close.

This is in my /etc/config/firewall.user to limit games playing times - but you could skip the time based parts of the rules. Because it creates a new table you can see the amount of traffic hitting it in the Firewall status page.

iptables -N fred_traffic
iptables -F fred_traffic
iptables -A fred_traffic -m time --timestart 09:00 --timestop 11:30 -j RETURN
iptables -A fred_traffic -m time --timestart 14:30 --timestop 19:30-j RETURN
iptables -A fred_traffic -m limit --limit 3600/hour --limit-burst 1200 -j RETURN
iptables -A fred_traffic -j REJECT

iptables -F forwarding_rule
iptables -A forwarding_rule -m mac --mac-source 00:aa:bb:cc:dd:ee -m comment --comment "iPhone" -j fred_traffic
iptables -A forwarding_rule -m mac --mac-source 11:aa:bb:cc:dd:ee -m comment --comment "Xbox One Ethernet" -j fred_traffic