Traffic accounting with ulogd, by Stefano
07 Apr 2008
When I first started at the Bandwith Barn, the traffic accounting that such an environment required just wasn't available off-the-shelf or in the open source world. I've often been asked for the hacking combination of scripts and pmacct that maintain the Bandwidth Barn traffic system - which includes "buying" more monthly traffic, setting traffic limits per month per person, up-to-date graphs of usage per protocol and per client available to each company in the Barn, and months of historical data in case of queries or complaints about the billing.
Looks like ulogd, some iptables rules, and a few simple cronned SQL scripts make this a lot easier these days, thanks to this post about ulogd for bandwidth accounting by Stefano.
1 Responses
Stefano Rivera — April 07, 2008 at 04:11 PM.
IIRC NetFlow only reports on completed flows. If you want accurate accounting without losing too much information, you'd want to do something similar.
For high-traffic use, you probably want ulog -> raw SQL table -> netflow-type table.
In my case, I reduce it to one row of "user, type, bandwidth" per day.
Have your say