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 have main computer with 2 network cards: one from internet, another -> to next computer with web server. DNS points several domains to my static IP, I want to serve them by second computer. How to manage all this. I guess I need some proxy server?

share|improve this question
add comment

3 Answers

DNAT (port forwarding) should work if you only want to put one webserver behind the bastion host. This would be my choice for a linux bastion host with a single webserver behind it.

A quick google should give you a recipe.

You could also use a reverse proxy or proxy passing, which is probably the route I'd take if I wanted multiple webservers behind the bastion.

share|improve this answer
add comment

Enable IP forwarding and NAT static_ip:80 to next_computer:80 in iptables.

In /etc/sysctl.conf

net.ipv4.ip_forward=1

Iptables

iptables -t nat -A PREROUTING -p tcp -d <static_internet_ip> --dport 80 -j dnat --to-destination <next_computer_ip>:80
share|improve this answer
add comment

reverse proxy would also be a good solution if you wish to cache some content and have the actual webserver less loaded

share|improve this answer
add comment

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.