Ping an IP from multiple locations around the world. It is helpful to identify network latency problems or detect if the IP uses anycast.
Developer information
The following API method(s) are used:
https://geonet.shodan.io/api/geoping/{ip}
Other references:
- Geonet API Documentation: https://geonet.shodan.io/docs
Installation
Grab the latest Debian package and install all available geonet commands:
$ wget https://gitlab.com/api/v4/projects/32089582/packages/generic/geonet-rs/latest/geonet_latest_x86_64.deb$ sudo dpkg -i geonet_latest_x86_64.debFor MacOS, install the latest version from tap repository with homebrew
$ brew tap shodan-public/homebrew-shodan https://gitlab.com/shodan-public/homebrew-shodan$ brew install geonetPrebuilt releases of the individual commands are also available for most x64 platforms. To get the most recent release from the Release page, download the command and chmod it. For example, to download the 0.4.4 Linux x64 release of geoping:
$ wget https://gitlab.com/api/v4/projects/32089582/packages/generic/geonet-rs/0.4.4/geoping-linux-x86_64 -O geoping$ chmod +x geopingTo build the utilities from source you need to have Rust stable or nightly installed. Afterwards you can simply run:
cargo build --releaseThe geodns and geoping tools will then be available in the target/release folder.
Usage
The geoping tool requires a single argument: the IP address that should get pinged. A few other options are also supported:
$ geoping -hgeoping 0.2.0Ping an IP from multiple locations around the world
USAGE: geoping [OPTIONS] <address>
FLAGS: -h, --help Prints help information -V, --version Prints version information
OPTIONS: -o, --output <output> [default: ]
ARGS: <address>The geoping command supports JSON output using the JSON-NL format which can then be consumed by tools such as jq.
Examples
Geoping 1.1.1.1
$ geoping 1.1.1.1Amsterdam (NL) 0.969 ms (min: 0.909 ms, max: 1.063 ms)Clifton (US) 1.545 ms (min: 1.24 ms, max: 2.132 ms)Frankfurt am Main (DE) 1.252 ms (min: 0.902 ms, max: 1.848 ms)London (GB) 2.99 ms (min: 2.637 ms, max: 3.648 ms)Singapore (SG) 1.74 ms (min: 1.348 ms, max: 2.507 ms)Geoping yahoo.com:
$ geoping yahoo.comAmsterdam (NL) 115.044 ms (min: 113.476 ms, max: 116.06 ms)Clifton (US) 31.53 ms (min: 31.287 ms, max: 31.969 ms)Frankfurt am Main (DE) 119.753 ms (min: 119.504 ms, max: 120.219 ms)London (GB) 102.826 ms (min: 102.65 ms, max: 103.152 ms)Singapore (SG) 196.851 ms (min: 196.808 ms, max: 196.875 ms)Geoping yahoo.com and output results in JSON
$ geoping -o json yahoo.com{"ip":"98.137.11.164","is_alive":true,"min_rtt":148.197,"avg_rtt":148.558,"max_rtt":149.104,"rtts":[149.10435,148.19693,148.37193],"packets_sent":3,"packets_received":3,"packet_loss":0.0,"from_loc":{"city":"Amsterdam","country":"NL","latlon":"52.3740,4.8897"}}{"ip":"98.137.11.164","is_alive":true,"min_rtt":71.686,"avg_rtt":72.039,"max_rtt":72.382,"rtts":[72.38197,71.68579,72.04914],"packets_sent":3,"packets_received":3,"packet_loss":0.0,"from_loc":{"city":"Clifton","country":"US","latlon":"40.8344,-74.1377"}}{"ip":"74.6.231.20","is_alive":true,"min_rtt":241.031,"avg_rtt":241.322,"max_rtt":241.743,"rtts":[241.74309,241.0314,241.19043],"packets_sent":3,"packets_received":3,"packet_loss":0.0,"from_loc":{"city":"Doddaballapura","country":"IN","latlon":"13.2257,77.5750"}}{"ip":"74.6.231.20","is_alive":true,"min_rtt":115.003,"avg_rtt":115.327,"max_rtt":115.922,"rtts":[115.92221,115.056755,115.00311],"packets_sent":3,"packets_received":3,"packet_loss":0.0,"from_loc":{"city":"Frankfurt am Main","country":"DE","latlon":"50.1025,8.6299"}}{"ip":"74.6.231.21","is_alive":true,"min_rtt":106.846,"avg_rtt":107.252,"max_rtt":107.806,"rtts":[107.806206,106.845856,107.10382],"packets_sent":3,"packets_received":3,"packet_loss":0.0,"from_loc":{"city":"London","country":"GB","latlon":"51.5085,-0.1257"}}{"ip":"74.6.143.25","is_alive":true,"min_rtt":61.551,"avg_rtt":62.389,"max_rtt":63.351,"rtts":[63.351395,62.265873,61.551094],"packets_sent":3,"packets_received":3,"packet_loss":0.0,"from_loc":{"city":"Santa Clara","country":"US","latlon":"37.3924,-121.9623"}}{"ip":"74.6.231.20","is_alive":true,"min_rtt":238.492,"avg_rtt":238.777,"max_rtt":239.276,"rtts":[239.27617,238.49178,238.56306],"packets_sent":3,"packets_received":3,"packet_loss":0.0,"from_loc":{"city":"Singapore","country":"SG","latlon":"1.3215,103.6957"}}