Saturday, December 10, 2011

pf firewall nested macros variables expansion

# pfctl -f /etc/pf.conf
No ALTQ support in kernel
ALTQ related functions disabled
/etc/pf.conf:260: syntax error
/etc/pf.conf:261: syntax error

pfctl: Syntax error in config file: pf rules not loaded

You need extra single quotes to solve the problem.

net1 = '""'
net2 = '""'
net3 = '""'

allow_hosts = "{" $net1 $net2 $net3 "}"

No comments: