Community discussions

 
santa
newbie
Topic Author
Posts: 43
Joined: Sun Jul 06, 2014 10:53 pm
Location: POLAND, Gdansk

Feature request: ACCOUNT target

Thu Jul 31, 2014 2:17 pm

Monitoring traffic on Linux router is very easy with ACCOUNT target.
The ACCOUNT target is a high performance accounting system for large local networks. It allows per-IP accounting in whole prefixes of IPv4 addresses with size of up to /8 without the need to add individual accouting rule for each IP address.
Let's look at the example below.

1. We just need to add a simple iptables rule.
iptables -A FORWARD -j ACCOUNT --addr 172.18.100.24 --tname clients
2. Then all we need to do is to use also simple userspace accounting tool.
(root@router tmp)# iptaccount -l clients

libxt_ACCOUNT_cl userspace accounting tool v1.3

Showing table: clients
Run #0 - 22 items found
IP: 172.18.100.2 SRC packets: 20908 bytes: 13866573 DST packets: 29815 bytes: 12334220
IP: 172.18.100.3 SRC packets: 26112 bytes: 2226988 DST packets: 44037 bytes: 3349542
IP: 172.18.100.5 SRC packets: 27187150 bytes: 3087798816 DST packets: 46738642 bytes: 907473240
IP: 172.18.100.6 SRC packets: 127087 bytes: 14878583 DST packets: 199884 bytes: 221315992
IP: 172.18.100.7 SRC packets: 101255 bytes: 14455979 DST packets: 147722 bytes: 160126887
IP: 172.18.100.8 SRC packets: 1348110 bytes: 113363783 DST packets: 1688085 bytes: 2143059193
IP: 172.18.100.9 SRC packets: 2039 bytes: 340021 DST packets: 3359 bytes: 3069374
IP: 172.18.100.10 SRC packets: 798328 bytes: 51779193 DST packets: 1373315 bytes: 1830480295
IP: 172.18.100.13 SRC packets: 41775 bytes: 4717904 DST packets: 54818 bytes: 62625282
IP: 172.18.100.14 SRC packets: 1487859 bytes: 69407416 DST packets: 9782 bytes: 547792
IP: 172.18.100.18 SRC packets: 5441288 bytes: 352821688 DST packets: 13031266 bytes: 1698233528
IP: 172.18.100.19 SRC packets: 6812797 bytes: 734934083 DST packets: 10146694 bytes: 2207580724
IP: 172.18.100.20 SRC packets: 62799997 bytes: 953183460 DST packets: 105673585 bytes: 1018204666
IP: 172.18.100.21 SRC packets: 205853 bytes: 20750957 DST packets: 270737 bytes: 229837645
IP: 172.18.100.22 SRC packets: 3679803 bytes: 451370792 DST packets: 4013317 bytes: 4065200515
IP: 172.18.100.24 SRC packets: 102894 bytes: 5762064 DST packets: 0 bytes: 0
IP: 172.18.100.25 SRC packets: 7811057 bytes: 1092280332 DST packets: 14179670 bytes: 1055852286
IP: 172.18.100.26 SRC packets: 97380962 bytes: 2347994883 DST packets: 168553983 bytes: 2361017929
IP: 172.18.100.29 SRC packets: 163988 bytes: 14492240 DST packets: 259437 bytes: 339538966
IP: 172.18.100.31 SRC packets: 119344 bytes: 19332931 DST packets: 171174 bytes: 175458923
IP: 172.18.100.177 SRC packets: 0 bytes: 0 DST packets: 1 bytes: 126
IP: 172.18.100.200 SRC packets: 676326 bytes: 51400776 DST packets: 0 bytes: 0
Finished.
So the question is: is it possible to implement such mechanism inside RouterOS?

Who is online

Users browsing this forum: Google [Bot] and 94 guests