You can get your external #IP address without using HTTP(S)!
dig @resolver1.opendns.com ANY myip.opendns.com +short
Other providers, IPv4/IPv6, etc at the source: https://unix.stackexchange.com/questions/22615/how-can-i-get-my-external-ip-address-in-a-shell-script
@digitalfox Whoa, that's cool! Also means we can get it programmatically and/or without going to some website. =^.^=
@IceWolf There's other options like
IP=$(curl https://api.ipify.org/), which I had been using before, but I'm about to use this in a system service (setting up coTURN behind NAT) and wanted to check if there's a simpler and/or more robust option :)
@digitalfox I just check pfSense's status page.
@faoluin Makes sense!
In my case, I'm hosting a home server on a friend's network, which is using Google Wifi… My use case is making a more robust version of https://github.com/instrumentisto/coturn-docker-image#automatic-detection-of-external-ip - I wanted to add some IPv4 address validation and such to guard against malicious responses 🙃
@digitalfox Ahh, I see! Yeah, router status pages aren't (usually) parsable or anything, so not as robust.
@faoluin The Google/Nest Wifi router setup is special in that *there is no router HTTP admin page* - you have to use the app (or reverse-engineer the protocol the app uses). For me, it's a mild nicety since I'm able to remotely set up port forwards instead of asking a friend to log in (or using a proxy/VPN to their house), but I'd probably never personally want to use Google Wifi - OpenWRT here, pfSense or such I'll try later :)
@digitalfox Bleh, Google. :/
I was on OpenWRT until I bought a new router and put pfSense on it. Still use the old one for a WAP actually. OpenWRT is nice but pfSense is /way/ more powerful. I highly recommend it.
@faoluin Your recommendation pretty much matches up what I've heard from elsewhere, too, thanks!
(I decided to try OpenWRT with the ZyXEL NBG6817 for parents' home network, as I figured an all-in-one solution would be easier to manage and keep working once I'm out of the house. Time will tell if I goofed )
The Vulpine Club is a friendly and welcoming community of foxes and their associates, friends, and fans! =^^=