Change the IP range used by Docker
This page indicates how to change the IP ranges used by Docker.
By default, docker will use these two ranges:
172.17.0.0/16
: for thebridge
network (also calleddocker0
)172.18.0.0/16
: for thedocker_gwbridge
network
If the procedure is followed during the installation of Cyberwatch, only steps 3 and 4 are necessary.
Stop the instance:
sudo cyberwatch stop
Disconnect and remove network
docker_gwbridge
docker network disconnect -f docker_gwbridge gateway_ingress-sbox
docker network rm docker_gwbridge
Edit file
/etc/docker/daemon.json
:{ "bip": "10.0.64.1/24", "default-address-pools": [ { "base": "10.0.64.0/18", "size": 24 } ] }
The field
bip
(Bridge IP) defines the IP range that network interfacedocker0
can use. The example reserves IP range10.0.64.1/24
to the interface. Beware, the range must end with.1
, otherwise docker won’t start.The field
default-address-pools
defines the IP range of network interfacedocker_gwbridge
. The example reserves IP range10.0.64.0/18
.Restart docker:
sudo systemctl restart docker
Start Cyberwatch:
sudo cyberwatch start
Check that the IPs changed:
docker network inspect bridge | grep Subnet docker network inspect docker_gwbridge | grep Subnet