Pcornel
Browse topics
Options
Recent
Favorites
Containers · Technical reference

Docker Bridge Networks

Direct answer

Docker bridge networks connect containers on one host through a Linux bridge with NAT to the outside. The default bridge has no DNS between containers; user-defined bridges do.

When to use this

Use it when containers on one host cannot reach each other or the internet.

First 30 seconds

1. docker network inspect <net> — containers and subnets.

2. Name resolution between containers on the same network.

3. Outbound: docker exec <c> ping 8.8.8.8 / DNS.

4. sysctl net.ipv4.ip_forward = 1.

5. iptables DOCKER chains present.

Operational verification

container veth → docker bridge → NAT → host network

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
Docker / containerd / Podman / Kubernetes / OCI-compatible platforms
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformDocker / containerd / Podman / Kubernetes / OCI-compatible platforms
Key commandip addr show docker0 ; bridge link
Scope / prerequisiteUse it when containers on one host cannot reach each other or the internet.
What next?2 suggested next steps
Evidence0
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

2 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 How to verify Verify boundary

From inside one container, resolve and connect to the other by name. From the host, ping the container IP on the bridge. Check that ip_forward is enabled with sysctl net.ipv4.ip_forward.

Step 2 Common failures Narrow the fault

Containers on different user-defined networks cannot reach each other unless connected to a shared network. A host firewall that flushes iptables removes Docker's rules. Overlapping bridge subnets with corporate networks break routing to those networks.

Key points

Create a user-defined network for each app (docker network create). Containers on different networks are isolated. Docker adds iptables NAT rules — host firewall tools may interact.

Key checks
  • docker ps -a — containers and exit codes
  • docker logs <c> — container output
  • docker inspect <c> — config, mounts, network, state
ReferenceWhat it is1 section · depth on demand

How it works

Docker creates a Linux bridge per network and a veth pair per container. The embedded DNS server at 127.0.0.11 answers names of containers on the same user-defined network. Docker writes iptables rules for masquerade and published ports; disabling iptables management breaks both.

ReferenceImportant terms & boundaries2 sections · depth on demand

In depth

A Docker bridge network is a Linux bridge (docker0 or br-<id>) with one veth pair per container. Outbound traffic is masqueraded to the host's address; inbound traffic only arrives through published ports.

Default bridge vs user-defined bridge

Default bridgeUser-defined bridge
Name resolution between containersNo (only legacy --link)Yes, embedded DNS at 127.0.0.11
IsolationAll unattached containers togetherOnly containers on that network
Connect/disconnect while runningNoYes (docker network connect)
Per-network subnet and optionsDaemon-wide onlyPer network

Always create a user-defined network for multi-container applications.

Worked trace of one packet

docker network inspect appnet -f '{{range .Containers}}{{.Name}} {{.IPv4Address}}{{"\n"}}{{end}}'
ip -br link show master br-3f1c2a      # veth interfaces attached to the bridge
iptables -t nat -S POSTROUTING | grep 172.30.0.0/24
# -A POSTROUTING -s 172.30.0.0/24 ! -o br-3f1c2a -j MASQUERADE

The MASQUERADE rule is what lets containers reach the outside world; if a host firewall flushes the NAT table, outbound traffic from containers stops until Docker is restarted.

Subnet clashes

Docker picks bridge subnets from 172.17.0.0/16 upwards. If that overlaps a company or VPN range, containers cannot reach those hosts. Set default-address-pools in /etc/docker/daemon.json to a free range before creating networks.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

Common mistakes

  • Expecting DNS between containers on the default bridge.
ReferenceConfiguration & state1 section · depth on demand

Bridge network commands

docker network ls
docker network create --driver bridge --subnet 172.30.0.0/24 appnet
docker run -d --network appnet --name api myapi
docker network inspect appnet
ip addr show docker0 ; bridge link

Documented example, not captured output. User-defined bridges provide DNS by container name; the default bridge network does not. Docker adds iptables/nftables NAT rules for outbound traffic and published ports.

Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Terminology layer

Terms & aliases

Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.

Aliases that resolve here
docker bridge networksdocker bridge networkdocker embedded dns
Confirmation

Confirm action

Continue?