ALTQ cbq : borrowing when no tfaffic with higher priority

Yuriy Grishin usgrishin at samaradom.ru
Tue Jan 13 11:07:27 PST 2009


Hello,

I have a gate with some traffic comes directly from it (wget, rtorrent).
And I have two computers behind the gate with NAT.

My target is to allow to borrow full bandwith for traffic that comes 
directly from the gate
BUT throttle this traffic to minimum rate when the computers behind the 
gate are active.

I wrote the rule set :
-------------------------------
...
##--queues
## real bandwith 1Mb symmetrical channel
## use altq at 97%
altq on $ext_if cbq bandwidth 970Kb queue { qme, qmywife, qgateway, qack }
   queue qme bandwidth 50% priority 3 cbq ( borrow )
   queue qmywife bandwidth 30% priority 2 cbq ( borrow )
   queue qgateway bandwidth 1% priority 0 cbq ( default borrow )
   queue qack bandwidth 19% priority 5 cbq ( borrow )

##--nat & rdr
nat on $ext_if from $int_if:network to any -> $ext_if

##--rules
block all
pass in on $int_if from $me to any queue (qme, qack)
pass in on $int_if from $mywife to any queue (qmywife, qack)
....
pass out on $ext_if from $ext_if to any
...
-------------------------------

In fact it allows to use ~30% of the link throughput for my wife and 50% 
for me while the gateway is downloading.
It seems that it guarantees bandwidth parameter values only. I don't 
understand the duty of priority parameter then!
How to make the gate get off the link while other computers are 
downloading?


More information about the freebsd-pf mailing list