I'm trying to configure pf port forwarding on OpenBSD 5.0
The firewall machine has two nics:
em0: 192.168.200.3 vic0: 126.96.36.199
I would like to forward all packets comming into 192.168.200.3:104 to 188.8.131.52: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 184.108.40.206 # 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 220.127.116.11.
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 18.104.22.168 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.