Linux Route Tracing with BestTrace: Display IP Locations

besttracelinux tracerouteip locationroute tracingipip.net
Published·Modified·

The standard method for route tracing on Linux servers is using the traceroute command, but it cannot display IP locations, making it less convenient. Consider using BestTrace, a route tracing tool provided by ipip.net, to replace traceroute. BestTrace supports IP location display, making it very intuitive.

Download BestTrace

ipip.net provides a BestTrace binary package. You can download and extract it directly to use.

Using BestTrace

# Download BestTrace
wget http://soft.xiaoz.org/linux/besttrace4linux.zip
# Install unzip
yum -y install unzip
# Extract
unzip besttrace4linux.zip

After extraction, you will see several binary files. Choose the one that matches your system. For example, on a Linux X64 system like the one used by xiaoz, simply 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 8866432 Aug 20 14:48 besttracebsd
-rw-r--r--. 1 root root 7686464 Aug 20 14:48 besttracebsd32
-rw-r--r--. 1 root root 8950288 Aug 20 14:48 besttracemac

First, grant execution permissions to BestTrace using chmod +x besttrace, then run the route tracing command ./besttrace -q1 -g cn IP. The screenshot is shown below.

Parameter Explanation

For more usage instructions, input ./besttrace --help to view the complete parameters:

-6, - ipv6
    Use IPv6.
  -J, - json
    Print traceroute results in JSON format.
  -g, - lang string
    Language currently supports only cn and en.
  -m, - maxhop int
    Specify the maximum number of hops (TTL value) for the traceroute. Default is 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. Default is 3.
  -z, - sendtime int
    Minimum time interval between probes (default is 0).
    If the value is greater than 10, it specifies a number in milliseconds; otherwise, it is in seconds (floating-point values are also allowed).
    Useful when certain routers rate-limit ICMP messages.
  -f, - stopop int
    Specify the TTL to start from. Default is 1.
   - sync
    Send ICMP packets synchronously.
  -T, - tcp
    Use TCP SYN for probing.
  -V, - version
    Print version and exit.
  -w, - waittime int
    Set the wait time for probe responses in seconds. (Default is 3)

Other Notes

The BestTrace client supports all platforms, including Windows, Mac, and Android. More clients can be downloaded from the official website: https://www.ipip.net/product/client.html