错误提示
can't connect to remote host (172.18.0.6): Host is unreachable
# 查看所有工作区
firewall-cmd --get-zones
# 查看默认工作区
firewall-cmd --get-default-zone
docker network ls #查看所有网络
docker network inspect lnet0 #查看docker的bridge网络的ip地址段
# 注意工作区docker
firewall-cmd --zone=docker --add-source=172.17.0.1/16 --permanent # 添加docker0地址段
firewall-cmd --zone=docker --add-source=172.18.0.1/16 --permanent # 添加lnet0地址段
#
#firewall-cmd --zone=docker --add-source=10.10.0.1/16 --permanent # 主机网络,无需添加
firewall-cmd --reload
systemctl enable firewalld
systemctl restart firewalld
systemctl status firewalld
firewall-cmd --zone=docker --list-ports
firewall-cmd --zone=docker --list-sources
systemctl stop firewalld
systemctl disable firewalld
#进入docker容器
docker exec -it nginx sh
#测试调用内部的端口
wget http://goapi:8090/api/level/detail
wget http://go-welcome:8090/api/level/detail
# 查看nginx的error.log
启动
firewall-cmd --reload
systemctl enable firewalld
systemctl restart firewalld
# 添加docker0地址段
# 添加lnet0地址段
firewall-cmd --zone=docker --add-source=172.17.0.1/16 --permanent
firewall-cmd --zone=docker --add-source=172.18.0.1/16 --permanent
firewall-cmd --reload