Listing firewalld Rules
Wondering what firewall rules are put in place by firewalld tool? Here's how to know that.
Listing firewalld rules is the first step when configuring a network problem to know if the service you intend to use is being blocked by the firewall or not.
To list firewalld rules, all you need to do is execute the following:
firewall-cmd --list-all
Want more details? Let me help.
How to list firewalld rules
If your distro comes pre-installed with firewalld then the firewalld service will be up and running but sometimes, it may bring an error than the firewalld rules.
For example, when I tried listing the firewalld rules, it gave me this:
The above output simply means the firewalld is not enabled so first, you have to enable the firewall using the following:
sudo systemctl start firewalld
Now, if you try to list the firewalld rules, it will show you the following:
How to list firewalld rules of a specific zone
To list firewalld rules of a specific zone, use the firewall-cmd
command in the following manner:
firewall-cmd --list-all --zone <zone_name>
For example, if I want to list firewalld rules of the public
zone, then I'll be using the following:
firewall-cmd --list-all --zone public
Yep, that's all it takes to list firewalld rules of a specific zone.
Final words
Listing firewalld rules is a simple yet important task. And in this tutorial, I went through how you can list all the firewall rules and also explained how you can list firewalld rules of a specific zone.
I hope listing firewalld will no longer be a complex task for you.
If you still have any doubts or queries, feel free to leave a comment.
A software engineer who loves to tinker with hardware till it gets crashed. While reviving my crashed system, you can find me reading literature, manga, or watering my plants.