A server has two network interfaces: eth0 (10.0.0.10/24) and eth1 (192.168.1.10/24). The server needs to act as a router for a subnet 172.16.0.0/24, forwarding packets between it and the 10.0.0.0/24 network. Which sysctl parameter must be set to a value of 1 to enable IP forwarding?
This parameter enables IP forwarding globally for all network interfaces. It is a valid and effective method, so Option A is correct.
Why this answer
Both option A and option D are valid sysctl parameters for enabling IP forwarding. `net.ipv4.conf.all.forwarding` enables forwarding globally across all interfaces, while `net.ipv4.ip_forward` is the classic global parameter. Setting either to 1 allows the server to forward packets between interfaces, making both correct in this scenario.
Exam trap
Both `net.ipv4.conf.all.forwarding` and `net.ipv4.ip_forward` can enable IP forwarding. Candidates may think only one is correct, but both are valid. The trap is to know that the `all.forwarding` parameter is also effective.
How to eliminate wrong answers
Option A is wrong because `net.ipv4.conf.all.forwarding` is not a valid sysctl parameter; the correct parameter for per-interface or all-interface forwarding control is `net.ipv4.conf.all.forwarding` does not exist, and the proper parameter for enabling forwarding on all interfaces is `net.ipv4.conf.all.forwarding` is actually a valid parameter but it is an alias for `net.ipv4.ip_forward` in some kernel versions, however the standard and most commonly tested parameter is `net.ipv4.ip_forward`. Option B is wrong because `net.core.forwarding` is not a valid sysctl parameter; the `net.core` namespace deals with core networking parameters like `net.core.rmem_default` and `net.core.wmem_max`, not IP forwarding. Option C is wrong because `net.ipv4.tcp_forwarding` is not a valid sysctl parameter; TCP forwarding is not a kernel-level concept, and IP forwarding operates at the network layer (Layer 3), not the transport layer (Layer 4).