xref: /freebsd/share/examples/pf/queue2 (revision d37eb51047221dc3322b34db1038ff3aa533883f)
1# $OpenBSD: queue2,v 1.4 2006/10/07 04:48:01 mcbride Exp $
2# advanced queue example.
3# give interactive ssh traffic priority over ssh bulk transfers (scp, sftp)
4
5ext_if="dc0"
6developerhosts="192.168.2.0/24"
7employeehosts="192.168.0.0/23"
8
9altq on $ext_if cbq bandwidth 5Mb queue { std, http, mail, ssh }
10
11queue std bandwidth 10% cbq(default)
12queue http bandwidth 60% priority 2 cbq(borrow red) { employees, developers }
13queue  developers bandwidth 75% cbq(borrow)
14queue  employees bandwidth 15%
15queue mail bandwidth 10% priority 0 cbq(borrow ecn)
16queue ssh bandwidth 20% cbq(borrow) { ssh_interactive, ssh_bulk }
17queue  ssh_interactive bandwidth 25% priority 7
18queue  ssh_bulk bandwidth 75% priority 0
19
20block return out on $ext_if inet all queue std
21pass out on $ext_if inet proto tcp from $developerhosts to any port 80 \
22    queue developers
23pass out on $ext_if inet proto tcp from $employeehosts to any port 80 \
24    queue employees
25pass out on $ext_if inet proto tcp from any to any port 22 \
26    queue(ssh_bulk, ssh_interactive)
27pass out on $ext_if inet proto tcp from any to any port 25 \
28    queue mail
29