Show HN: An etcd backed DHCP server
github.com
github.com
I would not recommend anyone use this for anything other than entertainment.
> I would not recommend anyone use this for anything other than entertainment.
For what it's worth, we used a similar setup at a previous huge employer, but using powerdns with a custom backend adapter that hit a zookeeper cluster, serving a tiny subset of our DNS records (with really short TTLs so that changing ZK resulted in prompt DNS changes). We used this for Real Work, and it worked really well.
So I think your approach is probably fine.
Shall also have to do some stuff to correlate brightness with time of day.
Hate to disappoint you, but I have to try this together with NFQUEUE to power a distributed computing cluster.
I will even use the lease information to implement a host-side firewall, BCP-38 style!
maniacal laughter
subnet 192.168.1.0 netmask 255.255.255.0 {
on commit {
set ip = binary-to-ascii (10, 8, ".", leased-address);
execute ("/usr/local/bin/on-device-connect", "commit", ip);
}
}
I have setup exactly this to automate stuff unlocking the door in my office (in the morning, whenever some one arrives and phone connects to wifi).My original source: http://jpmens.net/2011/07/06/execute-a-script-when-isc-dhcp-...
Edit: Fix code formatting.
This is the lock that Im using: http://www.ebay.com/itm/12V-Electromagnetic-Door-Locks-Magne... . Its electromagnetic and not a turn lock.
And the actuator that I built to control the lock is something like this: https://www.tindie.com/products/Armtronix/wifi-esp8266-solid...
The callback script in the dhcp server pushes an event to a mqtt broker on dhcp commit event.
And all of these orchestrated by home-assistant.io, on top of which, we have also mobile and voice (alexa) integration too.
More seriously, part of the reason I did the project was to see if I could have things react to the dhcp server, and not have the dhcpserver run things for me. No good reason, other than wanting all the components in my home network to run in their own VMs, and so having everything talking via etcd is convenient.
That said, if I didn't have copious amounts of free time, I definitely should have done that.
Happy hacking!