
Overlay network driver Explain
Learn about Docker's Overlay network driver: Connect containers across multiple hosts, enabling seamless communication in Swarm or multi-host setups.
overlay
network driver creates a distributed network among multiple Docker daemon hosts. This network sits on top of (overlays) the host-specific networks, allowing containers connected to it to communicate securely when encryption is enabled. Docker transparently handles routing of each packet to and from the correct Docker daemon host and the correct destination container.overlay
networks using docker network create
, in the same way that you can create user-defined bridge
networks. Services or containers can be connected to more than one network at a time. Services or containers can only communicate across networks they're each connected to.
2377/tcp:
The default Swarm control plane port, is configurable with docker swarm join --listen-addr
4789/udp:
The default overlay traffic port, configurable with docker swarm init --data-path-addr
7946/tcp
, 7946/udp:
Used for communication among nodes, not configurabledocker network create
command with the --driver
option set to overlay
. Optionally, you can specify additional parameters such as subnet, gateway, and network name.— attachable
Command:--attachable
option enables both standalone containers and Swarm services to connect to the overlay network. Without --attachable
, only Swarm services can connect to the network.docker network ls
command to list all networks and verify that your overlay network has been created:--opt encrypted
flag to encrypt the application data transmitted over the overlay network:multi-host-network
with a busybox
container: