Linux Networking, From First Principles
A four-lesson Linux networking course: start with isolated hosts, connect them, build a switched LAN, and route between subnets.
· 3 min read
Understand the objects. Compare the architectures. Build the network. Explain the packets.
This is a four-lesson course and a practical reference for someone who can use a Linux terminal but has not yet formed a clear picture of networking. You do not need to have read another document or completed an earlier lab.
We will eventually build three hosts named host1, host2, and host3, connected to the Linux bridge br1 inside the namespace bridge1. But first we will learn what each of those words means. Afterwards, we will add a router and a fourth host to discover what changes when traffic crosses into another IP subnet.
The main examples use IPv4 over Ethernet. Advanced features such as VLAN filtering, policy routing, proxy ARP, overlays, and NAT are not enabled in the lab. When a statement depends on that simple setup, the surrounding explanation says so.
The four lessons
- Interfaces, namespaces, and loopback
- Connecting two hosts
- Building a switched LAN
- Routing between subnets
Each lesson combines the concepts, topology, guided exercise, and review questions for one lab stage. Follow the lessons in order on your first visit; use the contents list within each lesson when returning to a particular concept.
Prerequisites
You should be comfortable using a Linux terminal. Use a Linux machine or Linux VM where you can run sudo and create network namespaces and virtual devices. A restricted container may prevent these operations.
The tools are ip, bridge, ping, tcpdump, sysctl, lsns, Python 3, and curl. Lesson 1 includes installation and environment checks. No Internet access is needed for the completed lab itself.
One cumulative lab
This is one cumulative lab in four stages, not four independent scripts. Stage 2 starts from Stage 1. Stage 3 replaces the direct cable built in Stage 2. Stage 4 extends Stage 3 without removing its three-host LAN.
You will enter individual commands. There are no helper functions hiding the networking operations.
An architecture describes which objects exist, how they connect, and which object is responsible for each decision. The same tools can create different architectures. Do not learn a command sequence without knowing which architecture it produces.
Stop at each Predict → Observe → Explain checkpoint. Read the explanation, make a prediction, run only the current step, and compare its result with the expected observation.
Keep the same Linux environment between lessons. Lesson 1 creates a temporary web directory recorded in the shell variable LAB_WEB; Lesson 3 reuses it, and Lesson 4 removes it. Each lesson states which namespaces must exist and which processes must be stopped. If you finish early, follow the cleanup instructions for only the resources you created.
Offline course and reference
Open or save the complete self-contained HTML course, including all ten diagrams and expandable answers. This is the original continuous edition; its Parts I-IV correspond to material reorganized across these lessons.
The complete command reference and source documentation and supplied validation record are in Lesson 4.