[GTALUG] Getting external IP

Giles Orr gilesorr at gmail.com
Sat Jan 27 16:25:05 EST 2018


On 27 January 2018 at 20:03, Don Tai via talk <talk at gtalug.org> wrote:

> I have wanted to know how to do this but never had the reason. My first
> inclination is to write a shell script in a loop. You can control the
> timing and save results to a file if necessary. Here's the command that
> seems to work
>
> https://unix.stackexchange.com/questions/22615/how-can-i-
> get-my-external-ip-address-in-a-shell-script
>
> dig +short myip.opendns.com @resolver1.opendns.com
>
>
> It seems to work. I usually check my ip using a google search. For a faster response you could find the RoBeUs dns server.
>
> Post up your script if you write one.
>
> Don
>
>
> On 27 January 2018 at 14:46, William Park via talk <talk at gtalug.org>
> wrote:
>
>> Hi,
>>
>> I recently switched to CarryTel, and I'm getting disconnected quite often.
>> So, I want to monitor my external IP, every minute.  For this, I usually
>> use <http://myexternalip.com/raw>, but it has rate limit.
>>
>> What site do you use to get your external IP?  I want to round-robin
>> through these.  Google gives you this when you search "what is my ip",
>> but it's difficult to dig it out.  Simpler, the better.
>
>
There are a lot of services like this.  Here's one I've used in the past:

     $ curl ifconfig.co
     xx.yyy.zz.www

It returns just an IP address, which is very useful (and low bandwidth).  I
have no idea if it has a rate limit.

Your problem if you're round-robin-ing several such sources will be
consistency.  Building on a previously mentioned idea, I'd suggest writing
a function for each source that returns only the IP (or whatever
information you're interested in).

So ... is the problem disconnection?  The duration of the disconnection?
The fact that your IP changes?  I personally wouldn't be concerned if my IP
changed (I don't run externally accessible services), so long as I have a
connection.  So I'd be logging a never-ending ping to some source like
8.8.4.4 (Google DNS) to determine how long and how often I was disconnected
for.  (I'm not really looking for answers to these questions, just
suggesting things to think about.)

-- 
Giles
https://www.gilesorr.com/
gilesorr at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://gtalug.org/pipermail/talk/attachments/20180127/9051d0aa/attachment.html>


More information about the talk mailing list