Article View: bit.listserv.openbsd-pf
Article #140Re: Working example of bi-directional asymmetric ALTQ + NAT ruleset?
From: Bonnie Packet
Date: Wed, 12 Jan 2011 16:40
Date: Wed, 12 Jan 2011 16:40
81 lines
5020 bytes
5020 bytes
If you look at the posting from yesterday, you'll see the attempted
setup is on two different interfaces, yes. That's been the case from
the start.
However, when I try to do the setup suggested by folks here several
times now (same queue name repeated on another interface) pf complains
bitterly and refuses to load the rules (see below). This is on an old,
old OpenBSD 3.9 system - does anyone know if something changed in
later releases to allows the the same queue name on multiple
interfaces? (I looked through all the change logs up through the
current 4.8, but didn't see anything.) Or do I have the syntax wrong?
#cat /etc/pf.conf
...
altq on $int_if cbq bandwidth 5000Kb queue { std, slow, fast, tcpack }
queue std bandwidth 1200Kb priority 1 cbq(default borrow)
queue slow bandwidth 400Kb priority 0 cbq(ecn)
queue fast bandwidth 3300Kb priority 2 cbq(borrow)
queue tcpack bandwidth 100Kb priority 3 cbq(borrow)
altq on $ext_if cbq bandwidth 900Kb queue { std, slow, fast, tcpack }
queue std bandwidth 400Kb priority 1 cbq(default borrow)
queue slow bandwidth 50Kb priority 0 cbq(ecn)
queue fast bandwidth 400Kb priority 2 cbq(borrow)
queue tcpack bandwidth 50Kb priority 3 cbq(borrow)
.....
#./rc.pf
queue std already exists on interface rl0
/etc/pf.conf:45: errors in queue definition
queue slow already exists on interface rl0
/etc/pf.conf:46: errors in queue definition
queue fast already exists on interface rl0
/etc/pf.conf:47: errors in queue definition
queue tcpack already exists on interface rl0
/etc/pf.conf:48: errors in queue definition
pfctl: Syntax error in config file: pf rules not loaded
On Jan 12, 12:01 am, jhe...@logn.net (Jason Healy) wrote:
> On Jan 11, 2011, at 1:35 AM, Bonnie Packet wrote:
>
> > Note that I know PF reasonably well and have altq queuing / rate
> > limiting working perfectly already in ONE direction (right now, the
> > high-bandwidth download side) - I just can't figure out how to get it
> > working in both directions, up and down, simultaneously. I've beat my
> > head against TFM and nothing seems applicable - though this can't be
> > an uncommon need...?
>
> Are you creating your in/out queues on a single interface? If so, that might be your problem.
>
> We have our box set up with both a "lan" interface and a "wan" interface. The "outbound" queues are children of the "wan" interface, but the "inbound" queues are children of the "lan" interface. The folklore you hear about "only being able to shape outbound traffic" is sort of true; you can only shape the packets as they leave the PF box. However, as packets traverse your box, they come IN, get processed, and then go OUT to be delivered, so you always have the opportunity to shape them. You just need to make sure you're doing it at the right end.
>
> Essentially, for "inbound" traffic (from the internet to your lan), PF queues (and possibly drops) packets *just before* they would be delivered to your boxes on the inside. It's a little tragic (as others have mentioned) since those packets have already consumed your DSL bandwidth only to be dropped, but it's necessary to force the congestion-control to slow the flow for future packets.
>
> With a 2-interface 2-queue setup, we've been able to manage asymmetrical bandwidth amounts. We now have a symmetric connection, but I know we had one working back when we were on a 16up/2down cable connection...
>
> Jason
>
> --
> Jason Healy | jhe...@logn.net | http://www.logn.net/
Technical Details
Message-ID:
<57b6ad42-0d12-4c7b-9efa-7e83d9700cb1@w29g2000vba.googlegroups.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!postnews.google.com!w29g2000vba.googlegroups.com!not-for-mailReferences:
<df3ca561-057c-4cfd-8b5c-9992bd81bac7@s9g2000vby.googlegroups.com> <550AA59E-EAF3-466A-9F89-E1A1F253CB96@logn.net>Show Full Headers
Complete Article Headers
X-Google-Thread: ff4ef,36576d448873d3c2 X-Google-NewGroupId: yes X-Google-Attributes: gidbffa70e3,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: arc1-ca.pugleaf.net!g2news2.google.com!postnews.google.com!w29g2000vba.googlegroups.com!not-for-mail From: Bonnie Packet <thatseattleguy@gmail.com> Newsgroups: bit.listserv.openbsd-pf Subject: Re: Working example of bi-directional asymmetric ALTQ + NAT ruleset? Date: Wed, 12 Jan 2011 08:40:02 -0800 (PST) Organization: http://groups.google.com Lines: 82 Message-ID: <57b6ad42-0d12-4c7b-9efa-7e83d9700cb1@w29g2000vba.googlegroups.com> References: <df3ca561-057c-4cfd-8b5c-9992bd81bac7@s9g2000vby.googlegroups.com> <550AA59E-EAF3-466A-9F89-E1A1F253CB96@logn.net> NNTP-Posting-Host: 216.160.113.36 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1294850402 28099 127.0.0.1 (12 Jan 2011 16:40:02 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 12 Jan 2011 16:40:02 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: w29g2000vba.googlegroups.com; posting-host=216.160.113.36; posting-account=OxFlgAoAAACxFQaqQ3ZMgkcxEZhof8Vy User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_8; en-us) AppleWebKit/533.19.4 (KHTML, like Gecko) Version/5.0.3 Safari/533.19.4,gzip(gfe)