exam questions

Exam XK0-005 All Questions

View all questions & answers for the XK0-005 exam

Exam XK0-005 topic 1 question 70 discussion

Actual exam question from CompTIA's XK0-005
Question #: 70
Topic #: 1
[All XK0-005 Questions]

A junior administrator is setting up a new Linux server that is intended to be used as a router at a remote site. Which of the following parameters will accomplish this goal?

  • A.
  • B.
  • C.
  • D.
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
e418137
9 months ago
Selected Answer: C
They don't mention the purpose of the NAT, so keep it simple for the "entry level" exam. With the most common form of NAT or IP Masquerading, post-routing alters packets as they leave the system.
upvoted 1 times
...
BryanSME
11 months ago
Option C. did execute without errors: # echo 1 > /proc/sys/net/ipv4/ip_forward # iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE # So I'm with LRISB, C is the correct answer
upvoted 3 times
...
DRVision
11 months ago
Selected Answer: C
Option B is the correct one: echo 1 > /proc/sys/net/ipv4/ip_forward; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE This command does two things: echo 1 > /proc/sys/net/ipv4/ip_forward enables IP forwarding, which is necessary for the server to forward packets between interfaces. iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE sets up NAT (Network Address Translation) so that packets leaving the eth0 interface will have their source IP address replaced with the IP address of the eth0 interface (i.e., the IP address of the server). This is necessary for the server to act as a router. Option A is incorrect because it uses PREROUTING instead of POSTROUTING. The PREROUTING chain is used for DNAT (Destination NAT), not for SNAT (Source NAT) which is what we want in this case.
upvoted 1 times
...
LKRISB
1 year, 5 months ago
The iptables command "-t nat -A POSTROUTING -o eth0 -j MASQUERADE" configures NAT on the server. It adds a rule to the nat table in iptables that performs source NAT (SNAT) on outgoing packets. The "-o eth0" option specifies the outgoing interface (eth0 in this case), and "-j MASQUERADE" instructs iptables to modify the source IP address of outgoing packets to match the IP address of the interface, effectively masquerading the internal IP addresses. Options a and d are incorrect because they use the PREROUTING chain in iptables, which is used for modifying packets as they enter the system. In the context of setting up a router, we need to modify packets as they leave the system, so we should use the POSTROUTING chain. Option b is incorrect because it uses the "-D" flag, which stands for "delete," to remove a rule from iptables. However, in this case, we need to add a rule to configure NAT, not delete an existing rule. Therefore, the correct answer is
upvoted 2 times
LKRISB
1 year, 5 months ago
Selected answers is : C
upvoted 1 times
...
...
BreakOff874
1 year, 8 months ago
Selected Answer: A
postrouting does not forwards incoming traffic.
upvoted 1 times
...
linux_admin
1 year, 8 months ago
Selected Answer: C
C. echo 1 > /proc/sys/net/ipv4/ip_forward iptables -t nat -A PREROUTING -o eth0 -j MASQUERADE Explanation: The first command (echo 1 > /proc/sys/net/ipv4/ip_forward) enables IP forwarding on the Linux server, allowing it to forward packets from one interface to another. The second command (iptables -t nat -A PREROUTING -o eth0 -j MASQUERADE) uses iptables to set up Network Address Translation (NAT), which will allow the Linux server to act as a router and forward traffic between the external network and the internal network. The "-o eth0" option specifies the outgoing interface, and the "-j MASQUERADE" option sets up MASQUERADE NAT, which dynamically assigns IP addresses to internal network clients as they make outbound connections.
upvoted 2 times
linux_admin
1 year, 8 months ago
Option A (echo 1 > /proc/sys/net/ipv4/ip_forward and iptables -t nat -A PREROUTING -i eth0 -j MASQUERADE) is not preferred because it only enables IP forwarding and NAT (network address translation) for incoming traffic on the eth0 interface. This may not be sufficient for routing all the traffic from a remote site. In a real-world scenario, the router would need to route traffic for both incoming and outgoing traffic. Option C (echo 1 > /proc/sys/net/ipv4/ip_forward and iptables -t nat -A PREROUTING -o eth0 -j MASQUERADE) is more complete as it enables IP forwarding and NAT for both incoming and outgoing traffic on the eth0 interface.
upvoted 1 times
...
...
Ckl22
1 year, 10 months ago
Selected Answer: A
I think the answer is A, as with IP forwarding and PREROUTING, both modifying the packet as it arrives from outside the private LAN, and altering the destination address to a preconfigured mapping
upvoted 2 times
...
Nvoid
1 year, 11 months ago
Selected Answer: A
I picked `A` because its a "remote system" and taking in packets to route which is -i for the "in" interface and the "prerouting". And it's implying the there needs to be traffic between both remote sites.
upvoted 1 times
TheRealManish
1 year, 11 months ago
i think C, please read this and let me know if you still think A after reading.. thanks
upvoted 1 times
TheRealManish
1 year, 11 months ago
https://www.adamintech.com/configure-nat-masquerading-in-iptables/
upvoted 1 times
Nvoid
1 year, 11 months ago
Thanks i read it, i believe you need both a prerouting rule and a postrouting rule: prerouting is incoming packages. postrouting is outgoing packets to other networks. so -i should be used for "in" which would be prerouting. and -o should be used for "out" which would be posting routing. i'm sticking to A, 3 weeks ago someone made a comment that they got 60 out of 63 on the test, so most of the questions i'm thinking are correct, just something thats one the back of my mind.
upvoted 2 times
...
...
...
...
TheRealManish
1 year, 11 months ago
Selected Answer: C
The more i research this one, the more the answer is C. Several links agree.
upvoted 4 times
...
TheRealManish
2 years ago
I don't know the answer for sure, but this link makes it seem like it could be C? https://bobcares.com/blog/iptables-nat-masquerade/
upvoted 4 times
Nvoid
1 year, 11 months ago
its A or C 50/50 chance.
upvoted 2 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago