测试 TCP 端口:
telnel IP PORT
nc -vz IP PORT
测试 UDP 端口:
nc -vuz IP PORT
其中 -u 表示使用 udp 协议来进行测试。
p.p1 { margin: 0; font: 11px Menlo; color: rgba(0, 0, 0, 1); background-color: rgba(255, 255, 255, 1) } span.s1 { font-variant-ligatures: no-common-ligatures }
-u, --udp Use UDP instead of default TCP
具体选项的功能,可以观察man page 来进行查询。
udp 端口示例:
[root@docker log]# nc -vuz 127.0.0.1 6666
Ncat: Version 7.70 ( https://nmap.org/ncat )
Ncat: Connected to 127.0.0.1:6666.
Wed Mar 27 15:22:34 2019
Ncat: UDP packet sent successfully
Ncat: 1 bytes sent, 25 bytes received in 2.01 seconds.
这是测试监听 udp 6666 端口的 nc 命令返回情况。
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有