Docker - No route to host

前端 未结 8 1227
予麋鹿
予麋鹿 2021-02-01 17:46

When i try and connect to a port from within my container to another container, i am unsuccessful and get,

root@ac1590a59fe5:/opt/f5massupgrade#         


        
8条回答
  •  时光说笑
    2021-02-01 18:34

    Since docker will create a couple of networks, I would prefer to open all the related IPs.

    # open all IPs starts with "172" so that all the containers may communicate each other
    sudo firewall-cmd --permanent --zone=public --add-rich-rule='rule family=ipv4 source address=172.0.0.0/8 accept'
    # make our container able to visit the network outside
    sudo firewall-cmd --permanent --zone=public --add-masquerade
    # apply the change
    sudo firewall-cmd --reload
    

    You may visit /etc/firewalld/zones/public.xml for your final result.

    Here is my example:

    
    
      Public
      For use in public areas. You do not trust the other computers on networks to not harm your computer. Only selected incoming connections are accepted.
      
      
      
      
        
        
      
    
    

    Hoping it helps.

提交回复
热议问题