Courseiva
NetworkingmediumMultiple ChoiceObjective-mapped

How to Enable IP Forwarding in Linux for Routing

A server needs to forward packets between two networks: 10.0.1.0/24 on eth0 and 10.0.2.0/24 on eth1. Which sysctl parameter must be enabled?

Quick Answer

The answer is `net.ipv4.ip_forward = 1`. This sysctl parameter must be enabled because it instructs the Linux kernel to forward IP packets between network interfaces—in this case, between eth0 on the 10.0.1.0/24 subnet and eth1 on the 10.0.2.0/24 subnet—allowing the server to act as a router. Without this setting, the kernel drops any packet not destined for the local system, effectively isolating the two networks. On the Linux Foundation Certified System Administrator LFCS exam, this concept tests your understanding of basic routing and kernel parameters; a common trap is confusing this with firewall rules or interface-specific settings. Remember that enabling IP forwarding is a global kernel toggle, not a per-interface configuration. A simple memory tip: think of the “4” in `ipv4` as the number of octets in an IP address, and “forward” as the action needed to pass traffic between subnets—if you want packets to move, you must flip that switch to 1.

⚠ Common exam trap

Candidates often confuse security-related sysctl parameters (like rp_filter or send_redirects) with the actual forwarding control, or mistakenly think that enabling source route acceptance is needed for routing between subnets.

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

net.ipv4.ip_forward = 1

Enabling `net.ipv4.ip_forward = 1` allows the Linux kernel to forward IP packets between network interfaces, which is required for a server to route traffic between the 10.0.1.0/24 and 10.0.2.0/24 subnets. Without this parameter, the kernel drops any packet not destined for the local system, preventing inter-network communication.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • net.ipv4.conf.all.rp_filter = 1

    Why it's wrong here

    This enables reverse path filtering, not forwarding.

  • net.ipv4.ip_forward = 1

    Why this is correct

    This enables IP forwarding between interfaces.

  • net.ipv4.conf.all.accept_source_route = 1

    Why it's wrong here

    This enables acceptance of source-routed packets, not forwarding.

  • net.ipv4.conf.all.send_redirects = 0

    Why it's wrong here

    This disables ICMP redirects, not forwarding.

Visual reference

192.168.1.0 /24 256 addresses (254 usable) 192.168.1.0 /25 Subnet A 128 addr (126 usable) 192.168.1.128 /25 Subnet B 128 addr (126 usable) Borrowing 1 bit from host portion creates 2 subnets (/25)

About these practice questions

Courseiva writes every LFCS 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 →

How Courseiva writes practice questions · Editorial policy

Same concept, more angles

1 more way this is tested on LFCS

These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.

Variation 1. Which THREE conditions must be met for a Linux system to function as a router between two networks?

hard
  • A.Each interface has an IP address in the respective subnet
  • B.IP forwarding is enabled (net.ipv4.ip_forward = 1)
  • C.Both interfaces have the same MAC address
  • D.iptables rules allow forwarding (FORWARD chain policy or rules)
  • E.The system is configured as the default gateway for both networks

Why A: Each interface must have an IP address in its respective subnet for the Linux system to receive packets from that network and forward them to the other. Without an IP address in the subnet, the interface cannot participate in ARP resolution or routing decisions for that network.

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

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.