Calculating all addresses within a subnet…for IPv6

前端 未结 4 1259
失恋的感觉
失恋的感觉 2021-01-02 17:26

I have seen plenty of great C# examples which demonstrate how to convert IPv4 addresses provided in CIDR notation (e.g. 192.168.0.1/25) into their relevant ranges (192.168.0

4条回答
  •  一生所求
    2021-01-02 18:05

    I know this post is 5yr old, but given the Google capabilities it may as well have been updated this morning. So, I'll add a bit of clarification from the network engineering perspective.

    It depends on what kind of addresses. If you mean every address in the range, then the above discussion is correct. If you mean addresses that can be uniquely assigned to a node in the subnet ("unicast" addresses), be aware that in IPv6 (a) there is no broadcast, and (b) there is a substantial multicast range.

    Basically: [subnet]:ff:: is reserved for multicast. If you're not using a /64 for a subnet mask, you REALLY want to be careful because it goes against a fundamental assumption is many IPv6-related RFCs. There's other RFCs out that caution against using the all-zeros host address (but I'm not aware of a specific requirement to that effect).

    So, for a /64 subnet, that means the range of unicast addresses is ::0:0:0:1 through ::feff:ffff:ffff:ffff.

    See here for discussion: http://www.tcpipguide.com/free/t_IPv6MulticastandAnycastAddressing.htm

    weylin

提交回复
热议问题