xref: /freebsd-14.2/share/examples/pf/queue2 (revision 9d7ccc0f)
1*9d7ccc0fSMax Laier# $FreeBSD$
2*9d7ccc0fSMax Laier# $OpenBSD: queue2,v 1.2 2003/01/20 16:14:23 henning Exp $
3*9d7ccc0fSMax Laier# advanced queue example.
4*9d7ccc0fSMax Laier# give interactive ssh traffic priority over ssh bulk transfers (scp, sftp)
5*9d7ccc0fSMax Laier
6*9d7ccc0fSMax Laierext_if="dc0"
7*9d7ccc0fSMax Laierdeveloperhosts="192.168.2.0/24"
8*9d7ccc0fSMax Laieremployeehosts="192.168.0.0/23"
9*9d7ccc0fSMax Laier
10*9d7ccc0fSMax Laieraltq on $ext_if cbq bandwidth 5Mb queue { std, http, mail, ssh }
11*9d7ccc0fSMax Laier
12*9d7ccc0fSMax Laierqueue std bandwidth 10% cbq(default)
13*9d7ccc0fSMax Laierqueue http bandwidth 60% priority 2 cbq(borrow red) { employees, developers }
14*9d7ccc0fSMax Laierqueue  developers bandwidth 75% cbq(borrow)
15*9d7ccc0fSMax Laierqueue  employees bandwidth 15%
16*9d7ccc0fSMax Laierqueue mail bandwidth 10% priority 0 cbq(borrow ecn)
17*9d7ccc0fSMax Laierqueue ssh bandwidth 20% cbq(borrow) { ssh_interactive, ssh_bulk }
18*9d7ccc0fSMax Laierqueue  ssh_interactive priority 7
19*9d7ccc0fSMax Laierqueue  ssh_bulk priority 0
20*9d7ccc0fSMax Laier
21*9d7ccc0fSMax Laierblock return out on $ext_if inet all queue std
22*9d7ccc0fSMax Laierpass out on $ext_if inet proto tcp from $developerhosts to any port 80 \
23*9d7ccc0fSMax Laier    keep state queue developers
24*9d7ccc0fSMax Laierpass out on $ext_if inet proto tcp from $employeehosts to any port 80 \
25*9d7ccc0fSMax Laier    keep state queue employees
26*9d7ccc0fSMax Laierpass out on $ext_if inet proto tcp from any to any port 22 \
27*9d7ccc0fSMax Laier    keep state queue(ssh_bulk, ssh_interactive)
28*9d7ccc0fSMax Laierpass out on $ext_if inet proto tcp from any to any port 25 \
29*9d7ccc0fSMax Laier    keep state queue mail
30