In article <(E-Mail Removed) .com>,
<(E-Mail Removed)> wrote:
> Hi. I am using a cable modem. It is connected to an Airport Extreme
> base station.
>
> Is there a way to find out, from the unix command line, what my
> "world/outside" IP address is? I know I can find this out by pointing
> a browser at:
>
> http://www.dyndns.org/cgi-bin/check_ip.cgi
>
> but I want to be able to get it without having to do that. Is there a
> way I can more directly query my Airport Extreme base station or my
> cable modem for the IP address that the world sees for me?
Well, you probably can, but it'd be as much bother as any other way.
Also, nobody would write a program to do it because it'd be different
for every router and/or brand of cable modem; it's far easier to just
ask some server out on the Internet where you're coming from and it
works no matter what kind of router or modem you have.
What kind of method are you looking for that's easier than a browser?
Command line? Easy:
curl 'http://www.jerrykindall.com/myip.asp'; echo
Assuming you use bash, just add this line to your .profile:
alias myip="curl 'http://www.jerrykindall.com/myip.asp'; echo"
Then you can get your IP address anytime by typing "myip".
Want a little application that, when double-clicked, displays the
address and/or puts it on the clipboard? Paste this AppleScript into
Script Editor and save as an application:
do shell script "curl 'http://www.jerrykindall.com/myip.asp'"
set addr to the result
set the clipboard to addr
display dialog addr buttons "OK" default button "OK"
(take out the third or fourth line if you just want the display or
clipboard function, respectively)
(BTW, the
http://www.jerrykindall.com/myip.asp is a little script on my
Web server that returns your IP address as plain text, no HTML, and
you're welcome to use it -- I don't track you or anything)
If you want the IP address in your menu bar or in a floating window or
Dashboard widget or whatever, go to VersionTracker and search for "IP
address." Most of the programs found that way will look up your
external address, and many of them are free.
--
Jerry Kindall, Seattle, WA <http://www.jerrykindall.com/>
Send only plain text messages under 32K to the Reply-To address.
This mailbox is filtered aggressively to thwart spam and viruses.