Verify firewalld config with cat /etc/firewalld
In the previous step, we saw which firewalld
zones are active. Now, let's take a look at where firewalld
stores its configuration files. These files define the rules for each zone.
The main configuration directory for firewalld
is /etc/firewalld
. Inside this directory, you'll find subdirectories for zones, services, and other configuration elements.
We can use the cat
command to view the contents of files. To see what's inside the /etc/firewalld
directory, we can try to cat
it, but cat
is designed for files, not directories. Instead, let's list the contents of the directory using the ls
command.
Type the following command and press Enter:
ls /etc/firewalld/
You should see a list of directories and files, something like this:
icmptypes lockdown-whitelist.xml modules panic-iface.conf services zones
This shows the structure of the firewalld
configuration. The zones
directory is particularly important, as it contains the configuration files for each zone (like public.xml
, trusted.xml
, etc.).
Let's look inside the zones
directory. Type:
ls /etc/firewalld/zones/
You'll see a list of XML files, one for each predefined zone:
block.xml dmz.xml drop.xml external.xml home.xml internal.xml public.xml trusted.xml work.xml
These XML files contain the specific rules for each zone. For example, public.xml
defines the rules for the public
zone we saw was active in the previous step.
While we won't dive into the details of the XML files in this lab, knowing where the configuration is stored is a key part of understanding firewalld
.
Click Continue to move to the next step.