Here's the setup : I have got 2 LANS ( lets call them external and internal )
eth1 - 10.5.1.14 ( connects to external LAN )
eth0 - 10.1.11.4 ( connects to internal LAN )
I have a webserver running on the internal LAN machine (IP: 10.1.1.11) on port 8080 and would like it to be accessible from 10.5.0.0 network by some kind of natting. I went through lots of guides and finally came up with the solution :
iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 8080 -j DNAT --to 10.1.1.11 ( or --to 10.1.1.11:8080 )
iptables -A FORWARD -i eth1 -o eth0 -p tcp -d 10.1.1.11 --dport 8080 -j ACCEPT
But surprisingly this is not working. when I do telnet on 8080 port of 10.5.1.14 , I get a "connection refused". Can somebody please help me to find out where I might have gone wrong ?
Thanks in advance...