xref: /freebsd/share/examples/pf/queue2 (revision 9d7ccc0ffa59fce38a85599754ceeba6cf748d04)
19d7ccc0fSMax Laier# $FreeBSD$
29d7ccc0fSMax Laier# $OpenBSD: queue2,v 1.2 2003/01/20 16:14:23 henning 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 }
189d7ccc0fSMax Laierqueue  ssh_interactive priority 7
199d7ccc0fSMax Laierqueue  ssh_bulk 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 \
239d7ccc0fSMax Laier    keep state queue developers
249d7ccc0fSMax Laierpass out on $ext_if inet proto tcp from $employeehosts to any port 80 \
259d7ccc0fSMax Laier    keep state queue employees
269d7ccc0fSMax Laierpass out on $ext_if inet proto tcp from any to any port 22 \
279d7ccc0fSMax Laier    keep state queue(ssh_bulk, ssh_interactive)
289d7ccc0fSMax Laierpass out on $ext_if inet proto tcp from any to any port 25 \
299d7ccc0fSMax Laier    keep state queue mail
30