There are numerous reasons that can result in DHCP problems. However, as with any other issue, the most common reasons are due to device misconfigurations. However, additional problems can also be caused by any of the following possible causes:
- NIC compatibility issue or DHCP feature issue
- Faulty NIC or improper NIC driver installation
- Operating System behavior or defect
- Spanning Tree issues
- CDP Is Disabled On Ports Connected to IP Phones
- DHCP Server DHCP Relay Information Option Incompatibility
- Cisco IOS DHCP/BOOTP Software Bugs
Device misconfigurations are the most common reason for DHCP problems. Common errors that may result in DHCP problems include the following:
- The Cisco IOS DHCP service is disabled
- Using secondary addressing
- Wrong DHCP configuration parameters
By default, the Cisco IOS DHCP service is enabled via the service dhcp global configuration command. However, it is possible that the service may have been disabled when disabling unused services if the device was not previously used as a DHCP server. If you have verified the device configuration and everything appears to be correct, but the Cisco IOS DHCP server is not leasing addresses, check the configuration to ensure that the DHCP service is enabled.
Secondary addressing is also another common reason for DHCP problems. By default, DHCP has a limitation in that the reply packets are sent only if the request is received from the interface configured with the primary IP address. If you have secondary subnets assigned to a router interface and Cisco IOS DHCP server or Cisco IOS DHCH relay agent is configured to forward DHCP Broadcasts to a remote server, only addresses from the pool included in the primary network will be assigned to requesting clients. If you need to assign addresses to hosts from different subnets, you must configure additional interfaces or use subinterfaces instead.
Wrong or incorrect DHCP configuration parameters may include incorrect network statements when configuring the DHCP pool. In the event that the network statement does not include any local device interfaces, no addresses will be assigned, even by the local Cisco IOS DHCP server. Consider the following basic configuration for example:
| R1(config)#interface fastethernet 0/0 R1(config-if)#ip add 192.168.1.1 255.255.255.0 R1(config-if)#exit R1(config)#ip dhcp pool CLIENT-POOL R1(dhcp-config)#network 192.168.2.0 255.255.255.0 R1(dhcp-config)#default-router 192.168.1.1 R1(dhcp-config)#lease 8 0 0 R1(dhcp-config)#dns-server 10.0.0.254 R1(dhcp-config)#netbios-name-server 10.0.0.254 R1(dhcp-config)#exit |
In the configuration example above, the FastEthernet0/0 subnet and DHCP network statement are mismatched. Because of this misconfiguration, the Cisco IOS DHCP server will not be able to assign addresses to local clients sending DHCP packets on FastEthernet0/0. This can be validated by debugging the Cisco IOS DHCP server functionality using the debug ip dhcp server events and debug ip dhcp server packet commands as follows:
| R1#debug ip dhcp server events DHCP server event debugging is on. R1#debug ip dhcp server pack R1#debug ip dhcp server packet DHCP server packet debugging is on. R1# R1# R1# *Oct 20 16:13:13.828: DHCPD: Sending notification of DISCOVER: *Oct 20 16:13:13.828: DHCPD: htype 1 chaddr 0024.e8f5.7ea2 *Oct 20 16:13:13.828: DHCPD: remote id 020a0000c0a8010100000000 *Oct 20 16:13:13.828: DHCPD: circuit id 00000000 *Oct 20 16:13:13.828: DHCPD: DHCPDISCOVER received from client 0100.24e8.f57e.a2 on interface FastEthernet0/0. *Oct 20 16:13:13.828: DHCPD: Seeing if there is an internally specified pool class: *Oct 20 16:13:13.828: DHCPD: htype 1 chaddr 0024.e8f5.7ea2 *Oct 20 16:13:13.828: DHCPD: remote id 020a0000c0a8010100000000 *Oct 20 16:13:13.832: DHCPD: circuit id 00000000 *Oct 20 16:13:13.832: DHCPD: there is no address pool for 192.168.1.1. *Oct 20 16:13:18.828: DHCPD: Sending notification of DISCOVER: *Oct 20 16:13:18.828: DHCPD: htype 1 chaddr 0024.e8f5.7ea2 *Oct 20 16:13:18.828: DHCPD: remote id 020a0000c0a8010100000000 *Oct 20 16:13:18.828: DHCPD: circuit id 00000000 *Oct 20 16:13:18.828: DHCPD: DHCPDISCOVER received from client 0100.24e8.f57e.a2 on interface FastEthernet0/0. *Oct 20 16:13:18.828: DHCPD: Seeing if there is an internally specified pool class: *Oct 20 16:13:18.828: DHCPD: htype 1 chaddr 0024.e8f5.7ea2 *Oct 20 16:13:18.828: DHCPD: remote id 020a0000c0a8010100000000 *Oct 20 16:13:18.832: DHCPD: circuit id 00000000 *Oct 20 16:13:18.832: DHCPD: there is no address pool for 192.168.1.1. *Oct 20 16:13:26.829: DHCPD: Sending notification of DISCOVER: *Oct 20 16:13:26.829: DHCPD: htype 1 chaddr 0024.e8f5.7ea2 *Oct 20 16:13:26.829: DHCPD: remote id 020a0000c0a8010100000000 *Oct 20 16:13:26.829: DHCPD: circuit id 00000000 *Oct 20 16:13:26.829: DHCPD: DHCPDISCOVER received from client 0100.24e8.f57e.a2 on interface FastEthernet0/0. *Oct 20 16:13:26.829: DHCPD: Seeing if there is an internally specified pool class: *Oct 20 16:13:26.829: DHCPD: htype 1 chaddr 0024.e8f5.7ea2 *Oct 20 16:13:26.829: DHCPD: remote id 020a0000c0a8010100000000 *Oct 20 16:13:26.829: DHCPD: circuit id 00000000 R1# *Oct 20 16:13:26.829: DHCPD: there is no address pool for 192.168.1.1. |
When forwarding DHCP messages to a remote server, i.e. the ip helper-address command has been issued; the gateway forwards all DHCP messages to the configured helper using the primary address on the interface. If a pool has not been configured that includes the source address of the DHCP relay, no addresses will be assigned by the remote DHCP server. For example, if the remote DHCP server was a Cisco IOS DHCP server, if you enabled DHCP server functionality debugging using the debug ip dhcp server events and debug ip dhcp server packet commands, you would see the following messages printed on the console:
| R2#debug ip dhcp server events DHCP server event debugging is on. R2#debug ip dhcp server packet DHCP server packet debugging is on. R2# R2# *Mar 3 11:14:18.830: DHCPD: DHCPDISCOVER received from client 0100.24e8.f57e.a2 through relay 192.168.1.1. *Mar 3 11:14:18.830: DHCPD: Seeing if there is an internally specified pool class: *Mar 3 11:14:18.830: DHCPD: htype 1 chaddr 0024.e8f5.7ea2 *Mar 3 11:14:18.830: DHCPD: circuit id 00000000 *Mar 3 11:14:18.830: DHCPD: there is no address pool for 192.168.1.1. *Mar 3 11:14:23.366: DHCPD: Sending notification of DISCOVER: *Mar 3 11:14:23.366: DHCPD: htype 1 chaddr 0024.e8f5.7ea2 *Mar 3 11:14:23.366: DHCPD: circuit id 00000000 *Mar 3 11:14:23.370: DHCPD: DHCPDISCOVER received from client 0100.24e8.f57e.a2 through relay 192.168.1.1. *Mar 3 11:14:23.370: DHCPD: Seeing if there is an internally specified pool class: *Mar 3 11:14:23.370: DHCPD: htype 1 chaddr 0024.e8f5.7ea2 *Mar 3 11:14:23.370: DHCPD: circuit id 00000000 *Mar 3 11:14:23.370: DHCPD: there is no address pool for 192.168.1.1. |
The troubleshooting of NIC issues is platform and hardware dependent. For this reason, we will not delve into any specific details on NIC troubleshooting. However, you can isolate NIC issues by resetting the NIC card, re-installing the driver, or verifying if the NIC is configured to automatically acquire an IP address for example. Figure 9-2 illustrates how you would validate this configuration when using a Windows-based machine:
Fig. 9-2. Verifying NIC Settings When Using DHCP
You could also perform additional troubleshooting functions such as assigning a static IP address verifying if the local host has network connectivity for example. As is the case with NIC issues, Operating System behaviors or defects are platform independent and will require different troubleshooting commands depending on the platform.
By default, all ports transition through several Spanning Tree Protocol states before they begin forwarding user data. The default amount of time before the port transitions into the forwarding state may cause some hosts to fail to receive dynamic addressing via DHCP due to NIC timeouts. The recommended solution in such cases is to enable the PortFast feature on access ports connected to hosts that will be getting addressing information via DHCP.
When an IP phone is connected to the port, assuming correct MVAP configuration, if CDP is disabled on the switch port, while the host connected to the phone LAN port will still be assigned an IP address by the DHCP server, the IP phone will be unable to acquire an address from the voice VLAN. If the CDP is enabled, the switch is able to detect that the Cisco IP Phone requests the DHCP and can provide the correct subnet information. The DHCP server then is able to allot an IP address from the voice VLAN / subnet pool. Keep in mind that there are no explicit configuration steps required to bind the DHCP service to the voice VLAN.
When configuring Cisco IOS DHCP relay agent functionality on Catalyst switches, the switch will include the DHCP relay agent information option (option 82) in packets it sends to the DHCP server. This option allows the switch to include information about itself when forwarding client-originated DHCP packets to a DHCP server. While Cisco IOS DHCP server will accept such packets, it may be incompatible with other DHCP servers. In such cases, consider disabling this behavior using the no ip dhcp snooping information option global configuration command on the switch.
And finally, while rare, it is possible to run into Cisco IOS DHCP software bugs. For example, in older Cisco IOS software images, i.e. 12.1, enabling the Unicast Reverse Path Forwarding (uRPF) feature, which was described in the previous chapter, causes the router to drop packets with a source address of 0.0.0.0 and a destination address of 255.255.255.255. This software defect is resolved in current Cisco IOS images. If you have performed the necessary checks, i.e. verified the router or switch configuration and host and server settings (if an external DHCP server is being used) and you suspect a software bug, then you should contact the Cisco TAC for additional troubleshooting assistance and verification.
In addition to the debug commands as well as other verifications described in this section, you can also use the show ip dhcp server statistics command to troubleshoot possible Cisco IOS DHCP server problems when Cisco IOS DHCP server functionality is enabled on the device. This command provides statistics on the DHCP messages described in the previous section. Following is a sample output of the message statistics that is printed by this command.
| R1#show ip dhcp server statistics Memory usage 40343 Address pools 1 Database agents 0 Automatic bindings 1 Manual bindings 0 Expired bindings 0 Malformed messages 0 Secure arp entries 0Message Received BOOTREQUEST 0 DHCPDISCOVER 19 DHCPREQUEST 2 DHCPDECLINE 0 DHCPRELEASE 0 DHCPINFORM 2Message Sent BOOTREPLY 0 DHCPOFFER 1 DHCPACK 4 DHCPNAK 0 |
