I'm trying to work out why a firewall is not behaving as I think I've asked it to behave, and thus trying to work out how to get firewalld
to show its complete set of rules, in some format resembling an iptables
configuration file. Or some other format – I don't much care – as long as it's as least as readable as an iptables
or pf
configuration (ie, this is a pretty low bar to clear!).
- Commands like
firewall-cmd --list-all
‘List everything added for or enabled in zone.’ But that just lists interfaces, services, and so on, with no further detail. I can't see a --list-all-no-really-everything
option.
- I thought I had found it when I read about the
direct
rules, but I see that that only applies to rules added as extra ‘direct’ rules, and isn't the trapdoor into the engine room that it first appeared.
- I see the configuration files in
/etc/firewalld
and the defaults in /usr/lib/firewalld
. But while this is promising at first glance, and beautifully commented, it doesn't seem to actually tell me much about the current state. Questions like this one are about exporting rules (for moving elsewhere), and suggests that this is all there is (I'm guessing that ports mentioned in services mentioned in the public zone are blocked for incoming...?).
My understanding (correct me if I'm wrong) is that firewalld
has something iptables-like inside, which is doing all the actual work, and it has some sort of state which --reload
can find and, well,... reload. That is the state which I'm hoping to find.
Perhaps I'm dim, but I find the overall level of indirection and helpfulness of firewall-cmd
completely unintelligible. Yes, famously ‘every problem in computing science can be solved by adding another layer of indirection’, but sometimes this can be taken to extremes.
I may not have a firewall problem at all, but I can't work out enough about the firewall state to rule that out. Is there a case for switching to iptables (I wonder in desperation)? It's more fuss to set up, and easy to get things wrong, but at least I have some idea what's happening.
I'm very open to frame challenges, or to being told I'm barking up the wrong tree.