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.
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)- A5% (3)
- B9% (5)
- C71% (41)
- D16% (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.
`iptables -L` lists rules and does not add or modify any firewall rules.
`iptables -D` deletes a rule from a chain, which would remove a rule if it existed, not add one to allow communication.
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.
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
Community Discussion
No community discussion yet for this question.