Linux_FoundationLinux_Foundation
LFCS · Question #225
LFCS Question #225: Real Exam Question with Answer & Explanation
The correct answer is C: Forwards all requests from the host 208.77.188.166 on port 22 the internal host 10.142.232.1. This iptables rule permits TCP traffic on destination port 22, originating from 208.77.188.166 and destined for 10.142.232.1, to be accepted.
Submitted by emma.c· Apr 18, 2026Networking
Question
What does the following iptables rule accomplish: iptables A INPUT s 208.77.188.166 d 10.142.232.1 p tcp dport 22 j ACCEPT
Options
- AAccepts traffic on port 22 only from the hosts 208.77.188.166 and 10.142.232.1.
- BForwards all requests from the host 10.142.232.1 on port 22 the internal host 208.77.188.166
- CForwards all requests from the host 208.77.188.166 on port 22 the internal host 10.142.232.1
- DDrops traffic on port 22 only from the hosts 208.77.188.166 and 10.142.232.1.
Explanation
This iptables rule permits TCP traffic on destination port 22, originating from 208.77.188.166 and destined for 10.142.232.1, to be accepted.
Common mistakes.
- A. The rule specifies a single source IP (
-s) and a single destination IP (-d), not traffic from two sources or to two destinations. - B. This rule is in the
INPUTchain, which processes traffic destined for the local machine, not for forwarding to another internal host. Also, the source and destination IPs are reversed from the interpretation given. - D. The
j ACCEPTtarget explicitly allows traffic, it does not drop it.
Concept tested. Iptables rule interpretation (source, destination, port)
Reference. https://linux.die.net/man/8/iptables
Topics
#iptables#firewall rules#network security#SSH
Community Discussion
No community discussion yet for this question.