# Can't connect to website using external IP



## Spotsilver (Apr 24, 2008)

Hi there,
I'm trying to connect to a website hosted from my home computer using wampserver, however I can only access it either by typing 'localhost' or '192.168.2.2' in my browser. If I go to my external ip, 81.96.32.204, it takes me to the Belkin router setup page. Here's the weird thing, if I type my external IP into a proxy then the website I wanted to see appears, does anybody know why this is, or how I can fix it?
I'm on Windows XP SP3 with a Belkin F5D7231-4, version 1103UK Wireless G Router, and have port 80 forwarded on my router virtual servers list.
Thank you in advance for your help.
Bri.


----------



## steelmans1980 (Jun 14, 2008)

If your server is behind a router, then most likely you are not visible to the outside world.
If you want, I can suggest trying an openvpn account from your machine, where you would get the public ip on the machine itself, and no longer need the router public ip. Check http://publicip.info


----------



## Spotsilver (Apr 24, 2008)

Thanks for the reply, the problem lies more with me not being visible to myself. Everybody else can view my website from my external IP but me, I have to use the internal IP to view it.


----------



## steelmans1980 (Jun 14, 2008)

I believe that would happen if your traffic is Natted outside through the router, and the router is natting inside the web server port. 
What happens in this scenario is the following:
1- you request opening a webpage (your site in this case). 
2- Router receives your request on the Natted interface, and will nat it outside, by changing the source IP to its IP , then sending the request out through the public interface. 
3- Router here would not parse the 'nat inside' rule, as it's trying to 'nat outside' the packet, and would then not be able to process your request
4- Your browser ends up not receiving any response. 

This scenario is typical for a cisco 2811 router. I'm not sure what you are using, but for instance an ISA firewall does not have this issue.

The solution I can think of is updating your LMHOSTS file to resolve the website name to your local ip before trying to go to your router


----------



## Spotsilver (Apr 24, 2008)

steelmans1980 said:


> I believe that would happen if your traffic is Natted outside through the router, and the router is natting inside the web server port.
> What happens in this scenario is the following:
> 1- you request opening a webpage (your site in this case).
> 2- Router receives your request on the Natted interface, and will nat it outside, by changing the source IP to its IP , then sending the request out through the public interface.
> ...


Thanks for the response. How would I go about updating my LMHOSTS file to do that?


----------



## steelmans1980 (Jun 14, 2008)

actually, Hosts file can do it, 'cause LMHosts is for netbios, while hosts is for TLDs
The file is located here: C:\windows\system32\drivers\etc\hosts
if it doesn't exist create it

a simple example:
192.168.0.1 google.com

This feature has priority over DNS, so your OS will look there first, if it's found, it won't go to DNS. 

for more info on LMHosts:
http://en.wikipedia.org/wiki/HOSTS_file

:wave:


----------



## Spotsilver (Apr 24, 2008)

I added these two lines to my host file, saved and rebooted and the two links still show the router setup page, are they correct?

192.168.2.3	orals.ath.cx
192.168.2.3	81.96.32.204


----------



## steelmans1980 (Jun 14, 2008)

yes, the 1st one is correct. The 2nd one will not work, because it's an IP address, that doesn't invoke name resolving services. 

If you ping orals.ath.cx now, does it show IP and reply from 192.168.2.3?


----------

