How to Log Account Usage?

Paul Bryan pa_bryan at
Thu Aug 1 21:31:18 EST 2002

Hash: SHA1

You can use your firewall rules to implement ip accounting. 

ipchains and iptables have packet and byte counts. 

You can add a rule (with no target) for you're ppp interface that matches all 
packets. The byte count will then give you the total number of bytes sent 
in/out on that interface. You have one for incoming (your download total) and 
one for outgoing (your upload total). 

As there is no target for the rule, your other rules won't be affected. Also, 
make sure this is the first rule in your input chain for that interface (and 
the same for output). That way, your other rules won't match and drop out of 
the chain before the packets are counted.

There's a whole bit about this at the linux doco project ( Check 
out the network administrators guide.

You'll need to zero the rules periodically, and record the packet/byte count. 
Otherwise the counts will "overflow" at some point, and start again. cron 
should do this nicely.

Of course, you can get as specific with your rules as you like. e.g. you can 
count the traffic on port 80. Anything you can do with rules, you can do here 
as it's just a rule with no target.

If you don't know much about linux firewalls, check out 
There are some really good how-to's here that I highly recommend. Anyone 
connected to the net should have a reasonable grasp on this stuff. There's 
also how-to's for ipchains (I can't remember where though, google is your 
friend), but iptables offers some extra nice stuff.

Hope that helps,

On Thu, 1 Aug 2002 20:40, brt_informatics at wrote:
> Hi,
>  Now my Dialin server, using mgetty is up and running in Red Hat 7.2.
>  Actually there was a bug in the ppp package that came along with the
>  7.2 installation cd. check out for more information.
>  Now the next challenge for me is to log user account usage? Can
> anybody
>  help me how to do that. Till now I've not seen any mgetty help pages
>  reffering to this topic. Can user accounting be managed by mgetty or I
>  have to use separate account?
>  help me please.....
>  Thanks...
>  Bikrant Neupane
>  Kathmandu,Nepal

- -- 
Paul Bryan
E-Mail: pa_bryan at


I need to discuss BUY-BACK PROVISIONS with at least six studio SLEAZEBALLS!!
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see


More information about the linux mailing list