xref: /freebsd/share/examples/pf/queue2 (revision d0b2dbfa0ecf2bbc9709efc5e20baf8e4b44bbbf)
142a227f8SMax Laier# $OpenBSD: queue2,v 1.4 2006/10/07 04:48:01 mcbride Exp $
29d7ccc0fSMax Laier# advanced queue example.
39d7ccc0fSMax Laier# give interactive ssh traffic priority over ssh bulk transfers (scp, sftp)
49d7ccc0fSMax Laier
59d7ccc0fSMax Laierext_if="dc0"
69d7ccc0fSMax Laierdeveloperhosts="192.168.2.0/24"
79d7ccc0fSMax Laieremployeehosts="192.168.0.0/23"
89d7ccc0fSMax Laier
99d7ccc0fSMax Laieraltq on $ext_if cbq bandwidth 5Mb queue { std, http, mail, ssh }
109d7ccc0fSMax Laier
119d7ccc0fSMax Laierqueue std bandwidth 10% cbq(default)
129d7ccc0fSMax Laierqueue http bandwidth 60% priority 2 cbq(borrow red) { employees, developers }
139d7ccc0fSMax Laierqueue  developers bandwidth 75% cbq(borrow)
149d7ccc0fSMax Laierqueue  employees bandwidth 15%
159d7ccc0fSMax Laierqueue mail bandwidth 10% priority 0 cbq(borrow ecn)
169d7ccc0fSMax Laierqueue ssh bandwidth 20% cbq(borrow) { ssh_interactive, ssh_bulk }
1742a227f8SMax Laierqueue  ssh_interactive bandwidth 25% priority 7
1842a227f8SMax Laierqueue  ssh_bulk bandwidth 75% priority 0
199d7ccc0fSMax Laier
209d7ccc0fSMax Laierblock return out on $ext_if inet all queue std
219d7ccc0fSMax Laierpass out on $ext_if inet proto tcp from $developerhosts to any port 80 \
2242a227f8SMax Laier    queue developers
239d7ccc0fSMax Laierpass out on $ext_if inet proto tcp from $employeehosts to any port 80 \
2442a227f8SMax Laier    queue employees
259d7ccc0fSMax Laierpass out on $ext_if inet proto tcp from any to any port 22 \
2642a227f8SMax Laier    queue(ssh_bulk, ssh_interactive)
279d7ccc0fSMax Laierpass out on $ext_if inet proto tcp from any to any port 25 \
2842a227f8SMax Laier    queue mail
29