openwrt / odhcpd

This repository is a mirror of https://git.openwrt.org/?p=project/odhcpd.git. Pull requests will be accepted which will be merged in odhcpd.git
GNU General Public License v2.0
161 stars 98 forks source link

Feature Request: Ability to (optionally) persist IPv6 leases on daemon restarts #26

Open ktgeek opened 9 years ago

ktgeek commented 9 years ago

In observing the daemon, and in reading the code, it looks like currently the lease file can only be written to at this time, it doesn't looks like there is any ability to read from it. Since I upgraded to OpenWRT 14.07 over the weekend and was tweaking things, it was a minor annoyance each time I tweaked something and restarted the daemon to lose all existing IPv6 leases as I experimented getting my setup right.

As a contrast, I have the dnsmasq and miniupnpd lease file on a USB disk so that my leases will persist across deamon AND OpenWRT reboots. I'd love my IPv6 leases to go that way too.

I suspect this is already on the todo list, but I'd love to see it implemented and wouldn't mind assisting where I could.

sbyx commented 9 years ago

You can already define static leases as noted here: http://wiki.openwrt.org/doc/uci/dhcp#static.leases (see hostid / duid options) but you are right this currently doesn't work with the auto-generated leases.

ktgeek commented 9 years ago

The static leases are working great for the few hosts I for sure want to know where they are. (It forced me to start to learn LUCI to add DUID to the web interface.) It's definitely the auto-generated ones I'm talking about.

Although, speaking of that...

I have a few dhcpv6 clients (OS X boxes) that don't send their host name as part of the request. I was hoping to supply the hostname, the MAC and/or the DUID, as I don't care about the specific IP, just that it ends up in DNS. I'm guessing that isn't a use case that was thought of. It caused odhcpd to not respond to repeated solicits.

In any case, I just want to provide hopefully helpful feedback, I love odhcpd and its integration into the rest of OpenWRT so far and am looking forward to watching it grow.

weikai commented 9 years ago

Is it possible to tag upstream DNSs and send requests from tagged client to different upstream DNSs server?

For example, having the default upstream DNS set to DNS servers provide by ISP but also set and tag upstream server to OpenDNS. The request coming from tagged should go to OpenDNS.

JohnstonJ commented 8 years ago

I would also be interested in this feature. My OpenWrt router has USB ports available, and I would like to use a USB stick to store the leases so they can withstand reboots & power failures. Otherwise the worst problem when rebooting is that DNS breaks on my network until the clients get around to renewing leases that they think are still valid. I have the DHCP server set up to link with DNS using the hostnames sent by the DHCPv6 clients, so when the DHCP server forgets about all its clients, name resolution starts failing.