TOPIC CONTAINERS
Container Networking how containers find each other
IN 10 SECONDS
Containers use virtual network interfaces (veth pairs) linked to a virtual bridge (docker0). The bridge routes packets locally, while iptables rules translate port bindings for external traffic.
GOTCHA Containers on different host bridges cannot talk directly. You must link them via a overlay network (like flannel) or export ports to the host.
HOW PACKET PASSING FLOWS
01 Creation container runtime creates a veth pair, placing one end inside the container namespace.
02 Bridge Link places the other end of the pair on the host's virtual bridge (e.g. docker0).
03 IP allocation assigns a private IP address (like 172.17.0.2) to the container interface.
04 Port Forwarding iptables translates traffic landing on host port 80 to container IP port 8080.
POKE IT YOURSELF
docker network ls — list all local container networks
docker network inspect bridge — inspect IP allocations and bridge configuration
Drill this topic →
~65 sec read