The correct command is `iptables -A INPUT -s 192.168.1.100 -j DROP`, which appends a rule to the INPUT chain that silently discards all incoming packets from that source IP. This works because iptables uses netfilter, the Linux kernel’s packet filtering framework, to evaluate traffic against a set of ordered rules; the `-A` flag adds the rule to the end of the chain, `-s` specifies the source address, and `-j DROP` tells the kernel to drop the packet immediately without sending any response. On the CompTIA Linux+ XK0-005 exam, this question tests your ability to apply basic firewall rules at the command line, often presented with distractors that use the wrong chain (like OUTPUT or FORWARD) or the wrong target (like REJECT instead of DROP). A common trap is confusing `-A` (append) with `-I` (insert), but since the rule is unique and order doesn’t matter for a single block, `-A` is perfectly valid. Remember the mnemonic: “Add Source, then Drop” — A for Append, S for Source, D for Drop.
XK0-005 Troubleshooting Practice Question
This XK0-005 practice question tests your understanding of troubleshooting. Read the scenario carefully and evaluate each option against the stated constraints before committing to an answer. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.
Exhibit
Refer to the exhibit.
journalctl -u sshd output:
sshd[1234]: Failed password for root from 192.168.1.100 port 22 ssh2
sshd[1235]: Failed password for root from 192.168.1.100 port 22 ssh2
... repeated ...
The administrator wants to block the IP address shown in the exhibit. Which command should be used?
Clue words in this question
Noticing these words before you look at the options changes how you read each choice.
Clue: "which command"
Why it matters: Tests specific CLI syntax. Recall the exact command and its required context — near-synonyms and partial matches are common distractors.
Refer to the exhibit.
journalctl -u sshd output:
sshd[1234]: Failed password for root from 192.168.1.100 port 22 ssh2
sshd[1235]: Failed password for root from 192.168.1.100 port 22 ssh2
... repeated ...
A
fail2ban
Why wrong: Automated tool, not a command to immediately block.
B
echo '192.168.1.100' >> /etc/hosts.deny
Why wrong: Legacy tcpwrappers, not effective for all services.
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
iptables -A INPUT -s 192.168.1.100 -j DROP
Option C is correct because `iptables -A INPUT -s 192.168.1.100 -j DROP` appends a rule to the INPUT chain that drops all incoming packets from the source IP 192.168.1.100. This is the standard Linux firewall command for blocking traffic at the network layer using netfilter, and it works immediately without requiring a service restart.
Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
✗
fail2ban
Why it's wrong here
Automated tool, not a command to immediately block.
✗
echo '192.168.1.100' >> /etc/hosts.deny
Why it's wrong here
Legacy tcpwrappers, not effective for all services.
✓
iptables -A INPUT -s 192.168.1.100 -j DROP
Why this is correct
Correct: Drops all packets from that IP.
Clue confirmation
The clue word "which command" in the question point toward this answer.
Related concept
Read the scenario before looking for a memorised answer.
Syntax is for firewalld but not directly block; need --add-rich-rule.
Common exam traps
Common exam trap: answer the scenario, not the keyword
The trap here is that candidates confuse `hosts.deny` with a network-level firewall, not realizing it only controls access to specific services using TCP wrappers and requires a daemon:client format, while `iptables` operates at the kernel level on all IP traffic.
Trap categories for this question
Command / output trap
Automated tool, not a command to immediately block.
Detailed technical explanation
How to think about this question
The `iptables` command operates on netfilter hooks in the Linux kernel; the `-A INPUT` flag appends the rule to the end of the INPUT chain, which processes all packets destined for the local system. The `-j DROP` target silently discards the packet without sending an ICMP unreachable message, which can be useful for security by not revealing the existence of the host. In modern systems, `nftables` is the successor, but `iptables` remains widely used and is still tested on the XK0-005 exam.
KKey Concepts to Remember
Read the scenario before looking for a memorised answer.
Find the constraint that changes the correct option.
Eliminate answers that are true in general but not in this case.
TExam Day Tips
→Watch for words such as best, first, most likely and least administrative effort.
→Review why wrong options are wrong, not only why the correct option is correct.
Key takeaway
Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.
Real-world example
How this comes up in practice
A security administrator must allow nursing staff to reach a patient records server while blocking access from the guest Wi-Fi VLAN. After applying an extended ACL, traffic is still blocked from nursing workstations. The ACL was applied outbound instead of inbound on the wrong interface. Questions like this test ACL direction and placement rules.
Related glossary terms
Concepts from this question explained
These glossary pages explain the core terms tested in this XK0-005 question in full detail.
Troubleshooting — This question tests Troubleshooting — Read the scenario before looking for a memorised answer..
What is the correct answer to this question?
The correct answer is: iptables -A INPUT -s 192.168.1.100 -j DROP — Option C is correct because `iptables -A INPUT -s 192.168.1.100 -j DROP` appends a rule to the INPUT chain that drops all incoming packets from the source IP 192.168.1.100. This is the standard Linux firewall command for blocking traffic at the network layer using netfilter, and it works immediately without requiring a service restart.
What should I do if I get this XK0-005 question wrong?
Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.
Are there clue words in this question I should notice?
Yes — watch for: "which command". Tests specific CLI syntax. Recall the exact command and its required context — near-synonyms and partial matches are common distractors.
What is the key concept behind this question?
Read the scenario before looking for a memorised answer.
About these practice questions
Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
This XK0-005 practice question is part of Courseiva's free CompTIA certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the XK0-005 exam.
Question Discussion
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
Sign in to join the discussion.