如下示例代码实现了用telnet命令测试端口连通性的功能:

端口通信正常
-bash-4.1$ echo " " | telnet 192.0.0.1 10100
Trying 10.71.133.9...
Connected to 10.71.133.9.
Escape character is '^]'.
Connection closed by foreign host.

#端口通信异常
-bash-4.1$ echo " " | telnet 192.0.0.1 10100
Trying 192.0.0.1...
telnet: connect to address 192.0.0.1: Connection timed out

如您从本文得到了有价值的信息或帮助,请考虑扫描文末的二维码对我进行赞赏和鼓励。

与《telnet 测试端口连通性》相关的博文:


留言

Admin Avatar
😀
😀😁😂😅😭🤭😋😘🤔😰😱🤪💪👍👎🤝🌹👌