How to get public ip. No access to config files

If you have the SSH add-on then curl api.ipify.org will give your public IP.

1 Like

I’m 300 miles away and not on the home network, sorry I typed that at one point but had to start post over.

I’m 300 miles away and not on the home network, so trying to do this remotely

Trying to do this remotely as I’m 300 miles from home at the moment

Then before we all say you’re hosed… what DO you have access to.

I have Unifi access, but not able to find the IP there. I have NabuCasa, so I can access my Home assistant remotely, but nothing that requires command line access. It’s also a Docker Container so some things like SSH/Configuration Editor can’t be installed.

I have found this Rest/Json result Service that just returns public API, though not been able to figure out how to call it without setting up a sensor in the configuration.yaml

Been a while since I’ve left the house and forgot to get the IP before hand so I can access my VPN.

What’s your install type. If you can install addons you can install the SSH addon and run @FriedCheese 's suggestion

Docker, can’t install the AddOns

Gotcha. I’m Running through this thread for various methods to create a command line sensor to grab your IP…

Im sure something here will do the trick.

Are you not getting your public IP from Settings → Internet?

Yes, but the IP I’m getting there doesn’t seem correct. I’m guessing the IP here is the one the Router is assigning to the Unifi system internally.

image

Double NAT, big oof, but that’s besides your issue.

thank you for the suggestion, seems like it all revolves around the editing of config files which I can’t do remotely. Also the DNSip, which still fails to install for me for some reason (nothing in logs)

From the Unifi UI go to Settings → System and under the Advanced section, enabled debug tools:

Go to the devices page and select one of your devices. Go to the settings tab and select Debug. In the terminal window, use the curl command I provided above.

I don’t think Unifi Access will give it if op is behind double NAT. The network controller definitely does but im not sure about Access. Protect and Talk definitely don’t (i just checked)

The curl command is using the API call to get the IP that the website sees. Doesn’t matter about double nat and whatnot.

1 Like

Agreed that’s the way to do it. But if op can’t edit files and can’t VPN in to be behind the firewall I just don’t see how they get it.

Thank you, I looked for that 10 times last night and didn’t see it, maybe just tired from driving so much.
using curl https://api64.ipify.org/?format=json I was able to get the IP

Unifi brokers a connection to the local equipment. The debug terminal gives you local access to the device. Curl’ing from there is emulating an on-prem connection.

1 Like

The access device has a debug terminal? (adds to back of tricks)

Dangit now I need to get one to play with.