Search code examples
iplocalhostip-addresslan

Being able to use router's global address from its LAN?


It was hard to word the title, so let me clarify. I've been messing around with Wampserver and to test the website from an external source I have to rely on my cellphone; however, I want to be able to use the computer I'm running the server on. So instead of typing local ip address and seeing the website, I want to be able to type the global ip address. Right now, it just times out if I do that. When I use global IP address from the computer I have the server running on, it fails to connect due to being unable to properly resolve the address. I've tried editing the localhost file to see if I can get something to work, but so far no luck. I use Windows 8 and I have an Arris router.

I want this capability for easier testing, rather than using my cell phone to see if it's loading properly for an external client.

Is it even possible? If it is - how?


Solution

  • this is more a feature then a bug and it has to do with a way most routers handle traffic going through NAT (and port forwarding). Most commonly the port forward will be done only when the traffic flows through the router from the outside interface to the inside interface. Some routers have something called NAT reflection or NAT loopback which allows them to do the port forwarding when you are sending packets from your own IP.

    But you don't need to worry about that or even test the page as outside client if your port forwarding works correctly, which you have confirmed, or you don't have any firewalls etc. I don't know exactly what are you testing, but if it is the web server itself there won't be any real difference weather you test from outside or inside, the response will be the same, so you can do this from your local network.