CompTIA Linux+ XK0-006 (V8) Practice Question

A Linux edge router that uses iptables has two interfaces: eth0 (public 198.51.100.2/30) and eth1 (private 10.10.10.1/24). A Git service is listening on 10.10.10.42 TCP port 3000. External clients must be able to connect to 198.51.100.2 on TCP port 443 and transparently reach the Git service. IP forwarding is already enabled. Which single iptables command correctly performs the required address translation?

  • iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 443 -j DNAT --to-destination 10.10.10.42:3000

  • iptables -A FORWARD -i eth0 -p tcp --dport 443 -j ACCEPT

  • iptables -t nat -A OUTPUT -o eth1 -p tcp --dport 443 -j MASQUERADE --to-ports 3000

  • iptables -t nat -A POSTROUTING -o eth0 -p tcp --dport 443 -j SNAT --to-source 10.10.10.42:3000

CompTIA Linux+ XK0-006 (V8)
Security
Your Score:
Settings & Objectives
Random Mixed
Questions are selected randomly from all chosen topics, with a preference for those you haven’t seen before. You may see several questions from the same objective or domain in a row.
Rotate by Objective
Questions cycle through each objective or domain in turn, helping you avoid long streaks of questions from the same area. You may see some repeat questions, but the distribution will be more balanced across topics.

Check or uncheck an objective to set which questions you will receive.

Bash, the Crucial Exams Chat Bot
AI Bot