Ctrl K

Docker and Wi-Fi Subnet Conflict

Fix a broken network where Docker's default 172.x bridge overlaps the Wi-Fi subnet, by pinning Docker to safe 10.x pools in daemon.json.

Docker picks a default bridge subnet in the 172.x range. On some networks, often captive-portal or hotel Wi-Fi, the router hands out addresses from the same range, so the Docker network and the Wi-Fi network overlap and the connection breaks. The fix is to move Docker onto 10.x subnets that will not collide, set once in /etc/docker/daemon.json.

Confirm the conflict

Look at the IPv4 routes. A conflict shows Docker and Wi-Fi claiming overlapping ranges, for example Docker on 172.20.0.0/16 while the Wi-Fi interface is on 172.20.0.0/20.

ip -4 route

Stop Docker

Stop the daemon and its socket before editing the config.

sudo systemctl stop docker.service docker.socket

Pin Docker to safe 10.x subnets

Create the config directory and edit daemon.json. bip sets the docker0 bridge address, and default-address-pools sets the range Compose networks are carved from.

sudo mkdir -p /etc/docker
sudo nano /etc/docker/daemon.json
{
  "bip": "10.200.0.1/24",
  "default-address-pools": [
    {
      "base": "10.201.0.0/16",
      "size": 24
    }
  ]
}

Validate the JSON before starting Docker. A malformed file stops the daemon from coming up.

python -m json.tool /etc/docker/daemon.json

Start Docker and clear old networks

Start the daemon, prune networks left on the old subnets, then restart so everything comes up on the new pools.

sudo systemctl start docker
docker network prune -f
sudo systemctl restart docker

Verify

Check the routes again. Wi-Fi keeps its own range and Docker now sits on 10.x.

ip -4 route
default via 172.20.0.1 dev wlo1
10.200.0.0/24 dev docker0
172.20.0.0/20 dev wlo1

Confirm the bridge and any Compose networks landed on the expected subnets.

docker network inspect $(docker network ls -q) \
  --format '{{.Name}}: {{range .IPAM.Config}}{{.Subnet}} {{end}}'

The default bridge should read 10.200.0.0/24, and future Compose networks are allocated from 10.201.x.0/24. Docker containers now run normally without touching the Wi-Fi range.

See also