Bridges and veth pairs: how containers share a network
Select an icon to see what it is.
Step 1 of 6
Creating the network creates a bridge
docker network create sends POST /networks/create with the subnet. dockerd asks the kernel for a bridge named br-<network id> and gives it the gateway address 172.18.0.1/16. The bridge acts like a virtual switch on the host.
$ docker network create --subnet 172.18.0.0/16 shop-net PrevNext
POST /v1.45/networks/create
{"Name": "shop-net""Driver": "bridge""IPAM": {"Config": [{"Subnet": "172.18.0.0/16"}]}}