Study FAQ
How do I compare IPv6 prefixes when the addresses use double-colon compression?
Also asked as 2
- How do I tell whether compressed IPv6 addresses share a prefix?
- How does expanding compressed IPv6 notation help identify the network prefix?
Answer
Expand each IPv6 address to eight groups of four hexadecimal digits, then compare the number of leading bits given by the prefix length. A double colon replaces one continuous run of zero groups and may appear only once per address. Leading zeros within each group are also optional.
For example, 2001:db8:10:20::5/64 expands to 2001:0db8:0010:0020:0000:0000:0000:0005/64. A /64 covers the first four complete groups, so the network prefix is 2001:db8:10:20::/64. The address 2001:db8:10:21::5 is outside that prefix. If a prefix cuts through a hexadecimal digit, compare only the leading bits of that digit that fall inside the prefix. On many IPv6 LANs, /64 is used for Stateless Address Autoconfiguration (SLAAC). Use the actual configured prefix when verifying a link.
References
Full explanation
IPv6 Addressing, Prefixes, and Address Types
Study guide · 200-301
Read the full explanation