OSPF lab: bring up dynamic routing on three routers in your browser

The second networking lab: five machines inside the student’s one Ubuntu VM, h1 and h2 as hosts and r1, r2 and r3 as routers running FRRouting, each with its OSPF daemon started and nothing configured. Nobody has any routes, so the first ping from h1 to h2 fails, and the student has to configure OSPF in area 0.

What students learn

Watching OSPF work before configuring it: tcpdump on the link between r1 and r2, filtered to IP protocol 89, is quiet until the routers are told to speak, and then shows what a router says to its neighbours and how often. Configuring OSPF in vtysh on three routers in area 0 so every router learns every host network, waiting for every adjacency to be Full with show ip ospf neighbor, and working out what OSPF is waiting for and how an interface can be told it has only one neighbour.

Then checking the result with show ip route ospf and traceroute -n, and keeping the management network behind r3 out of the advertisements so that h1 cannot reach it.

The topology

h1 connects to r1, r1 to r2, r2 to r3 and r3 to h2, with a management network on a link behind r3. The addresses are in the README the lab leaves in the home folder.

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. An adjacency on links like these takes about forty seconds to reach Full.

  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 2: OSPF. 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

OSPF 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, tries to cross the network and fails, and asks the router whether OSPF is on and what it has been told.

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 check runs on a copy of the saved machine after a fresh start, so it sees only what the student saved. It passes only if the OSPF neighbours are Full, h1 reaches h2 along the path through the routers over routes OSPF learned, and the management network is not advertised and stays unreachable.

  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. Copy it to make your own topology: daemons ospfd starts the protocol on every router.

Questions people ask

Why does it take about forty seconds for the neighbours to be Full?
On links like these OSPF takes about forty seconds to bring an adjacency to Full. What it is waiting for, and how to tell an interface it has only one neighbour, is part of the lab, so this page does not give the answer away.
Which area do students use?
Area 0 for all three routers, the backbone, which is what the check expects.
Can I practise OSPF without Cisco equipment?
Yes. The three routers are network namespaces in the student’s VM, each running FRRouting, and the console is vtysh. The lab is marked on the real state: the neighbours are Full, h1 reaches h2 over routes OSPF learned, and the management network is not advertised.