The Docker Engine default bridge network is conflicting with our internal network hosts access. How do I configure the default bridge (
docker0) network for Docker Engine to a different subnet?
You can configure the default bridge network by providing the
--bip option along with the desired subnet using two possible methods:
- Start the Docker daemon with the
--bipoption. For example:
docker daemon --bip=172.26.0.1/16
- Edit the Docker daemon configuration file to always use the
--bipoption during daemon startup. (Instructions below.)
Editing the Docker daemon configuration file on Ubuntu
For Ubuntu hosts, the Docker daemon configuration file can be found at
/etc/default/docker. Uncomment the
DOCKER_OPTS line and add the
The daemon configuration file (
/etc/default/docker) file should look something like this:
# Docker Upstart and SysVinit configuration file # # THIS FILE DOES NOT APPLY TO SYSTEMD # # Please see the documentation for "systemd drop-ins": # https://docs.docker.com/engine/articles/systemd/ # # Customize location of Docker binary (especially for development testing). #DOCKERD="/usr/local/bin/dockerd" # Use DOCKER_OPTS to modify the daemon startup options. DOCKER_OPTS="--dns 188.8.131.52 --dns 184.108.40.206 --bip=172.26.0.1/16" # If you need Docker to use an HTTP proxy, it can also be specified here. #export http_proxy="http://127.0.0.1:3128/" # This is also a handy place to tweak where Docker's temporary files go #export TMPDIR="/mnt/bigdrive/docker-tmp
Editing the Docker daemon configuration file on RHEL/CentOS 7.x
For RHEL 7.x and CentOS 7.x hosts, first, follow the documentation on this link to learn how to create the config file: https://docs.docker.com/engine/admin/#/configuring-docker-1.
The Docker daemon configuration file is located at
The daemon configuration file should look something like this:
[Service] ExecStart= ExecStart=/usr/bin/docker daemon -H fd:// --bip=172.26.0.1/1
Please ensure that the IP address specified does not end with .0 (*.*.*.0) as these are reserved network addresses.
An example of a valid entry would be
For further information on configuring the default bridge network and the options available, refer to https://docs.docker.com/engine/userguide/networking/default_network/custom-docker0/.