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 LAN with multiple PCs and some servers. I would like to provide access to one of the servers from outside the LAN. The problem for me is I have one IP address for the whole LAN. The server is running under Apache. I set a virtual host for my IP address with some port added. How allow to use the IP with this port outside the LAN?

share|improve this question

closed as off-topic by Dave M, Ward, TheCleaner, Mark Wagner, Falcon Momot Mar 29 '14 at 6:23

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions must demonstrate a minimal understanding of the problem being solved. Try including attempted solutions, why they didn't work, and the expected results. See How can I ask better questions on Server Fault? for further guidance." – Dave M, Ward, TheCleaner, Mark Wagner, Falcon Momot
If this question can be reworded to fit the rules in the help center, please edit the question.

up vote 5 down vote accepted

You want network address translation (NAT) for your LAN: source NAT for your clients, destination NAT for your servers. Your LAN firewall probably provides this capability.

Then, you need to configure your firewall to forward ports 80 and/or 443 from the external IP address to your server's LAN IP address.

share|improve this answer
Also note that you do not want traffic traversing multiple NAT devices. If you already have a NAT device between your network and the Internet, adding another NAT device in that path can cause problems. It may be possible if the NAT is only between one subnet and another, and neither subnet uses said NAT device (but possibly another NAT device) to access the Internet. – Calrion Mar 27 '14 at 22:26
@Calrion And why is that? Granted, NAT sucks in general, but most corporate networks I've worked on have double, or even triple NATs in place. In fact, in some situations, double NAT is the recommended practice... at least until IPv6 gains real traction and widespread usage. – HopelessN00b Mar 28 '14 at 0:53
@HopelessN00b Certain protocols, mostly those that already have trouble negotiating one NAT (like SIP), break; if you're not using those protocols, it can work. It still sounds like the way of pain, to me. One thing I will say (not suggesting this directly applies to you) is that using NAT with IPv6 is doing it wrong—you simply shouldn't need it. – Calrion Mar 28 '14 at 20:52

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