Which of the following commands will accomplish this task?

A systems administrator is configuring a Linux system so the network traffic from the internal network 172.17.0.0/16 going out through the eth0 interface would appear as if it was sent directly from this interface.

Which of the following commands will accomplish this task?
A . iptables -A POSTROUTING -s 172.17.0.0/16 -o eth0 -j MASQUERADE
B . firewalld -A OUTPUT -s 172.17.0.0/16 -o eth0 -j DIRECT
C . nmcli masq-traffic eth0 -s 172.17.0.0/16 -j MASQUERADE
D . ifconfig — nat eth0 -s 172.17.0.0/16 -j DIRECT

Answer: A

Explanation:

This command will use the iptables tool to append a rule to the POSTROUTING chain of the nat table, which will match any packet with a source address of 172.17.0.0/16 and an output interface of eth0, and apply the MASQUERADE target to it. This means that the packet will have its source address changed to the address of the eth0 interface, effectively hiding the internal network behind a NAT12.

References: 1: Iptables NAT and Masquerade rules – what do they do? 2: Routing from docker containers using a different physical network interface and default gateway

Latest XK0-005 Dumps Valid Version with 136 Q&As

Latest And Valid Q&A | Instant Download | Once Fail, Full Refund

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments