PF in /etc/rc.d: some issues
yar at comp.chem.msu.su
Thu Sep 22 04:20:27 PDT 2005
I think we have a couple of issues regarding PF set-up during the
system boot process.
First, in the presence of vlan's or other dynamic interfaces it can
be hard to ensure that pfsync0 will appear after its syncdev on the
final list of interfaces built inside /etc/network.subr from several
rc.conf variables and other sources. Consequently, pfsync0 won't
get up because it is configured before its syncdev is up and running.
IMHO, this problem can be addressed by creating a separate rcNG script
for pfsync, which I already did in my systems using PF (see below.)
Second, /etc/rc.d/pf script starts before DAEMON and LOGIN, which
is too late IMHO. Can we make it start before "routing"? In an
ideal world, a firewall should start before "netif", but I'm unsure
if PF can start when not all interfaces mentioned in pf.conf are
present in the system yet.
# PROVIDE: pfsync
# REQUIRE: root mountcritlocal netif
# KEYWORD: nojail
case "$pfsync_syncdev" in
warn "pfsync_syncdev is not set, nothing done"
echo "Enabling pfsync."
ifconfig "$pfsync_if" syncdev "$pfsync_syncdev" up
echo "Disabling pfsync."
ifconfig "$pfsync_if" -syncdev down
More information about the freebsd-pf