Traffic Accounting with Shorewall

 

Shorewall allows accounting of traffic with iptaccount. The following script inserts the output of iptaccount into a PostgreSQL Database (without proper input validation). In combination with cron/runwhen this script allows accounting of traffic from multiple interfaces. If the intervals between updates are short the datatype can be changed from bigint to int.

http://shorewall.net/Accounting.html

The following is an example schema for the database.

 

Leave a Reply

Your email address will not be published. Required fields are marked *