Failed to start docker-daemon: Firewalld: docker zone already exists

5.8k Views Asked by At

I have the following after running firewall-cmd --get-active-zones

public
  interfaces: virbr0 docker0 lxcbr0 wlan0
trusted
  sources: 172.17.0.0/16 53.0.0.0/8

These are insights I got from failed to start daemon: Error initializing network controller: Error creating default "bridge" network

The problem is, sudo dockerd fails with error messages, among which there is

failed to start daemon: Error initializing network controller: Error creating default "bridge" network: Failed to program NAT chain: ZONE_CONFLICT: 'docker0' already bound to a zone

How to manipulate the zone so that I can start the docker daemon?

EDIT: This solution worked for me:

sudo firewall-cmd --permanent --new-zone=docker 
sudo firewall-cmd --reload
sudo firewall-cmd --permanent --zone=docker --add-interface=docker0
2

There are 2 best solutions below

0
On

it was better to mention the solution in answers @Ilonpilaaja. this commands worked for me too:

sudo firewall-cmd --permanent --new-zone=docker 
sudo firewall-cmd --reload
sudo firewall-cmd --permanent --zone=docker --add-interface=docker0
0
On

this works (do all the steps):

  1. Check if docker zone exists in firewall-cmd
$ firewall-cmd --get-active-zones
  1. If "docker" zone is available, change interface to docker0 (not persisted)
$ sudo firewall-cmd --zone=docker --change-interface=docker0
  1. If "docker" zone is available, change interface to docker0 (persisted, thanks rbjorklin)
$ sudo firewall-cmd --permanent --zone=docker --change-interface=docker0
$ sudo systemctl restart firewalld

credit: https://gist.github.com/reytech-dev/1cbbb158df374018be454537de32a428