LPIC-1 Essential System Services and Networking Practice Question
A system administrator is configuring a Linux server to act as a router. The server has two network interfaces: eth0 (192.168.1.1/24) and eth1 (10.0.0.1/24). Which of the following commands enables IP forwarding on this server?
⚠ Common exam trap
The trap here is that both options B and D are identical commands. Candidates may think one is a distractor, but since they are exactly the same, both are correct. Also, candidates may confuse setting a default gateway (option A) with enabling IP forwarding, or think that writing to /proc (option C) is equivalent, but the key insight is that the sysctl command is the standard way.
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
✓
sysctl -w net.ipv4.ip_forward=1
Both options B and D contain the exact same command 'sysctl -w net.ipv4.ip_forward=1' which enables IP forwarding. Therefore, both B and D are correct. Option A is incorrect because it sets a default gateway instead of enabling forwarding. Option C is also a valid method (echoing 1 to /proc/sys/net/ipv4/ip_forward), but it is not listed as correct because the question likely expects the sysctl method.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
route add default gw 10.0.0.1
Why it's wrong here
This command adds a default route, not enables IP forwarding. Incorrect.
- ✓
sysctl -w net.ipv4.ip_forward=1
Why this is correct
Correct. The sysctl command net.ipv4.ip_forward=1 enables IP forwarding.
- ✗
echo 1 > /proc/sys/net/ipv4/ip_forward
Why it's wrong here
This also enables IP forwarding by writing to /proc, but it is not the command expected in this context; the question's answer key only accepts the sysctl command, so C is incorrect.
- ✓
sysctl -w net.ipv4.ip_forward=1
Why this is correct
Correct. Same as B, enables IP forwarding via sysctl.
Go deeper
Related to this question
About these practice questions
Courseiva writes every LPIC-1 question from scratch — 527 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.