Normalize IPv6 Addresses
Access logs write 2001:DB8:0:0:0:0:0:1, the firewall 2001:db8::1, an old script 2001:0db8:0000::0001. Searching and deduplicating across them is impossible.
Create the executable script /home/student/bin/normalize6.sh that reads one address per line from stdin and prints each in its canonical form (RFC 5952), one per line:
:: (the first one if two runs are equally long); a single zero group stays 0,::ffff:192.0.2.128,%eth0) is kept as it is.Lines that aren't IPv6 addresses print INVALID <line>. Empty lines are skipped. Python 3 is installed.
About this machine
Ubuntu 24.04 with no internet access. You are student with passwordless sudo. The grader checks the final state of the machine, not the commands you typed. Values like names and ports are generated for you.
Part of Networking and TLS in Practice. Next step: Plan IPv6 Subnets for a VPC
Teaching or writing about this? Embed this lab on your page
Your machine is ready to start
A fresh, isolated Ubuntu machine boots in a few seconds with the task already set up.
No account needed: 3 of 3 free tries left. Guest machines last 30 minutes.