Simple LAN IP accounting

Chuck Swiger cswiger at mac.com
Sun Jun 18 14:21:24 UTC 2006


Roger T. Harvey wrote:
> $IPFW pipe 1 config mask src-ip 0xffffffff buckets 512
> $IPFW pipe 2 config mask dst-ip 0xffffffff buckets 512
> $IPFW add 32001 pipe 1 src-ip 192.168.110.0/24 bridged
> $IPFW add 32002 pipe 2 dst-ip 192.168.110.0/24 bridged
>  
> Now that's all well and good, and I saw the output as well.
> However, im not running bridged. or does that make a difference in this
> instance?

It means you should create pipe rules which match the traffic you want to 
count, rather than using the "bridged" keyword (which would match none of your 
traffic).

Something like "in via fxp0" and "out via fxp0" might be right, assuming for 
the sake of example that you had an Intel "Fast EEPro" card which was the 
interface on the subnet whose traffic you want to count.

> Also, is there any scripts, etc to format the pipe info into a nice readable
> format (pref html)
>  
> Doesn't need graphs, etc. Just Daily and Monthly totals would be nice.
> (I am running MySQL so it can store the data)

This kind of thing tends to be fairly idiosyncratic, and you'll probably have 
to modify or write something for your specific case...perhaps others have more 
useful sample scripts to contribute.

-- 
-Chuck


More information about the freebsd-net mailing list