Subject: Re: Bandwidth throttling once limit reached
To: J. Piers Hearn <endareth@spamcop.net>
From: Harry Waddell <waddell@caravan.com>
List: netbsd-help
Date: 12/15/2002 11:35:06
On Sun, 15 Dec 2002 22:03:01 +1100
"J. Piers Hearn" <endareth@spamcop.net> wrote:

> Hi all,
> 
> I'm trying to set up a system whereby once my data transfer through a 
> specified interface (pppoe0 specifically) has passed a specified amount (in 
> this case being my monthly 10 gigs of download), my bandwidth automatically 
> throttles down to a lower rate, say equivalent to a 28.8k modem. I figure I 
> can do this by some use of netstat to track my data transfer, and altq to 
> then throttle down my interface.
> 
> So far, run into the following snags: If I'm going to use netstat, I need 
> some way to clear it's totals at the end of month, but I can't see a 
> convenient way of doing so. Second, setting up altq, can anyone point me to 
> any good doco on configuring it? I've found one at 
> ftp://ftp.csl.sony.co.jp/pub/kjc/papers/altq98.ps.gz which gives good 
> technical info about altq, but not much useful about how to configure it.
> 

I personally don't have much experience with it, but you could try using the
accounting features, i.e. using "count" in ipf.conf, of ipfilter to do the
counting. You should be able to reset those counters using ipf -z. The cia
package may be of some assistance as well. Man altq.conf has the altq config
info you should need. 

-- 
Harry Waddell
Caravan Electronic Publishing