iptables traffic accounting for each IP/MAC
hi all,
how to count traffic for each IP/MAC in my network with iptables/linux gateway.
e.g.:
iptables -N clients
iptables -A FORWARD -j clients
iptables -A clients -s 192.168.0.24 -m mac --mac-source 00:30:1B:AB:F6:83
iptables -A clients -s 192.168.0.25 -m mac --mac-source 00:30:1B:AB:F6:84
but then if I download 1.2meg file on 192.168.0.24 I get:
bash-2.05b# iptables -L FORWARD -vn
Chain FORWARD (policy ACCEPT 7045 packets, 6258K bytes)
pkts bytes target prot opt in out source destination
1408 1251K clients all -- * * 0.0.0.0/0 0.0.0.0/0
total FORWARD is OK, but it's total for all clients not only 192.168.0.24
bash-2.05b# iptables -L clients -vn
Chain clients (1 references)
pkts bytes target prot opt in out source destination
553 22411 all -- * * 192.168.0.24 0.0.0.0/0 MAC 00:30:1B:AB:F6:83
0 0 all -- * * 192.168.0.25 0.0.0.0/0 MAC 00:30:1B:AB:F6:84
and chain clients shows 22411bytes for this client (192.168.0.24). How can I count traffic for each client and not only total.
Thanks!
|