Get IP address / Timezone when using Proxy

hi,
we are using a proxy for all of spread Balena systems.
i need to know every machine timezone in order to run certain things on certain hours of the day.
when i try to translate the Local IP Address or the Public IP Address into timezones i get either private network (local) or somewhere in the USA (public) because we are using AWS and it returns amazon’s location for the IP.

so:

  1. how can i know the original IP of the machine?
  2. can i make it visible?
    or
  3. how do i get the correct timezone when using a proxy?

Thanks!
Tzachi

Hello,

The answer likely depends on where your proxy is in the network and how it is connected. (If you can provide more details that might be helpful.) The Public IP address listed on the dashboard is what balena knows about the device and also what we use for geolocation. Does the location tab on the dashboard match what you were seeing when you tried to translate the public IP address? Can you try separately querying the device’s public IP (such as with curl ifconfig.me) and let us know if that is returning a different value than on the dashboard?

hi
thanks for the reply.

  1. the location at the Location tab is the same as i get when i “translate” the Public IP
  2. the response for curl ifconfig.me is :

curl: (52) Empty reply from server

i don’t know what can / can’t i write about our proxy… but on every system uploading we first unset proxy and then re-set it if:
unset:

$(curl --silent -X PATCH --header “Content-Type:application/json” --data ‘{“network”: {“proxy”: {}}}’ “$BALENA_SUPERVISOR_ADDRESS/v1/device/host-config?apikey=$BALENA_SUPERVISOR_API_KEY”)

set:

$(curl --silent -X PATCH --header “Content-Type:application/json” --data ‘{“network”: {“proxy”: {“type”: “http-connect”, “ip”: "’$PROXY_URL’", “port”: ‘$PROXY_PORT’, “login”: “‘$CURRENT_USER’”, “password”: “‘$CURRENT_PWD’”}}}’ “$BALENA_SUPERVISOR_ADDRESS/v1/device/host-config?apikey=$BALENA_SUPERVISOR_API_KEY”)

(…i hope it gives u some relevant info…)

anyway,
isn’t there a way to know / get the “real” ip address on any time, or shall i just take it between the “unset” and “set” from above?

hi,
a minor improvement achieved, and between unsetting the proxy, and setting it back - i can get the “real” public ip address! :slight_smile:
but…
it takes about a minute until the command:
curl -sSL "$BALENA_API_URL/v6/device?\$select=public_address&\$filter=uuid%20eq%20'$BALENA_DEVICE_UUID'" -H "Authorization: Bearer $BALENA_API_KEY"
gets this “real” public ip address
is there a way to make it update more quickly? any kind of force refresh to the device values?