Are static DHCP ranges part of the "hand out" range?

I have three types of IPs on my network:

  • statically assigned on a host y manual configuration
  • statically assigned by DHCP based on the MAC
  • randomly assigned by DHCP

Pi-hole, in its DHCP configuration, has a "Range of IP addresses to hand out".

Say that

  • I set this range to 192.168.10.10192.168.10.250
  • I want a device to be statically assigned IP 192.168.10.8 (so outside of the range above)

My question:

  • does the "Range of IP addresses to hand out" includes static DHCP addresses? In other words, is this range all of what DHCP can provide?
  • or does it cover only the random addresses but still can provide an IP outside of the range when it is statically assigned (via its MAC)

The general idea behind this question is that I would like to neatly put devices in ranges "manual static", "DHCP static" and "DHCP random" without the last two mangling together.

1 Like

Any device set up and configured, IN/ON the device, to have a specific, static IP address will not even make a DHCP request. Your DHCP config should allow 'room' for those outside your range. In the above example, 192.168.10.1-9 are useful for that.

Any addresses assigned in the DHCP config to hand out specific IP addresses to particular MACs AND all ad hoc, non-configured clients making requests, come out of the DHCP configured range. In the example, 192.168.10.10-250.

If gaps are left, in what you are calling DHCP static, they could be used. The DHCP server will not allow the same address to be handed out but it will use any open, available one, even between others. That is when you configure DHCP static, you just tell the server that certain MACs should get certain IPs. That's all. No other real magic is in play. If a MAC shows up and the server doesn't have a predetermined IP to give it, it will chose another available one to hand out.

Thank you for your answer. I use DHCP on a regular basis so it is less the functioning itself that is a problem, but what Range of IP addresses to hand out means.

The DHCP server can provide addresses

  • at random when it gets a DHCP DISCOVER message, does not see any static assignment for the MAC, and hands out an IP that is free(1)
  • "predefined" (="static") when there is matching MAC in its configuration.

My question was whether Range of IP addresses to hand out is describing only the first case (the pool of IPs that will be handed over randomly), or whether the "DHCP static" addresses must also be in that pool.

If this is the former then I can manually have well established ranges (say 1-10 for manual static, 11-20 for what will be the DHCP static ones, and 21-200 for random ones. 200-254 would not be used)

If it the latter, I can of course have the manual static IPs neatly in, say, 1-10 range but then anything DHCP will land in 11-200. The scenario I wanted to avoid would then be

  • I would like all my "static DHCP" addresses at the beginning o the range (say, 11-20) so I add the MACs I know there before handing out IPs
  • DHCP starts and a random device gets 192.168.10.15 (because it can, and that IP was not "statically assigned" yet
  • I have a mess :frowning:

As I am typing, and if we are I the former case, I realized that I could cheat the DHCP server by forcefully adding MACs that do not exist and "reserve" some IPs for later (by editing the MAC to match the one of the device I want to be DHCP static). I will need to try this tonight.


(1) what "free" means depends on the implementation - it is at least "free because I do not have it in my leases", but usually also "free because I do not have it in my leases and I tried to check if it is otherwise already live on the network"

EDIT: looks like my idea to reserve ranges could be working:

Pi-hole's embedded dnsmasq will serve DHCP requests with an IPv4 address either from its Range of IP addresses to hand out or from its list of DHCP reservations, provided a client's request matches an entry from Static DHCP leases configuration.
Pi-hole does allow to enter any arbitrary fixed IP in that Static DHCP leases configuration, but you should make sure that it doesn't conflict with manual on-device IPs, and that it falls into your router's subnet if you want that to be useful.

1 Like

Thank you! This answers my question and my idea to "reserve" IPs with fake MACs is not useful after all. I will just move the "Range of IP addresses to hand out" further to the right to make space for statically DHCP assigned IPs.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.