1. 官方介绍
Trippy combines the functionality of traceroute and ping and is designed to assist with the analysis of networking issues.
Trippy 结合了 traceroute 和 ping 的功能,旨在协助分析网络问题。
https://github.com/fujiapple852/trippy
2. 特点
- Trace using multiple protocols / 使用多种协议进行跟踪
- ICMP, UDP & TCP
- IPv4 & IPv6
- Customizable tracing options / 可自定义的跟踪选项
- packet size & payload pattern / 数据包大小和有效载荷模式
- start and maximum time-to-live (TTL) / 开始和最大生存时间 (TTL)
- minimum and maximum round duration / 最短和最长回合持续时间
- round end grace period & maximum number of unknown hops / 回合结束宽限期和最大未知跳数
- source & destination port (TCP & UDP) / 源端口和目标端口 ( TCP& UDP)
- source address and source interface / 源地址和源接口
- TOS (aka DSCP + ECN) / TOS(又名DSCP + ECN)
- Support for classic, paris and dublin Equal Cost Multi-path Routing strategies (tracking issue) / 支持classic、paris 和dublin 等价多路径路由 策略(跟踪问题)
- RFC4884 ICMP Multi-Part Messages / RFC4884 ICMP 多部分消息
- Generic Extension Objects / 通用扩展对象
- MPLS Label Stacks / MPLS 标签堆栈
- Unprivileged mode / 非特权模式
- Tui interface / Tui界面
- Trace multiple targets simultaneously from a single instance of Trippy / 从 Trippy 的单个实例同时跟踪多个目标
- Per hop stats (sent, received, loss%, last, avg, best, worst, stddev, jitter & status) / 每跳统计(发送、接收、丢失%、最后、平均、最佳、最差、标准差、抖动和状态)
- Per hop round-trip-time (RTT) history and frequency distributing charts / 每跳往返时间 (RTT) 历史和频率分布图表
- Interactive chart of RTT for all hops in a trace with zooming capability / 具有缩放功能的跟踪中所有跳数的 RTT 交互式图表
- Interactive GeoIp world map / 交互式 GeoIp 世界地图
- Isolate and filter by individual tracing flows / 按单独的跟踪流进行隔离和过滤
- Customizable color theme & key bindings / 可定制的颜色主题和按键绑定
- Customizable column order and visibility / 可自定义的列顺序和可见性
- Configuration via both command line arguments and a configuration file / 通过命令行参数和配置文件进行配置
- Show multiple hosts per hop with ability to cap display to N hosts and show frequency / 每跳显示多个主机,能够将显示限制为 N 个主机并显示频率
- Show hop details and navigate hosts within each hop / 显示跳转详细信息并导航每个跳转内的主机
- Freeze/unfreeze the Tui, reset the stats, flush the cache, preserve screen on exit / 冻结/解冻 Tui,重置统计数据,刷新缓存,退出时保留屏幕
- Responsive UI with adjustable refresh rate / 响应式用户界面,可调整刷新率
- Hop privacy / 跳转隐私
- DNS
- Use system, external (Google 8.8.8.8 or Cloudflare 1.1.1.1) or custom resolver / 使用系统、外部(Google8.8.8.8或 Cloudflare 1.1.1.1)或自定义解析器
- Lazy reverse DNS queries / 惰性反向 DNS 查询
- Lookup autonomous system number (ASN) and name / 查找自治系统编号 (ASN) 和名称
- GeoIp
- Lookup and display GeoIp information from local MaxMind and IPinfo mmdb files / 从本地MaxMind 和IPinfo mmdb文件中查找并显示
- Generate tracing reports / 生成跟踪报告
- json, csv & tabular (pretty-printed and markdown) / json、csv表格(精美打印和markdown)
- Tracing flows report / 追踪flows报告
- Graphviz dot charts / Graphvizdot图表
- configurable reporting cycles / 可配置的报告周期
- Runs on multiple platform (macOS, Linux, Windows, NetBSD, FreeBSD, OpenBSD) / 可在多个平台上运行(macOS、Linux、Windows、NetBSD、FreeBSD、OpenBSD)
- Capabilities aware application (Linux only) / 功能感知应用程序(仅限 Linux
3. 安装方法
3.1 Windows系统
以管理员身份运行Windows PowerShell
,然后输入下面代码:
winget install trippy
3.2 Linux(以x86架构,Debian12为例)
wget https://github.com/fujiapple852/trippy/releases/download/0.10.0/trippy-0.10.0-x86_64-unknown-linux-musl.tar.gz && tar -xvf trippy-0.10.0-x86_64-unknown-linux-musl.tar.gz && mv trippy-0.10.0-x86_64-unknown-linux-musl/trip /usr/local/bin/ && chmod +x /usr/local/bin/trip
3.3 其他系统
去官网自行下载:https://github.com/fujiapple852/trippy/releases/tag/0.10.0
4. 使用方法
4.1 直接开始(默认是ICMP
协议)
trip example.com
4.2 同时追踪多个目标(仅支持ICMP协议,按左右方向键查看不同目标的结果)
trip example.com google.com
4.3 其他协议(-p,默认80端口)
trip example.com -p udp
trip example.com -p tcp
trip example.com -p icmp
示例
trip example.com |
trip example.com google.com |
trip example.com google.com |
trip example.com -p udp |
trip example.com -p tcp |
trip example.com -p icmp |
|
|
|
|
|
|
4.4 指定目标端口(-P,按上下方向键查看不同跳数的结果)
trip example.com -p udp -P 40000
trip example.com -p tcp -P 40000
4.5 指定源端口(-S,与-P二选一)
trip example.com -p udp -S 40000
trip example.com -p tcp -S 40000
4.6 同时指定目标端口和源端口(-R,只支持udp)
支持两种模式:dublin
,paris
trip example.com -p udp -R dublin -P 10102 -S 4919
trip example.com -p udp -R paris -P 10102 -S 4919
示例
trip example.com -p udp -P 40000 |
trip example.com -p tcp -P 40000 |
trip example.com -p udp -S 40000 |
trip example.com -p tcp -S 40000 |
trip example.com -p udp -R dublin -P 10102 -S 4919 |
trip example.com -p udp -R paris -P 10102 -S 4919 |
|
|
|
|
|
|
4.6 指定源地址(-A,Linux运行ifconfig
/ Windows运行ipconfig
查看本机IP)
trip example.com -p tcp -A 127.0.0.1
4.7 指定源网卡(-I)
trip example.com -p tcp -I en0
4.8 IPv4 & IPv6(--addr-family)
支持4种模式,ipv4-then-ipv6
(默认,优先IPv4),ipv6-then-ipv4
(优先IPv6),ipv4
(指定IPv4),ipv6
(指定IPv6)
trip example.com --addr-family ipv4-then-ipv6
trip example.com --addr-family ipv6
4.9 指定包大小(--packet-size,默认84,最大1024)
trip example.com --tcp --packet-size 48
示例
trip example.com -p tcp -A 127.0.0.1 |
trip example.com -p tcp -I en0 |
trip example.com --addr-family ipv4-then-ipv6 |
trip example.com --addr-family ipv6 |
trip example.com --tcp --packet-size 1024 |
trip example.com --tcp --packet-size 48 |
|
|
|
|
|
|
4.10 输出结果(-m,-C)
-m
设置格式,支持多种格式:tui, stream, pretty, markdown, csv, json, dot, flows, silent
-C
设置循环次数,默认10次
以trip example.com --tcp -m markdown -C 5
为例,输出的markdown格式的结果为:
Hop |
IPs |
Addrs |
Loss% |
Snt |
Recv |
Last |
Avg |
Best |
Wrst |
StdDev |
1 |
104.28.0.0 |
104.28.0.0 |
0.0 |
5 |
5 |
7.7 |
8.0 |
7.6 |
8.5 |
0.3 |
2 |
104.29.45.1 |
104.29.45.1 |
0.0 |
5 |
5 |
9.6 |
8.3 |
7.9 |
9.6 |
0.6 |
3 |
188.114.100.18 |
188.114.100.18 |
0.0 |
5 |
5 |
15.4 |
12.3 |
8.7 |
18.4 |
3.6 |
4 |
62.115.144.78 |
mno-b3-link.ip.twelve99.net |
0.0 |
5 |
5 |
9.2 |
9.1 |
9.0 |
9.2 |
0.1 |
5 |
62.115.116.170 |
ffm-bb1-link.ip.twelve99.net |
60.0 |
5 |
2 |
17.4 |
17.3 |
17.3 |
17.4 |
0.0 |
6 |
62.115.137.203 |
win-bb1-link.ip.twelve99.net |
0.0 |
5 |
5 |
28.8 |
28.7 |
28.5 |
28.9 |
0.1 |
7 |
62.115.114.111 |
buca-b3-link.ip.twelve99.net |
0.0 |
5 |
5 |
42.6 |
43.4 |
42.6 |
46.4 |
1.3 |
8 |
??? |
??? |
100.0 |
5 |
0 |
??? |
0.0 |
??? |
??? |
0.0 |
9 |
92.180.51.73 |
92.180.51.73 |
0.0 |
5 |
5 |
81.9 |
68.2 |
53.7 |
81.9 |
9.6 |
10 |
92.180.51.74 |
92.180.51.74 |
0.0 |
5 |
5 |
85.1 |
78.5 |
56.2 |
85.1 |
9.6 |
11 |
188.241.240.230 |
hosted-by.hazi.ro |
0.0 |
5 |
5 |
53.5 |
53.6 |
53.3 |
53.9 |
0.2 |
直接粘贴到nodeseek:
Hop |
IPs |
Addrs |
Loss% |
Snt |
Recv |
Last |
Avg |
Best |
Wrst |
StdDev |
1 |
104.28.0.0 |
104.28.0.0 |
0.0 |
5 |
5 |
7.7 |
8.0 |
7.6 |
8.5 |
0.3 |
2 |
104.29.45.1 |
104.29.45.1 |
0.0 |
5 |
5 |
9.6 |
8.3 |
7.9 |
9.6 |
0.6 |
3 |
188.114.100.18 |
188.114.100.18 |
0.0 |
5 |
5 |
15.4 |
12.3 |
8.7 |
18.4 |
3.6 |
4 |
62.115.144.78 |
mno-b3-link.ip.twelve99.net |
0.0 |
5 |
5 |
9.2 |
9.1 |
9.0 |
9.2 |
0.1 |
5 |
62.115.116.170 |
ffm-bb1-link.ip.twelve99.net |
60.0 |
5 |
2 |
17.4 |
17.3 |
17.3 |
17.4 |
0.0 |
6 |
62.115.137.203 |
win-bb1-link.ip.twelve99.net |
0.0 |
5 |
5 |
28.8 |
28.7 |
28.5 |
28.9 |
0.1 |
7 |
62.115.114.111 |
buca-b3-link.ip.twelve99.net |
0.0 |
5 |
5 |
42.6 |
43.4 |
42.6 |
46.4 |
1.3 |
8 |
??? |
??? |
100.0 |
5 |
0 |
??? |
0.0 |
??? |
??? |
0.0 |
9 |
92.180.51.73 |
92.180.51.73 |
0.0 |
5 |
5 |
81.9 |
68.2 |
53.7 |
81.9 |
9.6 |
10 |
92.180.51.74 |
92.180.51.74 |
0.0 |
5 |
5 |
85.1 |
78.5 |
56.2 |
85.1 |
9.6 |
11 |
188.241.240.230 |
hosted-by.hazi.ro |
0.0 |
5 |
5 |
53.5 |
53.6 |
53.3 |
53.9 |
0.2 |
4.11 指定DNS服务器(-r)
支持4种模式,google
,cloudflare
,system
(系统自带),resolv
(使用/etc/resolv.conf
的DNS)
trip example.com -r google
trip example.com -r cloudflare
trip example.com -r system
trip example.com -r resolv
4.12 输出IP对应的AS信息(-z,配合-r使用,不支持-r system)
trip example.com -r google -z
示例
trip example.com -r google |
trip example.com -r cloudflare |
trip example.com -r system |
trip example.com -r google -z |
|
|
|
|
4.13 输出IP详细信息
- 先下载mmdb文件(也可以自己找喜欢的mmdb文件,我提供的这个mmdb文件对国内IP的识别不够好):
wget -O /root/GeoLite2-City.mmdb https://git.io/GeoLite2-City.mmdb && chmod +r /root/GeoLite2-City.mmdb
trip example.com baidu.com hostloc.com --geoip-mmdb-file /root/GeoLite2-City.mmdb --tui-geoip-mode long
trip example.com -p tcp --geoip-mmdb-file /root/GeoLite2-City.mmdb --tui-geoip-mode long
示例
example.com |
baidu.com |
hostloc.com |
|
|
|
4.14 其他用法
参考官网:https://github.com/fujiapple852/trippy