[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

iptables to record bandwidth usage

I have already looked at the ULOG target including the ability to send
information about every packet to a MySQL database.  However, I don't
need records on every packet sent.  Instead, I only need totals on bytes
sent and received so that we can pass on charges to our clients.

What I need to do is just to total bandwidth usage on a per IP basis for
our connected clients.  Each client is issued with a fixed IP address in
the range.

I was thinking of using the ULOG target to send packets to a daemon I
will write which will simply keep a running tally of total bytes sent
and received.  Then every day, a cron job can query this daemon to
obtain all the daily totals for storage in a MySQL database.

Does anyone here use iptables in such a way to monitor and charge for
bandwidth usage?  What solutions do large ISPs use in order to pass on
costs to clients?  Do they somehow monitor usage at the routers?


Attachment: signature.asc
Description: This is a digitally signed message part

Reply to: