How to determine the assigned IPv4 inside a container deployed to Fly

I have a Kubo container deployed to Fly.io that has been assigned the following IPv4: 149.248.221.175.

How can I find out what the public IPv4 is from within the container?

Some approaches I looked at:

  • The FLY_PUBLIC_IP env var, but it’s pointing to the IPv6.
  • Making an HTTP call to ifconfig.me
  • Relying on libp2p AutoNAT in order to get the publicly visible IPv4.

The last two approaches consistently return a different IP from the one assigned which is interesting (145.40.93.179).

Are there any other approaches? What would you recommend?

Lookup <appname>.fly.dev for A records?

Note though, while each VM gets a unique IPv6 (FLY_PUBLIC_IP), the app as a whole (ie, all VMs of the app) gets the assigned shared / dedicated IPv4s.