nerdexam
CompTIA

XK0-005 · Question #611

A systems technician is configuring an application server to accept packets from a trusted source with the IP address 192.168.10.22. Which of the following commands will allow communication between…

The correct answer is C. iptables -A INPUT -s 192.168.10.22 -j ACCEPT. To allow incoming network communication from a specific IP address using iptables, a rule must be appended to the INPUT chain to accept packets from that source.

Security

Question

A systems technician is configuring an application server to accept packets from a trusted source with the IP address 192.168.10.22. Which of the following commands will allow communication between the two servers?

Options

  • Aiptables -L -s 192.168.10.22 -j ACCEPT
  • Biptables -D INPUT -s 192.168.10.22 -j ACCEPT
  • Ciptables -A INPUT -s 192.168.10.22 -j ACCEPT
  • Diptables -A OUTPUT -s 192.168.10.22 -j ACCEPT

How the community answered

(58 responses)
  • A
    5% (3)
  • B
    9% (5)
  • C
    71% (41)
  • D
    16% (9)

Why each option

To allow incoming network communication from a specific IP address using `iptables`, a rule must be appended to the `INPUT` chain to accept packets from that source.

Aiptables -L -s 192.168.10.22 -j ACCEPT

`iptables -L` lists rules and does not add or modify any firewall rules.

Biptables -D INPUT -s 192.168.10.22 -j ACCEPT

`iptables -D` deletes a rule from a chain, which would remove a rule if it existed, not add one to allow communication.

Ciptables -A INPUT -s 192.168.10.22 -j ACCEPTCorrect

The command `iptables -A INPUT -s 192.168.10.22 -j ACCEPT` appends (`-A`) a rule to the `INPUT` chain. This rule specifies that any packets originating from the source IP address (`-s`) 192.168.10.22 should be accepted (`-j ACCEPT`), thereby allowing communication from the trusted source to the application server.

Diptables -A OUTPUT -s 192.168.10.22 -j ACCEPT

An `OUTPUT` rule with `-s` refers to the local machine's source IP for outgoing packets, and is not used to accept incoming connections from a remote source IP.

Concept tested: Iptables incoming traffic rules

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

Topics

#Firewall configuration#iptables#Network access control#Linux commands

Community Discussion

No community discussion yet for this question.

Full XK0-005 Practice