In this article, we will get acquainted with the types of networks in Docker:

1- Bridge Network: When you start Docker, a default bridge network is created automatically. Newly started containers will automatically connect to it. You can also create custom user-defined bridge networks. User-defined bridge networks take precedence over the default bridge network.

2- Host Network: removes the network separation between the container and the Docker host and uses the host network directly. If you run a container that connects to port 80 and uses the host’s network, the container application is available on port 80 on the host’s IP address. This means you cannot run multiple web containers on the same host.

3- None Network: In this type of network, the containers are not connected to any network and do not have access to the external network or other containers. Therefore, this network is used when you want to completely disable the network stack on a container.

4- Overlay network: Creates an internal private network that spreads to all participating nodes in the Swarm cluster. Therefore, Overlay networks facilitate communication between a Docker Swarm service and an independent container or between two independent containers in different Docker daemons.

5- Macvlan Network: Some applications, especially legacy applications or applications that monitor network traffic, expect to connect directly to the physical network. In this type of situation, you can use the Macvlan network driver to assign a MAC address to each container’s virtual network interface, which appears to be a physical network interface directly connected to the physical network.

Categorized in: