What should I do if docker cannot connect to broadband?
Solution to docker’s inability to connect to broadband:
1. Problem description
I have been using docker in the development environment for a long time, but suddenly the docker network is blocked.
The internal network of the docker host is normal, but the connection with other hosts fails. Other hosts cannot connect to the port mapped on the docker host. Docker cannot connect to the external host either inside the system
where the system centos
docker info is as follows:
WARNING: IPv4 forwarding is disabled WARNING: bridge-nf-call-iptables is disabled WARNING: bridge-nf-call-ip6tables is disabled
2. Solution copy
Edit configuration file
vim /etc/sysctl.conf
Add the following code in the file
net.bridge.bridge-nf-call-ip6tables=1 net.bridge.bridge-nf-call-iptables=1 net.bridge.bridge-nf-call-arptables=1 net.ipv4.ip_forward=1
Restart the network
systemctl restart network
Check docker info again, the warning disappears and the network returns to normal
Recommended tutorial: "docker video tutorial"
The above is the detailed content of What should I do if docker cannot connect to broadband?. For more information, please follow other related articles on the PHP Chinese website!