Skip to content

Bridges and veth pairs: how containers share a network

Select an icon to see what it is.

Step 2 of 6

web gets a veth pair

When web starts, dockerd creates a veth pair, a virtual cable with two ends. One end stays on the host and joins the bridge. The other end moves into web's network namespace, becomes eth0 and gets 172.18.0.2.

$ docker run -d --name web --network shop-net nginx

Host side

veth<random> master br-<network id> state UP