CentOS 7、 8 中,Docker采用bridge网络的Container无法连接外网的问题
原因:系统默认采用firewelld管理防火墙规则参考:https://github.com/firewalld/firewalld/issues/195
[woods@localhost ~]$ nmcli connection modify docker0 connection.zone trusted
[woods@localhost ~]$ systemctl stop NetworkManager.service
[woods@localhost ~]$ firewall-cmd --permanent --zone=trusted --change-interface=docker0
success
[woods@localhost ~]$ systemctl start NetworkManager.service
[woods@localhost ~]$ nmcli connection modify docker0 connection.zone trusted
[woods@localhost ~]$ systemctl restart docker.service
[woods@localhost ~]$ firewall-cmd --get-active-zone
libvirt
interfaces: virbr0
public
interfaces: ens37
trusted
interfaces: docker0
网友评论