Validating IPv6 netmask

大憨熊 提交于 2019-12-10 11:13:56

问题


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!


回答1:


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:

2001:db8:0:160::/64

would have a netmask of

ffff:ffff:ffff:ffff::

But you would only ever see the former.




回答2:


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.



来源:https://stackoverflow.com/questions/7765125/validating-ipv6-netmask

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!