Docker 101 : Changing the default bridge settings - docker0 -



To change the default settings of docker - Bridge settings and IP addresses of containers -, we follow the below steps:

We start by stopping the docker service as follows:


Then we take the docker0 bridge interface down:


We delete the default docker0 bridge interface:


We flush the POSTROUTING chain using the below command so it deletes all the rules related to it:


We change the bridge in the "/etc/default/docker" file:


Then we create the "br1" Linux bridge:


We assign an IP address to the new bridge:


Then we enable it using the below command:


Finally, we start our docker services as follows:


We check if our new bridge was taken into account by Linux using the below command:


Comments

Leave as a comment:

Archive