nerdexam
CompTIA

LX0-104 · 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.. This iptables rule adds an entry to the INPUT chain to discard all incoming network traffic originating from the specified source IP address.

Security

Question

What does the following iptables rule accomplish: iptables A INPUT s 208.77.188.166 j DROP

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

(34 responses)
  • A
    3% (1)
  • B
    3% (1)
  • C
    9% (3)
  • D
    85% (29)

Why each option

This iptables rule adds an entry to the INPUT chain to discard all incoming network traffic originating from the specified source IP address.

AForwards all incoming traffic to the host 208.77.188.166.

The `DROP` target discards traffic, it does not forward it, and the `INPUT` chain is for traffic destined for the local host.

BAccepts all traffic from 208.77.188.166.

The `DROP` target explicitly discards traffic, which is the opposite of accepting it.

CNothing, there is a syntax error.

The rule `iptables -A INPUT -s 208.77.188.166 -j DROP` is syntactically correct.

DDrops all traffic from 208.77.188.166.Correct

The `iptables -A INPUT` command appends a rule to the `INPUT` chain; `-s 208.77.188.166` specifies the source IP address; and `-j DROP` instructs iptables to silently discard any packets that match this criteria.

Concept tested: Iptables rule syntax - source IP and DROP target

Source: https://man7.org/linux/man-pages/man8/iptables.8.html

Topics

#iptables rules#firewall#packet filtering#DROP action

Community Discussion

No community discussion yet for this question.

Full LX0-104 Practice