Docker容器no route to host解决

在使用Centos7上使用docker容器访问其他服务器的的端口时,发现容器无法访问外部服务器的端口,却可以ping通外部服务器的地址。其中Centos7中的防火墙也是关的,经过发现docker启动时会自动调用iptables防火墙来作为管理,所以即使我们关闭了firewalld防火墙也没有效果。
解决方案
Centos7关闭iptables服务
sudo systemctl stop iptables.service

posted @ 2022-10-10 10:04  u清  阅读(714)  评论(0编辑  收藏  举报