From owner-freebsd-pf@FreeBSD.ORG Wed Aug 20 13:42:05 2008 Return-Path: Delivered-To: freebsd-pf@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EEF801065687 for ; Wed, 20 Aug 2008 13:42:05 +0000 (UTC) (envelope-from jille@quis.cx) Received: from mulgore.hexon-is.nl (mulgore.hexon-is.nl [82.94.237.14]) by mx1.freebsd.org (Postfix) with ESMTP id 6D2858FC24 for ; Wed, 20 Aug 2008 13:42:05 +0000 (UTC) (envelope-from jille@quis.cx) X-Hexon-MailScanner-Watermark: 1219843589.05744@Vz9eBZJ37P5KvAjhTdRa6g Received: from [10.0.0.72] ([10.15.16.6]) (authenticated bits=0) by mulgore.hexon-is.nl (8.14.1/8.13.8) with ESMTP id m7KDQRhl008364; Wed, 20 Aug 2008 15:26:27 +0200 Message-ID: <48AC1BCE.3050109@quis.cx> Date: Wed, 20 Aug 2008 15:27:42 +0200 From: Jille User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: Erik Danielsson References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Hexon-MailScanner-Information: Please contact the ISP for more information X-Hexon-MailScanner-ID: m7KDQRhl008364 X-Hexon-MailScanner: Found to be clean X-Hexon-MailScanner-From: jille@quis.cx Cc: freebsd-pf@freebsd.org Subject: Re: Limiting bandwidth X-BeenThere: freebsd-pf@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Technical discussion and general questions about packet filter \(pf\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Aug 2008 13:42:06 -0000 Erik Danielsson wrote: > Hello, > > I'm using PF together with ALTQ, but my need of limiting bandwidth has > changed. I need to be able to limit the bandwidth from/to a certain IP > range, but only once a specific amount of data has been transferred from/to > that IP range. At midnight I want the counter to be reset, and everything > should start over. > > For example, I want to allow, let's say 10 GiB from e.g 192.168.0.1/24, and > once the 10GiB limit has been reached, I want to limit the bandwidth to xx > kbits/s until midnight. > Any ideas how to accomplish this, can it be done using PF and ALTQ? > afaik, you can only limit the bandwith with pf/altq and not count the total usage, and use that in rules. The best you can do (I think), is let pf create stats of the used bandwidth, and let some script check whether they reached the 10GiB limit, and if so add that rule to a table that limits bandwith. and a script that resets the counters at midmight and flush the table. -- Jille > Regards > Erik Danielsson > _______________________________________________ > freebsd-pf@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-pf > To unsubscribe, send any mail to "freebsd-pf-unsubscribe@freebsd.org" >