How can I get the Gateway IP

I am trying to get the Gateway IP of the first non-loopback adapter.

$nc(ifip)$ returns the IP correctly. I am looking for the Gateway IP.

You need to either use wget() or a flow to get that. If you want to use a flow do the following:

  • Create a new flow
  • Add a new trigger (“on load” is the minimum, you can also use a formula to trigger this when you connect to Wifi)
  • Add a Web Get action and point to https://ipinfo.io/json
  • Use $wg(#last, json, .ip)$ to get your external IP
  • Add a “store to global”

Then you can use the global around, hope it helps.