1.只能测试tcp端口
telnet IPADDR PORT
2.可以测试tcp及udp端口
安装nc
nc -uvz 172.19.17.141 80-8080
注(man说明):
-u Use UDP instead of the default option of TCP.
-v Have nc give more verbose output.
-z Specifies that nc should just scan for listening daemons, without
sending any data to them. It is an error to use this option in
conjunction with the -l option.
简单起见,可以直接用:
nc -z 172.19.17.141 80-8080