exam questions

Exam XK0-005 All Questions

View all questions & answers for the XK0-005 exam

Exam XK0-005 topic 1 question 4 discussion

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

A Linux administrator needs to redirect all HTTP traffic temporarily to the new proxy server 192.0.2.25 on port 3128. Which of the following commands will accomplish this task?

  • A. iptables -t nat -D PREROUTING -p tcp --sport 80 -j DNAT - -to-destination 192.0.2.25:3128
  • B. iptables -t nat -A PREROUTING -p top --dport 81 -j DNAT –-to-destination 192.0.2.25:3129
  • C. iptables -t nat -I PREROUTING -p top --sport 80 -j DNAT –-to-destination 192.0.2.25:3129
  • D. iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT –-to-destination 192.0.2.25:3128
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

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
linux_admin
Highly Voted 11 months ago
The command "iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT –-to-destination 192.0.2.25:3128" will temporarily redirect all HTTP traffic to the new proxy server at IP address 192.0.2.25 and port 3128. The options used in this command are: -t nat: Specifies the table (nat) to be used for this operation -A PREROUTING: Specifies that the rule should be added to the PREROUTING chain, which is used to manipulate incoming packets before they are processed by the routing decision -p tcp: Specifies that the rule should apply to TCP packets --dport 80: Specifies that the rule should apply to incoming packets destined for port 80 (the default HTTP port) -j DNAT: Specifies that the target of the rule should be DNAT (Destination NAT), which rewrites the destination address of a packet --to-destination 192.0.2.25:3128: Specifies the destination address and port to which incoming packets should be redirected Note: After executing this command, the administrator should make sure to save the iptables configuration, so that it will persist after a reboot.
upvoted 5 times
...
copovo
Most Recent 4 weeks, 1 day ago
Selected Answer: D
D is correct. Learn more here The options used in this command are: https://docs.google.com/document/d/1FHKk4HZOASQ88Ots-dfaV3V3dpK1LdENg18jKsBx0cI
upvoted 1 times
...
Alizadeh
4 months, 4 weeks ago
Selected Answer: D
The correct answer is D. iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT –-to-destination 192.0.2.25:3128.
upvoted 1 times
...
Huckleberry
11 months, 4 weeks ago
-A --append -D --delete -t --tables nat PREROUTING(for altering packets as soon as they come in)
upvoted 2 times
...
bjornborg
1 year, 2 months ago
D is correct. Learn more here https://sourcedaddy.com/networking/running-public-services-private-ip-addresses.html
upvoted 1 times
Nvoid
1 year, 1 month ago
was on the test and i choose D.
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