Courseiva
NetworkingeasyMultiple SelectObjective-mapped

LFCS Networking Practice Question

A system administrator needs to check the firewall rules on a Linux server using firewalld. Which two commands can be used to list the current rules? (Choose two.)

⚠ Common exam trap

Many exam-takers confuse legacy iptables commands with firewalld's native tools, assuming `iptables -L` or `-S` are equivalent to listing firewalld rules, when in fact they bypass firewalld's zone abstraction and may not reflect the current dynamic configuration.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

firewall-cmd --list-all-zones

`firewall-cmd --list-all-zones` displays the firewall rules for all zones configured in firewalld, showing services, ports, and rules per zone. Option E is correct because `firewall-cmd --list-all` lists the rules for the default zone, providing a concise view of active firewall configuration. Both commands are native to firewalld and directly query its runtime and permanent rules via D-Bus.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • systemctl status firewalld

    Why it's wrong here

    This command shows the status of the firewalld service (running or not), not the firewall rules themselves. It does not list any rules.

  • iptables -S

    Why it's wrong here

    This command lists rules in the legacy iptables table. However, firewalld uses nftables as its backend, and iptables rules may not reflect the current firewalld configuration. It bypasses firewalld's zone abstraction.

  • iptables -L

    Why it's wrong here

    Similar to iptables -S, this command lists iptables rules but does not query firewalld's native configuration. It may show rules that are not managed by firewalld.

  • firewall-cmd --list-all-zones

    Why this is correct

    Correct. This command displays the firewall rules for all zones configured in firewalld, including services, ports, and rules per zone.

  • firewall-cmd --list-all

    Why this is correct

    Correct. This command lists the rules for the default zone, providing a concise view of the active firewalld configuration.

About these practice questions

One of 507 original LFCS practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This LFCS practice question is part of Courseiva's free Linux Foundation certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the LFCS exam.