I'm trying to configure pf port forwarding on OpenBSD 5.0
The firewall machine has two nics:
em0: 192.168.200.3 vic0: 220.127.116.11
I would like to forward all packets comming into 192.168.200.3:104 to 18.104.22.168:104. Also I need to still have access to port 22, for ssh.
So far, the rules I've setup are as this:
set skip on lo pass in log on em0 proto tcp from any to any port 104 rdr-to 22.214.171.124 # By default, do not permit remote connections to X11 block in on ! lo0 proto tcp to port 6000:6010
By reading the log using tcpdump -n -e -ttt -r /var/log/pflog, I see thar rule 0 is matched, but the calling application does not receives the acknowledge it is expecting.
What I'm doing wrong?.
BTW. I can ping and telnet to 126.96.36.199.
Edit: Here's the new /etc/pf.conf, now it works. Thanks Falcon.
set skip on lo pass in log on em0 proto tcp from any to any port 104 rdr-to 188.8.131.52 pass out on vic0 from em0:network to any nat-to vic0 # By default, do not permit remote connections to X11 block in on ! lo0 proto tcp to port 6000:6010
Edit: Mm, the nat-to rule only works when packets are sent from 192.168.200.x, but some packets are sent from 192.168.7.xxx, how can I allow those too?.
Thanks in advance, Leonardo.