# macros
ext_if="tun0"
int_if="fxp0"
tcp_services="{ 25, 80, 110, 143 }"
icmp_types="{ 0, 3, 11 }"
##comp3="192.168.0.3" #Not Used
#TABLES
table <trusted> { 192.168.1.1, 192.168.1.2, 10.0.0.1 }
# options
set optimization normal
set ruleset-optimization basic
set block-policy drop
set loginterface $ext_if
set fingerprints "/etc/pf.os"
set skip on lo
set skip on $int_if
# scrub
#scrub in on $ext_if no-df #testing
scrub all
# nat/rdr
nat on $ext_if from !($ext_if) -> ($ext_if:0)
#nat-anchor "ftp-proxy/*"
#rdr-anchor "ftp-proxy/*"
# UPnPd rdr anchor
nat-anchor "miniupnpd"
rdr-anchor "miniupnpd"
#rdr pass on $int_if proto tcp to port ftp -> 127.0.0.1 port 8021
#rdr on $ext_if proto tcp from any to any port 80 -> $comp3
# filter rules
block in
pass out keep state
#anchor "ftp-proxy/*"
# uPnPd rule anchor
anchor "miniupnpd"
antispoof quick for { lo $int_if }
#RULES
pass in quick on $ext_if inet proto tcp from <trusted> to port 22 keep state
pass in on $ext_if inet proto tcp from any to ($ext_if) \
port $tcp_services flags S/SA keep state
#pass in on $ext_if inet proto tcp from any to $comp3 port 80 \
# flags S/SA synproxy state
#pass out on $int_if from any to 239.0.0.0/8 keep state
#pass in on $int_if from any to 239.0.0.0/8 keep state
pass in inet proto icmp all icmp-type $icmp_types keep state
pass in quick on $int_if