0

On Arch linux, using docker 24.0.2, when I start docker as a service like this:

$ systemctl start docker

it creates four new network routes:

$ ip route
....
172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.0.1 linkdown 
172.18.0.0/16 dev docker_gwbridge proto kernel scope link src 172.18.0.1 linkdown 
172.19.0.0/16 dev br-ff0cba0bb071 proto kernel scope link src 172.19.0.1 linkdown 
192.168.0.0/20 dev br-0a4abef1c7bb proto kernel scope link src 192.168.0.1 linkdown
... 

The last one of these -- 192.168.0.0/20 -- overlaps with some addresses on my local network. Once I start docker, I cannot access these machines, and I have to manually delete the bridges with brctl.

How can I stop docker from creating these routes that overlap with addresses on my network?

Alex Flint
  • 6,040
  • 8
  • 41
  • 80
  • Have you ever found the answer? It started happening on fresh install of Debian 12 to me – Quimby Aug 22 '23 at 12:35
  • 1
    @Quimby no I haven't found an answer; I've resorted to just switching docker off at the systemd level, which is kind of a crazy workaround! – Alex Flint Aug 24 '23 at 15:22
  • Thanks, I actually found a solution for me - [connman](https://stackoverflow.com/questions/62176803/docker-is-overriding-my-default-route-configuration) that is newly used in Debian 12 . But not sure if that could be the case for you. – Quimby Aug 24 '23 at 17:38
  • 1
    @Quimby Thanks for the link. I actually found that a different one of the answers on that question worked for me! (Re-configuring the docker daemon to use IP ranges that don't conflict with my local network) – Alex Flint Aug 26 '23 at 11:53

1 Answers1

1

I found a solution here: https://stackoverflow.com/a/62176918/795053

Simply reconfigure the docker daemon to use an IP range that is not in conflict with the local network:

# /etc/docker/daemon.json
{
  "bip": "172.200.0.1/16"
}

This is not the most upvoted answer on the linked question, but I believe it is in fact the correct one. It does not require installing some any additional connection manager or otherwise working around the underlying issue, which is a conflict in IP ranges between docker and local network.

Alex Flint
  • 6,040
  • 8
  • 41
  • 80