LFCS Networking Practice Question
An administrator must ensure that a Linux router forwards IPv4 packets between its two interfaces, eth0 and eth1, without rebooting. Which command enables this behavior immediately?
⚠ Common exam trap
Many exam-takers confuse firewall FORWARD rules or interface activation with the kernel's routing capability.
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
Enabling IPv4 forwarding requires setting the kernel parameter net.ipv4.ip_forward to 1. The sysctl -w command applies this change at runtime, immediately allowing the router to forward packets between interfaces. Firewall rules and interface states are separate concerns; they do not substitute for the kernel forwarding parameter.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
iptables -A FORWARD -j ACCEPT
Why it's wrong here
An iptables FORWARD rule permits packets to traverse the firewall, but it does not enable the kernel's routing capability. Without net.ipv4.ip_forward=1, the kernel will not forward packets regardless of firewall rules. This rule is complementary but not the primary setting required.
- ✗
echo 1 > /proc/sys/net/ipv4/ip_forward
Why it's wrong here
Writing to /proc/sys/net/ipv4/ip_forward also enables forwarding at runtime, but the question asks for a command that is the standard, recommended method. While this works, sysctl is the preferred interface because it handles formatting and can be made persistent more easily. Both are technically valid, but only one is the best practice answer.
- ✗
ip link set eth0 up && ip link set eth1 up
Why it's wrong here
Bringing interfaces up only activates the links; it does not enable IP forwarding between them. The kernel will still drop packets destined for other networks unless net.ipv4.ip_forward is set to 1. This command is necessary for connectivity but insufficient for routing functionality.
- ✓
sysctl -w net.ipv4.ip_forward=1
Why this is correct
The sysctl -w command writes the value 1 to the net.ipv4.ip_forward kernel parameter at runtime, immediately enabling IPv4 packet forwarding. This satisfies the requirement without a reboot. The change is temporary unless also written to /etc/sysctl.conf or a file under /etc/sysctl.d/ for persistence.
Go deeper
Related to this question
About these practice questions
Courseiva writes every LFCS question from scratch — 406 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 and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Linux Foundation exam blueprint
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.