mediumMultiple ChoiceObjective-mapped
XK0-006 Practice Question: A system administrator is configuring a firewall…
A system administrator is configuring a firewall using iptables. The requirement is to allow incoming SSH connections from the 192.168.1.0/24 network only. Which iptables rule should be added to the INPUT chain?
⚠ Common exam trap
A common mix-up: candidates confuse the `-s` (source) and `-d` (destination) flags, leading candidates to choose option A, which would allow SSH traffic destined for the 192.168.1.0/24 network instead of traffic originating from it.
Answer choices
Why each option matters
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 -p tcp --dport 22 -s 192.168.1.0/24 -j ACCEPT
It uses the `-s` (source) flag to specify the 192.168.1.0/24 network, ensuring only incoming SSH traffic (TCP port 22) from that subnet is accepted. The `-A INPUT` appends this rule to the INPUT chain, which processes incoming packets destined for the local system. This matches the requirement exactly.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
iptables -A INPUT -p tcp --dport 22 -d 192.168.1.0/24 -j ACCEPT
Why it's wrong here
The -d flag specifies destination, not source.
- ✗
iptables -A INPUT -p tcp --dport 22 -s 192.168.1.0/24 -j REJECT
Why it's wrong here
REJECT sends an error; typically ACCEPT is used for allowed traffic.
- ✓
iptables -A INPUT -p tcp --dport 22 -s 192.168.1.0/24 -j ACCEPT
Why this is correct
Allows SSH from the specified network.
- ✗
iptables -A INPUT -p tcp --dport 22 -s 192.168.1.0/24 -j LOG
Why it's wrong here
LOG only logs, does not accept.
- ✗
iptables -A INPUT -p tcp --dport 22 -j ACCEPT
Why it's wrong here
Accepts SSH from all sources.
Visual reference
Go deeper
Related to this question
Learn chapter
Process Management and System Monitoring
Key term
Subnet
A subnet is a logical subdivision of an IP network, created by partitioning a larger network address space using subnet masks.
Key term
SSH
SSH (Secure Shell) is a cryptographic network protocol that provides secure, encrypted communication and remote administration between two devices over an unsecured network.
About these practice questions
One of 979 original XK0-006 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This XK0-006 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-006 exam.