[Dnsmasq-discuss] second dnsmasq machine for "hot standby" - proposals wanted

Michael Rack michael.rack at rsm-freilassing.de
Tue Jul 5 16:55:00 BST 2011


If you can be sure, that your NSLU2 does not react for ssh then try this:

Make sure, your Hot-Standby can login via ssh to the Master-Device 
without needing a password (ssh-keygen).

So lets begin:
1) change your dnsmasq-configuration to use a dhcp-leasefile
         dhcp-leasefile=/var/state/dnsmasql.leases
2) create a bash-script on your hot-standby
> #!/bin/bash
> scp master-server:/var/state/dnsmasql.leases /var/state/dnsmasql.leases
> if [ $? -ne 0 ]
> then
>     /sbin/ip addr add [ip.of.master.server]/24 brd + dev eth0
>     /etc/init.d/dnsmasq start
> else
>     /etc/init.d/dnsmasq stop
>     /sbin/ip addr del [ip.of.master.server]/24 dev eth0
> fi
3) add this script to run periodicly on your hot-standby

This script copies your leases-File and if that will fail, it starts 
dnsmasq. Comes the Primary-Server ready back, the script will stop 
dnsmasq automatically.

Liebe Grüße aus Freilassing,

Michael Rack
RSM Freilassing
-- 
RSM Freilassing                 Tel.: +49 8654 607110
Nocksteinstr. 13                Fax.: +49 8654 670438
D-83395 Freilassing            www.rsm-freilassing.de


Am 05.07.2011 17:26, schrieb Modem Man:
> I wonder if someone has some solution for my problem:
>
> In my private home, dnsmasq is running on a small server (NSLU2 / SlugOS
> 5.3) here.
> Sometimes, the having is dying because of other misbehaving processes or
> DoS attacks. When this happens, the whole home network is out of order,
> because of missing DHCP/DNS. Not the biggest problem if I'm at home. Can
> just reset the server and wait until it's up again.
> But last times, I've been out of home very often and the remaining
> family is starting to hate my computer network :-(
>
> So, I'm often thinking about 2 identical servers with identical setup,
> but the second dnsmasq does only answer after a delay of some seconds.
> Or something else. Bad idea, right?
>
> Or, just to discuss better possible solutions:
> I could imagine pinging or dns-testing the master server each minute and
> if ping/dns is lost 3 times, I somehow call "/etc/init.d/dnsmasq start"
> from the second server. Better Idea? I also need to find out if this is
> easily done in bash or perl and so on. But my 1st question is: better
> way? usable way? What are your better ideas?
>
> Greetings,
> M.M.
>
>
>
> _______________________________________________
> Dnsmasq-discuss mailing list
> Dnsmasq-discuss at lists.thekelleys.org.uk
> http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss



More information about the Dnsmasq-discuss mailing list