How to traceroute with geolocation information in Fedora
You can always traceroute an IP address in Fedora using the standard traceroute command. However, if you are looking to find out more about each hop’s geolocation information inside the trace, you should consider using the IP2Trace command tool. In addition to the geolocation information, such as country, region, city, latitude and longitude, IP2Trace also provides you with the ZIP code, time zone, ISP, domain name, area code, weather, mobile information, elevation and usage type of an IP address. The type of data returned will depend on the IP2Location BIN data that you are using for the lookup, which can be downloaded for free.
Below is an example of the IP2Trace screenshot:
You can follow the below steps to download and install the IP2Trace package in Fedora:
- Install IP2Location development headers and libraries.
sudo dnf install IP2Location-devel - Sign up for a free IP2Location LITE account and get your download token.
- Once you have obtained the download token, download the IP2Location BIN database using the following command:
wget -O ip2location.zip “https://www.ip2location.com/download?token={YOUR_DOWNLOAD_TOKEN}&package=DB3LITEBIN” - In this tutorial, we will download the DB3BIN which will provide you with the country, region and city information.
- Unzip the package.
unzip ip2location.zip - Download the IP2Trace source from its Github project.
wget https://github.com/ip2location/ip2location-traceroute/archive/master.zip - Unzip the package.
unzip master.zip && cd ip2location-traceroute-master - Compile IP2Trace from source code.
sudo make
sudo make install - Start using IP2Trace by trace-routing IP 8.8.8.8.
sudo ip2trace -d ../IP2LOCATION-LITE-DB3.BIN -p 8.8.8.8