How to change the default IP address of docker bridge adapter?

0 votes

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 in Docker by akhtar
• 11,270 points

edited May 30 by MD 101 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 by MD
• 24,500 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 16, 2018 in Docker by Sophie may
• 9,940 points
4,518 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
• 9,940 points
968 views
0 votes
2 answers

How can I inspect the file system of a failed `docker build

Failed command is a build that has ...READ MORE

answered Aug 6, 2018 in Docker by Nilesh
• 6,960 points
362 views
0 votes
1 answer

Docker, how to get container information from within the container?

I've found out that the container id ...READ MORE

answered Jul 31, 2018 in Docker by Kalgi
• 51,850 points
152 views
0 votes
1 answer
0 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
• 57,530 points
542 views
0 votes
1 answer

How to make a port available to services outside of Docker?

Hi@akhtar, By default docker containers works in a ...READ MORE

answered May 5 in Docker by MD
• 24,500 points
43 views
0 votes
1 answer

How to create our own docker image?

Hi@akhtar, There are two ways to create docker ...READ MORE

answered Mar 11 in Docker by MD
• 24,500 points
73 views