Labs / First Contact / IP routing

Lab 2 of 3 · IP routing

Static routes, by hand

Type routes by hand, then add a backup route that takes over on failure.

Open this lab Pro 7 steps

The idea

A laptop behind branchRouter, servers behind hqRouter, two links between the two routers. They know only their own networks until you type their routes: there and back, one address, a backup that floats, and a default.

A route there is not a route back
A route there is not a route back
A dead link that looks alive
A dead link that looks alive

Steps

  1. Only its own networks

    Before typing routes, see what a router does without one. No routes are typed in yet; the laptop pings the web server, 10.0.2.10, behind both routers.

    branchRouter:~# vtysh -c 'show ip route'
    laptop:~# ping -c1 -W2 10.0.2.10
  2. A route, and the way back

    A route typed by hand is a static route: it never changes unless someone edits it. branchRouter gets one: 10.0.2.0/24 goes to hqRouter, 10.0.12.3, the next hop. hqRouter gets no route back yet.

    branchRouter:~# vtysh -c 'configure terminal' -c 'ip route 10.0.2.0/24 10.0.12.3'
    laptop:~# ping -c1 -W2 10.0.2.10
    hqRouter:~# vtysh -c 'configure terminal' -c 'ip route 10.0.1.0/24 10.0.12.2'
    laptop:~# ping -c1 -W2 10.0.2.10

Pro

5 more steps in the app

  1. The longest match wins
  2. The floating static
  3. When the primary fails
  4. A dead link looks alive
  5. A default route, far away
Get Pro

Learn it on real machines.

Every lab is a small network of real Linux machines in your browser. Start with a free account: Google or email, no card.

Open this lab