Web lists-archives.com

Re: get my ip address




On Tue, Feb 19, 2019 at 11:36:49AM -0500, Dan Ritter wrote:
> tony wrote: 
> > I have a network of IoTs consisting of 5 (I think) Paspberry Pis,
> > monitoring various things, and periodically sending the data to my VPS.
> > I need access to these hosts to manage them.
> > 
> > The network supplier is Orange France (spit!) who supply a dynamic DNS
> > on both IPv4 and IPv6. I need to access any of them.

> That sounds like a job for a dynamic dns client.

Agreed.

> existing Debian packages:
> 
> ddclient (multiple backend services supported)
> ddupdate (also supports multiple services, more plugin-oriented)
> dyfi  (Finnish users only)
> dyndns   (multiple services)
> ez-ipupdate (multiple services)
> ipcheck (dyndns protocol specific, but many services use it)
> isc-dhcp-client-ddns  (adds dynamic dns to DHCP)

And the specific case of dynamic DNS updates is definitely covered
on the wiki page that I linked (https://mywiki.wooledge.org/IpAddress).
It even has sample code for Debian 8.

If you need to use a special python dynamic DNS client for some reason,
that's fine.  Just hook it from the dhclient-exit-hooks.d directory and
let it use the new_ip_address environment variable.  The example is
right there on the wiki page.  Just replace /usr/local/sbin/dync with
your python program (assuming it takes the IP address on the argument list).

Oh... wait, you said IPv6 in the original message, right?  Ugh.  I don't
know IPv6 myself, but fortunately we can look that up... um, somewhere!

wooledg:~$ man dhclient-script | grep 6
       $new_dhcp6_server_id.  The options that the client explicitly requested

... OK, apparently not *there*.

But looking through /sbin/dhclient-script itself, there appear to be
the following variables:

new_ip6_address
new_dhcp6_name_servers
new_dhcp5_domain_search

Maybe those will help?  Give it a shot.  Or wait for someone who knows IPv6
to chime in.