Tuesday, July 12, 2011

How to ping a specific port / How to test a connection between two computers on a WAN

With Windows XP it was possible to use the DirectX Diagnostic Tool, specifically Test DirectPlay to test a connection between two computers. It was mainly used as a gaming tool to establish which computer was blocking a connection.

However the best way to test specific ports is to use the telnet feature as you cannot "ping" a specific port. What telnet does is open a TCP connection on the port that you specify (if you don't specify one it defaults to 25). To do this is simple.

Firstly though if you are on Windows Vista / Windows 7 you need to enable the telnet feature (Windows XP users can skip this step). To do this; Click on Control Panel, click Programs, and then click Turn Windows features on or off. Scroll down to Telnet Client and tick the box. It will take several minutes to install.

Now open command prompt  (Win XP click on Run in start menu and type in "cmd" and press enter / Win Vista and; 7 users simply type "cmd" into your start menu's search box and press enter). Now use the telnet command in the same way as the ping command.

For example computer 1 has an IP of 127.5.45.55, and computer 2 (ip of 225.36.52.2) is trying to connect to port 6667 in order to play Generals but they cannot connect. Computer 1 would type into command prompt "telnet 225.36.52.2 6667". Computer 2 would type in "telnet 127.5.45.55 6667". As you can see it is extremely similar to the ping command. The results will be relayed back to the user.