askvity

How do I test TCP connection in Windows?

Published in TCP Connection Testing 2 mins read

You can test a TCP connection in Windows using the Telnet client through the Command Prompt.

Testing TCP Connection with Telnet

Here's how to test a TCP connection using Telnet in Windows:

  1. Open Command Prompt:

    • Press the Windows key + R to open the Run dialog box.
    • Type cmd.exe and click OK.
  2. Execute the Telnet command:

    • In the Command Prompt window, enter the following command:
    telnet <IP address or hostname> <port number>
    • Replace <IP address or hostname> with the actual IP address or hostname of the server you want to test the connection to.

    • Replace <port number> with the specific port number you want to test.

    • Examples:

      • telnet www.example.com 1723
      • telnet 10.17.xxx.xxx 5000
  3. Interpret the Results:

    • Successful Connection: If the TCP port is open and the connection is successful, the Command Prompt window will display a blank screen with a blinking cursor. This indicates that a connection has been established.
    • Failed Connection: If the connection fails, you will see an error message such as "Could not open connection to the host, on port : Connection failed" or "Connection refused." This indicates that the port is either closed, blocked by a firewall, or the server is not listening on that port.

Note: By default, Telnet Client may not be installed. You may need to enable it in "Turn Windows features on or off" in Control Panel. Alternatively, tools like Test-NetConnection in PowerShell can be used. However, based on the reference provided, we will only use telnet.

Related Articles