I have the following interfaces configured on my gateway ruing iptables:
eth0 - 6.7.8.9 (public ip)
eth1 - 10.0.10.1 (Inteal LAN)
I want to host a web server on 10.0.10.6 from my inteal LAN to be accessible from outside my LAN (the inteet) via port 80.
I am assuming I need to forward port 80 on my gateway to port 80 in my inteal web server. (please correct me if I am wrong or if I have any other option).
I run the following commands on my gateway to forward and NAT both incoming and outgoing traffic to my web server but I still can't reach my web server from outside.
Code:
iptables -A FORWARD -i eth0 -o eth1 -m state -p tcp -d 10.0.10.6 --dport 80 --state NEW,ESTABLISHED,RELATED -j ACCEPT iptables -t nat -p tcp -A PREROUTING -i eth0 --dport 80 -j DNAT --to-destination 10.0.10.6 iptables -t nat -p tcp -o eth0 -A POSTROUTING -s 10.0.10.6 --dport 80 -j SNAT --to-source 213.55.103.202
Thanks for your help
برچسب:
نویسنده: استخدام کار