Change docker0 IP Address in Linux

If you would like to change the default IP address of the docker0 interface follow the steps from below.

1. Created and edit daemon.json

sudo vim /etc/docker/daemon.json

Add the following configuration, these are basic configuration options, in case you need more please check: Docker User Guide

{
  "bip": "10.0.0.1/24",
  "mtu": 1500
}

2. Restart dockerd

sudo systemctl restart docker

Leave a Reply

Your email address will not be published.