验证 IPv6 网络掩码
正如我们有管理 IPv4 网络掩码有效性的规则一样,IPv6 是否有自己的一套规则来限定网络掩码?
谢谢!
Just as we have rules governing the validity of an IPv4 netmask, does IPv6 have its own set of rules to qualify a netmask?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您的用例是什么?通常在 IPv6 中,您的地址将根据路由器提供的 /64 前缀自动生成。
您通常不会看到 IPv6 中写出的网络掩码。通常您会看到前缀长度。例如:
网络掩码为
但您只能看到前者。
What is your use case? Normally in IPv6 your addresses will be auto-generated from a /64 prefix your router provides.
You don't usually see a netmask written out in IPv6. Usually you will see a prefix length. For example:
would have a netmask of
But you would only ever see the former.
从技术上讲,更好的答案可能是使用 IPv6,您不再拥有网络掩码。对于 IPv6,您有一个“前缀长度”,您可以将其解释为等效网络掩码中 1 的位数。
采用“前缀长度”的概念,您不再需要有“网络掩码规则”,尽管几乎只有一个:网络掩码应该仅由左对齐的连续 1 位组成。
Technically the better answer may be that with IPv6 you no longer have a netmask. With IPv6 you have a "prefix length" which you can interpret as the number of 1 bits in an equivalent netmask.
Taking the concept of "prefix length" you no longer have to have "netmask rules", although there pretty much is only one: the netmask should consist of only left aligned contiguous 1 bits.