exam questions

Exam XK0-005 All Questions

View all questions & answers for the XK0-005 exam

Exam XK0-005 topic 1 question 100 discussion

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

A DevOps engineer needs to allow incoming traffic to ports in the range of 4000 to 5000 on a Linux server. Which of the following commands will enforce this rule?

  • A. iptables -f filter -I INPUT -p tcp --dport 4000:5000 -A ACCEPT
  • B. iptables -t filter -A INPUT -p tcp --dport 4000:5000 -j ACCEPT
  • C. iptables filter -A INPUT -p tcp --dport 4000:5000 -D ACCEPT
  • D. iptables filter -S INPUT -p tcp --dport 4000:5000 -A ACCEPT
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

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 8 months, 4 weeks ago
Selected Answer: B
The command iptables is used to manage the rules in the Linux kernel's firewall. The options used in the command determine how the rule will be enforced. In the case of option B, -t filter specifies that the rules should be applied to the filter table, which is used for packet filtering. The -A INPUT option specifies that the rule should be appended to the INPUT chain, which is used for incoming traffic. The -p tcp option specifies that the rule should only apply to TCP traffic, and the --dport 4000:5000 option specifies that the rule should only apply to incoming traffic to ports in the range of 4000 to 5000. The -j ACCEPT option specifies that the matching traffic should be accepted, allowing it to enter the system.
upvoted 5 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