LPIC-1 Essential System Services and Networking Practice Question
Which TWO commands can be used to display the current firewall rules in a system using nftables? (Choose two.)
⚠ Common exam trap
Many candidates confuse the legacy iptables command (`iptables -L -n`) with nftables, or assume that `systemctl status nftables` shows rules, when in fact it only shows the service's runtime state.
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
✓
nft list ruleset
`nft list ruleset` is the primary command in nftables to display the entire ruleset, including all tables, chains, and rules, regardless of the address family. Option D is also correct because `nft list table inet filter` specifically displays the rules within the 'filter' table of the 'inet' family, which is a valid way to show a subset of the firewall rules. Both commands rely on the nftables framework, which is the modern replacement for iptables on Linux.
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 nftables
Why it's wrong here
systemctl status reports whether the nftables service unit is active, not the ruleset contents. It is tempting because it confirms nftables is running, which suits troubleshooting a service that fails to start, but displaying rules requires nft list ruleset or nft -a list ruleset.
- ✗
iptables -L -n
Why it's wrong here
iptables -L -n reads the legacy iptables ruleset; on an nftables system it may show nothing or only a compatibility shim. It is tempting because both tools share similar syntax and iptables-nft translates commands, which suits mixed legacy environments, but native nftables rules need nft list ruleset.
- ✓
nft list ruleset
Why this is correct
The nft list ruleset command dumps every table, chain and rule in the current nftables ruleset, giving a complete view of active firewall configuration. It directly satisfies the stem's requirement to display current firewall rules without naming a specific table or family.
- ✓
nft list table inet filter
Why this is correct
The nft list table inet filter command displays all chains and rules within the inet family's filter table specifically. It satisfies the stem's requirement to show current firewall rules, scoping output to that table rather than dumping the entire ruleset.
- ✗
firewall-cmd --list-all
Why it's wrong here
firewall-cmd queries firewalld's configuration, not nftables directly, and may report zones rather than the live ruleset. It is tempting because firewalld can use an nftables backend, which suits hosts managed through firewalld, but on a plain nftables system it returns nothing useful.
Go deeper
Related to this question
About these practice questions
Courseiva writes every LPIC-1 question from scratch — 402 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This LPIC-1 practice question is part of Courseiva's free LPI 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 LPIC-1 exam.