DHCP scope configuration controls which IP addresses a server can assign to network clients, while lease time settings determine how long those assignments remain valid before being recycled. This content also covers IP address conflict prevention, link-local addressing, and a comparison of IPv4 and IPv6 auto-configuration methods.
DHCP Addressing Concepts
So what addresses are these machines going to offer up to clients that get onto the network? We have to specify that, and we specify it by defining a scope.
In this network right here, let's say 31.0 is the network address. We're going to say this is a /24, which means the address range of this network is anywhere from 0 to .255.0 is the broadcast address. We've got addresses in between, but I'm going to probably assign those statically to certain devices on there. So the default gateway quite often is a .1. Maybe I'm going to assign my DHCP servers .2 and .3. Perhaps I have access points and they're somewhere in here — maybe I've got this one as a .5. Maybe I have some printers, and the printers on this network are anywhere from .10 to .14.
So I'm going to want to statically assign some of these addresses, and I don't want the first part of these addresses to be assigned to two different machines. That would be bad, if this was a two.5 and then another machine got assigned a .5. It's not going to work out very well, so I want to make sure that there's no overlap with this.
What I'm going to do is specify the range of addresses that can be assigned out. In this case right here I'm going to use the first 14 addresses for statically assigned addresses, so I'm going to start the scope of what can be handed out at .15. Then I'm going to actually end this at .240, because perhaps if I ever need to statically assign a machine an IP address for some sort of temporary use, and I do a .14, I don't want to risk maybe assigning it to the same IP address that a printer is on the network — because if I do that then there could be a conflict. So maybe I want to leave the last part of this range so I could statically assign to some client machines on the network just for some troubleshooting, or just temporarily. So maybe I have a reason to keep some at the end of the range also.
We have now defined our scope, which is going to be that any address between .15 and .240 will be assignable on this network. That is the scope.
I would set this scope up on each of these servers. The problem is that if I've got two DHCP servers that are responding to the client, this server could be sending out "hey, you're going to be .45," and then this machine sends out to here "hey, you can be .45." Now there's a conflict: we've got two machines with the same IP address on there, and that can cause all sorts of problems. We don't want the same IP address to be able to be handed out to two different machines.
For that purpose, these two DHCP servers would have a different scope range. So this one is doing from .15 to .130, and this one's doing from .131 to .240. That way the two machines don't have an overlapping scope and accidentally hand out the same IP addresses to two different machines. If you're going to have two DHCP servers, make sure the scopes don't overlap — that there are two different scopes on those two DHCP servers and they're handing out two different scopes.
Another thing that happens is that this machine could go offline. The problem with that is if an IP address is assigned to this machine and it goes offline, and if that continues to happen, you could exhaust all of the IP addresses within your scope and run out of IP addresses on your scope. So what we need is some sort of mechanism where the lease time runs out on these machines. That way, when the lease time runs out, that IP address can be re-released or reassigned to someone else on the network. So we've got this notion of lease time.
If you have a long lease time, like let's say it's 7 days, then every time this machine gets back onto the network it's going to reconnect and it's going to use that same IP address when it's on that network. The advantage to this is that if you have it set up for seven days, that machine will have it for a long period of time, and really it cuts down on the network traffic because it needs to check in less and renew that lease less often.
The disadvantage is that if you struggle with having enough IP addresses to hand out on your network, then this could be disconnected after a day and it ties up that IP address now for the rest of the seven days, and that IP address may need to be used out on the network again. So maybe in that scenario right there you reduce the amount of lease time down to one day.
I've had this before where I've had to reduce the lease times because I'm running low on IP addresses, and I'm at a place like a college where there's a lot of computers that are on and off that network all the time, and so I need to expire those lease times possibly even faster than a day. Maybe students are just coming in for an hour or two connecting, and I don't want to use that IP address and now exhaust that IP address for the rest of the time. So I might bring this down from 1 day to 1 hour.
Now in that scenario, if it's one hour, we have a problem where maybe now it's generating a little more traffic and devices are communicating more and trying to renew those leases more often.
When a machine is on your network, it doesn't really want to lose its IP address, and so what it will do is renew the IP address. It doesn't want to wait till the last second to renew it and then lose that IP address. So what it will do is take the renewal time — for instance, if it is 1 day — and halve that. So every 12 hours it will renew its lease. That way, if it can't contact the server within that 12 hours, then it still has a couple more opportunities, a few more opportunities, to renew that lease time.
At the 12-hour mark it'll reach out and say, "Hey, you gave me an IP address and it's going to expire now in 12 hours, so I just want to preemptively say, would you renew this?" And then this machine will say, "Yes, you have it for another 24 hours." Then that machine will once again go up to about the 12-hour mark and then say, "Hey, I'd still like to renew this for another 24 hours." That continues as long as this machine is connected to the network.
There are sometimes when a device will connect to the network but there's not a DHCP server available to communicate to, and sometimes we still need to address that equipment. Let me give you an example. At one point in time I was creating a network between a computer and a device, and there was no DHCP server on this connection, although it was connecting through the Ethernet cable. So somehow these two devices needed to connect and communicate.
That's where the link local address enters in. A link local address is automatically assigned to a machine when it can't find a DHCP server. The address for this is 169.254 something something, and the range of this network is 16. So it's always the case that it's always 169.254, but these two something something is randomly chosen. You've got 65,536 possibilities with these two randomly chosen, so the chance that this is going to choose the same IP address as another device within this network is pretty rare. It's not going to happen very often. You can connect these devices and get some sort of communication back and forth and communicate between these devices.
This is called the link local address, or Windows machines call this the automatic private IP addressing, or the APIPA address. So this is the APIPA address on a Windows machine. It's a way that some IP address can get assigned to it when it can't find a DHCP server. If you do an ipconfig on a machine and you see that this pops up, that means that it can connect to a network and it has some sort of connectivity — it just can't find a DHCP server on that network.
IP version 6 has some of the same addressing capabilities as IP version 4. That is, we can statically assign an IP version 6 address to a network interface. It does have a link local that looks similar to an IP version 4 address, where it has a first part that's assigned to it and then it randomly generates the rest of it.
There is a DHCP option with IP version 6, so we call that DHCP version 6. It operates a little differently, but the concepts are still the same.
And then we have also stateless address autoconfiguration, or SLAAC. We're not going to get too much into that now, but it's a way for it to automatically assign an IP address to it, or a network address to it, and then use its MAC address for the second part of that — which we know is going to be unique on a network, because MAC addresses are all unique. That is a function of IP version 6 addressing.
TechKnowSurge builds IT and cybersecurity professionals through hands-on, concept-first training built around real understanding — not memorization. Free interactive tools, structured programs, and 25+ years of real-world experience, all in one place.
Explore free tools and programs →