Container 06: A Network Namespace and a Virtual Cable
Running a Container · Open board
The holes punched in a sealed box. A container’s network is the one hole that is a cable, and this stage lays it.
Before you start.Container 05: Cgroups, Memory and Process Limits finished the box’s ceilings. This stage gives it a network of its own. A network device is something a machine sends packets out of: a network card, or something that pretends to be one. An IP address names a device on a network, and a subnet like 10.200.0.0/24 is a group of addresses that can talk to each other directly (Inside your building (your router's life) draws it; How a parcel finds any house on earth covers what happens when the destination is outside the subnet). A route is a rule saying where to send packets for a given destination. You need those three words and nothing more.
Lesson 100 of 117 in From Scratch
The rest of this lesson is part of a plan.
A plan opens every lesson, board, video, lab and paper on chalk. Yearly is $39/year.
Or start free: a free account opens lessons 2 and 3 of every track.
In this lesson
18 October 2026: the box that shared the host’s network
A veth pair: a cable with a plug at each end
Who does what, and in what order
It works: a ping across the cable
What the cable does not do
The setup tool, and a failure that teaches
Terms it explains: network device, IP address, subnet, route, network namespace, veth pair, On the host, In the box, pipe, `run.go`, `child.go`, The tests, Changes to try, daemon.