Add Internet IP / Geolocation to Status Page

Hi,

Just a thought, but ... it would be nice / handy to have the option to show upstream IP and/or location information on the status page. ipinfo.io provides a relatively simple API to access the info (some more details here). You can even use your token if you have one. Some manual checks from my OpenWrt router, using wget -O - https://ipinfo.io/json and curl ipinfo.io/json as examples, output JSON,

{
  "ip": "X.X.X.X",
  "city": "Toronto",
  "region": "Ontario",
  "country": "CA",
  "loc": "43.7001,-79.4163",
  "org": "AS212238 Datacamp Limited",
  "postal": "M5A",
  "timezone": "America/Toronto",
  "readme": "https://ipinfo.io/missingauth"
}

Thoughts?

Thanks!

1 Like

Upstream IP of....?

I think, he is asking for an easy display of the Geo-Location and the IP of the default WAN route destination, as in e.g.: "Where is my DSLAM located physically?".

Basically, "Fetch and display in Luci the json returned by

curl ipinfo.io/$(ip r s | awk '$1=="default"{print $3}')

@arrmo , am I interpreting your request correctly?

but that's a one time request, it's not like it's mobile ?

unless we're talking LTE, then it's very much incorrect, ...

or am I missing something ?

I agree with you w.r.t to the perceived usefulness of:

  • displaying the information in the first place (because it's more-often-than-not not accurate enough for your needs)
  • regularly fetching this information, as in most cases it's probably fairly static.

I was just replying to get @arrmo to clarify his request, and maybe also throw in some details about his perceived usefulness of that information display.

So far people even refused the idea of simple telemetry reporting (to see device popularity / confirmation of flash success for new firmware versions) to the OpenWrt project itself for privacy reasons.

I can't see that we suddenly query unrelated 3rd party services by default from OpenWrt, revealing the current WAN IP.

3 Likes

Let me try to explain :laughing:. I travel for work quite a bit, and use OpenWrt with Travelmate on a battery powered router. It really does work great! And I make use of the VPN Hook feature in Travelmate, often connecting to different VPN endpoints (they are set separately for each upstream SSID), depending on where I am at (even back to home sometimes, my own WG server). So it would be handy to have this upstream information in LuCI ... yes, I can get it through ssh, route, etc. - but this would just be handy.

Perhaps (just thinking out loud here), have it as an optional module - sort of like the battery status I added a while back? Then a person can add it or not (to their custom build), not "forcing" it in to the mainstream.

Thoughts?

Thanks!

2 Likes

Sorry, just not sure what makes sense here. I don't mind creating a module, similar to the battery status one I wrote a while back. Then it's optional, if folks are interested.

Thoughts?

Thanks!