- Notifications
You must be signed in to change notification settings - Fork432
NextTrace, an open source visual route tracking CLI tool
License
nxtrace/NTrace-core
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
HomePage:www.nxtrace.org
We are extremely grateful toDMIT,Misaka andSnapStack for providing the network infrastructure that powers this project.
Document Language: English |简体中文
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.
Linux
One-click installation script
curl -sL nxtrace.org/nt|bashInstall nxtrace from the APT repository
- Supports AMD64/ARM64 architectures
curl -fsSL https://github.com/nxtrace/nexttrace-debs/releases/latest/download/nexttrace-archive-keyring.gpg| sudo tee /etc/apt/keyrings/nexttrace.gpg>/dev/nullecho"Types: debURIs: https://github.com/nxtrace/nexttrace-debs/releases/latest/download/Suites: ./Signed-By: /etc/apt/keyrings/nexttrace.gpg"| sudo tee /etc/apt/sources.list.d/nexttrace.sources>/dev/nullsudo apt updatesudo apt install nexttrace
- APT repository maintained by wcbing and nxtrace
- Supports AMD64/ARM64 architectures
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
- Directly download bin package (only supports amd64)
Linuxbrew's installation command
Same as the macOS Homebrew's installation method (homebrew-core version only supports amd64)
deepin installation command
apt install nexttrace
x-cmd installation command
x env use nexttrace
Termux installation command
pkg install root-repopkg install nexttrace
ImmortalWrt installation command
opkg install nexttrace
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
- Homebrew-core version
- macOS Homebrew's installation command
Windows
Windows WinGet installation command
- WinGet version
winget install nexttrace
- WinGet build maintained by Dragon1573
- WinGet version
Windows Scoop installation command
- Scoop-extras version
scoop bucket add extras && scoop install extras/nexttrace - Scoop-extra is maintained by soenggam
- Scoop-extras version
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.
Download the precompiled executable
For users not covered by the above methods, please go directly toRelease to download the compiled binary executable.
Releaseprovides 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
WindowsbyGolang, so currently,NextTraceis in an experimental support phase on theWindowsplatform.
NextTrace uses theICMP protocol to perform TraceRoute requests by default, which supports bothIPv4 andIPv6
# IPv4 ICMP Tracenexttrace 1.0.0.1# URLnexttrace http://example.com:8080/index.html?q=1# Form printingnexttrace --table 1.0.0.1# An Output Easy to Parsenexttrace --raw 1.0.0.1nexttrace --json 1.0.0.1# IPv4/IPv6 Resolve Only, and automatically select the first IP when there are multiple IPsnexttrace --ipv4 g.conexttrace --ipv6 g.co# IPv6 ICMP Tracenexttrace 2606:4700:4700::1111# Developer mode: set the ENV variable NEXTTRACE_DEVMODE=1 to make fatal errors panic with a stack trace.export NEXTTRACE_DEVMODE=1# Disable Path Visualization With the -M parameternexttrace 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 variablenexttrace --disable-mpls example.comexport NEXTTRACE_DISABLEMPLS=1
PS: The route visualization module is an independent component, You can find its source code atnxtrace/traceMap.
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.
- For Normal User Mode:
OnlyICMP mode can be used, and the firewall must allowICMP/ICMPv6traffic.netsh advfirewall firewall add rule name="All ICMP v4" dir=in action=allow protocol=icmpv4:any,anynetsh advfirewall firewall add rule name="All ICMP v6" dir=in action=allow protocol=icmpv6:any,any
- For Administrator Mode:
TCP/UDP mode requires additional installation ofnpcapandWinDivert.
ICMP mode requires allowingICMP/ICMPv6in the firewall ifnpcapandWinDivertare not installed.
You can download and installnpcapfrom the official website (https://npcap.com/#download), andWinDivertcan be automatically configured using the--initparameter.
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 Networknexttrace --fast-trace# You can also use TCP SYN for testingnexttrace --fast-trace --tcp# You can also quickly test through a customized IP/DOMAIN list filenexttrace --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
# Use eth0 network interfacenexttrace --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
# TCP SYN Tracenexttrace --tcp www.bing.com# You can specify the port by yourself [here is 443], the default port is 80nexttrace --tcp --port 443 2001:4860:4860::8888# UDP Tracenexttrace --udp 1.0.0.1# You can specify the target port yourself [here it is 5353], the default is port 33494nexttrace --udp --port 5353 1.0.0.1# For TCP/UDP Trace, you can specify the source port; by default, a fixed random port is used# (If you need to use a different random source port for each packet, please set the ENV variable NEXTTRACE_RANDOMPORT, or set the source port to -1)nexttrace --tcp --source-port 14514 www.bing.com
NextTrace also supports some advanced functions, such as ttl control, concurrent probe packet count control, mode switching, etc.
# Send 2 probe packets per hopnexttrace --queries 2 www.hkix.net# Set the maximum attempts per TTLnexttrace --max-attempts 10 www.hkix.net# or use the ENV variable NEXTTRACE_MAXATTEMPTS to persist across runsexport NEXTTRACE_MAXATTEMPTS=10# No concurrent probe packets, only one probe packet is sent at a timenexttrace --parallel-requests 1 www.hkix.net# Start Trace with TTL of 5, end at TTL of 10nexttrace --first 5 --max-hops 10 www.decix.net# In addition, an ENV is provided to set whether to mask the destination IP and omit its hostnameexport NEXTTRACE_ENABLEHIDDENDSTIP=1# Turn off the IP reverse parsing functionnexttrace --no-rdns www.bbix.net# Set the payload size to 1024 bytesnexttrace --psize 1024 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 outputnexttrace --no-color 1.1.1.1# or use ENVexport NO_COLOR=1
NextTrace supports users to select their own IP API (currently supports:LeoMoeAPI,IP.SB,IPInfo,IPInsight,IPAPI.com,IPInfoLocal,CHUNZHEN)
# You can specify the IP database by yourself [IP-API.com here], if not specified, LeoMoeAPI will be usednexttrace --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## Fill the token to: ipgeo/tokens.go## 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)## Current directory, nexttrace binary directory and FHS directories (Unix-like) will be searched.## To customize it, please use environment variables,export NEXTTRACE_IPINFOLOCALPATH=/xxx/yyy.mmdb## 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 variablesexport 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 variableexport NEXTTRACE_DATAPROVIDER=ipinfo
Example:nexttrace --data-provider IPAPI.com --max-hops 20 --tcp --port 443 --queries 5 --no-rdns 1.1.1.1nexttrace -tcp --queries 2 --parallel-requests 1 --table --route-path 2001:4860:4860::8888Equivalent to:nexttrace -d ip-api.com -m 20 -T -p 443 -q 5 -n 1.1.1.1nexttrace -T -q 2 --parallel-requests 1 -t -P 2001:4860:4860::8888
Globalping provides access to thousands of community-hosted probes to run network tests and measurements.
Run traceroute from a specified location by using the--from flag. The location field accepts continents, countries, regions, cities, ASNs, ISPs, or cloud regions.
nexttrace google.com --from Germanynexttrace google.com --from comcast+california
A limit of 250 tests per hour is set for all anonymous users. To double the limit to 500 per hour please set theGLOBALPING_TOKEN environment variable with your token.
export GLOBALPING_TOKEN=your_token_hereWe usebgp.tools as a data provider for routing tables.
NextTrace BackEnd is now open-source.
https://github.com/sjlleo/nexttrace-backend
NextTraceLeoMoeAPI 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)
- GitHub - tsosunchia/powclient: Proof of Work CLIENT for NextTrace
- GitHub - tsosunchia/powserver: Proof of Work SERVER for NextTrace
All NextTrace IP geolocationAPI DEMO can refer tohere
Usage: nexttrace [-h|--help] [--init] [-4|--ipv4] [-6|--ipv6] [-T|--tcp] [-U|--udp] [-F|--fast-trace] [-p|--port<integer>] [--icmp-mode<integer>] [-q|--queries<integer>] [--parallel-requests<integer>] [-m|--max-hops<integer>] [--max-attempts<integer>] [-d|--data-provider (IP.SB|ip.sb|IPInfo|ipinfo|IPInsight|ipinsight|IPAPI.com|ip-api.com|IPInfoLocal|ipinfolocal|chunzhen|LeoMoeAPI|leomoeapi|ipdb.one|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>"] [--source-port<integer>] [-D|--dev"<value>"] [--listen"<value>"] [--deploy] [-z|--send-time<integer>] [-i|--ttl-time<integer>] [--timeout<integer>] [--psize<integer>] [_positionalArg_nexttrace_38"<value>"] [--dot-server (dnssb|aliyun|dnspod|google|cloudflare)] [-g|--language (en|cn)] [--file"<value>"] [-C|--no-color] [--from"<value>"]Arguments: -h --help Printhelp information --init Windows ONLY: Extract WinDivert runtime to current directory -4 --ipv4 Use IPv4 only -6 --ipv6 Use IPv6 only -T --tcp Use TCP SYNfor tracerouting (default dest-port is 80) -U --udp Use UDP SYNfor tracerouting (default dest-port is 33494) -F --fast-trace One-Key Fast Trace to China ISPs -p --port Set the destination port to use. With default of 80for"tcp", 33494for"udp" --icmp-mode Windows ONLY: Choose the method to listenfor ICMP packets (1=Socket, 2=PCAP; 0=Auto) -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 --max-attempts Set the max number of attempts per TTL (instead of a fixed auto value) -d --data-provider Choose IP Geograph Data Provider [IP.SB, IPInfo, IPInsight, IP-API.com, IPInfoLocal, CHUNZHEN, disable-geoip]. Default: LeoMoeAPI --pow-provider Choose PoW Provider [api.nxtrace.org, sakura] For China mainland users, please use sakura. Default: api.nxtrace.org -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 of 1). Default: 1 -M --map Disable Print Trace Map -e --disable-mpls Disable MPLS -V --version Print version info andexit -s --source Usesource address src_addrfor outgoing packets --source-port Usesource port src_portfor outgoing packets -D --dev Use the following Network Devices as thesource addressin outgoing packets --listen Set listen addressfor web console (e.g. 127.0.0.1:30080) --deploy Start the Gin powered web console -z --send-time Set how many [milliseconds] between sending each packet. Useful when some routers use rate-limitfor ICMP messages. Default: 50 -i --ttl-time Set how many [milliseconds] between sending packets groups by TTL. Useful when some routers use rate-limitfor ICMP messages. Default: 50 --timeout The number of [milliseconds] to keep probe sockets open before giving up on the connection. Default: 1000 --psize Set the payload size. Default: 52 --_positionalArg_nexttrace_38 IP Address or domain name --dot-server Use DoT Serverfor DNS Parse [dnssb, aliyun, dnspod, google, cloudflare] -g --language Choose the languagefor displaying [en, cn]. Default: cn --file Read IP Address or domain name from file -C --no-color Disable Colorful Output --from Run traceroute via Globalping (https://globalping.io/network) from a specified location. The location field accepts continents, countries, regions, cities, ASNs, ISPs, or cloud regions.
OpenTrace is the cross-platformGUI version ofNextTrace developed by @Archeb, bringing a familiar but more powerful user experience.
This software is still in the early stages of development and may have many flaws and errors. We value your feedback.
https://github.com/Archeb/opentrace
NextTraceWebApi is a web-based server implementation ofNextTrace in theMTR style, offering various deployment options includingDocker.
https://github.com/nxtrace/nexttracewebapi
NextTraceroute is a root-free Android route tracing application that defaults to using theNextTrace API, developed by @surfaceocean.
Thank you to all the test users for your enthusiastic support. This app has successfully passed the closed testing phase and is now officially available on the Google Play Store.
https://github.com/nxtrace/NextTraceroute
NextTrace focuses on Golang Traceroute implementations, and its LeoMoeAPI geolocation information is not supported by raw data, so a commercial version is not possible.
The LeoMoeAPI data is subject to copyright restrictions from multiple data sources, and is only used for the purpose of displaying the geolocation of route tracing.
We would like to credit samleong123 for providing nodes in Malaysia, TOHUNET Looking Glass for global nodes, and Ping.sx from Misaka, where more than 80% of reliable calibration data comes from ping/mtr reports.
At the same time, we would like to credit isyekong for their contribution to rDNS-based calibration ideas and data. LeoMoeAPI is accelerating the development of rDNS resolution function, and has already achieved automated geolocation resolution for some backbone networks, but there are some misjudgments. We hope that NextTrace will become a One-Man ISP-friendly traceroute tool in the future, and we are working on improving the calibration of these ASN micro-backbones as much as possible.
In terms of development, I would like to credit missuo and zhshch for their help with Go cross-compilation, design concepts and TCP/UDP Traceroute refactoring, and tsosunchia for their support on TraceMap.
I would also like to credit FFEE_CO, TheresaQWQ, stydxm and others for their help. LeoMoeAPI has received a lot of support since its first release, so I would like to credit them all!
We hope you can give us as much feedback as possible on IP geolocation errors (see issue) so that it can be calibrated in the first place and others can benefit from it.
This project is sponsored byProject Alexandria.
This project is sponsored byAIWEN TECH. We’re pleased to enhance the accuracy and completeness of this project’s GEOIP lookups usingAIWEN TECH City-Level IP Database, and to make it freely available to the public.
This Project usesJetBrain Open-Source Project License. We Proudly Develop ByGoland.
Gubo Reliable Host Recommendation Website
IPInfo Provided most of the data support for this project free of charge
BGP.TOOLS Provided some data support for this project free of charge
PeeringDB Provided some data support for this project free of charge
Globalping An open-source and free project that provides global access to run network tests like traceroute
sjlleo The perpetual leader, founder, and core contributors
tsosunchia The project chair, infra maintainer, and core contributors
Yunlq An active community contributor
Although other third-party APIs are integrated in this project, please refer to the official website of the third-party APIs for specific TOS and AUP. If you encounter IP data errors, please contact them directly to correct them.
For feedback related to corrections about IP information, we currently have two channels available:
- IP 错误报告汇总帖 in the GITHUB ISSUES section of this project (Recommended)
- This project's dedicated correction email:
correct#nxtrace.org(Please note that this email is only for correcting IP-related information. For other feedback, please submit an ISSUE)
How to obtain the freshly baked binary executable of the latest commit?
Please go to the most recentBuild & Release workflow in GitHub Actions.
Common questions
- On Windows, ICMP mode requires manual firewall allowance for ICMP/ICMPv6
- On macOS, only ICMP mode does not require elevated privileges
- In some cases, running multiple instances of NextTrace simultaneously may interfere with each other’s results (observed so far only in TCP mode)
About
NextTrace, an open source visual route tracking CLI tool
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.





