есть шлюз на openbsd и есть внутри сети ftp на который нужно перенаправлять вот pf.conf:
#FTP
#adress
ext_ip = 1.1.1.8
ftp_ip = 2.2.2.243
#open 21
pass in on $ext_if inet proto tcp to $ext_ip port 21 flags S/SA keep state
#NAT
pass out on $ext_if from 2.2.2.0/8 to any nat-to $ext_ip
pass in on $ext_if proto tcp from any to any port 21 rdr-to $ftp_ip
pass out on $int_if inet proto tcp to $ftp_ip port 21 user proxy
#nat-anchor "ftp-proxy/*"
#nat on $ext_if inet from 2.2.2.14 rdr-to ($ext_if) port 21
#rdr-anchor "ftp-proxy/*"
#pass in on $ext_if inet proto tcp to $ext_ip port 21 flags S/SA keep state
#pass out on 2.2.2.14 inet proto tcp to $ftp_ip port 21 flags S/SA keep state
#anchor "ftp-proxy/*"
#pass in on $ext_if proto tcp from any to $ext_ip port 21 divert-to $ftp_ip port 21
#pass out on $int_if proto tcp to 2.2.2.243 port 21 received-on $int_if nat-to $ext_if
ext_ip = "192.168.0.1"
ftp_ip = "10.10.10.1"
match out on $ext_if inet from $int_if nat-to ($ext_if)
anchor "ftp-proxy/*"
pass in on $ext_if inet proto tcp to $ext_ip port 21
pass out on $int_if inet proto tcp to $ftp_ip port 21 user proxy