I'm trying to block wireless clients in using my DHCP-server. The
problem is that these clients are still able to retrieve IP-information
from the DHCP-server. If I understand the hereby included pf.conf,
everything (except UDP domain and TCP ssh) is blocked into entering
$wir_if (which comes from $wir_if:network). Doesn't this also mean that
an DHCP-request is blocked? Any suggestions in what I'm missing?

# macros
ext_if = "fxp0"
int_if = "fxp1"
wir_if = "wi0"

ext_tcp = "{ ftp, smtp, https, imaps }"
wir_tcp = "{ ftp, ssh, http, https }"
icmp_types = "echoreq"

priv_nets = "{ 127.0.0.0/8, 192.168.0.0/16, 172.16.0.0/12, 10.0.0.0/8 }"

# options
set block-policy return
set loginterface $ext_if

# scrub
scrub in all

# nat/rdr
nat on $ext_if from $int_if:network to any -> ($ext_if)
nat on $ext_if from $wir_if:network to any -> ($ext_if)

# filter rules
block log all

pass quick on lo0 all

block drop in log quick on $ext_if from $priv_nets to any
block drop out log quick on $ext_if from any to $priv_nets

pass in on $ext_if inet proto tcp from any to ($ext_if) port $ext_tcp
flags S/SA keep state

pass in inet proto icmp all icmp-type $icmp_types keep state

pass in on $int_if from $int_if:network to any keep state
pass out on $int_if from any to $int_if:network keep state

pass out on $ext_if proto tcp all modulate state flags S/SA
pass out on $ext_if proto { udp, icmp } all keep state

# wireless
pass in on $wir_if proto tcp from $wir_if:network to any port $wir_tcp
keep state
pass out on $wir_if from any to $wir_if:network keep state

block in log on $wir_if from $wir_if:network to $int_if:network
block in log on $wir_if from $wir_if:network to $wir_if:network

pass in on $wir_if proto udp from $wir_if:network to $wir_if port =
domain keep state
pass in on $wir_if proto tcp from $wir_if:network to $wir_if port = ssh
keep state

Reply via email to