Default network addresses¶
If you have issues related to the default network address configuration, curl either hangs or the following error occurs:
curl: (7) Failed to connect to xxx.xxx.xxx.xxx port xxxx: Host is unreachable
The issue may occur because the default Docker network address
172.17.0.0/16 and/or the kind Docker network, which is used by
kind, overlap with your cloud address or other addresses of network
configuration.
To apply the issue resolution:
Log in to your local machine.
Verify routing to the IP addresses of the target cloud endpoints:
Obtain the IP address of your target cloud. For example:
nslookup auth.openstack.example.comExample of system response:
Name: auth.openstack.example.com Address: 172.17.246.119
Verify that this IP address is not routed through
docker0but through any other interface, for example,ens3:ip r get 172.17.246.119
Example of the system response if the routing is configured correctly:
172.17.246.119 via 172.18.194.1 dev ens3 src 172.18.1.1 uid 1000 cache
Example of the system response if the routing is configured incorrectly:
172.17.246.119 via 172.18.194.1 dev docker0 src 172.18.1.1 uid 1000 cache
If the routing is incorrect, change the IP address of the default Docker bridge:
Create or edit
/etc/docker/daemon.jsonby adding the"bip"option:{ "bip": "192.168.91.1/24" }
Restart the Docker daemon:
sudo systemctl restart docker
If required, customize addresses for your
kindDocker network or any other additional Docker networks:Remove the
kindnetwork:docker network rm 'kind'
Select one of the following options:
Configure
/etc/docker/daemon.json:Note
The following steps are applied to customize addresses for the
kindDocker network. Use these steps as an example for any other additional Docker networks.Add the following section to
/etc/docker/daemon.json:{ "default-address-pools": [ {"base":"192.169.0.0/16","size":24} ] }
Restart the Docker daemon:
sudo systemctl restart docker
After Docker restart, the newly created local or global scope networks, including
'kind', will be dynamically assigned a subnet from the defined pool.
Recreate the
'kind'Docker network manually with a subnet that is not in use in your network. For example:docker network create -o com.docker.network.bridge.enable_ip_masquerade=true -d bridge --subnet 192.168.0.0/24 'kind'
Caution
Docker pruning removes the user defined networks, including
'kind'. Therefore, every time after running the Docker pruning commands, re-create the'kind'network again using the command above.