LOGBOOK

HELP

Quiz Entry - updated: 2026.11.10

How does Docker's default bridge network connect containers to each other, to the host and to the internet?

Docker creates a virtual switch docker0 on the host; each container plugs into it through a veth pair, gets a private IP (172.17.0.0/16 by default), and reaches the internet through NAT done by iptables.

  1. docker0. When Docker is installed, it creates a Linux bridge interface docker0 on the host (typically 172.17.0.1/16). A bridge behaves like a virtual switch. ip addr show lists it even when no container is running.
  2. veth pairs. For every container on the bridge, Docker creates a virtual Ethernet cable with two ends: one end appears in the container as eth0 (for example 172.17.0.2), the other end is plugged into docker0 and shows up on the host as vethXXXX@ifNN. Start two containers and two new veth interfaces appear on the host.
  3. Container to container. Containers on the same bridge reach each other through docker0 by IP.
  4. To the internet. Outgoing traffic is translated by an iptables NAT (masquerade) rule to the host's address, which is why ping google.ch works from a container.
  5. From outside in. The host only forwards traffic into a container for ports published with -p.

docker network inspect bridge shows the subnet, the gateway and every connected container with its IP.

Default bridge: containers connect through veth pairs to docker0, which reaches the internet through iptables NAT on the host NIC

* veth pairs into docker0, NAT out through the host NIC. *

Go deeper:

From Quiz: ISLAB / Docker Introduction | Updated: Nov 10, 2026