Static routing lab: build routes on a small network in your browser

The first networking lab: four machines, built inside the student’s one Ubuntu VM, h1 and h2 as hosts and r1 and r2 as routers running FRRouting. The routers only know the networks they are connected to, so a ping from h1 to h2 fails, and the student has to find out why and fix it with static routes.

There is no Cisco licence and nothing to install: every router is a network namespace with its own FRRouting, and the console is vtysh, the one students meet on real equipment.

What students learn

How a packet crosses routers: using traceroute -n and ip route on a host and show ip route on a router to find where a packet stops, adding static routes on the routers that need them and only those, and checking the path with ping and traceroute. A management network behind r2 must stay unreachable from h1, so they add the routes the lab asks for and nothing wider. They save every router with write memory.

The topology

h1 connects to r1, r1 to r2 and r2 to h2, with a management network on a fourth link behind r2. The addresses are in the README the lab leaves in the home folder, which says what to do and gives none of the answers.

Run it in your browser

VM labs are set as a lab task in a module, and the sample is on the lab’s page.

  1. Add the lab. In a module you teach, add a task and choose the Ubuntu VM lab card. The page shows a short description of the machine instead of a compose file.
  2. Start from the sample. The page offers three networking labs to start from. Choose Networking lab 1: static routing. Using a sample replaces the text, and Undo brings yours back.
  3. Publish and start your own copy. Publish, then Start. The lab’s own setup script installs FRRouting and builds the topology from Ubuntu’s archive the first time the VM starts, in about ten seconds.
  4. Open the terminal. Open its terminal and read README.md in the home folder: it says what to do and gives none of the answers. netlab status lists the machines and netlab shell r1 opens a router’s console.

A basic lesson on this lab

Static Routing Basics is a small lesson worked in this lab, which is an Ubuntu VM: each step is explained and has a Run button that types its command into the machine’s terminal and shows what the router answered. A student meets the machines, pings the router next door, tries to cross the network and fails, reads the router’s table to see why and watches where a packet stops with traceroute.

They look around and leave the lab’s own task, making the network work, to the student, so the lesson hands out no answers. A free personal account is given it on the Basics module, which is on Home, every college can copy it from the Library’s Basics folder, and a new college opens with it in a module called Networking Basics (Sample). They are deliberately small: they show a teacher what a lesson worked in a lab is, and the lab does the rest. Copy one into a module of your own to change it.

How it is marked

The lab has a check. It runs on a copy of the saved machine after a fresh start, so it sees only what the student saved with write memory, and it passes only if the real state holds: the static routes are saved in vtysh on both routers, h1 reaches h2 along the path through the routers, and the management network stays unreachable. A route typed with ip route and never saved does not pass, and the first line of what the check printed says why.

  1. Hand it out. Assign the lab like any task, with a due date if you want one. Each student gets a VM of their own, kept between sessions.
  2. Run the check. On a student’s row in the class list, press Run the check. It starts a copy of their saved machine that is not saved back, runs the lab’s check script as root and shows whether it passed, what it printed and when. The student is not told the result.
  3. Mark it. Read what the check printed. When a student stops their VM the class list also shows what they changed, the packages they installed and the files they wrote, so you can mark without starting it. Send the work back with a reason if it needs more.

The definition on GitHub

The file is the whole lab definition, the same text the platform runs: size, setup script, topology, README and check. Copy it and change the topology to make your own: one line for each router, host and link.

Questions people ask

Do students need a router or a Cisco licence?
No. The routers are network namespaces in the student’s VM, each running FRRouting, an open-source routing suite, with the vtysh console.
Can a student use the real Linux networking commands?
Yes, which is the point. sudo ip netns exec h1 ping 10.0.3.2 and sudo vtysh -N r1 work as written, and netlab shell r1 is a shortcut.
What is the difference between static routing and OSPF?
In the static routing lab the student adds each route by hand on the routers that need it and saves it with write memory. In the OSPF lab the routers learn the routes from each other in area 0, and the check looks for routes that OSPF learned.