美文网首页
Docker采用bridge网络的Container无法连接外网

Docker采用bridge网络的Container无法连接外网

作者: clam314 | 来源:发表于2020-05-19 00:55 被阅读0次

    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
    

    相关文章

      网友评论

          本文标题:Docker采用bridge网络的Container无法连接外网

          本文链接:https://www.haomeiwen.com/subject/wtomohtx.html