PortForwarding to IIS in Linux

Posted by Simon on Server Fault See other posts from Server Fault or by Simon
Published on 2010-03-11T23:35:30Z Indexed on 2010/03/12 0:38 UTC
Read the original article Hit count: 541

Filed under:


I am trying to set up port forwarding on a linux box to a IIS webserver on my internal network. The web server sits on Windows 2003 Server.

My linux box has

eth0 - Internet connection eth1 - internal subnet (10.10.10.x) eth2 - 2nd internal subnet (129.168.0.x) dhcp interface

my webserver is on the eth2 interface (

I am doing port forwarding for port 80 with no avail. I use the same set of rules to port forward to a different webserver and it works.

The webapplication is available on the internal network but not for external users.

iptables -t nat -A PREROUTING -p tcp -i eth0 -d $PUBLIC_IP --dport 80 -j DNAT --to

iptables -A FORWARD -p tcp -i eth0 -o eth2 -d --dport 80 -m state --state NEW -j ACCEPT

iptables -A FORWARD -t filter -o eth0 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT

iptables -A FORWARD -t filter -i eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

Any Ideas?

© Server Fault or respective owner

Related posts about port-forwarding

Related posts about firewall