docker networking ai_generated true

Error response from daemon: Pool overlaps with other one on this address space

ID: docker/network-bridge-conflict

Also available as: JSON · Markdown
85%Fix Rate
85%Confidence
27Evidence
2017-06-01First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
24 active
24 active

Root Cause

This error occurs when Docker tries to create a network with a subnet that overlaps an existing Docker network, a host network interface, or a VPN subnet. Docker assigns subnets from private IP ranges (172.16.0.0/12, 192.168.0.0/16) and conflicts arise when those ranges are already in use.

generic

Workarounds

  1. 90% success Specify a non-conflicting subnet in docker-compose.yml
    In your docker-compose.yml, explicitly define the network subnet to avoid the conflict:
    networks:
      mynet:
        driver: bridge
        ipam:
          config:
            - subnet: 10.100.0.0/16
    Choose a subnet from 10.0.0.0/8 that does not conflict with your host or VPN networks. Run 'ip route' to see which ranges are in use.

    Sources: https://docs.docker.com/compose/how-tos/networking/

  2. 75% success Prune unused Docker networks
    docker network prune --force. This removes all networks not used by at least one container, freeing up subnet allocations in Docker's pool. Then retry creating the network.

    Sources: https://docs.docker.com/reference/cli/docker/network/prune/

  3. 88% success Configure Docker daemon default address pools to avoid host network ranges
    Edit /etc/docker/daemon.json:
    {"default-address-pools": [{"base": "10.200.0.0/16", "size": 24}]}
    Restart Docker: 'sudo systemctl restart docker'. This tells Docker to allocate all new network subnets from 10.200.0.0/16, avoiding the commonly conflicting 172.x and 192.168.x ranges.

    Sources: https://docs.docker.com/engine/daemon/#daemon-configuration-file

Dead Ends

Common approaches that don't work:

  1. Running 'docker network rm' on the conflicting network alone 55% fail

    If the conflicting network has running containers attached, 'docker network rm' fails with an error. Even if removal succeeds, recreating the network with the same docker-compose.yml will reassign the same overlapping subnet from Docker's default pool.

  2. Restarting the Docker daemon without changing the network configuration 90% fail

    Restarting Docker (systemctl restart docker) does not change subnet allocations. Docker persists network state and will reassign the same subnets upon restart. The overlap condition remains.

Error Chain

Frequently confused with: