How to check whether firewall opened for a port but not listening on the port

firewallnetworkingsolaristcp

We will be deploying a new application to a Server and the application will be listening on port 8443. We have asked Network team to open the firewall for the port 8443 on that server before deploying the application. There is no application currently listening on that particular port on the server.

Is there anyway i can make sure the firewall is opened for the port 8443

OS: Linux / Windows

Best Answer

If you want to see if you can form a TCP connection from a remote machine, get OpenCSW installed on that and the target machine, and install netcat on both. This is the syntax for using netcat to test TCP connections:

nc -vz targetServer portNum

For example to check SSH on "homeServer1":

nc -vz homeserver1 22

That enables you to test TCP-level connectivity from the remote system. Netcat can also be configured to listen on a port rather than act as a client. To get it to listen on TCP/8443:

On the server that will house the application: nc -l homeserver1 8443

On a machine that sits outside the firewall: nc -vz homeserver.fqdn 8443

This is an example of a successful execution:

[jadavis6@ditirlns01 ~]$ nc -vz ditirlns01.ncat.edu 8443
Connection to ditirlns01.ncat.edu 8443 port [tcp/pcsync-https] succeeded!

A failed execution:

[jadavis6@ditirlns01 ~]$ nc -vz ditirlns01.ncat.edu 8443
nc: connect to ditirlns01.ncat.edu port 8443 (tcp) failed: Connection refused
Related Question