草稿 · 2022年5月1日 0

草稿:TCPING安装使用

安装相关依赖:
yum update -y
yum install -y tcptraceroute bc
下载TCPING脚本并添加可执行权限:
wget -O tcping https://soft.mengclaw.com/Bash/TCP-PING
chmod +x tcping
mv tcping  /usr/local/bin/

基本使用:
tcping  8.8.8.8 53

##### 参数详解:

tcpping [-d] [-c] [-C] [-w sec] [-q num] [-x count] ipaddress [port]
-d 在每个响应时间前,打印时间戳
-c 以列表形式显示
-C 输出类似于fping工具中-C选项的结果
-w 等待时间(默认 3)
-r 每N秒重试一次(默认 1)
-x 限定测试总时长 (默认 无限)

简要说明:

由于ping是基于ICMP的协议,有些服务器是对外会设置禁PING处理,所以可以TCPING来对目标端口进行检测。