环境:Centos7
ERROR: http://serverip:8080/v1 is not accessible (Failed to connect to ip port 8080: No route to host)
Centos默认设置/proc/sys/net/ipv4/ip_forward 为 0,这从底层阻断了Docker所有网络。
解决办法:
1.比较麻烦
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
转自:https://blog.csdn.net/hb_964385339/article/details/100636176
2.办法2简单 systemctl stop firewalld 直接关闭防火墙
来源:oschina
链接:https://my.oschina.net/NatureKingShine/blog/3211688