NextTrace 使用教程:一款追求轻量化的开源可视化路由跟踪工具

搬瓦工

NextTrace 是一个用来查看路由跟踪的工具,并且可以非常方便的进行可视化,支持多种使用方法,并且路由跟踪结果会显示在地图上。目前的版本是 V1 版本,此外目前已经有一个 NTrace-core 的项目,是后续 V2 版本的基础。本文介绍一下 NextTrace V1 版本的安装和使用方法。

  1. 项目地址:https://github.com/nxtrace/Ntrace-V1
  2. 更多地址:https://github.com/nxtrace/NTrace-core

一、NextTrace 安装教程

NextTrace 目前安装方法包括在 Linux、MacOS、以及 Windows 三个系统上。

  • Linux

    • 一键安装脚本

      bash -c "$(curl http://nexttrace-io-leomoe-api-a0.shop/nt_install_v1.sh)"
    • Arch Linux AUR 安装命令

      • 由源码构建

        yay -S nexttrace
      • 直接下载bin包(仅支持amd64)

        yay -S nexttrace-bin`
      • AUR 的2种构建分别由 huyz 和 ouuan 维护

    • Linuxbrew 安装命令

      同macOS Homebrew安装方法(homebrew-core版仅支持amd64)

  • macOS

    • macOS Homebrew 安装命令
      • homebrew-core版

        brew install nexttrace
      • 本仓库ACTIONS自动构建版(更新更快)

        brew tap xgadget-lab/nexttrace && brew install xgadget-lab/nexttrace/nexttrace
      • homebrew-core 构建由 chenrui333 维护,请注意该版本更新可能会落后仓库Action自动构建版本

  • Windows

    • Windows Scoop 安装命令
      • scoop-extras版

        scoop bucket add extras && scoop install extras/nexttrace
      • scoop-extra 由 soenggam 维护

    请注意,以上多种安装方式的仓库均由开源爱好者自行维护,不保证可用性和及时更新,如遇到问题请联系仓库维护者解决,或使用本项目官方编译提供的二进制包。

二、NextTrace 使用方法

NextTrace 默认使用ICMP协议发起TraceRoute请求,该协议同时支持IPv4IPv6

# IPv4 ICMP Trace
nexttrace 1.0.0.1
# URL
nexttrace http://example.com:8080/index.html?q=1

# 表格打印,使用 --table / -t 参数,将实时显示结果
nexttrace --table 1.0.0.1

# 一个方便供机器读取转化的模式
nexttrace --raw 1.0.0.1
nexttrace --json 1.0.0.1

# 只进行IPv4/IPv6解析
nexttrace --ipv4 g.co
nexttrace --ipv6 g.co

# IPv6 ICMP Trace
nexttrace 2606:4700:4700::1111

# 禁用路径可视化 使用 --map / -M 参数
nexttrace koreacentral.blob.core.windows.net
# MapTrace URL: https://api.leo.moe/tracemap/html/c14e439e-3250-5310-8965-42a1e3545266.html

需要注意的是,在 LeoMoeAPI 2.0 中,由于新增了了地理位置数据,我们已经弃用 traceMap 插件中 OpenStreetMap API 的在线查询的部分,并且使用自己数据库内的位置信息

路由可视化功能因为需要每个 Hop 的地理位置坐标,而第三方 API 通常不提供此类信息,所以此功能目前只支持搭配 LeoMoeAPI 使用。

NextTrace 现已经支持快速测试,有一次性测试回程路由需求的朋友可以使用

# 北上广(电信+联通+移动+教育网)IPv4 / IPv6 ICMP 快速测试
nexttrace --fast-trace

# 也可以使用 TCP SYN 而非 ICMP 进行测试
nexttrace --fast-trace --tcp

更多使用方法:https://github.com/nxtrace/Ntrace-V1/blob/main/README_zh_CN.md

全部用法:

Usage: nexttrace [-h|--help] [-4|--ipv4] [-6|--ipv6] [-T|--tcp] [-U|--udp]
                 [-F|--fast-trace] [-p|--port ] [-q|--queries
                 ] [--parallel-requests ] [-m|--max-hops
                 ] [-d|--data-provider
                 (Ip2region|ip2region|IP.SB|ip.sb|IPInfo|ipinfo|IPInsight|ipinsight|IPAPI.com|ip-api.com|IPInfoLocal|ipinfolocal|chunzhen|LeoMoeAPI|leomoeapi|disable-geoip)]
                 [-n|--no-rdns] [-a|--always-rdns] [-P|--route-path]
                 [-r|--report] [--dn42] [-o|--output] [-t|--table] [--raw]
                 [-j|--json] [-c|--classic] [-f|--first ] [-M|--map]
                 [-v|--version] [-s|--source ""] [-D|--dev ""]
                 [-R|--route] [-z|--send-time ] [-i|--ttl-time
                 ] [--timeout ] [--psize ]
                 [_positionalArg_nexttrace_31 ""] [--dot-server
                 (dnssb|aliyun|dnspod|google|cloudflare)] [-g|--language
                 (en|cn)]

Arguments:

  -h  --help                         Print help information
  -4  --ipv4                         Use IPv4 only
  -6  --ipv6                         Use IPv6 only
  -T  --tcp                          Use TCP SYN for tracerouting (default port
                                     is 80)
  -U  --udp                          Use UDP SYN for tracerouting (default port
                                     is 53)
  -F  --fast-trace                   One-Key Fast Trace to China ISPs
  -p  --port                         Set the destination port to use. It is
                                     either initial udp port value for
                                     "default"method (incremented by each
                                     probe, default is 33434), or initial seq
                                     for "icmp" (incremented as well, default
                                     from 1), or some constantdestination port
                                     for other methods (with default of 80 for
                                     "tcp", 53 for "udp", etc.)
  -q  --queries                      Set the number of probes per each hop.
                                     Default: 3
      --parallel-requests            Set ParallelRequests number. It should be
                                     1 when there is a multi-routing. Default:
                                     18
  -m  --max-hops                     Set the max number of hops (max TTL to be
                                     reached). Default: 30
  -d  --data-provider                Choose IP Geograph Data Provider [IP.SB,
                                     IPInfo, IPInsight, IP-API.com, Ip2region,
                                     IPInfoLocal, CHUNZHEN, disable-geoip].
                                     Default: LeoMoeAPI
      --pow-provider                 Choose PoW Provider [api.leo.moe, sakura]
                                     For China mainland users, please use
                                     sakura. Default: api.leo.moe
  -n  --no-rdns                      Do not resolve IP addresses to their
                                     domain names
  -a  --always-rdns                  Always resolve IP addresses to their
                                     domain names
  -P  --route-path                   Print traceroute hop path by ASN and
                                     location
  -r  --report                       output using report mode
      --dn42                         DN42 Mode
  -o  --output                       Write trace result to file
                                     (RealTimePrinter ONLY)
  -t  --table                        Output trace results as table
      --raw                          An Output Easy to Parse
  -j  --json                         Output trace results as JSON
  -c  --classic                      Classic Output trace results like
                                     BestTrace
  -f  --first                        Start from the first_ttl hop (instead from
                                     1). Default: 1
  -M  --map                          Disable Print Trace Map
  -v  --version                      Print version info and exit
  -s  --source                       Use source src_addr for outgoing packets
  -D  --dev                          Use the following Network Devices as the
                                     source address in outgoing packets
  -R  --route                        Show Routing Table [Provided By BGP.Tools]
  -z  --send-time                    Set how many [milliseconds] between
                                     sending each packet.. Useful when some
                                     routers use rate-limit for ICMP messages.
                                     Default: 100
  -i  --ttl-time                     Set how many [milliseconds] between
                                     sending packets groups by TTL. Useful when
                                     some routers use rate-limit for ICMP
                                     messages. Default: 500
      --timeout                      The number of [milliseconds] to keep probe
                                     sockets open before giving up on the
                                     connection.. Default: 1000
      --psize                        Set the packet size (payload size).
                                     Default: 52
      --_positionalArg_nexttrace_31  IP Address or domain name
      --dot-server                   Use DoT Server for DNS Parse [dnssb,
                                     aliyun, dnspod, google, cloudflare]
  -g  --language                     Choose the language for displaying [en,
                                     cn]. Default: cn

三、NextTrace 使用示例

三、搬瓦工新手教程和优惠套餐

1、搬瓦工新手入门

  1. 搬瓦工新手入门教程(1):搬瓦工众多方案怎么选择
  2. 搬瓦工新手入门教程(2):搬瓦工机房选择和速度测试
  3. 搬瓦工新手入门教程(3):注册账户和微信支付、支付宝购买教程
  4. 搬瓦工新手入门教程(4):登陆搬瓦工网站后台查看 VPS,登录 KiwiVM 面板进行简单管理
  5. 搬瓦工新手入门教程(5):通过 KiwiVM 后台面板更换操作系统并获取登陆信息

2、搬瓦工优惠套餐

搬瓦工优惠码:BWHCCNCXVV

方案内存CPU硬盘流量/月带宽机房价格购买
KVM
(最便宜)
1GB2核20GB1TB1GbpsDC3 CN2
DC8 ZNET
$49.99/年购买
KVM2GB3核40GB2TB1Gbps$52.99/半年
$99.99/年
购买
CN2GIA-E
(最推荐)
1GB2核20GB1TB2.5GbpsDC6 CN2 GIA-E
DC9 CN2 GIA
日本软银 JPOS_1
荷兰 EUNL_9
$49.99/季度
$169.99/年
购买
CN2GIA-E2GB3核40GB2TB2.5Gbps$89.99/季度
$299.99/年
购买
HK2GB2核40GB0.5TB1Gbps中国香港 CN2 GIA
日本东京 CN2 GIA
$89.99/月
$899.99/年
购买
HK4GB4核80GB1TB1Gbps$155.99/月
$1559.99/年
购买
OSAKA2GB2核40GB0.5TB1.5Gbps日本大阪 CN2 GIA$49.99/月
$499.99/年
购买
OSAKA4GB4核80GB1TB1.5Gbps$86.99/月
$869.99/年
购买

此外,也可以参考《2023年最新搬瓦工优惠码/搬瓦工便宜套餐/搬瓦工新手教程整理》。

3、搬瓦工优惠通知

下面的优惠通知只会在有优惠活动的时候推送信息,其他时候都是禁言的,所以不会对大家造成打扰,可以放心关注。

未经允许不得转载:搬瓦工 » NextTrace 使用教程:一款追求轻量化的开源可视化路由跟踪工具