How to install and use IP2Trace on Linux for traceroute

How to install and use IP2Trace on Linux for traceroute

IP2Trace is a traceroute application tool which allows the user to get IP address information such as country, region, city, latitude, longitude, ZIP code, time zone, ISP, domain name, connection type, area code, weather, mobile network, elevation, usage type from traceroute probes IP address.

Before getting started, please make sure you have compiled and installed the IP2Location C library.

1. Download the latest IP2Trace source code from GitHub.

wget https://github.com/ip2location/ip2location-traceroute/archive/master.zip

2. Unzip the package.

unzip master.zip && rm master.zip

3. Compile and install IP2Trace.

make
make install

4. You will need the IP2Location BIN database to get the geolocation information. Download a free database from https://lite.ip2location.com or a commercial database from https://www.ip2location.com

5. Once you have a IP2Location BIN database available, you can start using IP2Trace as below.

ip2trace -p 8.8.8.8 -d /usr/share/ip2location/DB24.BIN

Result:

ip2trace -p 8.8.8.8 -d /usr/share/ip2location/DB24.BIN -t 20
IP2Location Geolocation Traceroute (ip2trace) Version 8.0.0
Copyright (c) 2021 IP2Location.com [MIT License]
https://www.ip2location.com/free/traceroute-application

1.  50.97.82.1 0.6350 ms ["US","United States of America","Texas","Dallas","32.939491","-96.838730","75244","SoftLayer Technologies Inc.","softlayer.com","-06:00","T1","1","214/469/972","USTX0327","Dallas","-","-","-","129.0","DCH"]
2.  173.192.118.142 0.5120 ms ["US","United States of America","Texas","Dallas","32.939491","-96.838730","75244","SoftLayer Technologies Inc.","softlayer.com","-06:00","T1","1","214/469/972","USTX0327","Dallas","-","-","-","129.0","DCH"]
3.  50.97.18.194 1.1260 ms ["US","United States of America","Texas","Dallas","32.939491","-96.838730","75244","SoftLayer Technologies Inc.","softlayer.com","-06:00","T1","1","214/469/972","USTX0327","Dallas","-","-","-","129.0","DCH"]
4.  72.14.203.120 27.7610 ms ["US","United States of America","California","Mountain View","37.405991","-122.078514","94043","Google LLC","google.com","-08:00","T1","1","650","USCA0746","Mountain View","-","-","-","32.0","DCH"]
5.  108.170.252.161 2.2220 ms ["US","United States of America","California","Mountain View","37.405991","-122.078514","94043","Google LLC","google.com","-08:00","T1","1","650","USCA0746","Mountain View","-","-","-","32.0","DCH"]
6.  108.170.230.115 1.2490 ms ["US","United States of America","California","Mountain View","37.405991","-122.078514","94043","Google LLC","google.com","-08:00","T1","1","650","USCA0746","Mountain View","-","-","-","32.0","DCH"]
7.  8.8.8.8 1.0820 ms ["US","United States of America","California","Mountain View","37.405991","-122.078514","94043","Google LLC","google.com","-08:00","T1","1","650","USCA0746","Mountain View","-","-","-","32.0","DCH"]
IP2Location LITE database

Was this article helpful?

Related Articles