When we are troubleshooting a DHCP client, it is very necessary for us to understand certain issues about configuring the client and client-server communication.
Sometimes, the DHCP may fail to configure the client properly. It may be either because DHCP could not communicate with a server, or because, although configuration responses were received, they were incorrect. Also, the problems can also occur later if the client cannot renew its IP addresses.
Here at Bobcares, we have seen several such Windows-related errors as part of our Server Management Services for web hosts and online service providers.
Today we’ll take a look at how we can troubleshoot the DHCP client issues.
Troubleshooting DHCP client issues
Now let’s take a look at how our Support Engineers troubleshoot the DHCP client problems.
DHCP Client Cannot Communicate With the Server
Sometimes, a client and a server will not be able to communicate with each other. Its consequences depend on whether or not the client has a configuration cached from an earlier DHCP transaction. In case, if it has and if the lease is still valid then the client will use the cached data to configure the interface.
Since the client has not received any outside confirmation that this configuration is valid, there is no guarantee that the IP address, router address, and other information are valid.
If the interface is connected to a network other than the one on which the configuration was received, one of two things can happen.
Errors may appear when other network services start
It may be impossible to communicate with other hosts on the network.
On the other hand, if no cache with an unexpired lease exists, the interface is not configured.
DHCP Configurations Received Are Invalid
There can be two reasons for the configurations to be invalid.
1. Using ARP, the client determines that the IP address offered to it is in use elsewhere. In this case, the client will send a DHCPDECLINE message to the server. If the server offers more than two bad addresses, dhcpagent fails.
2. The client gets offers, but when it tries to confirm them, the server sends a DHCPNAK message instead of a confirmation. If the client receives DHCPNAK messages more than twice, dhcpagent fails. This indicates a malfunctioning server.
DHCP Client Cannot Obtain an IP Address from Server
If a DHCP client cannot obtain an IP address from the DHCP server, we perform the following troubleshooting steps to identify the problem.
1. Verifying whether the DHCP Server is up and running. For that, we check the following:
- We make sure that the IP interfaces are active, and that the UDP port 68 is registered if a DHCP server exists on the local segment.
- We make sure that a relay agent is set up so that the DHCP requests are forwarded to the appropriate DHCP server if there is no DHCP server on the local segment.
2. Also, we check that the DHCP Server has available IP addresses to hand out. It could be that the DHCP server has run out of addresses for a specific subnet and a client request for another IP address on that subnet will fail. In most cases, the DHCP server generates warnings or errors when this occurs. Checking the DHCP server logs will confirm the issue.
3. We check that the DHCP Server does not expect certain tags to be set in the DHCP request. Some ISP’s that provide IP addresses to cable modems via DHCP expect the customer’s hostname or customer ID in the incoming DHCP request. If this is the case, we make sure that the DHCPCLNT module is loaded with the HOST=<hostname/customer ID> parameter.
4. We verify that the DHCP server responds to the request and that the DHCP client receives this request. For doing it, we check the following:
- Most DHCP servers can be run in debug mode, which logs information about DHCP requests along with their responses. We check this log to verify that the DHCP client request made it to the DHCP server and that the DHCP server responded.
- When DHCPCLNT loads, it spawns a “DHCP Client Info Screen” at the server console. This Info screen displays error and warning information whenever it detects a problem, including error checks for resource issues, thread issues, and DHCP protocol issues. Check this screen for possible messages.
Troubleshooting by isolating the Issues to the Client or Server
We perform the following actions to isolate the problem to either the client or the server machine.
The DHCP server machine is not working.
For verification purposes, we log in to another machine on the same subnet as the client and use the ping command to try to reach the server.
We diagnose the problem on the server machine.
The DHCP server is not running.
We log in to the server and enter the command:
ps -ef | grep dhcp
We stop and restart the DHCP server. For that, we run the below command.
Wait about 10 seconds. Then we enter the command:
The boot process hangs during DHCP.
We verify if the interface is marked primary, but no valid DHCP transaction has occurred.
Solution: We interrupt DHCP by typing control-C. The boot continues.
[Need any further assistance in fixing DHCP errors? – We are here to help you]
Today, we saw the different suggestions our Support Engineers provided for troubleshooting different DHCP client issues.