From owner-freebsd-pf@FreeBSD.ORG Mon Feb 4 14:36:03 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 E12F916A41B for ; Mon, 4 Feb 2008 14:36:03 +0000 (UTC) (envelope-from tom@tomjudge.com) Received: from tomjudge.vm.bytemark.co.uk (tomjudge.vm.bytemark.co.uk [80.68.91.100]) by mx1.freebsd.org (Postfix) with ESMTP id A5D2C13C4E5 for ; Mon, 4 Feb 2008 14:36:03 +0000 (UTC) (envelope-from tom@tomjudge.com) Received: from localhost (localhost [127.0.0.1]) by tomjudge.vm.bytemark.co.uk (Postfix) with ESMTP id 2A08B341E7; Mon, 4 Feb 2008 14:04:43 +0000 (GMT) Received: from tomjudge.vm.bytemark.co.uk ([127.0.0.1]) by localhost (tomjudge.vm.bytemark.co.uk [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id A24u6BQyJS5n; Mon, 4 Feb 2008 14:04:42 +0000 (GMT) Received: from [192.168.255.6] (unknown [192.168.255.6]) by tomjudge.vm.bytemark.co.uk (Postfix) with ESMTP id BDCF3340E8; Mon, 4 Feb 2008 14:04:41 +0000 (GMT) Message-ID: <47A71B7B.6020806@tomjudge.com> Date: Mon, 04 Feb 2008 14:04:43 +0000 From: Tom Judge User-Agent: Thunderbird 2.0.0.6 (X11/20071022) MIME-Version: 1.0 To: Guntis Bumburs References: <15260126.post@talk.nabble.com> <200802040836.18611.guntis@rixtel.com> In-Reply-To: <200802040836.18611.guntis@rixtel.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-pf@freebsd.org Subject: Re: altq: dynamic queues 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: Mon, 04 Feb 2008 14:36:04 -0000 Guntis Bumburs wrote: > On Monday 04 February 2008 01:48:40 cnupm wrote: >> My English is no good, so I tried to describe what I want at this example: >> >> ### /etc/pf.conf >> altq on bge0 bandwidth 10Mb hfsc queue { u1_in, u1_out, u2_in, u2_out...} >> anchor users_queues >> >> block all >> anchor users_rules >> >> ### When user connected - teke parameter $x from DB (for example) and >> execute: >> echo "queue u1_in bandwidth 1Kb hfsc (upperlimit $xKb)" | pfctl -a >> user_queues:u1_in -f - >> echo "queue u1_out bandwidth 1Kb hfsc (upperlimit $xKb)" | pfctl -a >> user_queues:u1_out -f - >> *** ... users_rules... *** >> >> I know: it doesn't works - it's simplest way (with my English) to explain >> what I wont. >> How to dynamicly create/delete queues? > > Hello, > > It's no possible. > You can't define queues in anchors. > > ANCHORS > Besides the main ruleset, pfctl(8) can load rulesets into anchor attach- > ment points. An anchor is a container that can hold rules, address > tables, and other anchors. > What you could do is define X queues to start with and then use the pre allocated queues in dynamically added rules. If you set them up as borrow you should be able to get the queues to scale fairly with the number of users connected. Tom