iptables NAT configuration
- by Sarp Kaya
Hello I am experiencing some issues with my iptables.
Here's what I want to do:
A(eth0)--------(eth0)B(eth2)---------------(eth2)C
Brackets are interface names A,B and C are hosts.
Now I would like to forward port number 80 of host C so that It would be accessed via host A.
host A is 192.168.1.254
host C is 192.168.3.2
I intentionally ACCEPTed all FILTER chain options as the default policy because I wanted to make sure that NAT is working properly first. I enabled ip_forward.
So here's what I have done:
sudo iptables -A PREROUTING -t nat -p tcp - d 192.168.1.254 -j DNAT --to 192.168.3.2
However it is not working. What am I missing here?