Reading IPv6
Lesson 39 of 46 in Coddy's IP Addressing and Subnetting course.
Two rules shrink IPv6 addresses to something humans can read:
- Drop leading zeros in each group:
0db8becomesdb8,0000becomes0. - Replace one run of all-zero groups with
::, choosing the longest run. Only once per address, or it would be ambiguous.
So 2001:0db8:0000:0000:0000:0000:0000:0001 compresses to 2001:db8::1, and the loopback collapses all the way to ::1.
Challenge
BeginnerCompress 2001:0db8:0000:0000:0000:0000:0000:0001 as far as the rules allow and print the result.
Expected output:
2001:db8::1Try it yourself
Terminal
All lessons in IP Addressing and Subnetting
Practice on your own: Terminal playground