Publish: 2018-11-27 | Modify: 2018-11-27
The usual practice for performing route tracing on a Linux server is to use the traceroute
command. However, this command does not display the IP location, which can be inconvenient. You can consider using the route tracing tool "BestTrace" provided by ipip.net as a replacement for traceroute
. BestTrace supports displaying IP locations, which makes it very intuitive.
ipip.net provides the BestTrace binary package, which can be downloaded and extracted for immediate use.
# Download BestTrace
wget http://soft.xiaoz.org/linux/besttrace4linux.zip
# Install unzip
yum -y install unzip
# Unzip
unzip besttrace4linux.zip
After extracting, you will see several binary files. Please choose the appropriate one for your system. In this case, xiaoz is using a Linux X64 system, so you can directly use the besttrace
file.
-rw-r--r--. 1 root root 8905913 Aug 20 14:48 besttrace
-rw-r--r--. 1 root root 7694251 Aug 20 14:48 besttrace32
-rw-r--r--. 1 root root 736 Jul 25 16:04 besttrace4linux.txt
-rw-r--r--. 1 root root 7764434 Aug 20 14:48 besttracearm
-rw-r--r--. 1 root root 8866532 Aug 20 14:48 besttracebsd
-rw-r--r--. 1 root root 7686164 Aug 20 14:48 besttracebsd32
-rw-r--r--. 1 root root 8950288 Aug 20 14:48 besttracemac
First, give BestTrace execute permission with chmod +x besttrace
. Then, execute the command to perform route tracing: ./besttrace -q1 -g cn IP
. The screenshot below shows an example.
For more usage instructions, you can enter ./besttrace --help
to view them. The complete parameters are as follows:
-6, - ipv6
Use IPv6.
-J, - json
Print traceroute results in JSON format.
-g, - lang string
The language currently only supports cn and en.
-m, - maxhop int
Specify the maximum number of hops (maximum time-to-live value) that traceroute will probe. The default value is 30. (default 30)
-a, - noas
Do not attempt to map IP addresses to AS when displaying.
-n, - nodomain
Do not attempt to map IP addresses to hostnames when displaying.
-l, - location
Do not attempt to map IP addresses to locations when displaying.
-q, - query int
Set the number of probe packets per hop. The default value is 3. (default 3)
-z, - sendtime int
The minimum time interval between probes (default 0).
If this value is greater than 10, it specifies a number in milliseconds; otherwise, it is a number of seconds (floating-point values are also allowed).
Useful when some routers use rate limiting on ICMP messages.
-f, - stopop int
Specify the TTL to start with. The default is 1. (default 1)
-s, - sync
Send icmp packets synchronously.
-T, - tcp
Use TCP SYN for probes.
-V, - version
Print version and exit.
-w, - waittime int
Set the time (in seconds) to wait for a response to a probe. (default 3)
The BestTrace client supports all platforms, including Windows, macOS, and Android. You can download more clients from the official website: https://www.ipip.net/product/client.html
I come from China and I am a freelancer. I specialize in Linux operations, PHP, Golang, and front-end development. I have developed open-source projects such as Zdir, ImgURL, CCAA, and OneNav.