Docker defaults to using certain IP ranges (172.17.0.0/16) which can conflict with internal network infrastructure. Here’s how to solve this issue without rebuilding your Azure IoT Edge containers.
We delete not the conainters we only adjust the network that is the way to go.
Modify Docker daemon.json configuration
Edit your /etc/docker/daemon.json
{
"bip": "192.168.100.1/24",
"default-address-pools": [
{"base": "192.168.101.0/24", "size": 24}
]
// Keep your existing configuration options
}
Restart docker
systemctl restart docker
Adjust the docker network
# Create new network (will use your custom IP range)
docker network create azure-iot-edge-new
# Connect containers to new network
docker network connect azure-iot-edge-new edgeHub
docker network connect azure-iot-edge-new MCC
docker network connect azure-iot-edge-new edgeAgent
# Disconnect from old network
docker network disconnect azure-iot-edge edgeHub
docker network disconnect azure-iot-edge MCC
docker network disconnect azure-iot-edge edgeAgent
# Delete the old network
docker network rm azure-iot-edge
Check if all works as expected
# show ip address from the new network
docker network inspect azure-iot-edge-new
# check if all conainers have a new ip
docker inspect edgeHub | grep -A 20 "Networks"
docker inspect MCC | grep -A 20 "Networks"
docker inspect edgeAgent | grep -A 20 "Networks"
# check if the conainters can ping each other
docker exec edgeHub ping -c 3 MCC
docker exec MCC ping -c 3 edgeHub
# check container status
docker ps
# check container logs
docker logs edgeHub | tail -30
docker logs MCC | tail -30
docker logs edgeAgent | tail -30
# check if iotedge works
iotedge list
iotedge check
This approach allows you to change your Docker networking without rebuilding containers – particularly useful for special deployments like Azure IoT Edge where container recreation is complex.





