网络分析工具Trippy教程
## 1. 官方介绍> Trippy combines the functionality of traceroute and ping and is designed to assist with the analysis of networking issues.
> Trippy 结合了 traceroute 和 ping 的功能,旨在协助分析网络问题。
>
> (https://forum.naixi.net/goto.php?url=https%3A%2F%2Fgithub.com%2Ffujiapple852%2Ftrippy)
## 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://forum.naixi.net/goto.php?url=https%3A%2F%2Fgithub.com%2Ffujiapple852%2Ftrippy%2Freleases%2Ftag%2F0.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` |
| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
| !(https://p.sda1.dev/17/5cc8722b0c1ab8a2749dd81daa8475b5/image.png) | !(https://p.sda1.dev/17/4c8e2288dfdf5f30d5c76a4d231da579/image.png) | !(https://p.sda1.dev/17/3c57074ef43ce00a81d857f5e2c7ed9f/image.png) | !(https://p.sda1.dev/17/33f3167b0defb45d74174ecefe8f7dca/image.png) | !(https://p.sda1.dev/17/3e6a237df01ad7bb7ae0bf10aba457a8/image.png) | !(https://p.sda1.dev/17/d4c754811b599304e5795998add582c6/image.png) |
### 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` |
| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
| !(https://p.sda1.dev/17/1444e57a4f15edcf1865392b6976a73a/image.png) | !(https://p.sda1.dev/17/5c6871af08b23495d3c81a20239f456a/image.png) | !(https://p.sda1.dev/17/d8ac47cedad26c031c61f1a2df2bea43/image.png) | !(https://p.sda1.dev/17/c37f282f52bf54f211a9c2feafe790b6/image.png) | !(https://p.sda1.dev/17/d583ddd6e630f2bca29f38c73ce05add/image.png) | !(https://p.sda1.dev/17/3b1cd1e90d6121ac16ffa374ed254e44/image.png) |
### 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` |
| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
| !(https://p.sda1.dev/17/88f6e3db72118d3a4a4349679e319b61/image.png) | !(https://p.sda1.dev/17/81ba42e839a99098f6021e65ed88cc04/image.png) | !(https://p.sda1.dev/17/c96514292915799a63a2739316b60ead/image.png) | !(https://p.sda1.dev/17/5465aa8218355f24a9a510618ad9ce81/image.png) | !(https://p.sda1.dev/17/b9c0edb48bc91b3b6607c587f48041ed/image.png) | !(https://p.sda1.dev/17/04e706703f35d4ba1478c6367068f2ff/image.png) |
### 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 | (https://forum.naixi.net/goto.php?url=http%3A%2F%2Fmno-b3-link.ip.twelve99.net) | 0.0 | 5 | 5 | 9.2 | 9.1 | 9.0 | 9.2 | 0.1 |
> | 5 | 62.115.116.170 | (https://forum.naixi.net/goto.php?url=http%3A%2F%2Fffm-bb1-link.ip.twelve99.net) | 60.0 | 5 | 2 | 17.4 | 17.3 | 17.3 | 17.4 | 0.0 |
> | 6 | 62.115.137.203 | (https://forum.naixi.net/goto.php?url=http%3A%2F%2Fwin-bb1-link.ip.twelve99.net) | 0.0 | 5 | 5 | 28.8 | 28.7 | 28.5 | 28.9 | 0.1 |
> | 7 | 62.115.114.111 | (https://forum.naixi.net/goto.php?url=http%3A%2F%2Fbuca-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 | (https://forum.naixi.net/goto.php?url=http%3A%2F%2Fhosted-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 | (https://forum.naixi.net/goto.php?url=http%3A%2F%2Fmno-b3-link.ip.twelve99.net) | 0.0 | 5 | 5 | 9.2| 9.1| 9.0| 9.2| 0.1 |
| 5 | 62.115.116.170| (https://forum.naixi.net/goto.php?url=http%3A%2F%2Fffm-bb1-link.ip.twelve99.net) | 60.0| 5 | 2 | 17.4 | 17.3 | 17.3 | 17.4 | 0.0 |
| 6 | 62.115.137.203| (https://forum.naixi.net/goto.php?url=http%3A%2F%2Fwin-bb1-link.ip.twelve99.net) | 0.0 | 5 | 5 | 28.8 | 28.7 | 28.5 | 28.9 | 0.1 |
| 7 | 62.115.114.111| (https://forum.naixi.net/goto.php?url=http%3A%2F%2Fbuca-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 | (https://forum.naixi.net/goto.php?url=http%3A%2F%2Fhosted-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` |
| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
| !(https://p.sda1.dev/17/90e1d7d419aa18368f53f0d231fae594/image.png) | !(https://p.sda1.dev/17/945edfb32334f37f8ddfc5fb04f5c1b2/image.png) | !(https://p.sda1.dev/17/33090ed4c8989327a987d685c70547b0/image.png) | !(https://p.sda1.dev/17/47dec0f502b36685b75a7bd8d5eb2213/image.png) |
### 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` |
| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
| !(https://p.sda1.dev/17/f8e207ad15aa42e9faf900aa7652d1bd/image.png) | !(https://p.sda1.dev/17/3ef261439ae18867afcfb0cbeec289c7/image.png) | !(https://p.sda1.dev/17/a53cfdc66cb55f980abf1f6e5af07df7/image.png) |
### 4.14 其他用法
参考官网:(https://forum.naixi.net/goto.php?url=https%3A%2F%2Fgithub.com%2Ffujiapple852%2Ftrippy) 有什么特色的功能吗
页:
[1]