Courseiva
Networking →hardMultiple Choice

LFCS Networking Practice Question

An administrator is configuring a Linux server as a router. The server has two interfaces: eth0 (192.168.10.1/24) connected to the internal LAN and eth1 (203.0.113.2/24) connected to the internet. After enabling IP forwarding, internal clients still cannot reach external websites. Which command is required to allow the internal subnet to be translated to the external interface?

⚠ Common exam trap

The trap here is selecting a FORWARD rule alone, forgetting that NAT is also needed for private addresses to communicate with external networks.

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

✓

iptables -t nat -A POSTROUTING -s 192.168.10.0/24 -o eth1 -j MASQUERADE

For internal clients to reach the internet through a Linux router, their private source addresses must be translated to the router's public address. The correct rule uses the nat table's POSTROUTING chain with MASQUERADE on the outbound interface, enabling source NAT for the internal subnet.

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 -s 192.168.10.0/24 -o eth1 -j ACCEPT

    Why it's wrong here

    This rule only permits forwarding of packets from the internal subnet out eth1, but it does not perform address translation. Even with forwarding allowed, external hosts would not know how to route replies back to the private addresses. NAT is required in addition to the FORWARD rule.

  • ✓

    iptables -t nat -A POSTROUTING -s 192.168.10.0/24 -o eth1 -j MASQUERADE

    Why this is correct

    This rule performs source NAT (masquerading) for traffic from the internal subnet leaving via eth1. It rewrites the source address to that of eth1, allowing return traffic. Without it, external hosts cannot route replies back to the private 192.168.10.0/24 network, so clients fail to reach websites.

  • ✗

    iptables -t nat -A PREROUTING -s 192.168.10.0/24 -o eth1 -j MASQUERADE

    Why it's wrong here

    The PREROUTING chain is used for destination NAT, not source NAT. Applying MASQUERADE here is incorrect because it would attempt to rewrite packets before routing decisions, and the `-o` option is not valid in PREROUTING. This rule would not achieve the required source address translation for outbound traffic.

  • ✗

    iptables -t nat -A POSTROUTING -d 192.168.10.0/24 -i eth1 -j SNAT --to-source 203.0.113.2

    Why it's wrong here

    This rule matches destination 192.168.10.0/24, which is the internal network, and applies to incoming traffic on eth1. That is the wrong direction for source NAT of outbound traffic. It would not translate the source addresses of packets leaving the internal network.

Visual reference

Inside (Private) PC-A 10.0.0.1 PC-B 10.0.0.2 NAT Router Outside (Public) 203.0.113.1 Inside Global Server PAT: many private IPs share one public IP via unique port numbers

About these practice questions

This LFCS question is part of Courseiva's 406-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 →

How Courseiva writes practice questions · Editorial policy

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.