How to Change the Default Docker Network Address Allocation?
Question
How to change the default Docker network address allocation?
Environment
Container platform: Docker
Answer
You may experience setup test (connection) failures if your source or destination network overlaps with the default Docker network address range.
To change the default Docker network address pool, perform the following steps:
Stop the Hybrid Deployment Agent (if running):
./hdagent.sh stop
Remove unused networks:
docker network prune
Update or create the
daemon.json
file with a new default address pool:- For rootful Docker, the file is in
/etc/docker/
. - For rootless Docker, the file is in
~/.config/docker/
.
Use the following template (modify the subnet to avoid overlap with your source or destination network):
{ "default-address-pools": [ { "base": "192.168.0.0/16", "size": 24 } ] }
In this example, Docker will create networks from
192.168.0.0
to192.168.255.0
.- For rootful Docker, the file is in
Restart the Docker service:
For rootful:
sudo systemctl restart docker
For rootless:
systemctl --user restart docker
Restart the Hybrid Deployment Agent:
./hdagent.sh start
Verify the network changes:
docker inspect fivetran_ldp