I have the following pf.conf and authpf.rules. When I try to load the rules into the anchor I get
authpfbob# pfctl -a authpf -f /etc/authpf/authpf.rules /etc/authpf/authpf.rules:3: macro 'user_ip' not defined /etc/authpf/authpf.rules:3: syntax error pfctl: Syntax error in config file: pf rules not loaded >From reading the man page and the FAQ I think I have everything right. But >clearly I need to do somehting else to get user_ip to work. Wasn't able to >find anything in the archives. Any ideas, please? authpfbob# cat /etc/pf.conf # $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="xl1" int_if="xl0" #table <spamd> persist #table <spamd-white> persist table <authpf_users> persist scrub in #nat on $ext_if from !($ext_if) -> ($ext_if:0) #rdr pass on $int_if proto tcp to port ftp -> 127.0.0.1 port 8021 #rdr pass on $ext_if proto tcp from <spamd> to port smtp \ # -> 127.0.0.1 port spamd #rdr pass on $ext_if proto tcp from !<spamd-white> to port smtp \ # -> 127.0.0.1 port spamd block in all #pass out keep state #pass quick on { lo $int_if } #antispoof quick for { lo $int_if } pass in on $int_if proto tcp to ($int_if) port ssh keep state #pass in on $ext_if proto tcp to ($ext_if) port > 49151 user proxy keep state #pass in log on $ext_if proto tcp to ($ext_if) port smtp keep state #pass out log on $ext_if proto tcp from ($ext_if) to port smtp keep state anchor "authpf/*" load anchor authpf from "/etc/authpf/authpf.rules" authpfbob# cat /etc/authpf/authpf.rules int_if = "xl0" pass in quick on $int_if proto tcp from $user_ip to any keep state -- BOFH excuse #50: Change in Earth's rotational speed