A network administrator needs to block all outbound SSH connections from a subnet. Which iptables rule should be used?

Prepare for the CompTIA Server+ Exam. Use flashcards and multiple choice questions to test your knowledge of server installation, configuration, and management. Ace your exam with comprehensive study guides and detailed explanations!

The correct rule to block all outbound SSH connections from a subnet is structured to identify TCP packets being sent from the subnet to an SSH destination. The SSH protocol typically uses TCP port 22. Therefore, the rule specifies that if an outbound packet is being sent to a destination IP within the 10.152.8.0/21 subnet, and it is using TCP with the designated SSH port of 22, the action to take is to REJECT the connection.

The focus on the REJECT action is vital as it is designed to explicitly decline the connection attempt, informing the sender that the packet is not allowed. This provides feedback to the sender that the connection has been intentionally blocked, which is generally better for troubleshooting than a DROP action, which would silently discard the packets without notification.

In this context, all components of the rule, such as the correct interface for output (OUTPUT), the specific protocol (TCP), and the correct port number for SSH (22), are aligned with the objective of preventing outbound SSH connections from that specific subnet.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy