How to change the default IP address of docker bridge adapter

+1 vote

Hi Guys,

I am new in docker. Whenever I launched a container it gets ip from bridge adapter and the default gateway is 172.17.0.1/16. But I want to change the default gateway address. How can I do that?

May 11, 2020 in Docker by akhtar
• 38,210 points

edited May 30, 2020 by MD 3,200 views

1 answer to this question.

0 votes

Hi@akhtar,

You can reconfigure the default bridge network by providing the bip option along with the desired subnet in the daemon.json (default location at /etc/docker/daemon.json ) file as follows.

$ vim /etc/docker/daemon.json
{
  "bip": "172.200.0.1/16"
}

Then restart the docker daemon as root.

$ systemctl restart docker

Hope this will help.

answered May 11, 2020 by MD
• 95,300 points

Related Questions In Docker

0 votes
1 answer

How to obtain the Docker container's IP address from the host?

This can be done by executing the ...READ MORE

answered Jul 17, 2018 in Docker by Sophie may
• 10,550 points
7,607 views
0 votes
1 answer

How to increase the size of images while creating docker file?

Docker image optimization usually is intended to ...READ MORE

answered Oct 19, 2020 in Docker by anonymous
99 views
0 votes
1 answer

How to get the hostname of the manager node in the Docker swarm?

Hi@akhtar, You can find the manager hostname using ...READ MORE

answered Dec 24, 2020 in Docker by MD
• 95,300 points
620 views
0 votes
1 answer

How to run a docker command from inside the container?

You must have come across the /var/run/docker.sock file, ...READ MORE

answered Jun 28, 2018 in Docker by Sophie may
• 10,550 points
2,198 views
+2 votes
1 answer
+2 votes
1 answer

Deploy Docker Containers from Docker Cloud

To solve this problem, I followed advice ...READ MORE

answered Sep 3, 2018 in AWS by Priyaj
• 58,140 points
1,358 views
0 votes
1 answer

How to find a Docker container IP address from the command line?

Hi@akhtar, You can use the docker inspect command ...READ MORE

answered Sep 4, 2020 in Docker by MD
• 95,300 points
1,964 views
0 votes
1 answer

How to connect to the localhost of the machine from the Docker container?

Hi@akhtar, You can use --network="host" in your docker run command. It will ...READ MORE

answered Dec 23, 2020 in Docker by MD
• 95,300 points
1,890 views