ipt_ACCOUNT is a high performance local network accounting system written for the Linux netfilter/iptables system.
It has just two parameters:
addr is the subnet which is accounted for
tname is the table name where the information is stored
The data can be queried later using the libipt_ACCOUNT userspace library or by the "iptaccount" tool which is part of the libipt_ACCOUNT package.
A special subnet is "0.0.0.0/0": All data is stored in the src_bytes and src_packets structure of slot "0". This is useful if you want to account the overall traffic to/from your internet provider.
pt_ACCOUNT is designed to be queried for data every second or at least every ten seconds. It is written as kernel module to handle high bandwidths without packet loss.
The largest possible subnet size is 24 bit, meaning f.e. 10.0.0.0/8 networks. Therefore it's able to use a fixed internal data structures which speeds up the processing speed for each packet. Furthermore, accounting data for one complete 192.168.1.X/24 network takes 4kb of memory. Memory for 16 or 24 bit networks is only allocated when needed.
The data is queried using the userspace libipt_ACCOUNT library. There is no /proc interface as it would be too slow for continuous access. The read&flush query operation is the fastest, as no internal data snapshot needs to be created&copied for all data. Use the "read" operation without flush only for debugging purposes!
To optimize the kerneluserspace data transfer a bit more, the kernel module only transfers information about IPs, where the src/dst packet counter is not 0. This saves precious kernel time.
Install the pom-ng-ipt_ACCOUNT archive in your patch-o matic-ng directory
Patch your kernel (./runme ACCOUNT)
Patch the userspace iptabels tool with the iptables-ext ipt_ACCOUNT.patch
Recompile the kernel
Recompile iptables tool
Unpack the libipt_ACCOUNT library archive
Run autoreconf -f
./configure && make && make install
You can also install&build the provided .src.prm
What's New in This Release: [ read full changelog ]
· Support for kernel 2.6.36 and 2.6.37 was added.
· Support for iptables 1.4.3 and 1.4.4 was added.