LPIC-2 Advanced Networking Configuration Practice Question
A company has multiple subnets and wants to implement policy-based routing to direct traffic from a specific development subnet (192.168.10.0/24) through a specialized firewall for content filtering, while all other traffic uses the default gateway. Which of the following steps is required to achieve this using iproute2 tools?
⚠ Common exam trap
A common mix-up: candidates confuse destination-based static routing (which affects where traffic goes) with source-based policy routing (which affects how traffic leaves), leading them to choose Option C or B instead of recognizing the need for a separate routing table and ip rule.
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
✓
Create a new routing table (e.g., table 100), add a default route via the firewall in that table, and add an ip rule to use table 100 for traffic from 192.168.10.0/24.
Policy-based routing (PBR) with iproute2 requires creating a separate routing table, adding a default route via the firewall in that table, and then using an ip rule to match traffic from the source subnet (192.168.10.0/24) and direct it to that custom table. This allows traffic from the development subnet to follow a different path than the default gateway, while all other traffic continues to use the main routing table.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Use iptables to mark packets from the development subnet and then use ip rule to use the main table for marked packets.
Why it's wrong here
Directing marked packets to the `main` routing table would cause them to follow the same default routing as unmarked traffic, failing to implement the specialised path. Policy-based routing requires `ip rule` to select a *different* custom routing table for marked packets, not the `main` table. `iptables` marking is correctly utilised to classify packets for `ip rule`, making this option tempting, as it forms the initial step for directing traffic to an alternative routing table.
- ✗
Add an ip rule to route traffic from 192.168.10.0/24 to the firewall without creating a new table.
Why it's wrong here
An ip rule must reference a routing table; without a table, the rule is incomplete.
- ✗
Add a static route to the main routing table for 192.168.10.0/24 pointing to the firewall.
Why it's wrong here
This modifies the main table, affecting all traffic destined to that subnet, not policy routing.
- ✓
Create a new routing table (e.g., table 100), add a default route via the firewall in that table, and add an ip rule to use table 100 for traffic from 192.168.10.0/24.
Why this is correct
This correctly implements policy-based routing by using a separate routing table and a rule.
Visual reference
Go deeper
Related to this question
About these practice questions
This LPIC-2 question is part of Courseiva's 507-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam 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.