Querying firewall rules on Fedora with firewalld

Fedora uses firewalld and not ufw for managing firewall rules. Firewalld has a concept of zones, so if you ask it for a list of all rules like so:

sudo firewall-cmd --list-all

…you won’t get the output you expect. To list firewall rules for a specific zone, do this:

sudo firewall-cmd --list-all --zone=FedoraServer

…replacing FedoraServer with the zone you want.

To get the currently active zones and the network interfaces attached to them, do this:

sudo firewall-cmd --get-active-zones

Add new firewall rules to the zone that contains the network interface that you want to allow traffic from.

Don’t forget to reload the firewall when you’re done adding / editing rules! Otherwise they won’t take effect. Reload the firewall like so:

sudo firewall-cmd --reload