Hi all,
I’m new to Fedora, also new to Firewalld. After reading about it, it sounds like a fantastic abstraction, very logical.
So I set about moving my nic to the public zone:
sudo firewall-cmd --zone=public --change-interface=enp114s0 --permanent
The interface is under control of NetworkManager, setting zone to 'public'.
success
That stuff about NetworkManager does not sound good, but alas, things seem to be as expected:
$ sudo firewall-cmd --get-zone-of-interface=enp114s0
public
I remove all the services I don’t want on public (I’ll enable some on Tailscale later):
sudo firewall-cmd --zone=public --remove-service=dhcpv6-client --permanent
sudo firewall-cmd --zone=public --remove-service=mdns --permanent
Now we have:
$ sudo firewall-cmd --list-services --zone=public
ssh
Look good!
However, first confusing thing, /usr/lib/firewalld/zones/public.xml still reflects the old state (even after reboot), why is that? Should I ignore this?
$ cat /usr/lib/firewalld/zones/public.xml
<?xml version="1.0" encoding="utf-8"?>
<zone>
<short>Public</short>
<description>For use in public areas. You do not trust the other computers on networks to not harm your computer. Only selected incoming connections are accepted.</description>
<service name="ssh"/>
<service name="mdns"/>
<service name="dhcpv6-client"/>
<forward/>
</zone>
The second confusing thing, and I’ve found already that network manager is to blame, after a reboot my nic enp114s0 is back in the FedoraServer zone.
This is scary stuff, I don’t want myself locked out, I also don’t want things I don’t expect on the public interface.
I’ve read that you can disable network manager, but is this really the case? I haven’t found anything on this in the official docs anywhere. I don’t feel comfortable moving forward with firewalld with such types of issues, I really need to know this won’t just reset, ever.
What is the absolute best solution to this that I can put in our internal docs?
I suppose I can just keep using the zone FedoraServer for my nic, but would that mean NetworkManager will not change it? I prefer to fully understand this issues and deal with it thoroughly.