LPIC-3 Exam 303 (Security) — Question 4
What effect does the following command have on TCP packets?
iptables- A INPUT d 10.142.232.1 p tcp --dport 20:21 j ACCEPT
Answer options
- A. Forward all TCP traffic not on port 20 or 21 to the IP address 10.142.232.1
- B. Drop all TCP traffic coming from 10.142.232.1 destined for port 20 or 21.
- C. Accept only TCP traffic from 10.142.232.1 destined for port 20 or 21.
- D. Accept all TCP traffic on port 20 and 21 for the IP address 10.142.232.1
Correct answer: C
Explanation
The command explicitly allows TCP packets from the IP address 10.142.232.1 that are targeting ports 20 and 21, making option C the correct answer. Options A and B incorrectly describe the filtering effect and do not align with the command's action, while option D implies a broader acceptance of traffic which is not specified in the command.