How does Windows confirm whether the program port on the server is normal (ping, tcping)

Method 1: ping command

Description of ping command

The ping command is a very frequently used network diagnostic tool, which is applicable to Windows, Unix and Linux systems. It is part of the TCP/IP protocol used to determine whether a local host can exchange datagrams with another host. According to the returned information, we can deduce whether the TCP/IP parameter settings are correct and whether the operation is normal. It should be noted that one or two successful datagram exchanges with another host does not mean that the TCP/IP configuration is correct. A large number of datagram exchanges must be successfully performed to be sure of the correctness of TCP/IP. Let's take the Windows system as an example to introduce the basic usage of the ping command.

The ping command uses

Use the shortcut key win+R to bring up the run command box, enter cmd, click OK, and a DOS window will pop up.

click OK 

 ping baidu.com

ping 163.com 

ping 192.168.3.166 

 

To sum up, the format of the ping command is (note that a space needs to be followed by ping)

①Ping IP address or host domain name

②Ping IP address or host domain name + command parameters

③ ping command parameter + IP address or host domain name 

ping command parameter description

View ping command help

ping /?

Enter the above command, we can see the printing of the following figure, we can clearly understand the meaning of each parameter 

ping 163.com  -t

It will keep pinging until the Ctrl+C key combination is pressed to stop

 ping 163.com -t -l 1024

-l: Define the size of the sent data packet, which is 32 bytes by default, and can be defined up to 65500 bytes by using it.

often used in work

Method 2: telnet command

Install

Install entry 1

WIN + R shortcut key, enter OptionalFeatures

 

 Install entry 2

open control panel

 Click Uninstall a program

 Click to turn windows features on and off

 

 

Click OK

 How to confirm the installation is successful

WIN+R, enter cmd, open the command line terminal, enter telnet, the following figure appears to indicate that the installation is successful

image-20210517163416579

use

1. start

Example: telnet 192.168.31.100 8080

The following information is displayed, proving that the port is enabled:

img

The following figure shows that port 80 on the server 192.168.3.101 is blocked 

 

2. Exit

First case CTRL+], then enter quit to exit telnet and re-enter the cmd command line

 3. Parameter description 

Common commands

  open : 使用 openhostname 可以建立到主机的 Telnet 连接。

  close : 使用命令 close 命令可以关闭现有的 Telnet 连接。

  display : 使用 display 命令可以查看 Telnet 客户端的当前设置。

  send : 使用 send 命令可以向 Telnet 服务器发送命令。支持以下命令:

  ao : 放弃输出命令。

  ayt : “Are you there”命令。

  esc : 发送当前的转义字符。

  ip : 中断进程命令。

  synch : 执行 Telnet 同步操作。

  brk : 发送信号。
  
  quit 退出telnet。

command abbreviation

c    - close                    关闭当前连接
d    - display                  显示操作参数
o    - open hostname [port]     连接到主机(默认端口 23)。
q    - quit                     退出 telnet
set  - set                      设置选项(键入 'set ?' 获得列表)
sen  - send                     将字符串发送到服务器
st   - status                   打印状态信息
u    - unset                    解除设置选项(键入 'set ?' 获得列表)
?/h  - help                     打印帮助信息

Method 3: tcping command

Compare with other commands

ping

Everyone is familiar with the ping command, which belongs to the ICMP protocol at the network layer. It can only check the connectivity of the IP or the speed of the network connection, but cannot detect the port status of the IP.

telnet

The telnet command, which belongs to the application layer protocol, is used for remote login and can also be used to detect the port status of the IP. However, the function is limited, and it can only detect the temporary IP port status, and cannot view the ping value, nor can it monitor in real time.

tcping

The tcping command uses the transport layer protocol, which can detect the status of the IP port and view the ping value. Even if the source address is forbidden to ping, the network status of the server can be monitored through tcping .

download 

Official website http://www.elifulkerson.com/projects/tcping.php download tcping.exe, the file is less than 300KB.

Put the files under the c:\windows\system32\ and C:\Windows\SysWOW64 directories, and run the tcping command in any file path.

Enter tcping under the command and if the help document appears, the installation command is successful.

WIN+R opens the cmd command line

tcping 163.com

Port is open indicates that the port is open

time=xx.xxms indicates the network delay value

 An example of real-time monitoring of the status of a port on the server:

tcping.exe -t -d --tee d:/tcpping.log 163.com  80

The parameter -t means to send data packets continuously until pressing ctrl+c to stop

The parameter -d means to display the detailed date and time in front of each line

The parameter --tee means to output the result to the specified location.

Examples of unreachable ports

tcping.exe -t -d --tee d:/tcpping.log 163.com  81

Guess you like

Origin blog.csdn.net/zengliguang/article/details/130447035