Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 9 Jun 1998 01:24:10 -0700
To:        Jason McKay <>, questions@FreeBSD.ORG
Subject:   Re: Measuring Consumption
Message-ID:  <>
In-Reply-To: <000201bd9361$67c7cca0$>; from Jason McKay on Tue, Jun 09, 1998 at 12:45:18PM +0800
References:  <000201bd9361$67c7cca0$>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
On %M 0, Jason McKay <> wrote:
> I need a means of measuring how much data (in megabytes) my dial-in ppp
> clients are using.  I am running FreeBSD 2.2.6-RELEASE, with pppd and
> mgetty.

ipfw (you add the support to your kernel) can count things like
packets and bytes.

I use it to count the bytes used by each virtual web site.  I then
pipe the data to mrtg to get cool graphs.

Whether you could successfully use it in your application may depend
if you do static or dynamic IP assignment.  

With static you could just count the data going to and from a
particular IP.

With dynamic you would have to figure out who was associated with
which IP at what time.  Off the top of my head, it doesn't seem
too complicated.  Your ppp login script would have to determine
who had logged in, what IP they were assigned, add an appropriate
count rule, and then log the count when the person hung up.

Brian Litzinger <>

To Unsubscribe: send mail to
with "unsubscribe freebsd-questions" in the body of the message

Want to link to this message? Use this URL: <>