How to use Docker Default Bridge Networking?

Last Updated : 15 Oct, 2026

Docker Networking allows containers to communicate and share resources through dedicated networks. Docker supports different network drivers, with Bridge being the default driver for containers on a single Docker host.

  • Docker supports network drivers such as Bridge and Macvlan.
  • Bridge Network is the default network driver when no driver is specified.
  • Single Host bridge networks allow communication between containers running on the same Docker host.

Bridge Network Driver

Docker Bridge Network is the default network used when no specific network is mentioned while creating a container. Containers connected to the same bridge network can communicate with each other.

frame_3776
  • Containers are automatically connected to the default bridge network if no network is specified.
  • Containers on the same network can communicate with each other.
  • Containers on different networks cannot communicate directly without proper network configuration.
  • Use docker network ls to view available Docker networks.
docker network ls

Types of Docker Networks

There are three main default networks as mentioned following and also to know more about Docker networking refer to Docker Networking.

  1. Bridge(default)
  2. Host
  3. None/Null

Connect a Container To a User-Defined Bridge

In the default bridge network, containers communicate using their IP addresses, not their container names. Since container IP addresses can change, relying on them in applications is not recommended.

  • Containers in the default bridge network communicate using container IP addresses.
  • Container names cannot be used directly for communication in the default bridge network.
  • Container IP addresses may change when containers are recreated.
  • Avoid hardcoding container IP addresses for application connectivity.

To Create Custom Bridge Network

To create a Custom Bridge Network, we can use docker network command, the syntax of this as follows:

Syntax

docker network create -d <driver> <networkName>

How to create Custom Bridge Network? A Step-By-Step Guide

The following are the steps that guides you in creating a custom bridge network:

Step 1: Ensure Docker is Running

  • The following helps in checking the docker running status:
sudo systemctl status docker 
  • The following command helps in enabling the docker service:
sudo systemctl enable docker --now

Step 2: Create Bridge Network

  • Firstly check the existing networks list with the following command:
docker network ls
  • Use the following command to create a new bridge network:
docker network create --driver bridge mynetwork

Step 3: Verify the Network Creation

  • Use the following command to verify whether the network is successfully created or not:
docker network ls

Step 4: Inspect the Bridge Network

  • Inspect the created custom bridge networks by using the following command.
docker network inspect mynetwork

If containers are created in custom bridge network. Each container can access other using containerName/ContainerIP.Delete Containers which are running in default bridge or create container with different name.

Default Bridge Network

Every installation of Docker provides a pre-built default Bridge Network with a Bridge driver scoped locally. You can verify the same using the network ls to know more commands refer to command. Docker – Instruction Commands.

sudo docker network ls
 default Bridge Network
  • Bridge Driver always provides single-host networking hence, the scope is local.

Connecting A Docker Container In Bridge Network

Note that the Bridge Network we saw in the previous step is the default network for Docker Containers. If you don't specify any other network, all new Containers will be joined to this default network. To connect an Ubuntu Container to the default bridge network, use this command.

sudo docker run -dt ubuntu 
Connecting a Docker Container

Inspecting The Bridge Network

After you have created the Docker Container, check whether it is running or not.

sudo docker container ls
Inspecting the Bridge Network

Since the Container is already running, we can now use the network inspect command to inspect the Docker default bridge network.

sudo docker network inspect bridge
network inspect bridge

You can see the details related to the Bridge Network in JSON format. You can also check the Containers associated with the network in the Container object.

network inspect bridge

Testing The Network Connectivity

To test the network connectivity, note down the IP address of the Container. In this example, the IP address is "172.17.0.2/16".We will ping this address from the Docker Host to check the connectivity.

ping 172.17.0.2
Testing the Network Connectivity

It shows that the host is able to ping the Docker Container in the network.

User-Defined Bridges Vs Default Bridge

FeatureDefault Bridge NetworkUser-Defined Bridge Network
ConfigurationProvides basic network isolation.Supports custom network configuration.
Container CommunicationUses IP addresses.Uses container names or IP addresses.
Host CommunicationUses host IP addresses.Uses host IP addresses.
DNS ResolutionDoes not provide automatic container-name resolution.Supports automatic container-name resolution through embedded DNS.

Docker Network Host Vs Bridge

FeatureHost NetworkBridge Network
Network IsolationIt shares the host's network stack with providing no network isolationit provides a private internal network, isolating containers from the host network
PerformanceIt offers better network performance due to direct use of the host's networkIt slightly lower performance due to the overhead of network bridging
Use CaseIt is suitable for applications that needing direct access to host network, like monitoring toolsIt is ideal for typical containerized applications needing isolation and controlled communication
IP AddressingContainers use the host’s IP address and ports, leading to potential conflictsContainers get their own IP addresses within the bridge network, avoiding conflicts with the host
Comment