WAN-IP of router

Jay Nugent jjn at nuge.com
Thu Aug 5 03:51:50 PDT 2010


Greetings,

On Thu, 5 Aug 2010, Jorge Almeida wrote:

> Is there any sensible, script-friendly, way of finding my router's
> external (dynamical) IP? It looks surprisingly difficult, judging by
> Google results...
> The thing is an ASUS RT-N16. I intend to install dd-wrt, eventually,
> but for the time being it has the original software, which appears to
> be complete crap, BTW.

   http://whatismyipaddress.com

   And as a script use the --dump option of lynx and then grep for the 
specific string that will contain your IP address answer.   You can then 
use awk to grab the IP address string itself if that is all you want.


   lynx --dump http://whatismyipaddress.com | grep "IP Information"



   Enjoy!
      --- Jay Nugent
          Ypsilanti, Michigan

Train how you will Operate, and you will Operate how you were Trained.
+------------------------------------------------------------------------+
| Jay Nugent   jjn at nuge.com    (734)484-5105    (734)649-0850/Cell       |
|   Nugent Telecommunications  [www.nuge.com]                            |
|   Internet Consulting/Linux SysAdmin/Engineering & Design/ISP Reseller |
| ISP Monitoring [www.ispmonitor.org] ISP & Modem Performance Monitoring |
| Web-Pegasus    [www.webpegasus.com] Web Hosting/DNS Hosting/Shell Accts|
+------------------------------------------------------------------------+
  6:01am  up 7 days, 14:27,  3 users,  load average: 0.09, 0.11, 0.13




More information about the Linux-users mailing list