Namespaces, veth and bridges
Quick answer
A network namespace isolates network resources such as interfaces, routes, sockets and firewall rules. A veth pair is a virtual link with two connected ends; a Linux bridge forwards Ethernet frames between its attached ports.
Think of a veth pair as a cable between two virtual interfaces and a bridge as a link-layer switch. Neither automatically supplies an IP route or firewall policy. Draw the isolated topology and identify the observation point before interpreting connectivity.
Prepare the practice environment
Run python3 lab-fixtures/firewalls/setup.py from the extracted root as an ordinary user. Enter the printed fresh private path and check pwd. Use fresh fixtures, Bash with set -e -o pipefail, LC_ALL=C and umask 077. Run each snippet in a separate Bash process, not your interactive shell. Only private files are used; optional examples require an authorized snapshot VM. Do not modify firewall, interfaces or routing. The teaching ruleset must never be loaded. Review the lab guide.
Prerequisites
Review: Safe firewall changes.
How it works
Consider two isolated namespaces blue and green. Each has one veth endpoint; the other ends belong to a bridge in a third namespace. A frame entering one veth emerges from its peer; the bridge learns source MAC addresses and forwards frames by destination MAC. A bridge does not by itself route between IP subnets or provide internet connectivity. Each namespace has independent loopback and routing state, but network namespaces alone are not complete process isolation. A named namespace listed by ip netns is only a namespace registered through that mechanism, not every namespace on the machine. Real link creation and namespace attachment require privileges and isolated VM planning. Inspect only the current loopback or synthetic topology in this lab.
Try the examples
The names are fictional and represent a bridge joining two virtual Ethernet pairs.
Expected stdout:
blue: v-blue -> b-bluegreen: v-green -> b-greenbridge: b-blue, b-greenip -j link show dev lo | python3 -c 'import json,sys; print(json.load(sys.stdin)[0]["ifname"])'The output names the current namespace loopback interface; it does not enumerate other namespaces.
Expected stdout:
loThis confirms utility availability, not bridge creation or forwarding.
Expected stdout:
bridge utility,Common mistakes
Do not connect a practice bridge to production interfaces or assume that a namespace provides complete isolation.
Practice
Draw the two pairs from topology.json. Trace a frame between endpoints and identify where routing would be needed for separate subnets.
Related references
Study: ip, bridge. These are reference names, not deployed links.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Namespaces, veth and bridges — Knowledge Check
Apply firewall and network concepts to synthetic fixtures and VM-only scenarios.
What does a veth pair provide?
What does a bridge primarily forward?
What is isolated by a network namespace?
Does a bridge alone provide IP routing?