besttrace.sh is a very popular one-click return-route (回程) testing script for Linux. The name usually refers to two different but related projects: one maintained by “搬瓦工中文网” (Bandwagon Host Chinese site) and another maintained by tomdiary on GitHub. Both aim to simplify return-route testing with similar core functionality.
Core Features and Benefits
The core value of besttrace.sh is reducing complex return-route testing to a single command with automatic analysis.
- One-click execution: No complex installation required; one command starts the test.
- Smart line analysis: The biggest highlight. The script automatically identifies line types (such as CN2 GIA, CMIN2, Unicom 9929, etc.) and labels them directly in the output, making line quality obvious at a glance.
- Comprehensive test nodes: Covers China Telecom, China Unicom, China Mobile, and CERNET, with test points in major cities like Beijing, Shanghai, and Guangzhou.
- Summary report: Generates a summarized result after testing, saving you from manually analyzing routes hop by hop.
- Advanced underlying engine: Uses the NextTrace traceroute engine with a high-precision IP database to accurately show the geolocation and ISP of every hop.
Quick Start: Installation and Usage
Both scripts are very easy to install and use.
Option 1: 搬瓦工中文网 Maintained Version
The most common version online.
-
Official site: https://besttrace.sh
-
One-click command (recommended): run it in your VPS SSH terminal as root or a user with
sudoprivileges:wget -qO- besttrace.sh | bashNote: If
wgetis not found, install it first via your package manager (e.g.,yum install wgetorapt install wget).
After running, the script prompts you to choose a test mode:
请选择测试模式:
0. 测试所有节点(默认-直接回车)
1. 仅测试电信(ChinaTelecom)
2. 仅测试联通(ChinaUnicom)
3. 仅测试移动(ChinaMobile)
4. 仅测试教育网(CERNET)
5. 自定义IP测试(自动识别运营商)
请输入选项[0-5]:
Enter the corresponding number and press Enter to start the test.
Option 2: tomdiary/besttrace (GitHub Maintained)
An open-source project continuously updated on GitHub.
-
One-click command (recommended):
bash <(curl -Ls "https://raw.githubusercontent.com/tomdiary/besttrace/main/main.sh") -
Common options:
-6: Test IPv6 routes.-l en: Switch output language to English.-i zc: Switch node data source.
-
Examples:
# Default test (IPv4, Chinese) bash <(curl -Ls "https://raw.githubusercontent.com/tomdiary/besttrace/main/main.sh") # Test IPv6 routes bash <(curl -Ls "https://raw.githubusercontent.com/tomdiary/besttrace/main/main.sh") -6
Interpreting the Results
After the script finishes, the output clearly shows routing information for every hop with intelligent analysis.
-
Detailed traceroute: Lists every hop a packet passes through, including IP address, geolocation, and latency.
-
Smart line analysis: After the traceroute, the script gives a summary line judgment. For example:
>>> [智能分析] 线路判定 (目标: CT): 类型:电信 163 骨干网 (AS4134)If you see a marker like
[CN2-BackBone], it usually means the route traverses a high-quality CN2 line.
In short, besttrace.sh reduces complex return-route testing to a single command with automatic analysis, making it ideal for quickly evaluating a VPS’s return-route network quality.