On Tue, 14 Apr 2009 17:37:42 +0200 "Helmut Schneider" <jumpe...@gmx.de> wrote:
> From: "Robert" <rob...@openbsd.pap.st> > > On Tue, 14 Apr 2009 15:39:48 +0200 > > "Helmut Schneider" <jumpe...@gmx.de> wrote: > > > >> From: "Robert" <rob...@openbsd.pap.st> > >>> "Helmut Schneider" <jumpe...@gmx.de> wrote: > >>>> My proxy has one single GB interface and is connected to the > >>>> internet using a E3-line (34Mb). I want to shape http traffic to > >>>> 5Mb/s. How? > >>>> > >>>> Something like: > >>>> > >>>> altq on $extIF cbq bandwidth 100% queue { default, http_traf } > >>>> queue default bandwidth 100% cbq(default borrow) > >>>> queue http_traf bandwidth 5Mb cbq(borrow) > >>>> > >>>> What is the correct syntax? > >>>> > >>>> Thanks, Helmut > >>> > >>> This is explained (with an example you can adapt) in the PF FAQ. > >>> http://www.openbsd.org/faq/pf/queueing.html > >> > >> No, it's not. The FAQ talks about two interfaces, I only do have > >> one single interface. I also did not find an example where the > >> default queue may use 100% percent and HTTP may use lets say 5Mb > >> from that amount. > >> > >> If I'm wrong please point me to the specific location. > > > > Doesn't this section explain how to do it? > > http://www.openbsd.org/faq/pf/queueing.html#assign > > Well, if then I do not understand it. The section states: > > altq on fxp0 cbq bandwidth 2Mb queue { std, ftp } > queue std bandwidth 500Kb cbq(default) > queue ftp bandwidth 1.5Mb > > What I want to do is to assign the default queue the whole bandwith > (100%) and let e.g. http borrow 5Mb. As I do not know the connection > speed (might be 1GB or 100Mb within the local LAN, but might also be > 34Mb for the internet) I guess I need to mix absolute values and > percentages which I currently fail to implement. > > What I tried: > > altq on $extIF cbq bandwidth 100% queue { default, http_traf } > queue default bandwidth 100% cbq(default borrow) > queue [default_]http_traf bandwidth 5Mb cbq(borrow) > > which does not work: > > # pfctl -nf /etc/pf.conf > pfctl: the sum of the child bandwidth higher than parent "root_bge1" > # 100% + 5Mb > 100% All children have to fit into the parent. (I think its a bad idea to mix % and Mb limits in the same tier of child-queues.) And "borrow" allows the child-queue to use more bandwidth than was defined, if it is available. As your interface has more bandwidth than your 34Mbit to the internet the queue won't have any effect. If you want 'http-traf' to get 5Mb max omit the "borrow". If you only queue traffic to your E3, just set the parent to 34Mb. - Robert