[Csync2] Dynamic master ip...

Lars Ellenberg lars.ellenberg at linbit.com
Mon Mar 23 12:27:33 CET 2020


On Mon, Mar 23, 2020 at 11:57:11AM +0100, Marco Gaiarin wrote:
> 
> In this time of Coronavirus, i've switched to 'smart working'.
> 
> I've setup a set of csync2 config file to propagate some sets of config
> files to a bunch of servers. Eg:
> 
>         host hermione at hermione.sv.lnf.it;
> 
>         host (tank at tank.sv.lnf.it);
>         host (invernomuto at invernomuto.sv.lnf.it);
>         host (link at link.sv.lnf.it);
> 	[...]
> 
> But now my IP change, or it is not anymore 'hermione.sv.lnf.it'.
> 
> 
> There's some way to have a 'floating master host'? And this can be
> achived NOT passing every 'slave' server to change local csync2 config
> file?

This is how csync2 "authenticates" a peer:
it does a "forward lookup" (getaddrinfo) of the name the peer claims to be,
and checks if the address as returned by getpeername() on the connected
socket is listed in the results (and if that name is listed in the config).

If that IP changes all the time, you probably have to use dynamic DNS.
Or use some VPN, inside of which you then have your own, "static" IPs.

You can try to add the "expected" (by you) info to /etc/hosts,
if that makes sense in your context.

Or, of course, change csync2 to not do this "forward lookup of claimed
name lists peer address" sanity check. Though I'm not convinced that
would be a good idea.

hth,

    Lars



More information about the Csync2 mailing list