I want to forward all port 80 to a internal server, but can't make it work. My config are as follows:
The iptables server:
eth0 : 2xx.xxx.xxx.37
eth0 : 2xx.xxx.xxx.38 (alias)
eth1 : 192.168.0.1
iptables commands that I had run:
iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -o eth0 -j MASQUERADE
iptables -t nat -A PREROUTING -p tcp -d 2xx.xxx.xxx.38 --dport 80 -j DNAT --to 192.168.0.2
The internal server:
eth0: 192.168.0.2
eth0: 2xx.xxx.xxx.38 (alias)
gateway: 192.168.0.1
Ping from outside (my home) to 2xx.xxx.xxx.37 or 2xx.xxx.xxx.38 (Office) are okay.
What's missing/wrong? Please advise. Thanks. :)
Start Free Trial