Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a piece of equipment (WS-A) which has embedded web and email servers that can receive port 80 traffic and send out port 80 and port 25 traffic.

Currently WS-A sits on the LAN side of an existing router (Rtr-A) with a fixed LAN IP assigned as I do not have access to this router, nor can I have its settings changed. It is currently set to forward port 80 inbound traffic to and allow outbound traffic from on ports 80 and 25.

I connect (port 80) remotely to change settings, and the equipment also connects on demand to other URLs to get firmware updates.

I would like to expand so that a 2nd piece of equipment (also with web and email servers, =WS-B) can now send out through

Can another router do this? I was thinking that I would place a second router (=Rtr-B) between Rtr-A and WS-A and assign Rtr-B's WAN address as Then on Router B's LAN side use IP address in the range of, turning off DHCP and statically assigning addresses to the downstream equipment. Will this work? To clarify, WS-A would now have, WS-B could have

The problem will occur when I try to get to the WS-A's webserver from the internet. Do we set up port forwarding on Rtr-B, so that port 80 traffic goes to the (WS-A) address of the original webserver? This seems logical. But how do we get to the other webserver on WS-B? It uses port 80 and cannot be changed.

Hopefully this is clear. Any ideas and corrections are most welcome.

share|improve this question

migrated from Apr 3 '11 at 20:06

This question came from our site for professional and enthusiast programmers.

belongs on superuser, I am thinking. – Muad'Dib Apr 3 '11 at 15:51
There are no pcs (linux or otherwise) in the outer LAN that I have access to. Otherwise not sure what you mean here. – Fraser Gorrie Apr 3 '11 at 18:09

You're on the right track, yes. A second router using NAT to have multiple machines on a private network (192.168.x.x) behind it solves your first problem.

The feature you need in that router to make things go is load balancing.

share|improve this answer
Thanks for your quick reply, Brian. The traffic through is minimal, almost trivial. Less that 10 KBytes per hour (200 KBytes peak), so perhaps load balancing is not an issue. What I am struggling with now is being able to arrive at multiple destinations all with port 80, when only the Rtr-2 (at can only port-forward to one of them. Do I need to place a PC in the inner LAN and use some software (like lighttpd) to do the routing based on other content in the http packets? – Fraser Gorrie Apr 3 '11 at 18:07
oooh, sorry, I thought you just wanted to balance load between multiple (identical) servers. Given your restrictions you'd need to have something that routes the requests based on URLs. Rather than a router you'd use a cheap linux machine with two interfaces doing the NAT and also acting as a proxy to your two servers based on URLs. (A dedicated piece of hardware from a company called f5 can do this, but it's WAY overkill for this (and probably well beyond your budget) – Brian Roach Apr 3 '11 at 18:18
Good idea. Brian. Let that PC do the work of the router to the group as well as routing to the right equipment based on URL. Nice. I don't work with limux, alas, but I get the idea and will do something similar with windows (XP or 7). Thanks – Fraser Gorrie Apr 3 '11 at 18:28

What you describe is called a reverse Proxy: One Address to the outside, multiple Addresses on the inside.

Setting this up with e.g. Squid is somewhat tricky, but you should be able to find some examples in the net. Note that reverse proxy works only with http (>=1.0) and uses DNS-Names.

share|improve this answer

@TurboJ:Thanks for your thoughts, Turbo J.

I have since come up with another solution which may deal with all of the issues and it builds on the ideas of @BrianRoach while eliminating the need for a PC: install dd-wrt on Rtr-2 and load lighttpd on an USB thumb drive off the router. Then when I go through the hoops to make this active (for the router is a linux box) I can use specially formed URLs to get to each piece of equipment. For example (after port forwarding from Rtr-1) to go to the first piece of equipment, etc. lighttpd will strip away the /EQ1 from the URL before forwarding to the destination equipment's webserver.

share|improve this answer

Your Answer


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.