To test whether a port on the remote host is enabled, you do not need to use complicated work. In windows, a tool is provided, that is, Telnet. The ping command cannot detect the port. It can only detect whether you can connect to the corresponding IP address.
1. Install Telnet. There is no Telnet in win7. Enter the Telnet command in cmd to prompt that this command is not available. Go to the control panel ---->Program----> Enable or disable windows. Then, wait for a while and select the Telnet client and telnet server in the displayed dialog box, so that the Telnet component is installed.
2. test whether a port is enabled. The port 2121 of 192.168.3.42 is tested. After entering Telnet 192.168.3.42 2121 in cmd, a window is displayed, Which is minimized. If the window is closed automatically, the port is closed or the host cannot be pinged. Otherwise, the port is open. For example, if port 2121 is open, the following window appears; otherwise, the window is closed.
3. You can use your own machine to perform experiments. Enter netstat-anp tcp in cmd to view the ports opened by TCP on the current host.
4. Check whether the local port is occupied in Linux: netstat-APN | grep 8080
Original post address: http://zoulu1.blog.163.com/blog/static/46733149201252752125837