Skip to content

Instantly share code, notes, and snippets.

@reytech-dev
Created November 14, 2020 20:28
Show Gist options
  • Save reytech-dev/424f175223c62043c85e2b5fbd61e037 to your computer and use it in GitHub Desktop.
Save reytech-dev/424f175223c62043c85e2b5fbd61e037 to your computer and use it in GitHub Desktop.
Docker networking with firewalld
Source: https://stackoverflow.com/questions/40214617/docker-no-route-to-host
# Firewalld settings
1. open all IPs starts with "172" so that all the containers may communicate each other
```shell
$ sudo firewall-cmd --permanent --zone=public --add-rich-rule='rule family=ipv4 source address=172.0.0.0/8 accept'
```
2. make our container able to visit the network outside
```shell
$ sudo firewall-cmd --permanent --zone=public --add-masquerade
```
3. apply the change
```shell
$ sudo firewall-cmd --reload
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment