Docker container when connecting to new network bridge unable to contact internet as host firewall blocks new interface

I have been following the guide available here:

I think they are omitting a rather important issue regarding host firewalls.

For example, on Centos 8 I allow docker0 with the following command:
firewall-cmd --permanent --zone=trusted --add-interface=docker0

This works with the default bridge. When you create a new network, this creates a new network interface.

The guide should remind that this interface also needs to be considered by the host firewall. I have been troubleshooting for 1 hour until I realised that by creating an additional docker network, it was no longer using the default docker0 and now using a new br-xxxxx interface.

This was easily fixed by
firewall-cmd --permanent --zone=trusted --add-interface=br-xxxxx

I hope this avoids someone else the wasted time.

1 Like

Hi, try this please https://docs.docker.com/opensource/ :slight_smile: