Send dhcp-users mailing list submissions to dhcp-users@lists.isc.org
To subscribe or unsubscribe via the World Wide Web, visit https://lists.isc.org/mailman/listinfo/dhcp-users or, via email, send a message with subject or body 'help' to dhcp-users-requ...@lists.isc.org You can reach the person managing the list at dhcp-users-ow...@lists.isc.org When replying, please edit your Subject line so it is more specific than "Re: Contents of dhcp-users digest..." Today's Topics: 1. Move dhcp lease to new ip+reservation. How? (Gregory Sloop) 2. Re: Move dhcp lease to new ip+reservation. How? (Glenn Satchell) 3. Re: Move dhcp lease to new ip+reservation. How? (Simon) ---------------------------------------------------------------------- Message: 1 Date: Thu, 26 Aug 2021 20:37:06 -0700 From: Gregory Sloop <gr...@sloop.net> To: Users of ISC DHCP <dhcp-users@lists.isc.org> Subject: Move dhcp lease to new ip+reservation. How? Message-ID: <733440315.20210826203...@sloop.net> Content-Type: text/plain; charset="utf-8" An HTML attachment was scrubbed... URL: <https://lists.isc.org/pipermail/dhcp-users/attachments/20210826/2bcba352/attachment-0001.htm> -------------- next part -------------- I have a subnet in dhcpd - lets just assume 192.168.1.0/24 (It's a fail-over served pool - if that matters.) I have a pool where unknown-clients are allowed 192.168.1.21-40 I'd like to add a new lease for a machine where the IP is outside the unknown pool above. (I don't want to use a host definition with an IP in the conf files, because I want the ddns name to get added via the DDNS mechanisms - which doesn't happen in that case. Plus, if this machine/device gets moved to another subnet, and the host def is still there, it won't get ANY lease in the new subnet - which is bad. I'd like the device to still function if it gets dropped into a new subnet, even if it's not getting a "special" ip any more.) This new machine/device may have already been added to the network and currently has an address in the 192.168.21-40 pool. Lets assume I'd like to assign it 192.168.1.51 - and set a reservation.? Lets assume that I'll have several machines I'd like set as "static" between 51-70.? But I don't want just "any" machine to get one of these "special" addresses in the 51-70 range. What's the best way to go about this? --- Some thoughts I've had, but this gets complicated. --- I don't believe I can just add or modify the lease without changing the pool, because even if there's a defined lease, this is still an unknown client. So, even if there's a reserved lease for 192.168.1.51 - the DHCP server won't give out that address because this is an unknown client. (Right?) Yet if I make a pool for 51-70 and allow unknown clients, then any client might (will) get one - not just the ones I want to "move" there. I've thought about pre-creating leases for 51-70 and essentially adding "bogus" information for those leases and reserving them. (While allowing unknown-clients for the 51-70 pool - but since they're all "taken" it won't hand one out),? Then when I want to move something there, I can remove the "bogus" reservation and move the "real" lease to the appropriate IP in the 51-70 block/pool. --- Or define the MAC address in a host definition, without an IP definition. (I think DDNS works in this case.) Then define the 192.168.51-70 pool as "known" hosts only. (And make sure no "other" known hosts accidentally grab one of the IP's in this pool. This part worries me.) But it seems like I must be making this too hard. Am I missing something? Surely someone else has done this and can point me a tried-and-true solution that works without a ton of drama. :) (Yes, my pools are larger than those, but the details are essentially the same - this example is just more manageable.) Thanks! -Greg ? ? ------------------------------ Message: 2 Date: Fri, 27 Aug 2021 14:54:36 +1000 From: Glenn Satchell <glenn.satch...@uniq.com.au> To: Users of ISC DHCP <dhcp-users@lists.isc.org> Subject: Re: Move dhcp lease to new ip+reservation. How? Message-ID: <024ad5c7caa2eee4a0584285083fb...@uniq.com.au> Content-Type: text/plain; charset="us-ascii"; Format="flowed" Hi Greg, What about using a class for the 51-70 pool and use sub-classes to define the allowed mac addresses? There's an example in the dhcpd.conf man page, a bit like this. The leading 1 is added to the mac address to indicate hardware type 1 (ethernet). class "allocation-class-2" { match pick-first-value (option dhcp-client-identifier, hardware); } subclass "allocation-class-1" 1:8:0:2b:4c:39:ad; subclass "allocation-class-2" 1:8:0:2b:a9:cc:e3; subclass "allocation-class-1" 1:0:0:c4:aa:29:44; regards, Glenn On 2021-08-27 13:37, Gregory Sloop wrote: > I have a subnet in dhcpd - lets just assume 192.168.1.0/24 > > (It's a fail-over served pool - if that matters.) > > I have a pool where unknown-clients are allowed > > 192.168.1.21-40 > > I'd like to add a new lease for a machine where the IP is outside the > unknown pool above. (I don't want to use a host definition with an IP > in the conf files, because I want the ddns name to get added via the > DDNS mechanisms - which doesn't happen in that case. Plus, if this > machine/device gets moved to another subnet, and the host def is still > there, it won't get ANY lease in the new subnet - which is bad. I'd > like the device to still function if it gets dropped into a new subnet, > even if it's not getting a "special" ip any more.) > > This new machine/device may have already been added to the network and > currently has an address in the 192.168.21-40 pool. > > Lets assume I'd like to assign it 192.168.1.51 - and set a reservation. > > Lets assume that I'll have several machines I'd like set as "static" > between 51-70. > > But I don't want just "any" machine to get one of these "special" > addresses in the 51-70 range. > > What's the best way to go about this? > > --- > > Some thoughts I've had, but this gets complicated. > > --- > > I don't believe I can just add or modify the lease without changing the > pool, because even if there's a defined lease, this is still an unknown > client. So, even if there's a reserved lease for 192.168.1.51 - the > DHCP server won't give out that address because this is an unknown > client. (Right?) > > Yet if I make a pool for 51-70 and allow unknown clients, then any > client might (will) get one - not just the ones I want to "move" there. > > I've thought about pre-creating leases for 51-70 and essentially adding > "bogus" information for those leases and reserving them. (While > allowing unknown-clients for the 51-70 pool - but since they're all > "taken" it won't hand one out), Then when I want to move something > there, I can remove the "bogus" reservation and move the "real" lease > to the appropriate IP in the 51-70 block/pool. > > --- > > Or define the MAC address in a host definition, without an IP > definition. (I think DDNS works in this case.) > > Then define the 192.168.51-70 pool as "known" hosts only. (And make > sure no "other" known hosts accidentally grab one of the IP's in this > pool. This part worries me.) > > But it seems like I must be making this too hard. > > Am I missing something? > > Surely someone else has done this and can point me a tried-and-true > solution that works without a ton of drama. :) > > (Yes, my pools are larger than those, but the details are essentially > the same - this example is just more manageable.) > > Thanks! > > -Greg > > _______________________________________________ > ISC funds the development of this software with paid support > subscriptions. Contact us at https://www.isc.org/contact/ for more > information. > > dhcp-users mailing list > dhcp-users@lists.isc.org > https://lists.isc.org/mailman/listinfo/dhcp-users -------------- next part -------------- An HTML attachment was scrubbed... URL: <https://lists.isc.org/pipermail/dhcp-users/attachments/20210827/a5e3aa4e/attachment-0001.htm> ------------------------------ Message: 3 Date: Fri, 27 Aug 2021 10:36:23 +0100 From: Simon <dh...@thehobsons.co.uk> To: Users of ISC DHCP <dhcp-users@lists.isc.org> Subject: Re: Move dhcp lease to new ip+reservation. How? Message-ID: <7c3cc58f-42b7-4f81-8405-14e7007f2...@thehobsons.co.uk> Content-Type: text/plain; charset=utf-8 Gregory Sloop <gr...@sloop.net> wrote: > I've thought about pre-creating leases for 51-70 and essentially adding > "bogus" information for those leases and reserving them. (While allowing > unknown-clients for the 51-70 pool - but since they're all "taken" it won't > hand one out), Then when I want to move something there, I can remove the > "bogus" reservation and move the "real" lease to the appropriate IP in the > 51-70 block/pool. That?s what I?ve done for a small pool I?ve created at home for some devices - I wanted to segregate (isolate) some IoT stuff that others insist on having in the house. When you move the device, as well as assigning it to the reserved lease (which as you?ve probably realised, only initially needs to be a skeleton entry with MAC, IP, and the reserved flag), you need to remove it?s other lease(s) to ensure that it changes address. I don?t run failover, so I don?t know what you?ll need to do in terms of making the two servers agree on the details - e.g. whether it?s enough to do it on one with OMAPI and it?ll get copied by the failover setup, or whether you have to do it to both servers separately. Simon ------------------------------ Subject: Digest Footer _______________________________________________ ISC funds the development of this software with paid support subscriptions. Contact us at https://www.isc.org/contact/ for more information. dhcp-users mailing list dhcp-users@lists.isc.org https://lists.isc.org/mailman/listinfo/dhcp-users ------------------------------ End of dhcp-users Digest, Vol 154, Issue 8 ******************************************