XK0-006 practice question 14 of 15
A technician wants to temporarily use a Linux virtual machine as a router for the network segment 10.10.204.0/24. Which of the following commands should the technician issue? (Select three).
Full set: 149 questionsTo function as a router, a Linux system requires three configurations. First, IP forwarding must be enabled in the kernel, which is done by writing "1" to /proc/sys/net/ipv4/ipforward (A). Second, the firewall must be configured to allow traffic to pass between interfaces; a simple rule to permit this is iptables -A FORWARD -j ACCEPT (B). Third, to allow the private network to access external networks, Source NAT (SNAT) must be configured. iptables -t nat -A POSTROUTING -j MASQUERADE (G) achieves this by translating the source IP of packets from the specified subnet as they leave the router.
C: The PREROUTING chain is used for Destination NAT (DNAT), not for allowing traffic forwarding. D: MASQUERADE is a source NAT action and must be in the POSTROUTING chain, not PREROUTING. E: This command disables IP forwarding, which is the opposite of the required action. F: The /proc/net/tcp file is used to view active TCP connections, not to configure routing. H: The MASQUERADE target must be applied in the POSTROUTING chain, not PREROUTING.
1. The Linux Kernel Documentation. Documentation/networking/ip-sysctl.txt. The entry for ipforward in /proc/sys/net/ipv4/ describes it as the master switch for enabling or disabling packet forwarding.
2. iptables(8) Linux manual page. The "TABLES" section describes the nat table's POSTROUTING chain for altering packets "as they are about to go out." The "TARGETS" section describes MASQUERADE for SNAT.
3. Red Hat Enterprise Linux 7 Documentation. (2023). Networking Guide. Chapter 21, "Network Address Translation," Section 21.2, "IP Forwarding and Masquerading," provides a procedure that includes enabling ipforward and using iptables with POSTROUTING and MASQUERADE.
Keep practicing
Take the free XK0-006 practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other XK0-006 practice questions
- Question 1A DevOps engineer needs to create a local Git repository. Which of the following commands…
- Question 2Which of the following is the main reason for setting up password expiry policies?
- Question 3A Linux administrator needs to securely erase the contents of a hard disk. Which of the f…
- Question 4Which of the following best describes the role of initrd?
- Question 5Which of the following is a characteristic of Python 3?
- Question 6A Linux user runs the following command: nohup ping comptia.com & Which of the following …
