Routers and Forwarding inside and outside the network.
September 7, 2005 9:57 AM   Subscribe

Routers: This may seem rather silly to some folks, but I need a little help in figuring out what my network problem is. (I tried to google around, but i am not even sure what the term is that I should be searching for) The problem is, I am hosting my own web-server and MySQL DB for development purposes, and I have a domain name that points to it. When I am outside my own network I can hit my URL just fine. But when I inside my network, it always try to go to the routers configuration page. Any ideas as how to make sure the router is forwarding the ports correctly INSIDE my network?
posted by countzen to Computers & Internet (7 answers total)
You should probably mention what kind of router this is. Though, it doesn't really matter, because you should just be using the address of your web server's internal address if you're inside the local LAN. I doubt most routers think it's necessary to forward packets if they come from the LAN.
posted by angry modem at 10:19 AM on September 7, 2005

I'm betting your server has an internal address that's different from the external address, and that internal address is the one that's overriding the resolution for your home machine. If you add a line to your hosts file so that internal queries for that URL get properly routed to that server from your home machine, you should be Ok.
posted by thanotopsis at 10:35 AM on September 7, 2005

If you're using NAT, then you probably need to edit your hosts file and point the domain name to the internal IP of the machine running the servers.

The relevant file is at /etc/hosts on Linux and c:\windows\system32\drivers\etc\hosts on Windows NT/2000/XP systems.
posted by Goblindegook at 11:06 AM on September 7, 2005

My guess is that you are using an external DNS server. If that's the case, attempting to pull up from inside the network requires a DNS query to traverse the router. The IP address it gets (likely a port-address-translation on the router's IP address) is only accessible from outside. Instead of an error, your router chops of the port and just shows you its configuration page.

A simple fix for this would be to add a static entry to the end of the hosts file of any machine on the inside network. Just map the server's private (inside) IP address to the URL that you use from the outside. The hosts file is located at /etc/hosts on *NIX OSes, and at \Windows\system32\drivers\etc\hosts on in Windows OSes.

An example entry would be:

posted by pmbuko at 11:08 AM on September 7, 2005

...edit the hosts of any machine on the inside network that needs access to the server.

on (non-existent) preview: what reponders 2 and 3 said.
posted by pmbuko at 11:13 AM on September 7, 2005

Some home router/firewalls block "loopback" which is what you probably need to allow internal requests to the external IP address. On my linksys, I think they call it "Filter Internet NAT Redirection, " which, in your case, you'd want turned off.

The idea of aliasing it in the hosts file isn't a bad one either.
posted by Good Brain at 2:01 PM on September 7, 2005

Let me just add that you can run a caching-only nameserver (bind or Windows DNS or whatever) and set up a static entry for the server. Let your internal hosts use that DNS server, and then you've got it all centralized. Internal hosts use the internal address, external hosts use the external address.
posted by RikiTikiTavi at 9:32 PM on September 7, 2005

« Older I want to visit a very interesting factory and be...   |   iBookG4--can anyone help me decipher the lingo and... Newer »
This thread is closed to new comments.