/* HINT: Search archives @ http://www.indyramp.com/masq/ before posting! */



Nick Gotsinas <[EMAIL PROTECTED]> wrote:
>
> Is there a way I can measure the network bandwidth used by my masqued
> clients on a per-IP or per host basis?

Any ipchains rule that you create, will count how many times it is
triggered, and how many bytes of packets have passed through that
triggered rule.  You can harvest these byte-counts and trigger-counts
using a cron job, to get an idea how often they are being triggered,
used, whatever.

You can easily create rules that match particular ports, IP's, services,
etc, and simply assign them no target at all (leave out the -j option).
This creates a rule that has no effect, but it still keeps counts of
triggers and usage.  If you put these into a special "Accounting" chain,
which is called first from your input ruleset, then you can have it
identify all sorts of interesting traffic.

Your count-harvesting script should use the -L and -Z options to
ipchains, to collect the counts, and perhaps zero them out for the next
counting interval.

I don't have a ready-made example, but it seems straightforward enough
for a simple perl script.

-- 
   [EMAIL PROTECTED] (Fuzzy Fox)      || "Just about every computer on the market
sometimes known as David DeSimone  ||  today runs Unix, except the Mac (and
  http://www.dallas.net/~fox/      ||  nobody cares about it). -- Bill Joy '85


_______________________________________________
Masq maillist  -  [EMAIL PROTECTED]
Admin requests can be handled at http://www.indyramp.com/masq-list/
or email to [EMAIL PROTECTED]

PLEASE read the HOWTO and search the archives before posting.
You can start your search at http://www.indyramp.com/masq/
Please keep general linux/unix/pc/internet questions off the list.

Reply via email to