[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Fwd: altq + cbq
- To: misc_(_at_)_openbsd_(_dot_)_org
- Subject: Fwd: altq + cbq
- From: notrox <notrox_(_at_)_gmail_(_dot_)_com>
- Date: Tue, 26 Oct 2004 15:56:04 -0600
- Reply-to: notrox <notrox_(_at_)_gmail_(_dot_)_com>
I am running OpenBSD 3.5 and I am trying to do bandwidth limiting to a
single IP.
For some odd reason altq isnt borrowing from the root queue.
---------------------------------------------------------------------------------------------------------------------
#pf.conf
ext_if = "tun0"
int_if = "dc0"
lan = "192.168.1.0/24"
scrub in all
altq on $ext_if cbq bandwidth 400Kb queue {web, bt }
queue web bandwidth 300Kb cbq(default)
queue bt bandwidth 100Kb cbq(borrow)
nat on $ext_if from $lan to any -> $ext_if
rdr on $ext_if proto tcp from any to any port 22 -> 192.168.1.102 port 22
rdr on $ext_if proto tcp from any to any port 4899 -> 192.168.1.7 port 4899
rdr on $ext_if proto tcp from any to any port 80 -> 192.168.1.102 port 80
rdr on $ext_if proto tcp from any to any port 443 -> 192.168.1.102 port 443
block in log on $ext_if inet proto tcp all
block in log on $ext_if inet proto icmp all
pass out on $ext_if inet proto tcp from 192.168.1.102 to any keep state queue bt
pass in on $ext_if inet proto tcp from any to any port 80 \
flags S/SA keep state
pass in on $ext_if inet proto tcp from any to any port 443 \
keep state
#pass in on $ext_if inet proto tcp from any to any port 110 \
flags S/SA keep state
#pass in on $ext_if inet proto tcp from any to any port 25 \
flags S/SA keep state
pass in quick on $ext_if inet proto tcp from any to any port 22 keep state
pass in quick on $ext_if inet proto { tcp, udp } from any to any port 53
block out on $ext_if inet proto tcp all
pass out on $ext_if inet proto tcp all flags S/SA keep state
pass out on $ext_if inet proto udp all keep state
pass out on $ext_if inet proto icmp all keep state
------------------------------------------------------------------------------------------------------------------
# pfctl -vsq
queue root_tun0 bandwidth 400Kb priority 0 cbq( wrr root ) {web, bt}
[ pkts: 39 bytes: 3452 dropped pkts: 0 bytes: 0 ]
[ qlength: 0/ 50 borrows: 0 suspends: 0 ]
queue web bandwidth 300Kb cbq( default )
[ pkts: 39 bytes: 3452 dropped pkts: 0 bytes: 0 ]
[ qlength: 0/ 50 borrows: 0 suspends: 0 ]
queue bt bandwidth 100Kb priority 7 cbq( borrow )
[ pkts: 0 bytes: 0 dropped pkts: 0 bytes: 0 ]
[ qlength: 0/ 50 borrows: 0 suspends: 0 ]
Visit your host, monkey.org