Is This IP in One of These Networks?
The deploy script only lets requests through from allowed networks. Its current check compares string prefixes, so 10.10.0.1 "matched" 10.1.0.0/16.
Create the executable script /home/student/bin/in-cidr.sh IP CIDR... that exits:
0 if IP is inside at least one of the networks,1 if it is in none of them,2 if IP or any CIDR is invalid, or no CIDR is given. A network with host bits set (like 10.0.0.1/8) is invalid.It must work for IPv4 and IPv6. An address is never inside a network of the other family. 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.
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.