From owner-freebsd-pf@FreeBSD.ORG Sun Oct 26 10:35: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 D3F8E1065681 for ; Sun, 26 Oct 2008 10:35:03 +0000 (UTC) (envelope-from bounces@nabble.com) Received: from kuber.nabble.com (kuber.nabble.com [216.139.236.158]) by mx1.freebsd.org (Postfix) with ESMTP id A537A8FC1B for ; Sun, 26 Oct 2008 10:35:03 +0000 (UTC) (envelope-from bounces@nabble.com) Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1Ku2hI-0001kG-Ji for freebsd-pf@freebsd.org; Sun, 26 Oct 2008 03:18:12 -0700 Message-ID: <20171926.post@talk.nabble.com> Date: Sun, 26 Oct 2008 03:18:12 -0700 (PDT) From: 7charlie To: freebsd-pf@freebsd.org In-Reply-To: <15260126.post@talk.nabble.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: melissa-nabble@littlebluecar.co.uk References: <15260126.post@talk.nabble.com> 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: Sun, 26 Oct 2008 10:35:03 -0000 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? > I worked around this by telling PF to only reload the queue section of the file. I generate the queues from a mysql database, writing into /etc/pf.conf. I put the "pass" rules that assign the queue into an anchor called classify_rules. then execute: pfctl -A -f /etc/pf.conf pfctl -a classify_rules -f /etc/pf-classify.conf This doesn't reload any of the main rules, and doesn't reset counters except in the anchor and for the queues. Quoted from: http://www.nabble.com/altq%3A-dynamic-queues-tp15260126p15260126.html -- View this message in context: http://www.nabble.com/altq%3A-dynamic-queues-tp15260126p20171926.html Sent from the freebsd-pf mailing list archive at Nabble.com.