XK0-006 Security Practice Question
An administrator needs to configure iptables to allow incoming SSH traffic only from the 10.0.0.0/8 network and drop all other incoming traffic except established connections. Which TWO rules are necessary?
⚠ Common exam trap
The trap here is that candidates often forget to include the rule for established connections (Option E) and mistakenly think setting a default DROP policy (Option B) or a blanket DROP rule (Option C) alone is sufficient, not realizing that without allowing established traffic, all return packets are dropped, breaking connectivity.
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 10.0.0.0/8 -j ACCEPT
It explicitly allows incoming SSH traffic (TCP port 22) from the 10.0.0.0/8 network, which matches the requirement to permit SSH only from that subnet. Option E is correct because it accepts all packets that are part of an established or related connection, ensuring that return traffic for outbound connections is not dropped by the default policy or subsequent rules.
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 -j DROP
Why it's wrong here
This would drop all SSH, contradicting the requirement.
- ✗
iptables -P INPUT DROP
Why it's wrong here
This sets the default policy to drop, but it's a policy change, not a rule. The question asks for rules.
- ✗
iptables -A INPUT -j DROP
Why it's wrong here
This would drop all incoming traffic, including established connections, unless placed after allow rules. But it's not strictly necessary if default policy is DROP.
- ✓
iptables -A INPUT -p tcp --dport 22 -s 10.0.0.0/8 -j ACCEPT
Why this is correct
Allows SSH from the 10.0.0.0/8 network.
- ✓
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
Why this is correct
Allows established connections.
Visual reference
Go deeper
Related to this question
Learn chapter
Managing Storage and File Systems
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.
Key term
Policy
A policy is a set of rules or guidelines that defines how an organization manages, secures, and operates its IT systems and services.
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.