通过 IP 地址范围/域限制对网站的访问
我想了解如何根据客户端 IP 地址限制对 weba 应用程序(使用 .net 2.0 和 II6)的访问的最佳方法。我正在考虑的两种方法:
1)通过服务器端代码 - 根据 web.config 中的 IP 地址列表检查客户端 IP。
2) 通过 IIS 创建虚拟目录并限制该虚拟目录上的 IP 地址。
我的问题是,如果我采用虚拟目录路由,则会有很多用户访问该网站,并且我已经读到,在每个客户端请求期间进行的反向域查找可能会在服务器资源上非常昂贵。这有多少风险?
任何其他建议/想法将不胜感激,
谢谢,
I would like advice on the best way to restrict access to a weba pplication (using .net 2.0 and II6) based on the clients IP address. The two ways I am considering:
1) Through the server side code - check the client I.P against a list of IP addresses within the web.config.
2) Through IIS by creating a virtual directory and restricting the I.P addresses on this virtual directory.
My question is if I go the virtual directory route there are a lot of users that access this website and I have read reverse domain lookups made during each client request can be very expensive on server resources. How much of a risj is this?
Any other suggestions /ideas to doing this would be much appreciated
Thanks advance,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您选择第二条路线(虚拟目录),除非您过滤域名,否则不会进行任何反向查找。如果您受到 IP 地址(或地址范围)的限制,则这永远不会发挥作用。
请参阅此 MS 公告底部的内容:
If you go the second route (virtual directory), there will not be any reverse lookups done unless you filter on domain names. If you are restricting by IP addresses (or ranges of addresses), this never comes into play.
See the bit at the bottom of this MS bulletin: