Linux for network engineers lab 4 of 14
Network namespaces and veth pairs
One Linux box becomes a small network: namespaces as hosts and a router, veth pairs as cables, a bridge as a switch and a real interface as the uplink. It's how containers get their networking.
Run this lab
It needs Lite: its 2 nodes are set to 2 vCPU and 1,024 MB in total. That fits the free demo too.
In your workspace: Shared, then Linux for network engineers guided labs, then 04 - Network namespaces and veth pairs
- Level
- Intermediate
- Time
- About 50 minutes
- Nodes need
- 2 vCPU, 1,024 MB
- Smallest plan
- Lite
The scenario
The Sheffield team wants a test network for the tracker application before it goes live, but the depot has one spare Linux box, LNX1, and one port on router R1. Network namespaces let you build the whole thing inside LNX1: three hosts, a switch, a router and a real uplink. Anyone who runs containers uses these same parts every day.
| Device | Interface | Address | Role |
|---|---|---|---|
| red | eth0 | 10.4.1.10/24 | namespace, LAN 1 |
| green | eth0 | 10.4.1.20/24 | namespace, LAN 1 |
| blue | eth0 | 10.4.2.10/24 | namespace, LAN 2 |
| rtr | lan1, lan2 | 10.4.1.1/24, 10.4.2.1/24 | router namespace |
| rtr | eth0 (the real port) | 10.4.0.2/30 | uplink to R1 |
| R1 | Gi0/0, Loopback1 | 10.4.0.1/30, 10.4.99.1/24 | depot router |
| Device | Runs | How to log in |
|---|---|---|
| R1 | Cisco IOSv 15.9 | The console opens at >; enable has no password. |
| LNX1 | Alpine Linux 3.16 with iptables and iproute2 | Opens on a menu: press 5, then Enter, for a root shell. |
What you’ll practise
- Create namespaces and run commands inside them
- Connect namespaces with veth pairs and a bridge
- Build a router namespace with its own forwarding setting
- Move a physical interface into a namespace
- Find sockets and processes that belong to a namespace
The tasks
- Start the Linux nodes
- Make a namespace
- Join two namespaces with a cable
- Add a router namespace
- Run a service in a namespace
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
- LNX1
eth0to R1Gi0/0
| Node | Device | Image in Add Node | Set to |
|---|---|---|---|
| R1 | Cisco IOSv | vios-adventerprisek9-m.spa.159-3.m9 | 1 vCPU, 512 MB |
| LNX1 | 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
04 - Network namespaces and veth pairsand 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
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.