iptables for webserver with NAT
I am working on this iptables for some time now and would appreciate any help.
My network is configured as follow (I use vmware for the server in case you wonder about the strange adapter names)
Laptop | eth0 (192.168.1.1) <-> eth0 (192.168.1.2) | Server | vmware8 (172.16.139.1) <-> (172.16.139.2) | VmwareWebServer
The following works
On Server : ping 172.16.139.2
On Server: telnet 172.16.139.2 80
On Laptop: ping 192.168.1.2
I would like to get this to work
On Laptop: telnet 192.168.1.2 80
this request should be forwarded to the VmwareWebServer.
To accomplish this I set tried the following rules on the server.
iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j DNAT --to 172.16.139.2:80
iptables -A INPUT -p tcp -m state --state NEW --dport 80 -i eth0 -j ACCEPT
However it doesn't work I can not connect to the WebServer from my laptop.