Home >Operation and Maintenance >Docker >What should I do if docker cannot connect to broadband?

What should I do if docker cannot connect to broadband?

coldplay.xixi
coldplay.xixiOriginal
2020-06-12 15:05:142639browse

What should I do if docker cannot connect to broadband?

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn