Docker无法连接外网的问题

CentOS 7、 8 中,Docker采用bridge网络的Container无法连接外网的问题
原因::系统默认采用firewelld管理防火墙规则参考

[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

作者:clam314
链接:https://www.jianshu.com/p/8a4ea6fd9827
来源:简书
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。

你可能感兴趣的:(docker,linux)