Re: [Dnsmasq-discuss] Copying dnsmasq.leases, any issues to be aware of?

2022-02-08 Thread Matus UHLAR - fantomas via Dnsmasq-discuss

On 08.02.22 19:32, Ed W wrote:

This is never going to get high enough up my todo list to try, but I did wonder 
if a simple
"clustered" system could be built using DBUS or similar events. When a lease is 
allocated DBUS (and
a script) is run notifying about that. A little daemon could then use this hook 
to notify another
instance of dnsmasq. In fact I think the hook is run synchronously? So it 
should be possible to ship
new leases across to the other instance

I can think of a number of ways this can be racy... However, for a little home 
lab it would surely
be good enough. I'm not sure how to handle failover, but a few simple ideas 
spring to mind (I'm
thinking of a pure warm standby kind of setup, where something promotes the 
secondary to primary)

Anyway, just shooting the breeze...


I believe Simon's answer means: dnsmasq is small server for small systems. If
you need cluster-like features, you should try isc or kea dhcp servers.



On 05/02/2022 11:06, Simon Kelley wrote:

It could work; there's a whole IETF standard for DHCP failover and it's 
implemented beautifully by
ISC dhcp. If that's your niche, then ISC is the way to go.


--
Matus UHLAR - fantomas, uh...@fantomas.sk ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
If Barbie is so popular, why do you have to buy her friends?

___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
https://lists.thekelleys.org.uk/cgi-bin/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] Copying dnsmasq.leases, any issues to be aware of?

2022-02-08 Thread Ed W
Simon,

This is never going to get high enough up my todo list to try, but I did wonder 
if a simple
"clustered" system could be built using DBUS or similar events. When a lease is 
allocated DBUS (and
a script) is run notifying about that. A little daemon could then use this hook 
to notify another
instance of dnsmasq. In fact I think the hook is run synchronously? So it 
should be possible to ship
new leases across to the other instance

I can think of a number of ways this can be racy... However, for a little home 
lab it would surely
be good enough. I'm not sure how to handle failover, but a few simple ideas 
spring to mind (I'm
thinking of a pure warm standby kind of setup, where something promotes the 
secondary to primary)

Anyway, just shooting the breeze...

Ed W

On 05/02/2022 11:06, Simon Kelley wrote:
> It could work; there's a whole IETF standard for DHCP failover and it's 
> implemented beautifully by
> ISC dhcp. If that's your niche, then ISC is the way to go.
>
> Simon.
> rent instances of dnsmasq on the
>> network
>>    - use UDP to 'copy' each new lease  to the other instance
>>    - on startup, use UDP to request a sync of known leases from the other 
>> instance
>>    - maybe sync local DNS entries as well (though it might be less desirable 
>> for folks
>>  like me who have 850k 'undefined' entries for ads, pron, warez, etc.)
>>
>> Could this even work? Would it be worth the effort? 


___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
https://lists.thekelleys.org.uk/cgi-bin/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] Copying dnsmasq.leases, any issues to be aware of?

2022-02-05 Thread Chris Green
On Fri, Feb 04, 2022 at 09:28:42PM +, Simon Kelley wrote:
> 
> 
> On 04/02/2022 18:16, Chris Green wrote:
> > I'm looking at ways to provide backup DHCP/DNS with dnsmasq.  This is
> > on a small, fairly 'quiet' home LAN so there aren't dozens of clients
> > connecting and disconnecting every second.  Also if DHCP/DNS is not
> > available for a few minutes the world won't end! :-)
> > 
> > So, I'm proposing to have dnsmasq installed on two systems, one (say
> > dns1, 192.168.1.2) is the live DHCP/DNS server, the other (say dns2,
> > 192.168.1.3), both with static IP.
> > 
> > If dns1 dies or needs to be turned off I just copy the dnsmasq
> > configuration (stored elsewhere as well of course) to dns2 and also
> > copy the dnsmasq.leases file and [re]start dnsmasq on dns2.  Will this
> > work reasonably OK?  I.e. if/when a system on the LAN broadcasts a
> > DHCP request will it get the same IP again?
> > 
> > It's not a disaster if a system gets a different IP anyway, if
> > something *really* needs a fixed IP I can add a dhcp-host in the
> > dnsmasq configuration.
> > 
> > I can even have dnsmasq running on dns2 all the time with it
> > configured to provide only local DNS and no DHCP, then it's just 'copy
> > dnsmasq configuration, copy dnsmasq.leases, restart dnsmasq.
> > 
> > (All my systems run syncthing so it's very easy to have pretty much
> > live copies of files synchronised across systems)
> > 
> 
> To be honest, even if you didn't bother copying the leases file, most
> systems would get the same address. The clients try to renew the lease on
> the exiting DHCP server and when they get no response they broadcast the
> renewal to try and find a new server. As long as there's no reason not to,
> the new server will accept the client's request for the address it already
> had.
> 
OK, thanks Simon, I sort of knew this already but it's good to have it
all confirmed.

-- 
Chris Green

___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
https://lists.thekelleys.org.uk/cgi-bin/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] Copying dnsmasq.leases, any issues to be aware of?

2022-02-04 Thread Neal P. Murphy
Along this line, how much effort would it take to program dnsmasq to:
  - understand the idea of two concurrent instances of dnsmasq on the network
  - use UDP to 'copy' each new lease to the other instance
  - on startup, use UDP to request a sync of known leases from the other 
instance
  - maybe sync local DNS entries as well (though it might be less desirable for 
folks
like me who have 850k 'undefined' entries for ads, pron, warez, etc.)

Could this even work? Would it be worth the effort?

N

From: Dnsmasq-discuss  on 
behalf of Simon Kelley 
Sent: Friday, February 4, 2022 4:28 PM
To: dnsmasq-discuss@lists.thekelleys.org.uk 

Subject: Re: [Dnsmasq-discuss] Copying dnsmasq.leases, any issues to be aware 
of?



On 04/02/2022 18:16, Chris Green wrote:
> I'm looking at ways to provide backup DHCP/DNS with dnsmasq.  This is
> on a small, fairly 'quiet' home LAN so there aren't dozens of clients
> connecting and disconnecting every second.  Also if DHCP/DNS is not
> available for a few minutes the world won't end! :-)
>
> So, I'm proposing to have dnsmasq installed on two systems, one (say
> dns1, 192.168.1.2) is the live DHCP/DNS server, the other (say dns2,
> 192.168.1.3), both with static IP.
>
> If dns1 dies or needs to be turned off I just copy the dnsmasq
> configuration (stored elsewhere as well of course) to dns2 and also
> copy the dnsmasq.leases file and [re]start dnsmasq on dns2.  Will this
> work reasonably OK?  I.e. if/when a system on the LAN broadcasts a
> DHCP request will it get the same IP again?
>
> It's not a disaster if a system gets a different IP anyway, if
> something *really* needs a fixed IP I can add a dhcp-host in the
> dnsmasq configuration.
>
> I can even have dnsmasq running on dns2 all the time with it
> configured to provide only local DNS and no DHCP, then it's just 'copy
> dnsmasq configuration, copy dnsmasq.leases, restart dnsmasq.
>
> (All my systems run syncthing so it's very easy to have pretty much
> live copies of files synchronised across systems)
>

To be honest, even if you didn't bother copying the leases file, most
systems would get the same address. The clients try to renew the lease
on the exiting DHCP server and when they get no response they broadcast
the renewal to try and find a new server. As long as there's no reason
not to, the new server will accept the client's request for the address
it already had.


Cheers,

Simon.


___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
https://lists.thekelleys.org.uk/cgi-bin/mailman/listinfo/dnsmasq-discuss
___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
https://lists.thekelleys.org.uk/cgi-bin/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] Copying dnsmasq.leases, any issues to be aware of?

2022-02-04 Thread Simon Kelley




On 04/02/2022 18:16, Chris Green wrote:

I'm looking at ways to provide backup DHCP/DNS with dnsmasq.  This is
on a small, fairly 'quiet' home LAN so there aren't dozens of clients
connecting and disconnecting every second.  Also if DHCP/DNS is not
available for a few minutes the world won't end! :-)

So, I'm proposing to have dnsmasq installed on two systems, one (say
dns1, 192.168.1.2) is the live DHCP/DNS server, the other (say dns2,
192.168.1.3), both with static IP.

If dns1 dies or needs to be turned off I just copy the dnsmasq
configuration (stored elsewhere as well of course) to dns2 and also
copy the dnsmasq.leases file and [re]start dnsmasq on dns2.  Will this
work reasonably OK?  I.e. if/when a system on the LAN broadcasts a
DHCP request will it get the same IP again?

It's not a disaster if a system gets a different IP anyway, if
something *really* needs a fixed IP I can add a dhcp-host in the
dnsmasq configuration.

I can even have dnsmasq running on dns2 all the time with it
configured to provide only local DNS and no DHCP, then it's just 'copy
dnsmasq configuration, copy dnsmasq.leases, restart dnsmasq.

(All my systems run syncthing so it's very easy to have pretty much
live copies of files synchronised across systems)



To be honest, even if you didn't bother copying the leases file, most 
systems would get the same address. The clients try to renew the lease 
on the exiting DHCP server and when they get no response they broadcast 
the renewal to try and find a new server. As long as there's no reason 
not to, the new server will accept the client's request for the address 
it already had.



Cheers,

Simon.


___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
https://lists.thekelleys.org.uk/cgi-bin/mailman/listinfo/dnsmasq-discuss


[Dnsmasq-discuss] Copying dnsmasq.leases, any issues to be aware of?

2022-02-04 Thread Chris Green
I'm looking at ways to provide backup DHCP/DNS with dnsmasq.  This is
on a small, fairly 'quiet' home LAN so there aren't dozens of clients
connecting and disconnecting every second.  Also if DHCP/DNS is not
available for a few minutes the world won't end! :-)

So, I'm proposing to have dnsmasq installed on two systems, one (say
dns1, 192.168.1.2) is the live DHCP/DNS server, the other (say dns2,
192.168.1.3), both with static IP.

If dns1 dies or needs to be turned off I just copy the dnsmasq
configuration (stored elsewhere as well of course) to dns2 and also
copy the dnsmasq.leases file and [re]start dnsmasq on dns2.  Will this
work reasonably OK?  I.e. if/when a system on the LAN broadcasts a
DHCP request will it get the same IP again?

It's not a disaster if a system gets a different IP anyway, if
something *really* needs a fixed IP I can add a dhcp-host in the
dnsmasq configuration.

I can even have dnsmasq running on dns2 all the time with it
configured to provide only local DNS and no DHCP, then it's just 'copy
dnsmasq configuration, copy dnsmasq.leases, restart dnsmasq.

(All my systems run syncthing so it's very easy to have pretty much
live copies of files synchronised across systems)

-- 
Chris Green

___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
https://lists.thekelleys.org.uk/cgi-bin/mailman/listinfo/dnsmasq-discuss