In this brief troubleshooting article, we’ll take a look at some of the classic things that can go wrong with DHCP reservation, the things you should check and how you can resolve these issues.
As we’ve already mentioned on previous occasions, the DHCP service (Dynamic Host Configuration Protocol) service is one of the most important services when it comes to managing any home or business network. This service allows you to automatically assign IP addresses and set other network configuration parameters, which reduces the administrative burden and the risk of making mistakes.
NOTE: This article focuses on Windows Server 2022, but the information here is equally valid for any version of Microsoft Windows Server.
Potential DCHP Reservation Errors
There are actually quite a lot of things that can go wrong with DHCP reservation. So, in this article, we’re going to focus on a small number of specific problems and take a look at their root causes.
Today, we’ll focus on the following issues:
- IP address conflicts
- No more available IP addresses
- Being assigned an address for the wrong scope.
IP Address Conflicts
IP address conflicts are very common problems and can occur on any home or business network. They’re normally caused by human error when a technician manually assigns an IP address that is already in use.
However, even though it’s often down to human error, the cause can sometimes be a little harder to find.
Firstly, it may not be the result of a manual IP address assignment. It can also happen due to an error in the range assigned when creating scopes on the DHCP server.
Therefore, the first thing you need to check is that there is no overlap between the various scopes that you’ve created.
If everything looks fine on your DHCP server, it’s time to start checking any individual computers that have been configured manually to see if there are any duplicate IP addresses.
Once you find a computer that has a duplicate IP address, you should change it and then review your IP address assignment policy. If you don’t have one, now is a good time to make one to avoid these kinds of issues in the future.
Of course, even if you have a policy in place already, it’s also possible that the conflict has been created by an unauthorised user trying to connect a computer to the network.
How to prevent these types of problems in the future
To start with, as we’ve already mentioned, it’s generally good practice to create an IP address assignment policy. This will help prevent duplicate IP assignments in the future and allow you to keep records on IP addresses assigned, the name of the computer, the section of the network, lease duration, etc.
Secondly, you should ensure that you’ve taken the necessary measures to prevent any unauthorised users from connecting to the network. You should disable any unused network ports, for example, so that users need to ask for them to be activated to connect a device. You can do this either by disabling the network ports or disconnecting them from the patch panel.
OK, I know what you’re thinking. This is all great advice so far, but what about wireless connections? Well, if it’s a business network, you could use a MAC filter so that computers using the company Wi-Fi network need to be previously registered on the DHCP server database.
No More Available IP Addresses
This is another common issue and it usually happens when a DHCP server has assigned all available addresses for a given scope and has no more to assign to any new devices that try to connect to the network.
This problem is normally caused by one of two things:
- An error when planning and creating the scope.
- An error when setting the lease duration.
In the case of a scope planning error, it’s possible that a scope was created to provide access to a specific service and that the systems administrator underestimated the number of hosts that would need access to the service. As a result, the range of IP addresses may not be big enough.
In this situation, they’ll need to re-calculated how many addresses are truly required based on the number of potential users and create a new scope with a suitably large IP range.
If you’re not sure how to calculate the IP range required to provide a service to a certain number of computers, you can use one of the many IP calculators available online, such as this one at jodies.de.
In the case of a lease duration error, it could be that your lease duration is too long. This will mean that IP addresses remain assigned even once the computer has disconnected from the network, preventing them from being re-assigned to other computers.
As we explained in What is DHCP and Why is it Important?, the DHCP service assigns IP addresses using something called a lease. This is the amount of time that the IP address will be assigned to the computer before it needs to renew it. In the case of Microsoft servers, the default lease duration is 8 days and many systems administrators leave this default value as it is. The problem is that, depending on the needs of your scope, this value may be far from ideal.
When planning and configuring a scope, you should always bear in mind that the number of IP addresses is finite and adjust the lease duration based on the kind of clients that are going to connect to the scope. For example, you can make 254 IP addresses available to be shared amongst all your clients or you can restrict this to a lower number.
When an IP address is assigned to a client computer, this address will not become free again until the lease has expired or until the client manually frees up the address using a command like “ipconfig /release” (something that users will almost never do).
The most appropriate lease duration will not be the same in an office as in, say, a hotel or a cafe.
This means that it’s important to think about how long your client computers are likely to need access for. Are we talking about employees who never leave the building and who use the service constantly? Are we talking about temporary employees who will leave in a week’s time? Or are we talking about visitors who will only need to connect for a couple of hours?
By answering these questions, you can get a good idea of what the most appropriate lease duration will be for your DHCP scope.
That’s why you need to take special care when setting the lease duration, which can be expressed in days, hours or even minutes.
Even if this value has already been set, you can change it later. Simply go to the scope properties and change the “Lease duration for DHCP clients” value.
IP Address Assigned from the Wrong Scope
Another common error that you might encounter is when an address is assigned that belongs to the wrong scope.
This normally happens when the client connects using a network socket that is connected to a different network (normally VLAN) and therefore receives an IP address for a different scope. To solve this, you simply need to connect the cable to the correct socket or reconfigure the network port to use the right VLAN.
For example, if you’re using Cisco Systems, you can use the following commands to reconfigure the port:
# configure terminal
# interface ge1/0/12
# switchport Access vlan 20
# end
It’s also possible that this problem is being caused by a malfunctioning DHCP relay agent. The agent could have an incorrect gateway setting and as a result, could be sending requests to the wrong scope or server. To solve this problem, you will need to reconfigure the relay agent.
Conclusion
As we mentioned at the beginning, the DHCP service is one of the most fundamental services for any home or business network, and if you have a lot of hosts, it’s important to be able to manage it in an efficient and organised way.
However, whilst it is a relatively simple service and fairly straightforward to set up, poor planning or configuration errors can lead to a host of network issues. In this tutorial, we’ve just looked at three common issues, any there are many other things that can go wrong. But if you take your time to plan your network carefully, you should be able to avoid the majority of them.
We hope that you have found this article useful. If you would like to learn more about the DHCP service, check out the following tutorials:
Thanks for reading!