

This would open port 22 for a limited time and, if you want, allow connections from that IP only. For example you can set-up the firewall to open TCP port 22 (SSH) if you first connect to port 100 and then within the next 10 seconds, you need to connect to port 99. Port knocking is usually used to open ports on a firewall after connecting to a specified set of ports in a sequence.

This is were port knocking comes in handy.

In this scenario, the firewall would drop your requests and you would not b able to access the ports. Sometimes you may need to connect to the ports but you may not be connected to any of the IPs in the safe list. This is done simply by creating a “safe” access list, containing a list of the IPs retained as safe, and configure the firewall rules to accept connections on the port from the IPs listed in the safe list. When setting up routers or firewalls and we open management ports on the internet, we allow only trusted, safe, IPs to access these ports.
