i have a small network, with one valid IP and a firewall with 3 network interfaces (LAN, WAN, DMZ).
- I want to enable PAT on this valid IP to redirect http traffic to a server in my DMZ. (done)
- I want to enable MASQ on this ip from traffic that comes from my LAN (done)
- I want from my LAN as well to access my http server at DMZ. (partially)
in the above scenario, i cannot from my LAN, to access my http server in the DMZ, since it has the IP used by the MASQ (the only valid ip that i have). What would be the best option to solve this problem?
- eth0 (WAN)
- eth1 (DMZ)
/sbin/iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
/sbin/iptables -A FORWARD --o eth1 -d 18.104.22.168 -p tcp --dport 80 -j ACCEPT
/sbin/iptables -t nat -A PREROUTING -i eth0 -d 22.214.171.124 -p tcp --dport 80 -j DNAT --to 126.96.36.199
/sbin/iptables -A FORWARD -i eth0 -o eth1 -m state --state RELATED,ESTABLISHED -j ACCEPT
/sbin/iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT
/sbin/iptables -A FORWARD -i eth2 -o eth0 -j ACCEPT