Hi there,
As my needs for a home automation “server” are growing from what a Raspberry Pi with Docker can deliver, I have successfully (and painlessly) installed Rocky Linux 9.3 a few days ago on a SFF PC and installed Docker on it, followed by the containers I needed.
Fortunately, the containers do not have overlapping ports, and they are meant to have full access to the rest of the local network, so I bound them all to the “host” virtual network in docker. To make them accessible over the network through the active firewalld, I defined the “home” zone as being the default one, with the ethernet interface connected to this zone, and with the necessary explicit firewall rules added in the zone.
All is well so far, containers work as expected, and there was much rejoicing.
The odd thing was that, after some time of running, firewalld no longer reported the home zone as being active with firewall-cmd --get-active-zones
, and the Ethernet interface was no longer assigned to any zone with firewall-cmd --get-zone-of-interface=interfacename
. Only the docker0 interface showed up under the Docker zone, although there was no container connected to it or doing any traffic there. There is no functional impact from this, it only annoys me that I cannot add new firewall rules in the Cockpit if the corresponding zone doesn’t show up as active. If I reload the firewall configuration from the shell, it appears again but disappears after some time (minutes even).
As I don’t need the docker “bridge” virtual private network for inter-container traffic, I set the bridge to “none” in the docker json configuration file, restarted docker service and voila, it no longer has a “bridge” network. NetworkManager no longer sees the interface with nmcli device
(only the Ethernet interface and lo are listed), and the Cockpit currently shows just the Ethernet interface with its IP assignments, and I manually deleted the Docker zone in the Cockpit. But firewalld still shows with firewall-cmd --list-all-zones
a Docker zone, and at the same time the “home” zone randomly disappears from being active, and the Cockpit reports “0 zones active”.
Am I doing something wrong or missing something? From all the probing tried so far, it would seem that the root cause is somewhere with firewalld. But why, and more importantly how can I fix it?
Any hints would be very much appreciated. Many thanks in advance!
[quick edit] Just found some leftover configuration file in /etc/firewalld/zones/docker.xml and deleted it. After a firewalld reload, the docker zone is no longer mentioned. Let’s see if home still disappears, though…