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
Release: 2020-06-13 12:53:47
Original
2641 people have browsed it

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
Copy after login

2. Solution copy

Edit configuration file

vim /etc/sysctl.conf
Copy after login

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
Copy after login

Restart the network

systemctl restart network
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template