Docker Community Forums

Share and learn in the Docker community.

Changing default bridge subnet

Hi!

I’ve installed docker using snap (Docker version 19.03.7, build 7141c199a2 Kubuntu 19.10 eoan)
everything works but default subnet assign to docker0 is in conflict with my local net.

Need to assign different one. Tried to add the line — “bip” : “172.16.31.0/24” to /var/snap/docker/current/config/daemon.json ( validated with online JSON validator) and restart # snap restart docker…

Didn’t work, here journalctl -b | grep docker output:
A stop job for unit snap.docker.dockerd.service has finished.
Mar 05 13:57:31 kub systemd[1]: snap.docker.dockerd.service: Start request repeated too quickly.
Mar 05 13:57:31 kub systemd[1]: snap.docker.dockerd.service: Failed with result ‘exit-code’.
– The unit snap.docker.dockerd.service has entered the ‘failed’ state with result ‘exit-code’.
Mar 05 13:57:31 kub systemd[1]: Failed to start Service for snap application docker.dockerd.
– Subject: A start job for unit snap.docker.dockerd.service has failed
– A start job for unit snap.docker.dockerd.service has finished with a failure.
if I delete the entry - it start normally

Can somebody explain the right way of changing default bridge subnet?