Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I find out what my external IP address is?

My computers are sitting behind a router/firewall. How do I programmatically find out what my external IP address is. I can use http://www.whatsmyip.org/ for ad-hoc queries, but the TOS don't allow for automated checks.

Any ideas?

like image 821
Scott Weinstein Avatar asked Jul 17 '09 21:07

Scott Weinstein


People also ask

How do I know if my IP address is internal or external?

There's nothing in a normal request that would indicate internal or external origin. All you have to go on is the ip address sent in the request. To see if an IP is on the same network, you take your subnet mask and perform a bitwise AND with your own IP.


1 Answers

http://ipecho.net/plain appears to be a workable alternative, as whatismyip.com now requires membership for their automated link. They very kindly appear to be offering this service for free, so please don't abuse it.

like image 53
Kevin L. Avatar answered Oct 09 '22 11:10

Kevin L.