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
tracerouteandip route get
Topology
| Node | Image | CPUs / memory | Addresses | Role |
|---|---|---|---|---|
h1 | debian-13 | 1 / 1GiB | mgmt 10.113.0.11; lan 192.168.1.10/24 | Host in LAN 1 |
r1 | debian-13 | 1 / 1GiB | mgmt 10.113.0.12; lan 192.168.1.1/24; wan 172.16.13.1/30 | Router for LAN 1 |
r2 | debian-13 | 1 / 1GiB | mgmt 10.113.0.13; wan 172.16.13.2/30; lan 192.168.2.1/24 | Router for LAN 2 |
h2 | debian-13 | 1 / 1GiB | mgmt 10.113.0.14; lan 192.168.2.10/24 | Host in LAN 2 |
Before you start
bash
vz image pull disk debian-13Run it
bash
cd examples/13-static-routing
vz validate
vz up
vz node ls
ssh lab@10.113.0.11 # password: labFirst 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