docker0 bridge

docker0 bridge is the heart of default networking. When the Docker service is started, a Linux bridge is created on the host machine. The interfaces on the containers talk to the bridge and the bridge proxies to the external world. Multiple containers on the same host can talk to each other through the Linux bridge.

docker0 can be configured via the --net flag, and has four modes in general:

  • --net default: In this mode, the default bridge is used as the bridge for containers to connect to each other
  • --net=none: With this flag, the container created is truly isolated and cannot connect to the network
  • --net=container:$container2: With this flag, the container created shares its network namespace with the container named $container2

Get Troubleshooting Docker now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.