LPIC-2 Advanced Networking Configuration Practice Question
A company's Linux router uses iptables. The administrator needs to log all dropped packets (by default policy) before they are dropped. Where should the LOG rule be placed?
⚠ Common exam trap
Candidates often think the LOG rule must be placed in the INPUT chain (for incoming traffic) or that a custom chain is required, but the correct placement is in the FORWARD chain with an explicit DROP action after the LOG to ensure logging before the default policy drop.
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
✓
In the FORWARD chain with -j LOG --log-prefix 'DROPPED' and then -j DROP
The LOG rule must be placed in the FORWARD chain before the DROP action to log packets that are dropped by the default policy. In iptables, the LOG target does not terminate the rule; it logs the packet and then continues to the next rule. By placing `-j LOG --log-prefix 'DROPPED'` followed by `-j DROP`, the packet is logged before being explicitly dropped, ensuring that packets matching the default policy (which drops at the end of the chain) are captured in the log. The FORWARD chain is the correct chain for a router handling traffic that is not destined for the router itself.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
In the FORWARD chain with target LOG
Why it's wrong here
Only logs, does not drop; packets would still be accepted by default policy.
- ✗
In the INPUT chain before the drop rule
Why it's wrong here
Does not address FORWARD chain; default drop policy still not logged.
- ✗
In a custom chain called LOGDROP and jump to it
Why it's wrong here
Custom chain must be called; still need LOG and DROP rules and proper placement.
- ✓
In the FORWARD chain with -j LOG --log-prefix 'DROPPED' and then -j DROP
Why this is correct
Logs and then explicitly drops packets that reached end of chain, emulating default policy for logging.
Go deeper
Related to this question
About these practice questions
Courseiva writes every LPIC-2 question from scratch — 507 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-2 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-2 exam.