Ubuntu: using docker with snap and firewall is a problem

986 Views Asked by At

On a ubuntu 21.10, using docker as a snap (snap install docker). With my firewall enabled, i have a problem resolving DNS:

$ docker run bash ping www.google.com

==> error

$ docker run bash ping 8.8.8.8

==> ok

If I disable the firewall, all is ok (sudo ufw disable):

$ docker run bash ping www.google.com

==> ok

My ufw status is like:

Status: active

To Action From -- ------ ---- 22/tcp ALLOW Anywhere OpenSSH
ALLOW Anywhere Samba
ALLOW 192.168.100.0/24 22/tcp (v6)
ALLOW Anywhere (v6) OpenSSH (v6)
ALLOW Anywhere (v6)

I suspect that the docker container has no access to the internet over TCP (and probably UDP).

What would be the correct config to use to allow docker/snap to pass through the firewall?

0

There are 0 best solutions below