Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Confused...' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Confused...
Authored by: robg on May 05, '01 01:57:18PM
But this seems to only return the internal IP address. What if I want the external IP address? My machine sits behind a hardware router; all my internal IPs are "192.168.1.x", but my public IP is provided by AT&T. So when I hit a web site, the actual value returned is my true IP, not the internal-only (obviously) 192 version. When I tried these commands in my terminal, all that ipconfig getifaddr en0 returned was my "192" address. I don't see any way to pull the public IP from the ipconfig data? -rob.

[ Reply to This | # ]
Confused...
Authored by: Anonymous on May 06, '01 01:06:07PM

You're right, that will give you the local address. If you're behind a firewall and your address is being translated, the only way I can think of to get your address is to make a request out like you did with wget or a similar utility. That's what many dynamic DNS clients do.

That's assuming you want the external address and it doesn't change. Sometimes firewalls will not give you a 1-to-1 address correlation. The address may change every time you make a connection through the firewall.



[ Reply to This | # ]