Title: Iptables: DMZ, NAT; Portforwarding
Topic: blog
Date: 2008-03-16

Portforwarding of a public IP to DMZ and allow access from WAN to it.


iptables -t nat -A PREROUTING -p tcp -d $out_ip --dport $port -j DNAT --to-destination $dmz_ip

iptables -A dmz -m state --state NEW -o $IF_DMZ -p tcp --dport $port --dst $dmz_ip -j ACCEPT