in reply to Get External IP From Linksys Router

Another alternative to this script is the routerip.pl script created by Jerry LeVan. The advantage to his script is that it doesn't require any modules. The disadvantage is that it assumes curl is installed on the system. His regexen are probably more fragile, but the status page is pretty consistent.

His page is here and the script is routerip.pl.

Replies are listed 'Best First'.
Re^2: Get External IP From Linksys Router
by meonkeys (Chaplain) on Mar 10, 2015 at 21:11 UTC

    For what it's worth, my latest favorite method of obtaining my public IP from the command line is using a DNS query from the command line.

    alias wanip='dig +short myip.opendns.com @resolver1.opendns.com'