2

I have a OS X Server behind an airport extreme, serving services via opened ports on the airport.

The server has a 10.0.x.x local address, always the same one. The airport extreme gets it's external IP address via PPPoE, and sometimes... once a week it changes.

For security reasons WE ACTUALLY like this behavior. But i need a way to know the external IP address just in case i need to connect and do something to the server while on the outside.

What can i do?

2 Answers 2

3

The site I use for exactly this behaviour is ifconfig.me. This can return data in any format you might want to use. E.g. In a bash script where you just want the ip:

IP=curl http://ifconfig.me/ip Of course, you'll want to check the return code in case something goes wrong. It does seem quite robust for scripting, though.

by Morphit

https://serverfault.com/questions/443023/what-is-the-best-way-to-get-the-external-internet-gateway-ip-reported-periodical

0

I'm dubious about how much security you get this way, but if you can live with the changing IP address, might as well stick with your current setup.

You can obtain your router's IP address by visiting a site such as http://whatismyipaddress.com/ from a system behind the router. That doesn't do you any good if you're not currently behind the router, of course. So write a script that runs every little while and scrapes the IP address off such a site. You might want to provide your own site for that purpose, to avoid abusing somebody else's.

The script should compare the latest IP address against the last recorded IP address. If it's changed, the script email the new address to somebody who needs to know.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .