How does the default bridge network work?
AdvancedConceptNetworking
Answer
Docker creates the Linux bridge docker0 (172.17.0.0/16). For each container it creates a veth pair: one end in the container as eth0, the other attached to the bridge. Outbound traffic is NATed (iptables MASQUERADE); published ports use DNAT rules. Containers on default bridge communicate by IP only (legacy --link aside).
ip addr show docker0
bridge link
More on Networking
What network drivers does Docker have?BeginnerDefault bridge vs user-defined bridge: what is the difference?IntermediateHow does container DNS work?IntermediateHow does `-p 8080:80` work under the hood?AdvancedWhat is the difference between `-p 80:80` and `-p 127.0.0.1:80:80`?BeginnerHow does `--network host` work and what are the trade-offs?Intermediate