Linux Network Bridges Explained

A network bridge connects multiple network segments as if they were one — the underlying mechanism behind both physical network switches and the virtual networking every container runtime relies on.

# Create a bridge
sudo ip link add name br0 type bridge
sudo ip link set br0 up

# Attach a physical interface to it
sudo ip link set eth0 master br0

# Assign an IP to the bridge itself, not the underlying interface
sudo ip addr add 192.168.1.10/24 dev br0

Why Docker Needs This

Docker’s default bridge network is precisely this kind of Linux bridge — each container connects to it via a virtual ethernet pair (much like the network namespace example elsewhere), and the bridge itself handles forwarding traffic between containers and, via NAT, out to the host’s real network. This is exactly why containers on the same Docker network can reach each other by container name — they’re literally on the same virtual network segment.

Bridges vs Bonds

A bridge connects different network segments together (like a switch); a bond combines multiple physical interfaces into what looks like one logical interface (for redundancy or throughput) — genuinely different purposes despite both operating at a similar layer.