Linux for network engineers lab 2 of 14
Linux as a router: forwarding, static routes and policy routing
A Linux box replaces the depot's router. You turn on forwarding, send one PC and one application out through a second ISP with `ip rule`, find out why the replies vanish, and fit a backup default route.
Run this lab
It needs Lite: its 6 nodes are set to 6 vCPU and 3,072 MB in total. That fits the free demo too.
In your workspace: Shared, then Linux for network engineers guided labs, then 02 - Linux as a router - forwarding static routes and policy routing
- Level
- Intermediate
- Time
- About 65 minutes
- Nodes need
- 6 vCPU, 3,072 MB
- Smallest plan
- Lite
The scenario
The Hull depot's router has died and there's no budget for another. RTR is a Linux box with three ports: the depot LAN, ISP-A and ISP-B. Task 0 applies the team's hardening baseline, which includes strict reverse-path filtering. Most traffic should use ISP-A. The CCTV PC, H2, uploads footage that must go out through ISP-B, and so must the billing application on TCP 443.
| Device | Interface | Address | Role |
|---|---|---|---|
| H1, H2 | eth0 | 10.2.10.10, 10.2.10.20 /24 | depot PCs, gateway 10.2.10.1 |
| RTR | eth0 | 10.2.10.1/24 | depot LAN |
| RTR | eth1 | 10.2.1.2/30 | to ISP-A (R1 .1) |
| RTR | eth2 | 10.2.2.2/30 | to ISP-B (R2 .1) |
| R1, R2 | Gi0/1 | 10.2.99.1, 10.2.99.2 /24 | head office network |
| SRV | eth0 | 10.2.99.50/24 | head office server, gateway R1 |
| Device | Runs | How to log in |
|---|---|---|
| H1, H2, SRV | Alpine Linux 3.20 | root, no password. |
| R1, R2 | Cisco IOSv 15.9 | The console opens at >; enable has no password. |
| RTR | Alpine Linux 3.16 with iptables and iproute2 | Opens on a menu: press 5, then Enter, for a root shell. |
What you’ll practise
- Turn on IPv4 forwarding at run time and permanently
- Add static routes and prove the path with traceroute
- Build policy routing with ip rule and a named table
- Explain and tune reverse-path filtering
- Route by protocol and port
- Fit a floating default route and see what a link failure removes
The tasks
- Start the Linux nodes
- Turn on forwarding
- Point the depot at ISP-A
- Send the CCTV PC out through ISP-B
- Find out why the replies vanish
- Route by application
- Add a backup default route
The Lab Tasks pane has the scenario, these tasks, the checks to run, hints and the full solution.
Topology and devices
The network as it opens in EVE-NG, drawn from the lab’s own canvas, and the image each node runs.
Every link, as text
- H1
eth0to LAN (network) - H2
eth0to LAN (network) - RTR
eth0to LAN (network) - RTR
eth1to R1Gi0/0 - RTR
eth2to R2Gi0/0 - R1
Gi0/1to HQ (network) - R2
Gi0/1to HQ (network) - SRV
eth0to HQ (network)
| Node | Device | Image in Add Node | Set to |
|---|---|---|---|
| H1 | Alpine Linux | clbalpinebase-alpine-base-3-20-3 | 1 vCPU, 512 MB |
| H2 | Alpine Linux | clbalpinebase-alpine-base-3-20-3 | 1 vCPU, 512 MB |
| SRV | Alpine Linux | clbalpinebase-alpine-base-3-20-3 | 1 vCPU, 512 MB |
| R1 | Cisco IOSv | vios-adventerprisek9-m.spa.159-3.m9 | 1 vCPU, 512 MB |
| R2 | Cisco IOSv | vios-adventerprisek9-m.spa.159-3.m9 | 1 vCPU, 512 MB |
| RTR | Alpine WAN emulator | clbalpinewanem-alpine-3-16-2-wanem | 1 vCPU, 512 MB |
How to open this lab
Sign in to your workspace at
lab.cloudlabbox.com.In File Manager, open Shared, then the folder
Linux for network engineers guided labs.Open
02 - Linux as a router - forwarding static routes and policy routingand start its nodes, then open Lab Tasks for the scenario and the steps.
The lab is read-only. You can start the nodes and configure the devices, but changes to the topology can’t be saved. To change it, rebuild it in your own folder.
More Linux for network engineers labs
All Linux for network engineers labs
Related labs in other courses
CloudLabBox is independent of Cisco, CompTIA, the Linux Foundation and the Linux Professional Institute. The lab follows exam topics and isn’t vendor training material; vendor names identify the exams and the images in the workspace.