Make it possible to get the public ip address by use of a DNS service. Like the special myip.opendns.com dns request that returns the public ip adres if using opendns dns server(208.67.222.222).
Look if there are other DNS servers offering something like this too.