IPFW and IP Statistics.

Jez Hancock jez.hancock at munk.nu
Sun Jan 18 10:26:10 PST 2004


On Sat, Jan 17, 2004 at 12:46:12PM -0500, Grant Peel wrote:
> Hello,
> 
> I am currently using ipfm (IP FLow Meter) as a way of measuring bandwidth
> per IP. I am not too happy with it as it has some major limitations.
> 
> Is there a way to configure IPFW in FreeBSD so that all it does is monitor
> bandwidth per IP and writes simple stats to seperate files?
> 
> I am interested to hear other solutions (short of buying a router!).
This is 'another' solution which logs and displays bandwidth consuption
on a per-user basis using ipfw:

http://ipfwstats.sf.net/

You should however be able to make ipfw log traffic on a per-ip basis
using rules such as:

add 100 count ip from any to 1.2.3.4
add 101 count ip from 1.2.3.4 to any
... etc

and then at the end of each day run a script via cron to pipe the
traffic usage for each ip to a file or database.

I have a feeling there's also a few ports that do per-ip bandwidth logging,
iplog and ipfm are two that I know of, looking in /usr/ports/net there
appear to be others - ipacctd for example.

It might be worth using the portsearch tool to search for more - it's
in /usr/ports/Tools/scripts/portsearch - something like this:

portsearch -p /usr/ports/net -i "bandwidth|traffic"

or just have a look through the ports in /usr/ports/net :P

-- 
Jez Hancock
 - System Administrator / PHP Developer

http://munk.nu/
http://jez.hancock-family.com/  - Another FreeBSD Diary
http://ipfwstats.sf.net/        - ipfw peruser traffic logging


More information about the freebsd-questions mailing list