我已经读到,限制一个网站在IIS8的IP只允许一个或多个IP和否认其他人,你这样做:
(如下图所示)
但是,当我这样做(如下面的截图所示),我仍然能够从其他IP访问该网站。
这里缺less什么? 还有什么其他的,需要做的?

我试过iisreset,页面没有浏览器caching在testing机器上,应该没有访问权限。
如果安装IIS Windowsfunction下的IP安全性,你可以添加到你的web.config来阻止IP:
<location path="Default Web Site"> <system.webServer> <security> <ipSecurity allowUnlisted="false"><!-- this line blocks everybody, except those listed below --> <clear/> <!-- removes all upstream restrictions --> <add ipAddress="192.168.100.1" /> <add ipAddress="169.254.0.0" subnetMask="255.255.0.0" /> </ipSecurity> </security> </system.webServer> </location>
我发现了一个适合自己情况的工作。
情况:需要阻止networking上的IP,但允许IIS访问服务器本地应用程序的网站。 偶尔个人和整个子网访问IIS网站。
问题:将“编辑function设置”设置为“拒绝”无法正常工作。 它不尊重“允许”列表。 什么,本地或networking,都被允许访问托pipe的网站。
解决方法:在“允许”处保留“编辑function设置”。 “允许/拒绝”列表的最后一项是“拒绝”到完整的子网。 本地服务器IP的“允许”条目在子网“拒绝”之前。 任何允许访问的子网上的个人计算机在“拒绝”之前的“允许”条目为完整的子网。
你有客户端和你的IIS服务器之间的代理吗? 您可以在IIS日志中显示您的客户端将使用哪个IP。
经过大量的搞乱之后,我发现以下工作对我来说(赢得服务器2012 R2上的IIS 8.5.X)
确保为web.configpipe理启用function
(在我的情况下它是只读的,这是问题)
然后编辑web.config以包含
<system.webServer> <security> <!-- this line blocks everybody, except those listed below --> <ipSecurity allowUnlisted="false"> <!-- removes all upstream restrictions --> <clear /> <add ipAddress="XXXX" allowed="true" /> <add ipAddress="127.0.0.1" allowed="true" /> </ipSecurity> </security> </system.webServer>
其中XXXX是您希望允许的IP(为您希望允许的每个IP或IP子网组合添加一行这样的行)
值得注意的是,文档似乎错过了允许的=“真”,并且提到了允许该function被委派的要求 。 感谢@Summit 这里的提示