简体   繁体   中英

Can't access local website on the same machine through LAN IP

I created a website in my local IIS, I can get into my website on the same machine through http://localhost and http://127.0.0.1 , but not http://192.168.1.101 . In my website's binding setting I assigned *:80 to the website.

My machine is behind a router, 192.168.1.101 is LAN ip.

Anybody knows why it doesn't work with the LAN ip?

Please specify which type of IP address each is instead of typing them out next time. Assuming by LAN ip, you are referring to your ipv4 address, here is why: ipv4 addresses are slightly different than the localhost address. I am not sure that this is the exact reason for your circumstance because the question was a bit unclear. You should also be aware that your external IP address is different than your ipv4 address, which is different from your ipv6 address, which is different from the localhost. In many instances ipv4 and localhost are used for the same thing, however they are not the same.

Here are some articles that explain the differences:

http://www.howtogeek.com/140943/whats-the-difference-between-the-locahost-and-local-ip-address/

https://superuser.com/questions/414050/why-is-there-a-difference-between-ping-localhost-and-ping-local-ip-address

localhost vs real ip address

https://superuser.com/questions/196893/difference-between-localhost-and-the-ip-address

What is the difference between 127.0.0.1 and localhost

https://en.wikipedia.org/wiki/Localhost

https://superuser.com/questions/897699/what-is-the-difference-between-127-0-0-1-and-my-assigned-ipv4-address

I hope this helps you to fix your issue!

Probably a firewall issue. Open your IP address and port on firewall.

The localhost and 127 loopback address loop back within the machine. The packets do not go out to LAN.

LAN IP - the packets go out to LAN, to router and other networking stuff, and then come back to your machine. The intermediaries - the router, firewall etc may have policies blocking those packets. Many times it is the firewall - either local PC firewall OR the network firewall.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM