-1

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?

unom
  • 281

4 Answers4

6

Get a Dynamic DNS service. There are many such services available from various places on the Internet...

Michael Hampton
  • 252,907
4

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.

Morphit
  • 226
3
  1. Open browser.
  2. Visit a website that tells you your IP address.
  3. Script into periodic job for best results.

Alternately, buy a static IP address, but if you just need to know occasionally/just in case, that's how you'd do it. And make sure you set up IPv6/NAT/port-forwarding so the connection actually goes to the server when it hits the gateway.

To quote @MichaelHampton:

Have you deployed IPv6 yet? I'm getting sick of this NAT shit.

HopelessN00b
  • 54,273
1

You can set up a cron job to perform the following script:

#!/bin/bash

TIME='date' $TIME
IP='curl http://ifconfig.me/ip' $IP
echo $TIME - $IP >> ~/iplogging.txt

This will output the timestamp and IP at the time the script is ran and log it to ~/iplogging.txt.

rwc
  • 326