简体   繁体   English

无法通过LAN IP访问同一台计算机上的本地网站

[英]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 . 我在本地IIS中创建了一个网站,我可以通过http:// localhosthttp://127.0.0.1而不是http://192.168.1.101进入同一台计算机上的网站。 In my website's binding setting I assigned *:80 to the website. 在网站的绑定设置中,我为网站分配了*:80。

My machine is behind a router, 192.168.1.101 is LAN ip. 我的机器在路由器后面,192.168.1.101是LAN ip。

Anybody knows why it doesn't work with the LAN ip? 有人知道为什么它不适用于LAN ip吗?

Please specify which type of IP address each is instead of typing them out next time. 请指定每个IP地址的类型,而不是下次再键入。 Assuming by LAN ip, you are referring to your ipv4 address, here is why: ipv4 addresses are slightly different than the localhost address. 假设通过LAN ip,您指的是ipv4地址,这是为什么:ipv4地址与本地主机地址略有不同。 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. 您还应该注意,您的外部IP地址与ipv4地址不同,后者与ipv6地址不同,而ipv6地址与本地主机不同。 In many instances ipv4 and localhost are used for the same thing, however they are not the same. 在许多情况下,ipv4和localhost用于同一事物,但是它们并不相同。

Here are some articles that explain the differences: 以下是一些说明差异的文章:

http://www.howtogeek.com/140943/whats-the-difference-between-the-locahost-and-local-ip-address/ 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 https://superuser.com/questions/414050/why-is-there-a-difference-between-ping-localhost-and-ping-local-ip-address

localhost vs real ip address 本地主机与真实IP地址

https://superuser.com/questions/196893/difference-between-localhost-and-the-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 127.0.0.1和localhost有什么区别

https://en.wikipedia.org/wiki/Localhost https://zh.wikipedia.org/wiki/本地主机

https://superuser.com/questions/897699/what-is-the-difference-between-127-0-0-1-and-my-assigned-ipv4-address 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. 打开防火墙上的IP地址和端口。

The localhost and 127 loopback address loop back within the machine. 本地主机和127回送地址在计算机内回送。 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. LAN IP-数据包发送到LAN,路由器和其他网络设备,然后返回到您的计算机。 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. 很多时候,它是防火墙-本地PC防火墙或网络防火墙。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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