DHCP - Long Lease Allocations
-
DHCP - Long Lease Allocations
I know this is a topic the forums and team has bantered about before, but I think there needs to be a work around.
If I build out a resource which requires DHCP long lived leases. Ex: Deploying K8 cluster or nodes, the ignition via various tools like MAAS or k8 vendor installer, leans into site is "cloud like and has DHCP" for VM template build / deployment. But this then creates a post deployment step to convert lease into long lived leases. In other DHCP servers, you just select lease and convert within the scope to be "static" but PFsense this is blocked.
The VMs, as they tear down (upgrades as example) will at times, require changes in these reservations. So there is no perfect answer, just to make a workflow that is flexible.
Options:
- Allow reservation to be set within scope range
- Setup reservation so that you can set a lease to some crazy long time for that selected set of reservations
And then the follow-up would be if this can be done via Ansible or TF, such that it can be a post deployment automation: If hostname = <variable set> then reach into PFSense and using one of above options, set it aside, and clean out old ones no longer needed.
Thanks,
-
@penguinpages It's related to how the DHCP server used handles this. It is not a reservation so other devices might get that IP.
https://docs.netgate.com/pfsense/en/latest/services/dhcp/mappings-in-pools.html
A workaround is to split it into two pools: .100 to .119 and .121 to .150.
They're looking at other DHCP servers...see the last few posts in https://redmine.pfsense.org/issues/5413
-
I am following, I understand the reason and logic.. but does not solve the problem.
So my other work around is to spin out another VLAN upon which that subnet has its own working / more configurable IPAM.
That is fine. BUT...
DHCP Server is currently enabled. Cannot enable the DHCP Relay service while the DHCP Server is enabled on any interface.
So.. I have setup NetBlox VM and it has subnet configured, but for the three networks for K8, I need to have routers (PFSense router in this case) relay DHCP for those three networks, to IP of the host.
Is there a reason that DHCP service, is mutually exclusive, of relay on different logical LANs.
-
@penguinpages I have not used DHCP Relay. However if you are setting up different VLAN interfaces you should be able to set up a DHCP Server instance on each, with their own settings...?
-
Thanks for the reply. I have DHCP scopes set and active on three VLANs, but this fourth one I have to use other DHCP /DNS because I have to: Use API / IaC call to convert IP to static lease, and or remove post upgrade. But what would have helped would have been to have host in my normal server VLAN .. not having to have extra NIC set to that network to function.
Meh.. Got it to work. Seems like pfsense upgrade from ISC to something a bit more modern like Kea would be in the works :)
-