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