Which Route Does a Packet Take?
Support tickets come with a saved ip route output, and people answer "which way does traffic to X go?" by eye, often wrongly. /home/student/routes.txt is an example.
Create the executable script /home/student/bin/route-for.sh FILE IP that reads an IPv4 table in ip route format and prints the route the kernel would pick for IP:
default is 0.0.0.0/0); among equally long ones, the lowest metric (no metric means 0); if still tied, the first in the file,via <gateway> dev <device> for a route with a gateway, dev <device> for a directly connected one, or just the type for blackhole, unreachable and prohibit routes,unreachable and exit 1; otherwise exit 0.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: Configure the DNS Resolver
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.