LFCS · Question #224
What does the following iptables rule accomplish: iptables A INPUT s 208.77.188.166 j DROP
The correct answer is D. Drops all traffic from 208.77.188.166. The iptables rule described will block all incoming network traffic originating from the specified source IP address.
Question
Options
- AForwards all incoming traffic to the host 208.77.188.166.
- BAccepts all traffic from 208.77.188.166.
- CNothing, there is a syntax error.
- DDrops all traffic from 208.77.188.166.
How the community answered
(16 responses)- B6% (1)
- C6% (1)
- D88% (14)
Why each option
The `iptables` rule described will block all incoming network traffic originating from the specified source IP address.
This rule does not forward traffic; it explicitly blocks it. Forwarding is typically handled by the `FORWARD` chain or NAT rules.
The `j DROP` target explicitly discards traffic, it does not accept it. The `ACCEPT` target is used for allowing traffic.
The rule `iptables -A INPUT -s 208.77.188.166 -j DROP` has correct `iptables` syntax and will execute as intended.
The `iptables -A INPUT` command appends a rule to the `INPUT` chain, which processes incoming packets destined for the local host. The `-s 208.77.188.166` flag specifies the source IP address, and `-j DROP` means that any packet matching these criteria will be silently discarded without any notification to the sender.
Concept tested: Iptables basic packet filtering
Source: https://linux.die.net/man/8/iptables
Topics
Community Discussion
No community discussion yet for this question.