大网数据广告活动
服务器运维问答

Blocking or rate-limiting IPv6: what size prefix

· 52CE 我爱测

Given that blocking a single IPv6 address would seem to be somewhat pointless as an end user typically has at least 2**64 of them, we need to block a range, which identifies a "site". A "site" in this context is something like a …

问题原文

原帖链接 · Rodney · CC BY-SA 3.0

Given that blocking a single IPv6 address would seem to be somewhat pointless as an end user typically has at least 2**64 of them, we need to block a range, which identifies a "site".

A "site" in this context is something like a home or small office user. RFC 6177 discusses the allocation of address blocks to small sites:

... it might be tempting to give home sites a single /64, since that is already significantly more address space compared with today's IPv4 practice.

However, this precludes the expectation that even home sites will grow to support multiple subnets going forward. Hence, it is strongly intended that even home sites be given multiple subnets worth of space, by default. Hence, this document still recommends giving home sites significantly more than a single /64, but does not recommend that every home site be given a /48 either.

That said, I have read in online discussions that /64 and /56 are both common allocations for domestic users.

If I block a /64, and the attacker has a /56, then they have 255 more subnets to attack me from.

Conversely, if I block /56, and it turns out the ISP allocates blocks of /64, I might also have excluded 255 other users. Now the probability of you actually affecting your traffic by randomly excluding 255 sites is pretty low if you consider a random distribution. However, it is not, by definition random. It is feasible that I could in this sense block a small geographical area where my website is popular.

I use the example of blocking, but really it's a more general question, which extends to rate limiting, analytics etc.

In short, what is the best prefix size to identify a "site"? Are there any guidelines about this?

已采纳解答

原帖链接 · Sander Steffann · CC BY-SA 3.0

The best algorithm is to start blocking separate addresses. Then when multiple addresses are blocked in the same /64 you block the whole /64. Repeat that for bigger aggregates.

Prefixes are usually given out on nibble boundaries (multiples of 4, or one hexadecimal digit). Do you might want to scale from /64 to /60, /56, /52 and /48. A /48 is usually the largest prefix given to a single site.

Depending how careful you want to be you can skip from /64 straight to /56 and /48.

Depending on which region you are in you also might use the regional internet registry's (RIR) public database. In the RIPE database internet providers document the aggregation size they give to customers there. In that case you know exactly what size to use.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2017-07-21)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。