How to get the external ip in Objective-C
The easiest way to get your internet ip address from code is to use NSURLConnection.
For the URL you can use: http://www.whatismyip.com/m/mobile.asp or http://checkip.dyndns.com/
Just parse the return data and you have your external ip address.
Check Apple's PortMapper, does exactly what you want.
As of iOS7 this is irrelevant.
Have a look at the example in my second Answer here.
In a nutshell it uses *http://www.dyndns.org/cgi-bin/check_ip.cg*i to get the extenal I.P