pfsense DHCP Reservation Questions
-
I get that having static IP's mixed into the middle of a DHCP scope is not a best practice. Its my home network so it was just a convenience that worked for years on my current router. I just have static IP's and reservations scattered throughout the scope, so some in the 2-30 range, some in the 100-105 range, and some in the 200-254 range.
In my test, my laptop was connected and I had the DHCP scope set to 101-199. The laptop got a lease for .101. I then put in a reservation for .101 with the laptop MAC. I then went into the laptop and set the IP to static at .101. When I look at the DHCP leases in pfsense, it shows there is a lease for .102 for the laptop. I double checked the laptop and it does not recognize a .102 address. So it is really a confusing result.
All in all, I'd like to be able to just put in a reservation for all the static IP's so that essentially those IP's can never get handed out to any other device. That way I could just use the entire /24 and not have to worry about it. If that is not possible and that is how it looks right now, then I will either need to have multiple small dhcp scopes in the contiguous ranges OR re-ip all the static IP's OR remove all static IP's and make the reservations. I am hesitant to do the last just in case the DHCP server has an issue, then reaching the devices with no static IP will be very difficult. For reference, the devices with static IP's are things like switches, servers/domain controllers, etc.
-
@djtech2k not sure what part did not click for you.. You can not set a reservation for an IP inside your pool
If you have .10-.15 in you pool gets .12 - you can't then set a reservation -- 12 is inside the pool..
If you want 12 to be excluded for the pool then create a pool .10-.11 and another pool .13-15
-
@djtech2k said in pfsense DHCP Reservation Questions:
don't really understand why DHCP is doing what its doing on pfsense
See:
https://docs.netgate.com/pfsense/en/latest/services/dhcp/mappings-in-pools.html -
Yeah, I got it. I went back and looked over the dhcp config again to refresh my memory. I understand how they made reservations and scope work. I do not like how it works and I wish it were different, but it is what it is.
I wasnāt sure if there were any other options for dhcp of if I overlooked something or not. Sounds/looks there is not. So itāll have to be multiple smaller scopes that donāt include static/reservations or rearrange ip assignments on the network to accommodate a contiguous scope.
Validating is half the battle.
-
@djtech2k what I do when I add a new device is just let it get dhcp - then set a reservation for outside the pool. I'm not sure why anyone set a static on a device other than devices that don't even support dhcp
You can change its ip without ever having to touch it, you could even change whole network ip space. You can change options again without having to touch it..
My dhcp scopes are small .100-120 for example - rest of the space I just use as reservation. And its easy enough to know what IP is next to use..
-
@johnpoz said in pfsense DHCP Reservation Questions:
I'm not sure why anyone set a static on a device other than devices that don't even support dhcp
Because it prevent the most important infrastructure devices in the network to remain on their well-known IPs and not resort to APIPA should the non-redundant DHCP-service fail.
-
@P3R said in pfsense DHCP Reservation Questions:
Because it prevent the most important infrastructure devices in the network to remain on their well-known IPs
That's why static MAC DHCP lease were invented. Also valid for DHCPv6 btw.
Every device on my main LAN network support DHCPv4/DHCPv6.
Every device on my main LAN network always has the same IPv4/IPv6..
I've started to add a static MAC DHCP lease for every device I had back then (many decades ago), and continued to so for every new device I add (one or two every year).This means that I don't need to change something on the device, they are all 'out of the box', and these are printers, NAS, APs, PC's and servers, some witches, and some other 'special' stuff. 50 or so.
I've lost some what the notion of 'what IPv4 is sud by what device' as I gave them all my defined short host names.
Most devices don't even really use IPv4 anymore, they use IPv6 these days. And I'm not going to remember these anyway, they are to long, even when using 'short' mode.
I've my short host names, I will not break DNS, so everything works fine.If you don't have 24.11 with kea that supports this, stay with ISC and you're fine. Worked for me for since early 2010. ISC still rocks for billions of devices.
With 24.11 and kea, static DHCP work fine also.
Same thing for DHCPv6. -
@P3R where did you quote that from ;)
You know what needs static - loopback on your infrastructure equipment. The dhcp server ;) Your gateway on whatever network - which is normally by common practice either the 1st IP or the last on a network.
But sure go ahead if you want - but there is no reason they should be just shotgunned into the ip network.. put them on one side of the pool ;)
But also not just loopback on your routers or switches.. But normally their management IP on its own infrastructure network anyway. Servers of some kind would be on their own normally as well. But sure there might be some static stuff on any network. The gateway device, dns or dhcp server itself, etc. Common practice is to leave a few ips on each side of the scope.. We normally start at .10 and end at .244.
-
@johnpoz said in pfsense DHCP Reservation Questions:
@P3R where did you quote that from ;)
I quoted you and it says so in the first line of that post. It's the same in this one.
But sure go ahead if you want - but there is no reason they should be just shotgunned into the ip network.. put them on one side of the pool ;)
I'm not the OP and I have them outside of the pool, bottom and top. I just explained why some may use static and I don't need the approval.
I reserve them in DHCP as well though. That way the DHCP configuration is at the same time my IP documentation and it prevent any problems should there be a factory reset of a device. A little more work initially but less problems later on.
But also not just loopback on your routers or switches.. But normally their management IP on its own infrastructure network anyway. Servers of some kind would be on their own normally as well.
True for professional users and equipment but not for many home users.
-
@P3R said in pfsense DHCP Reservation Questions:
I quoted you and it says so in the first line of that post. It's the same in this one.
not not me - this part, this sounds like it came from doc from back in the day on why static is better
"Because it prevent the most important infrastructure devices in the network to remain on their well-known IPs"
True for professional users and equipment but not for many home users.
Sure - true, but what is the point of breaking up your pool and putting IPs inside your continuous space.. Just leave some in the beginning and leave some at the end for your reservations and statics.. A pool of .10 to .244 leaves you 20 ips for static or reservations - if you need more use .20 to .234, etc. or 100-200 as your pool.
What does it matter if device X is .9 or .90 ? or .128 or .156 or .245, etc..