Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

closed as off topic by Michael Hampton, HopelessN00b, Scott Pack, Zoredache, Magellan Oct 28 '12 at 5:13

Questions on Server Fault are expected to relate to server, networking, or related infrastructure administration within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

    
This "airport extreme" is in a role of a WLAN-router, right? So your OS-X-Server is connected via WLAN and gets his IP from just this router? –  Nils Oct 27 '12 at 20:16
    
Can you use an SNMP client to fetch the current addresses from the router? 1.3.6.1.2.1.4.20.1.1 is the OID for ipAdEntAddr: if you walk it using snmpwalk or a similar tool it should give you all addresses assigned to the router. You can pick out the dynamic address by removing the known static addresses. –  aecolley Oct 27 '12 at 21:00
    
@Nils yes... it's a wlan router and has a reservation with a fixed internal ip for the server. –  unmircea Oct 27 '12 at 21:09
1  
See serverfault.com/questions/89114/… –  Zoredache Oct 28 '12 at 0:30

4 Answers 4

up vote 6 down vote accepted

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

share|improve this answer
    
It is the router that changes - not the server. Strange scenario, though. And they seem to make security by obscurity. –  Nils Oct 27 '12 at 20:17
    
That's completely irrelevant. –  Michael Hampton Oct 27 '12 at 20:22
    
@Nils "security by obscurity" is one of the best one-liners in a long time, but yes our company has used this in the past... server is under enemy fire... reconnect... can't attack something that's not there. My thoughts on the method is to run a cron job or something every 2 hours or so... with a trace route to say google and have this sent via e-mail to the admin. From time to time when he wants to check in he just looks at the most recent mail. –  unmircea Oct 27 '12 at 21:12
    
In the end i ended up using easydns.com they have a native mac update client and everything works... nice. –  unmircea Nov 8 '12 at 12:26

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.

share|improve this answer
  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.

share|improve this answer
    
Your post gave me a "new" idea. Use "back to my mac" to get to the server screen, check ip via a website from there. Brilliant. I'll try that next time i'm onsite. –  unmircea Oct 27 '12 at 21:15

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.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.