To test if a port is open on a remote host or not. Our networking guys always use to tell that they opened the port, you can’t always run your code to test it.
If you are on windows then you can do telnet.
To enable the telnet on Windows 10, Click here
Open the command prompt and run the following command:
telnet 192.168.1.205 80
If it is successful, that it will enter on the screen. Run help to see the available option. Type quit to exit.
If networking guys are debugging the connection issue they always use to say give me the telnet screenshot or output, and you are on Linux or MacOSX. There are number of ways to do it on terminal via Netcat:
Netcat: Netcat (often abbreviated to nc) is a computer networking utility for reading from and writing to network connections using TCP or UDP. Netcat is designed to be a dependable back-end that can be used directly or easily driven by other programs and scripts. source wikipedia
Single Port:
nc -zv 192.168.1.205 80
Here is the output of the command:
Multiple Ports:
nc -zv 192.168.1.205 80 8080
Here is the output of the command:
Range of ports:
nc -zv 192.168.1.205 80-100
Here is the output of the command: