There are a number of RFC’s on this but the most recent, 5952, is the one that should be honored at this point. Here’s a breakdown of what you should be doing when typing out IPv6 addresses in your config, servers, routers, documentation, etc.:
- Leading zeroes in a non-zero field MUST be left off. This means if your 16-bit field is 0001, it needs to be written as simply 1 and cannot be written as 0001, 001 or 01.
- If you have adjacent fields of zero in the address, the LARGEST grouping MUST be shortened to :: and no other field shortened. This means that if your address is 2001:db8:0:0:0:1:1:1 it should be represented as 2001:db8::1:1:1. If your address were 2001:db8:0:0:1:0:0:0 then you do not get to do 2001:db8::1:0:0:0 or 2001:db8::1::, it MUST be represented as 2001:db8:0:0:1::.
- If there are multiple consecutive zero fields, the LEFTMOST field is the one that gets shortened. So 2001:db8:0:0:1:0:0:1 can only be represented as 2001:db8::1:0:0:1.
- You CANNOT use the :: representation for a single field; so 2001:db8:0:1:0:1:0:1 cannot have :: replace one of the zero fields.
- Letters should ALWAYS be represented in lowercase.