# $OpenBSD: pf.conf,v 1.28 2004/04/29 21:03:09 frantzen Exp $
#
# See pf.conf(5) and /usr/share/pf for syntax and examples.
# Remember to set net.inet.ip.forwarding=1 and/or net.inet6.ip6.forwarding=1
# in /etc/sysctl.conf if packets are to be forwarded between interfaces.
ext_if="rl1"
int_if="rl0"
lan_net="192.3.88.0/24"
Admin="192.3.88.15"
server="{53 80}"
# --- Define Table
table <leader> persist file "/etc/leader_user"
table <software> persist file "/etc/software_user"
table <message> persist file "/etc/message.block"
table <other> persist file "/etc/other.block"
# --- Option
set block-policy drop
set loginterface $ext_if
scrub in all
# --- Queue
altq on $ext_if cbq bandwidth 2Mb queue {other, Admin}
queue other bandwidth 1Mb cbq(default)
queue Admin bandwidth 1Mb priority 3 cbq(borrow)
# --- NAT
#nat on $ext_if from !($ext_if) -> ($ext_if:0)
nat on $ext_if from $Admin -> ($ext_if:0)
nat on $ext_if from <software> -> ($ext_if:0)
nat on $ext_if from <leader> -> ($ext_if:0)
# --- Redirection
rdr on $ext_if proto tcp from any to $ext_if port 22 -> 192.3.88.3 port 22
rdr on $int_if proto tcp from $Admin to $int_if port 8888 -> 192.168.42.1 port 8888
rdr on $int_if proto tcp from $Admin to any port 21 -> 127.0.0.1 port 8021
# --- Block All
block in on $ext_if from $lan_net to any
block out on $ext_if from any to $lan_net
#block on $ext_if all
pass quick on lo0 all
pass out on $ext_if inet proto { tcp udp } from any to any port domain keep state
# ---- Manager SSH
block in on $int_if proto tcp from $lan_net to $int_if port 22
pass in on $int_if proto tcp from $Admin to $int_if port 22 keep state
# --- Pass Administrator
pass out on $ext_if from $Admin to any keep state queue Admin
# --- Pass Table<leader>
pass out on $ext_if proto tcp from <leader> to any port 80 keep state queue other
block out on $ext_if from <leader> to <message>
block out on $ext_if from <leader> to <other>
block in on $int_if from <leader> to <message>
block in on $int_if from <leader> to <other>
# --- Pass Table<software>
pass out on $ext_if from <software> to any keep state queue Admin