ERROR: https://192.168.8.30:442/ping is not accessible (Failed to connect to 192.168.8.30 port 442: Connection refused)
CentOS1、为什么容器无法连接到网络? 如果你在主机上运行一个容器
(如:docker run -it ubuntu)该容器不能与互联网或其他主机通信,那可能是遇到了网络问题。
Centos默认设置/proc/sys/net/ipv4/ip_forward 为 0,这从底层阻断了Docker所有网络。
解决办法:
vi /usr/lib/sysctl.d/00-system.conf
添加如下代码:
net.ipv4.ip_forward=1
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
net.bridge.bridge-nf-call-arptables = 1
重启network服务
systemctl restart network
查看是否修改成功
sysctl net.ipv4.ip_forward
如果返回为
net.ipv4.ip_forward = 1