Transport external IP address of Unix command line [local ip address] [unix command line]

Q: Is it possible to the external IP address of a number of common Unix commands?

ifconfig-a gives me the . But thats not what I want.

I know that some websites can tell you the external IP. That is not the solution I want. Ideally I would love to be able to get the output of some Unix commands grep and pipe to an application that it.

One solution I can think of is it will monitor the use wget to the HTML source of one of these web pages to get, but that does it seem like the best solution.

Any other ideas?


Local Search Booster Training Video
Re:Or you could just wget www.google.com/index.html, the chances of Google diving should be far smaller than your router taking a crap.

Yes but with the ssh/telnet solution you could check for connectivity and also do something about it if you wanted to, like reboot the router or something. It really depends on how far you want to take this.


Worldwide Email Address Finder.
Re:Originally posted by: guy

Of course…if the site goes down or changes structure, my solution breaks. Thats what I want to avoid.

The only way to avoid that would be to manage the external site yourself. You could always write a script using ssh (or telnet if you have a crappy router) to log into the router and get the IP from it's external interface.

Or you could just wget www.google.com/index.html, the chances of Google diving should be far smaller than your router taking a crap.


Read Ledger Line Notes – Fast!
Re:Take a look at the dyndns listed clients, which do that exact thing. There are unix and mac clients, and the functionality you seek may be in there somewhere.
http://www.dyndns.org/services/dyndns/clients.html

Local Client Cash Machine
Re:Of course…if the site goes down or changes structure, my solution breaks. Thats what I want to avoid.

The only way to avoid that would be to manage the external site yourself. You could always write a script using ssh (or telnet if you have a crappy router) to log into the router and get the IP from it's external interface.


The One Command There is a power within you so great…
Re:Depending on what is getting the external IP, a modified ddclient might work…

The Local Marketing Secret
Re:i have found the following will work…

wget -O – http://www.whatismyip.com/ | grep 'Your IP is' | sed -e 's/.* is //' -e 's/ .*//'

Of course…if the site goes down or changes structure, my solution breaks. Thats what I want to avoid.


Local Lead Plan
Re:The wget method is probably the best (or lynx -dump). I can't think of anything else off hand.

Related posts

Leave a comment

0 Comments.

Leave a Reply


click to changeSecurity Code

[ Ctrl + Enter ]