Project Icon

NTrace-core

开源可视化网络路由追踪工具

NTrace-core是一款使用Golang开发的开源网络路由追踪工具。它支持IPv4和IPv6,可通过ICMP、TCP和UDP协议进行路由跟踪。该工具提供表格、原始数据和JSON等多种输出格式。NTrace-core支持自定义IP数据库、TTL控制和并发探测等高级功能,并具有路径可视化功能,直观展示网络路由情况。它还支持快速测试、指定网络设备追踪等特性,是一个功能丰富的网络诊断工具。

NextTrace Logo


NextTrace

An open source visual routing tool that pursues light weight, developed using Golang.


HomePage: www.nxtrace.org

Github Actions

IAAS Sponsor

         

We are extremely grateful to DMIT, Misaka and SnapStack for providing the network infrastructure that powers this project.

How To Use

Document Language: English | 简体中文

⚠️ Please note: We welcome PR submissions from the community, but please submit your PRs to the NTrace-V1 repository instead of NTrace-core repository.
Regarding the NTrace-V1 and NTrace-core repositories:
Both will largely remain consistent with each other. All development work is done within the NTrace-V1 repository. The NTrace-V1 repository releases new versions first. After running stably for an undetermined period, we will synchronize that version to NTrace-core. This means that the NTrace-V1 repository serves as a "beta" or "testing" version.
Please note, there are exceptions to this synchronization. If a version of NTrace-V1 encounters a serious bug, NTrace-core will skip that flawed version and synchronize directly to the next version that resolves the issue.

Automated Install

  • Linux

    • One-click installation script

      curl nxtrace.org/nt |bash
      
    • Arch Linux AUR installation command

      • Directly download bin package (only supports amd64)

        yay -S nexttrace-bin
        
      • Build from source (only supports amd64)

        yay -S nexttrace
        
      • The AUR builds are maintained by ouuan, huyz

    • Linuxbrew's installation command

      Same as the macOS Homebrew's installation method (homebrew-core version only supports amd64)

    • Deepin installation command

      apt install nexttrace
      
    • Termux installation command

      pkg install nexttrace-enhanced
      
  • macOS

    • macOS Homebrew's installation command
      • Homebrew-core version

        brew install nexttrace
        
      • This repository's ACTIONS automatically built version (updates faster)

        brew tap nxtrace/nexttrace && brew install nxtrace/nexttrace/nexttrace
        
      • The homebrew-core build is maintained by chenrui333, please note that this version's updates may lag behind the repository Action automatically version

  • Windows

    • Windows Scoop installation command
      • Scoop-extras version

        scoop bucket add extras && scoop install extras/nexttrace
        
      • Scoop-extra is maintained by soenggam

    Please note, the repositories for all of the above installation methods are maintained by open source enthusiasts. Availability and timely updates are not guaranteed. If you encounter problems, please contact the repository maintainer to solve them, or use the binary packages provided by the official build of this project.

Manual Install

  • Download the precompiled executable

    For users not covered by the above methods, please go directly to Release to download the compiled binary executable.

    • Release provides compiled binary executables for many systems and different architectures. If none are available, you can compile it yourself.
    • Some essential dependencies of this project are not fully implemented on Windows by Golang, so currently, NextTrace is in an experimental support phase on the Windows platform.
  • Install from source

    After installing Go >= 1.20 yourself, you can use the following command to install

    go install github.com/nxtrace/NTrace-core@latest
    

    because of the version constraints conflict, you can not install NTrace-V1 by this After installation, the executable is in the $GOPATH/bin directory. If you have not set GOPATH, it is in the $HOME/go/bin directory. The binary file name is consistent with the project name. You need to replace the nexttrace command below with NTrace-core. If you want to be consistent with the commands below, you can rename the binary after executing the go install command

    mv  $GOPATH/bin/NTrace-core $GOPATH/bin/nexttrace
    

Get Started

NextTrace uses the ICMP protocol to perform TraceRoute requests by default, which supports both IPv4 and IPv6

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

# Form printing
nexttrace --table 1.0.0.1

# An Output Easy to Parse
nexttrace --raw 1.0.0.1
nexttrace --json 1.0.0.1

# IPv4/IPv6 Resolve Only, and automatically select the first IP when there are multiple IPs
nexttrace --ipv4 g.co
nexttrace --ipv6 g.co

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

# Disable Path Visualization With the -M parameter
nexttrace koreacentral.blob.core.windows.net
# MapTrace URL: https://api.nxtrace.org/tracemap/html/c14e439e-3250-5310-8965-42a1e3545266.html

# Disable MPLS display using the --disable-mpls / -e parameter or the NEXTTRACE_DISABLEMPLS environment variable
nexttrace --disable-mpls example.com
export NEXTTRACE_DISABLEMPLS=1

PS: The routing visualization drawing module was written by @tsosunchia, and the specific code can be viewed at tsosunchia/traceMap.

Note that in LeoMoeAPI 2.0, due to the addition of geographical location data, we have deprecated the online query part of the OpenStreetMap API in the traceMap plugin and are using location information from our own database.

The routing visualization function requires the geographical coordinates of each Hop, but third-party APIs generally do not provide this information, so this function is currently only supported when used with LeoMoeAPI.

NextTrace now supports quick testing, and friends who have a one-time backhaul routing test requirement can use it

# IPv4 ICMP Fast Test (Beijing + Shanghai + Guangzhou + Hangzhou) in China Telecom / Unicom / Mobile / Education Network
nexttrace --fast-trace

# You can also use TCP SYN for testing
nexttrace --fast-trace --tcp

# You can also quickly test through a customized IP/DOMAIN list file
nexttrace --file /path/to/your/iplist.txt
# CUSTOMIZED IP DOMAIN LIST FILE FORMAT
## One IP/DOMAIN per line + space + description information (optional)
## forExample:
## 106.37.67.1 BEIJING-TELECOM
## 240e:928:101:31a::1 BEIJING-TELECOM
## bj.10086.cn BEIJING-MOBILE
## 2409:8080:0:1::1
## 223.5.5.5

NextTrace already supports route tracing for specified Network Devices

# Use eth0 network interface
nexttrace --dev eth0 2606:4700:4700::1111

# Use eth0 network interface's IP
# When using the network interface's IP for route tracing, note that the IP type to be traced should be the same as network interface's IP type (e.g. both IPv4)
nexttrace --source 204.98.134.56 9.9.9.9

NextTrace can also use TCP and UDP protocols to perform Traceroute requests, but UDP protocols only supports IPv4 now

# TCP SYN Trace
nexttrace --tcp www.bing.com

# You can specify the port by yourself [here is 443], the default port is 80
nexttrace --tcp --port 443 2001:4860:4860::8888

# UDP Trace
nexttrace --udp 1.0.0.1

nexttrace --udp --port 53 1.0.0.1

NextTrace also supports some advanced functions, such as ttl control, concurrent probe packet count control, mode switching, etc.

# Send 2 probe packets per hop
nexttrace --queries 2 www.hkix.net

# No concurrent probe packets, only one probe packet is sent at a time
nexttrace --parallel-requests 1 www.hkix.net

# Start Trace with TTL of 5, end at TTL of 10
nexttrace --first 5 --max-hops 10 www.decix.net
# In addition, an ENV is provided to set whether to hide the destination IP
export NEXTTRACE_ENABLEHIDDENDSTIP=1

# Turn off the IP reverse parsing function
nexttrace --no-rdns www.bbix.net

# Set the payload size to 1024 bytes
nexttrace --psize 1024 example.com

# Set the payload size and DF flag for TCP Trace
nexttrace --psize 1024 --dont-fragment --tcp example.com

# Feature: print Route-Path diagram
# Route-Path diagram example:
# AS6453 Tata Communication「Singapore『Singapore』」
#  ╭╯
#  ╰AS9299 Philippine Long Distance Telephone Co.「Philippines『Metro Manila』」
#  ╭╯
#  ╰AS36776 Five9 Inc.「Philippines『Metro Manila』」
#  ╭╯
#  ╰AS37963 Aliyun「ALIDNS.COM『ALIDNS.COM』」
nexttrace --route-path www.time.com.my

# Disable color output
nexttrace --nocolor 1.1.1.1
# or use ENV
export NO_COLOR=1

NextTrace supports users to select their own IP API (currently supports: LeoMoeAPI, IP.SB, IPInfo, IPInsight, IPAPI.com, Ip2region, IPInfoLocal, CHUNZHEN)

# You can specify the IP database by yourself [IP-API.com here], if not specified, LeoMoeAPI will be used
nexttrace --data-provider ip-api.com
## Note There are frequency limits for free queries of the ipinfo and IPInsight APIs. You can purchase services from these providers to remove the limits
##      If necessary, you can clone this project, add the token provided by ipinfo or IPInsight and compile it yourself
## Note For the offline database IPInfoLocal, please download it manually and rename it to ipinfoLocal.mmdb. (You can download it from here: https://ipinfo.io/signup?ref=free-database-downloads)
##      For the offline database Ip2region, you can download it manually and rename it to ip2region.db, or let NextTrace download it automatically
## Fill the token to: ipgeo/tokens.go
## Please be aware: Due to the serious abuse of IP.SB, you will often be not able to query IP data from this source
## IP-API.com has a stricter restiction on API calls, if you can't query IP data from this source, please try again in a few minutes

# The Pure-FTPd IP database defaults to using http://127.0.0.1:2060 as the query interface. To customize it, please use environment variables
export NEXTTRACE_CHUNZHENURL=http://127.0.0.1:2060
## You can use https://github.com/freshcn/qqwry to build your own Pure-FTPd IP database service

# You can also specify the default IP database by setting an environment variable
export NEXTTRACE_DATAPROVIDER=ipinfo

NextTrace supports mixed parameters and shortened parameters

Example:
nexttrace --data-provider IPAPI.com --max-hops 20 --tcp --port 443 --queries 5 --no-rdns 1.1.1.1
nexttrace -tcp --queries 2 --parallel-requests 1 --table --route-path 2001:4860:4860::8888

Equivalent to:
nexttrace -d ip-api.com -m 20 -T -p 443 -q 5 -n 1.1.1.1
nexttrace -T -q 2 --parallel-requests 1 -t -P 2001:4860:4860::8888

IP Database

We use bgp.tools as a data provider for routing tables.

NextTrace BackEnd is now open-source.

https://github.com/sjlleo/nexttrace-backend

NextTrace LeoMoeAPI now utilizes the Proof of Work (POW) mechanism to prevent abuse, where NextTrace introduces the powclient library as a client-side component. Both the POW CLIENT and SERVER are open source, and everyone is welcome to use them. (Please direct any POW module-related questions to the corresponding repositories)

All NextTrace IP geolocation API DEMO can refer to here

For full usage list, please refer to the usage menu

Usage: nexttrace [-h|--help] [-4|--ipv4] [-6|--ipv6] [-T|--tcp] [-U|--udp]
                 [-F|--fast-trace] [-p|--port <integer>] [-q|--queries
                 <integer>] [--parallel-requests <integer>] [-m|--max-hops
                 <integer>] [-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)]
                 [--pow-provider (api.nxtrace.org|sakura)] [-n|--no-rdns]
                 [-a|--always-rdns] [-P|--route-path] [-r|--report] [--dn42]
                 [-o|--output] [-t|--table] [--raw] [-j|--json] [-c|--classic]
                 [-f|--first <integer>] [-M|--map] [-e|--disable-mpls]
                 [-v|--version] [-s|--source "<value>"] [-D|--dev "<value>"]
                 [-z|--send-time <integer>] [-i|--ttl-time <integer>]
                 [--timeout <integer>] [--psize <integer>]
                 [_positionalArg_nexttrace_32 "<value>"] [--dot-server
                 (dnssb|aliyun|dnspod|google|cloudflare)] [-g|--language
                 (en|cn)] [--file "<value>"] [-C|--nocolor]

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 33494)
  -F  --fast-trace                   One-Key Fast Trace to China ISPs
  -p  --port                         Set the destination port to use. With
                                     default of 80 for "tcp", 33494 for "udp"
  -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
项目侧边栏1项目侧边栏2
推荐项目
Project Cover

豆包MarsCode

豆包 MarsCode 是一款革命性的编程助手,通过AI技术提供代码补全、单测生成、代码解释和智能问答等功能,支持100+编程语言,与主流编辑器无缝集成,显著提升开发效率和代码质量。

Project Cover

AI写歌

Suno AI是一个革命性的AI音乐创作平台,能在短短30秒内帮助用户创作出一首完整的歌曲。无论是寻找创作灵感还是需要快速制作音乐,Suno AI都是音乐爱好者和专业人士的理想选择。

Project Cover

有言AI

有言平台提供一站式AIGC视频创作解决方案,通过智能技术简化视频制作流程。无论是企业宣传还是个人分享,有言都能帮助用户快速、轻松地制作出专业级别的视频内容。

Project Cover

Kimi

Kimi AI助手提供多语言对话支持,能够阅读和理解用户上传的文件内容,解析网页信息,并结合搜索结果为用户提供详尽的答案。无论是日常咨询还是专业问题,Kimi都能以友好、专业的方式提供帮助。

Project Cover

阿里绘蛙

绘蛙是阿里巴巴集团推出的革命性AI电商营销平台。利用尖端人工智能技术,为商家提供一键生成商品图和营销文案的服务,显著提升内容创作效率和营销效果。适用于淘宝、天猫等电商平台,让商品第一时间被种草。

Project Cover

吐司

探索Tensor.Art平台的独特AI模型,免费访问各种图像生成与AI训练工具,从Stable Diffusion等基础模型开始,轻松实现创新图像生成。体验前沿的AI技术,推动个人和企业的创新发展。

Project Cover

SubCat字幕猫

SubCat字幕猫APP是一款创新的视频播放器,它将改变您观看视频的方式!SubCat结合了先进的人工智能技术,为您提供即时视频字幕翻译,无论是本地视频还是网络流媒体,让您轻松享受各种语言的内容。

Project Cover

美间AI

美间AI创意设计平台,利用前沿AI技术,为设计师和营销人员提供一站式设计解决方案。从智能海报到3D效果图,再到文案生成,美间让创意设计更简单、更高效。

Project Cover

AIWritePaper论文写作

AIWritePaper论文写作是一站式AI论文写作辅助工具,简化了选题、文献检索至论文撰写的整个过程。通过简单设定,平台可快速生成高质量论文大纲和全文,配合图表、参考文献等一应俱全,同时提供开题报告和答辩PPT等增值服务,保障数据安全,有效提升写作效率和论文质量。

投诉举报邮箱: service@vectorlightyear.com
@2024 懂AI·鲁ICP备2024100362号-6·鲁公网安备37021002001498号