Skip to content

Instantly share code, notes, and snippets.

@dungdt88
Last active April 20, 2016 07:21
Show Gist options
  • Save dungdt88/33c5da09fc7f285cb489 to your computer and use it in GitHub Desktop.
Save dungdt88/33c5da09fc7f285cb489 to your computer and use it in GitHub Desktop.
Change docker0

In this guide, you will learn how to change the default docker bridge network's subnet to 10.11.12.0/24 on Ubuntu

Docker-engine's default options

Docker creates a bridge called docker0 with a default ip address of 172.17.0.1.

On Ubuntu the configuration file is located at:

/etc/default/docker

Edit the docker-engine configuration file

If DOCKER_OPTS is alredy exist then add the following option:

--bip=10.11.12.1/24

So it will look like:

DOCKER_OPTS="--host=tcp://0.0.0.0:2376 --host=unix:///var/run/docker.sock --bip=10.11.12.1/24"

Otherwise, just add a new line:

DOCKER_OPTS="--bip=10.11.12.1/24

Restart docker-engine

sudo service docker restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment