Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm looking at using Rackspace cloud servers for some Windows based web hosting, and having used Amazon EC2 for similar projects before, I was disappointed to find Rackspace don't employ the EC2 security zone based approach for firewalling.

I thought it would be possible to add a low spec (cheap) Linux box to the Rackspace environment and set that up to act as a firewall/gateway to the Windows boxes, so that the linux box's external IP became the single point of entry to the Windows machines, but I'm getting nowhere fast at the moment. It's possibly my lack of Linux knowledge but after a day of tinkering with iptables on every flavour of Linux Rackspace offers I can't get something as simple as forwarding requests on port 80 to the internal address of my Windows web server to work.

Has anyone else had any success with such a set up, or got any ideas on a better strategy?

share|improve this question

1 Answer 1

echo 1 > /proc/sys/net/ipv4/ip_forward
PUBLIC_IF=eth0  
DMZ_IF=eth1
PORT=80
/sbin/iptables -A PREROUTING -t nat -p tcp --dport $PORT -i $PUBLIC_IF -j DNAT -to $DMZ_IP:$PORT
/sbin/iptables -A FORWARD -p tcp -d $DMZ_IP --dport $PORT -i $PUBLIC_IF  -o $DMZ_IF -j ACCEPT
/sbin/iptables -A FORWARD -p tcp -s $DMZ_IP --sport $PORT -i $DMZ_IF -o $PUBLIC_IF -j ACCEPT

I got the idea that your interfaces are eth0/eth1 from http://cloudservers.rackspacecloud.com/index.php/Using_your_private_IP_address . Feel free to adjust though.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.