PF, The OpenBSD Packet Filter: Building The Network You Need: BSDCan, Ottawa, June 10th 2015 | ||
---|---|---|
Prev | Next |
For static shaping, give bandwidth values in absolute values:
queue main on $ext_if bandwidth 20M queue defq parent main bandwidth 3600K default queue ftp parent main bandwidth 2000K queue udp parent main bandwidth 6000K queue web parent main bandwidth 4000K queue ssh parent main bandwidth 4000K queue ssh_interactive parent ssh bandwidth 800K queue ssh_bulk parent ssh bandwidth 3200K queue icmp parent main bandwidth 400K
Only leaf queues can be assigned traffic, make sure allocations sum up to parent queue allocation.
Traditional-style allocation via pass rules
set skip on { lo, $int_if } pass log quick on $ext_if proto tcp to port ssh \ queue (ssh_bulk, ssh_interactive) set prio (5,7) pass in quick on $ext_if proto tcp to port ftp queue ftp pass in quick on $ext_if proto tcp to port www queue http pass out on $ext_if proto udp queue udp pass out on $ext_if proto icmp queue icmp pass out on $ext_if proto tcp from $localnet to port $client_out