4

There are a plethora of websites that will try to deduce your location from your IP address. For example: https://nordvpn.com/what-is-my-ip/.

This is handy for debugging VPNs - if I visit one of these sites and the location corresponds to the reported server location, rather than where I actually am, then I'm reasonably sure the VPN is working.

I'd like to be able to use a tool like this from the command line, where I can't operate a complicated web browser. Does such a tool exist?

For what it's worth, I am running Gentoo using OpenVPN, and my provider is Private Internet Access. But I hope that there's a reasonably cross-platform solution.

1 Answers1

12

You can use ipinfo.io or ipstack.com services through curl:
curl --silent "https://ipinfo.io/ip"
similarly change ip to country to get your geographical location.