By default, Docker uses for its default docker0 interface, which can be problematic if your network or a network you want to reach is on the same subnet as Docker. I will show you how to change Docker’s network in a jiffy!


  • Available subnet to assign to Docker
  • Permission to create or modify /etc/docker/daemon.json

Start by thinking of a good subnet that you want to assign to Docker. In this example, we will use as the new subnet.

Then, create the file /etc/docker/daemon.json with your favourite editor like nano, and inside of it you’ll want to enter:

    "bip": ""

Of course replacing it with your chosen subnet.

Save and exit the editor, and then restart Docker with:

systemctl restart docker

If that does not work for you, you might have to reboot your machine.

Note that in this example will become the host’s docker0 IP address.

That’s all!

External Links