# pf.conf file syntax error



## juancamilo (Apr 29, 2014)

Hello all,

I'm trying to use the rdr-to and nat-to combination, but I'm having trouble implementing it, could you please help me detecting the syntax error:


```
pass in quick on $if_wan inet proto { tcp, udp } to $server to port domain rdr-to $host
pass in quick on $if_wan inet proto { tcp, udp } to $server2 to port domain rdr-to $host2
pass in quick on $if_wan inet proto tcp from any to $host3 port smtp rdr-to $mailman_server label "smtp"
pass in quick on $if_wan proto tcp from any to $host4 port ftp rdr-to $host5
pass in quick on $if_wan to $host5 port = $cgate_ports rdr-to $host6 label "Communigate"
pass in quick on $if_wan inet proto tcp from $College to $host7 port = 9010 rdr-to $host8 label "Communigate"
pass in quick on $if_wan to $host10 port = { smtp, 3840 } rdr-to $host9 label "Mail proxy"
pass in quick on $if_wan inet proto { tcp, udp } from any to $host12 port 6000:6100 rdr-to $host11 label "cloud"
```

And when I do a pfctl this is the result:


```
root@test:~ # pfctl -F all -f /etc/pf.conf
No ALTQ support in kernel
ALTQ related functions disabled
rules cleared
nat cleared
0 tables deleted.
0 states cleared
source tracking entries cleared
pf: statistics cleared
pf: interface flags reset
/etc/pf.conf:109: syntax error
/etc/pf.conf:110: syntax error
/etc/pf.conf:113: syntax error
/etc/pf.conf:115: syntax error
/etc/pf.conf:121: syntax error
/etc/pf.conf:122: syntax error
/etc/pf.conf:125: syntax error
/etc/pf.conf:128: syntax error
pfctl: Syntax error in config file: pf rules not loaded
root@test:~ #
```

In advance thanks for any help you can provide me, Cheers.

Juan


----------



## DutchDaemon (Apr 29, 2014)

See pf.conf(5) for the tags that are available for FreeBSD's implementation of PF. If you search the man page for rdr-to and nat-to, you won't find them. They are not implemented. They are present in OpenBSD's implementation of PF. FreeBSD lags behind OpenBSD's implementation by a couple of years. The older (and perfectly fine) rdr and nat tags are still available, and there are examples on how to use them in the manual, and in posts in this sub-forum.


----------

