Simplest way to test if a port is open on firewall is through telnet, but problem with that is what if you don’t have anything listening? What if you’re preparing infrastructure for a new app-server deployment — telnet won’t work unless there’s something listening on the server.
With netcat you can create a simple listener that echoes whatever character passed to it. Netcat should be available on standard UNIX system via nc command.
If you want to test if port 1234 has been allowed through on firewall:
- On the server, run nc -l -p 1234. Netcat will wait incoming connection to port 1234.
- On the client, simply do telnet 18.104.22.168 1234 (assuming the server ip is 22.214.171.124)
If the server is on Windows, there’s even a Windows version of Netcat available.