Internet Protocol version 6 (IPv6) addresses consist of eight groups of hexadecimal quartets separated by colons.
Fortunately, you can shorten IPv6 addresses by eliminating zeros. There are two rules that you must follow when condensing an IPv6 address.
First, you can use
:: to indicate you removed one or more groups of four consecutive zeros (0000). The final shorthand address can only contain one set of double colons. Using this rule alone, we can condense our example address to:
The second rule lets you make this address shorter. Now, you can remove any leading zeros in a group until the group starts with something other than zero, or is the final numeral left as a placeholder for the group.
Starting with our previous example:
Notice that in each line we stripped away the leading zero from each section. The section of zeros that were separated from the other groups of zeros is now notated as a single zero (because IPv6 only allows a single set of double colons).
For more information, see What is IPv6?