阻止 IP 访问站点
这更像是一个概念问题而不是代码问题,但我认为无论如何都会有人能够解释它。
我知道可以将 IP 地址列入黑名单/阻止其访问站点,但是如果用户拥有动态 IP 地址,这将如何工作?这是否意味着当 IP 更新后,用户将能够使用新的公共 IP 访问该网站?
也许我的概念是错误的,但任何信息都会有帮助。
谢谢!
This is more of a concept question than a code question, but I think someone will be able to explain it, anyhow.
I know that it is possible to blacklist/block an IP address from accessing a site, but how does this work if the user has a dynamic IP address? Wouldn't this mean that when the IP is renewed that user would be able to access the site under the new public IP?
Maybe I have the concept down wrong, but any information would be helpful.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果您只是希望阻止“滋扰用户”以及阻止他们的 IP,您还可以在他们的计算机上放置 Cookie,以在他们的浏览器中强制执行禁令(然后在每次后续访问尝试时,阻止新的 IP)。
当然,这很容易规避,但最终您无法识别访问者,因为他们可以很容易地使用不同的连接、不同的浏览器,甚至不同的物理设备。
您能做的最好的事情就是对普通的滋扰型访问者实施禁令,并希望您的网站一开始就不会特别吸引这类人。
If you are just wishing to block "nusisance users", as well as blocking their IP you could also place a Cookie on their machine to enforce the ban in their browser (then with each subsequent access attempt, block the new IP).
This, of course, would be fairly easy to circumvent, but ultimately there is no way for you to identify a visitor as they can very easily use a different connection, a different browser, or even a different physical device.
The best you can do is enforce bans against average nusisance visitors, and hope your website doesn't particularly attract that sort of person to begin with.
是的,就是这个意思。这将是一个不同的 IP,因此您不会知道它是同一个用户。您唯一可以看出的是,它们是同一个 ISP。这对你没有多大帮助。
这就是 IP 封锁很容易被绕过的确切原因。即使您阻止了他们的所有 IP,他们也可以只使用代理。
Yes that's what it means. It will be a different IP so you won't know that it's the same user. The only thing you can tell is that it is the same ISP. Which won't help you that much.
This is the exact reason that IP-blocking is easily circumvented. Even with you blocking all of their IPs, they could just use a proxy.
“这是否意味着当 IP 更新后,用户将能够使用新的公共 IP 访问该网站?”
是的。这就是为什么当动态分配的 IP 被阻止时,它们通常会在子网基础上而不是在单个基础上被阻止。
这也意味着无辜的一方会被列入黑名单。
"Wouldn't this mean that when the IP is renewed that user would be able to access the site under the new public IP?"
Yes. Which is why when dynamically assigned IPs are blocked they're often blocked on a subnet basis rather than on an individual basis.
That also means that innocent parties get blacklisted.