Every Compose project gets its own network, and Docker picks the ranges itself. Sooner or later one of them lands on the same range as your VPN or office network, and that part of the network becomes unreachable from the host.
In /etc/docker/daemon.json you set the pools Docker may take subnets from:
{
"default-address-pools": [
{ "base": "192.0.2.0/24", "size": 28 }
]
}
sudo systemctl restart docker
The addresses here are documentation placeholders; use a private range that is free on your networks. With this pool, each new network gets a /28 out of 192.0.2.0/24: sixteen networks with room for about a dozen containers each. A real pool is usually a /16 split into /24 blocks, giving 256 networks. That size matters too: the default pools hand out larger blocks than a home server will ever need.
Pick a range that is not used anywhere you connect to: not your LAN, not a VPN you dial into, not a customer network. I’d check the routes on the host with ip route before choosing.
The setting only affects networks created after the restart. Existing networks keep their old ranges until you remove and recreate them, which for Compose means docker compose down and up per project. The default docker0 bridge has its own bip setting and is not covered by the pools.
Further reading: dockerd reference: default-address-pools