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

Counting bytes to/from alias IPs on 3.0

For accounting purposes, I need to count bytes sent to and from particular
IPs, all of which are aliases on one interface.  netstat -bi gives me the
upper bound, listing the total through the interface for each alias.
However, the kernel doesn't keep per-alias stats, and I need separate
counters for each alias IP.

One possible solution is to have pf log the packets, and parse pflog0 for
the packet lengths (I previously used count rules in ipfilter to do
something similar).

A better solution might be to use a generic listener on the interface to do
the counting.

Can anyone suggest a more elegant solution for a 3.0 box?  Or, can anyone
perhaps point me to existing code implementing a generic byte counting
listener?  :-)


Visit your host, monkey.org