Docker compose break existing network bridge

We probably missed the question when the topic was created. There were other similar questions though, like this:

This Link was recommended:

https://wiki.archlinux.org/title/Docker#Starting_Docker_breaks_KVM_bridged_networking

Where you can find this:

If there is already a network bridge configured for KVM, this may be fixable by telling docker about it. See [20] where docker configuration is modified as:

/etc/docker/daemon.json

{ "bridge": "br0" }

If the above does not work, or you prefer to solve the issue through iptables directly, or through a manager like UFW, add this:

iptables -I FORWARD -i br0 -o br0 -j ACCEPT

Then the Docker documentation mentiones that parameter too

  • The -b, --bridge= flag is set to docker0 as default bridge network. It is created automatically when you install Docker. If you aren’t using the default, you must create and configure the bridge manually, or set it to ‘none’: --bridge=none

This was also recommended for running multiple Docker daemons, so that should help with KVM and Docker on the same machine too, but I never tried it. If you try it, please, share how it worked.