I used to use a Nokia M11 to connect to the Internet. The M11 acts as a router, so the IP address of the router on the Internet bore no resemblance to the IP address of my computer. However, I needed that external address to send to DynDNS.org.
The M11 supports SNMP, so I wrote a short shell script using NET-SNMP. It finds the external IP address in two steps:
Loop through the IP addresses under ipAdEntIfIndex to find the matching index, and get the IP address of the selected interface from ipAdEntAddr.
The command line syntax has probably changed since I used this program, so you might need to make some minor changes.
- m11addr.sh (2K)