Port Forwarding Using iptables on Ubuntu
- by user141610
This is the scenario. I have configured a web-server in MUX. Now I want to access that web-server from Internet. Ubuntu box has two interfaces, One is connected to WAN (Public IP) and another one is connected to MUX (Private IP). MUX has no option to insert default gateway.
iptables -t nat -A PREROUTING -p tcp -i eth0 -d 103.x.x.x --dport 8001 -j DNAT --to-destination 192.168.1.2:8080
iptables -A FORWARD -p tcp -d 192.168.1.2 --dport 8080 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT
It does not work.
Thanks...