Skip to content

13 Static routing ​

Two networks joined by two routers with hand-written routes. Follow a packet hop by hop.

What you practice ​

  • IP forwarding on a Linux router
  • Static routes in cloud-init network-config
  • Reading traceroute and ip route get

Topology ​

NodeImageCPUs / memoryAddressesRole
h1debian-131 / 1GiBmgmt 10.113.0.11; lan 192.168.1.10/24Host in LAN 1
r1debian-131 / 1GiBmgmt 10.113.0.12; lan 192.168.1.1/24; wan 172.16.13.1/30Router for LAN 1
r2debian-131 / 1GiBmgmt 10.113.0.13; wan 172.16.13.2/30; lan 192.168.2.1/24Router for LAN 2
h2debian-131 / 1GiBmgmt 10.113.0.14; lan 192.168.2.10/24Host in LAN 2

Before you start ​

bash
vz image pull disk debian-13

Run it ​

bash
cd examples/13-static-routing
vz validate
vz up
vz node ls
ssh lab@10.113.0.11        # password: lab

First boot installs packages; give it a minute or two after vz up returns.

Try it ​

bash
ssh lab@10.113.0.11 'traceroute -n 192.168.2.10'     # h1 -> r1 -> r2 -> h2
ssh lab@10.113.0.12 'ip route; ip route get 192.168.2.10'
ssh lab@10.113.0.13 'sudo ip route del 192.168.1.0/24'
ssh lab@10.113.0.11 'ping -c 2 -W 1 192.168.2.10'    # the reply has no way back
ssh lab@10.113.0.13 'sudo ip route add 192.168.1.0/24 via 172.16.13.1'

Notes ​

Every node also has a mgmt NIC on a NAT switch: out-of-band access from the Mac and package downloads. The exercise traffic stays on the links.

Clean up ​

bash
vz down
vz destroy --yes   # deletes the overlays and state of this lab