脚本介绍
BestTrace 是由 ipip.net 官方开发的路由追踪程序,可以显示路由归属地,以直观的、中文的方式显示路由,需要安装路由追踪软件 traceroute。
脚本安装
-
安装 TraceRoute
# CentOS系统: yum update && yum install traceroute -y # Debian/Ubuntu 系统: apt-get update && apt-get install traceroute -y
-
安装 BestTrace
mkdir besttrace && cd besttrace wget https://cdn.ipip.net/17mon/besttrace4linux.zip unzip besttrace4linux.zip chmod +x besttrace
使用方法
-
执行命令
./besttrace x.x.x.x
即可检测该IP路由。 -
默认情况下测试3次以规避丢包等情况的影响,更为准确,但是会导致显示内容繁多不易阅读,可以添加如下参数执行:
./besttrace -q 1 x.x.x.x
这样就只测试一次,测试结果更直观。
注意事项
命令 ./besttrace IP
适用于64位系统使用;如果是32位系统,请使用 ./besttrace32
。