There were times when we used to test network connectivity of a specific port of the router using telnet command. Telnet used to come pre-installed in Windows but not in Windows 10. We explore different possibilities to check if a remote network port is open using command line options in Windows 10.
Open Telnet using the three steps described above and issue the following command:
open google.com 80
Where google.com is the host you want to test. You can also put an IP address instead of the name. 80 is the port number which you want to probe. You should replace 80 with you desired port number.
If you receive “Press any key to continue” prompt, this means that the port is open and responding to telnet. If you receive “Could not open connection” or a blank screen with blinking cursor, this means the port is closed.
If you receive “Connection to host lost“, this means that the port is open but the host is not accepting new connections.
Check open port using PowerShell
Since Microsoft is pushing PowerShell and CMD has become a legacy system, we should be using PowerShell for most of our working. Let’s check whether a remote network port is open and listening or not.
tns is short for Test-NetworkConnection command. google.com is the host name. You can also put an IP address instead of the host name. You can specify the port number using the -port switch at the end of tnc command.
The TNC command will give you basic information about the network connection like computer name, IP address, Interface through which you are connecting, source IP, whether the ping is successful or not, Ping reply time and finally TcpTestSucceeded. TcpTestSucceeded will give you True if the port is open and false if the port is closed.
These commands and techniques are very useful when you are troubleshooting a network. Please let us know if this has been useful for you in the comments below and we will add more troubleshooting techniques in future.