Mac Manual Dhcp Connection

I go to system preferences - network-advanced (for my LAN ethernet connection) - Configure IPv4 (leave IPv6 at Stack Exchange Network Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers. It would be a good idea to to edit the Locations so that you can easily change from DHCP to manual IP simply. You will need to go to Edit Locations with in the Network Preference Pane. Name it something that will let you remember what it is for. Once you have named the new location you will click on the connection you want to set manually. UPC Cablecom Connect Box Manual. SWITCH MAC Label The Connect Box Media Access Control (MAC) label is located on the bottom of the Connect Box. DHCP Connect Box provides DHCP server to manage IP addresses to CPEs and supports reser- ved IP Address for users’ private and static clients.

  1. Static Connection
  2. Mac Manual Dhcp Connection Problems

Contents

Introduction

This document contains information on how to troubleshoot several common Dynamic Host Configuration Protocol (DHCP) issues that can arise within a Cisco Catalyst switch network. This document includes troubleshooting the use of the Cisco IOS® DHCP/BootP Relay Agent feature.

Prerequisites

Requirements

There are no specific prerequisites for this document.

Components Used

This document is not restricted to specific software and hardware versions.

The information presented in this document was created from devices in a specific lab environment. All of the devices used in this document started with a cleared (default) configuration. If you are working in a live network, ensure that you understand the potential impact of any command before using it.

Conventions

Static Connection

Refer to Cisco Technical Tips Conventions for more information on document conventions.

Key Concepts

These are several key concepts of DHCP:

  • DHCP clients initially have no configured IP address, and must therefore send a broadcast request to obtain an IP address from a DHCP server.

  • Routers, by default, do not forward broadcasts. It is necessary to accommodate client DHCP broadcast requests if the DHCP server is on another broadcast domain (Layer 3 (L3) network). This is performed by use of a DHCP Relay Agent.

  • The Cisco router implementation of DHCP Relay is provided through interface-level ip helper commands

Example Scenarios

Scenario 1: Cisco Router Routing between DHCP Client and Server's Networks

As configured in this diagram, interface Ethernet1 forwards the client's broadcasted DHCPDISCOVER to 192.168.2.2 through interface Ethernet1. The DHCP server fulfills the request through unicast. No further configuration to the router is necessary in this example.

Scenario 2: Cisco Catalyst Switch with L3 Module Routing between DHCP Client and Server's Networks

As configured in the diagram, interface VLAN20 forwards the client's broadcasted DHCPDISCOVER to 192.168.2.2 through interface VLAN10. The DHCP server fulfills the request through unicast. No further configuration to the router is necessary in this example. The switch ports need to be configured as host ports and have Spanning-Tree Protocol (STP) portfast enabled, and trunking and channeling disabled.

Background Information

DHCP provides a mechanism through which computers that use Transmission Control Protocol/Internet Protocol (TCP/IP) can obtain protocol configuration parameters automatically through the network. DHCP is an open standard that was developed by the Dynamic Host Configuration-Working Group (DHC-WG) of the Internet Engineering Task Force (IETF).

DHCP is based on a client-server paradigm, in which the DHCP client, for example, a desktop computer, contacts a DHCP server for configuration parameters. The DHCP server is typically centrally located and operated by the network administrator. Because the server is run by a network administrator, DHCP clients can be reliably and dynamically configured with parameters appropriate to the current network architecture.

Most enterprise networks consist of multiple subnets divided into subnetworks referred to as Virtual LANS (VLANs), where routers route between the subnetworks. Since routers do not pass broadcasts by default, a DHCP server would be needed on each subnet unless the routers are configured to forward the DHCP broadcast using the DHCP Relay Agent feature.

Understanding DHCP

DHCP was originally defined in Requests for Comments (RFCs) 1531 , and has since been obsoleted by RFC 2131 . DHCP is based on the Bootstrap Protocol (BootP), which is defined in RFC 951 .

DHCP is used by workstations (hosts) to get initial configuration information, such as an IP address, subnet mask, and default gateway upon bootup. Since each host needs an IP address to communicate in an IP network, DHCP eases the administrative burden of manually configuring each host with an IP address. Furthermore, if a host moves to a different IP subnet, it must use a different IP address than the one it previously used. DHCP takes care of this automatically. It allows the host to choose an IP address in the correct IP subnet.

Current DHCP RFC References

  • RFC 2131 - DHCP

  • RFC 2132 - DHCP Options and BootP Vendor Extensions

  • RFC 1534 - Interoperation between DHCP and BootP

  • RFC 1542 - Clarifications and Extensions for the BootP

  • RFC 2241 - DHCP Options for Novell Directory Services

  • RFC 2242 - Netware/IP Domain Name and Information

  • RFC 2489 - Procedure for Defining New DHCP Options

DHCP uses a client-server model where one or more servers (DHCP servers) allocate IP addresses and other optional configuration parameters to clients (hosts) upon client bootup. These configuration parameters are leased by the server to the client for some specified amount of time. When a host boots up, the TCP/IP stack in the host transmits a broadcast (DHCPDISCOVER) message in order to gain an IP address and subnet mask, among other configuration parameters. This initiates an exchange between the DHCP server and the host. During this exchange, the client passes through the several well defined states listed below:

  1. Initializing

  2. Selecting

  3. Requesting

  4. Bound

  5. Renewing

  6. Rebinding

In moving between the states listed above, the client and server may exchange the types of messages listed in the DHCP Message Table below.

DHCP Message Table

Reference Message Use
0x01 DHCPDISCOVER The client is looking for available DHCP servers.
0x02 DHCPOFFER The server response to the client DHCPDISCOVER.
0x03 DHCPREQUEST The client broadcasts to the server, requesting offered parameters from one server specifically, as defined in the packet.
0x04 DHCPDECLINE The client-to-server communication, indicating that the network address is already in use.
0x05 DHCPACK The server-to-client communication with configuration parameters, including committed network address.
0x06 DHCPNAK The server-to-client communication, refusing the request for configuration parameter.
0x07 DHCPRELEASE The client-to-server communication, relinquishing network address and canceling remaining lease.
0x08 DHCPINFORM The client-to-server communication, asking for only local configuration parameters that the client already has externally configured as an address.

DHCPDISCOVER

When a client boots up for the first time, it is said to be in the Initializing state, and transmits a DHCPDISCOVER message on its local physical subnet over User Datagram Protocol (UDP) port 67 (BootP server). Since the client has no way of knowing the subnet to which it belongs, the DHCPDISCOVER is an all subnets broadcast (destination IP address of 255.255.255.255), with a source IP address of 0.0.0.0. The source IP address is 0.0.0.0, since the client does not have a configured IP address. If a DHCP server exists on this local subnet and is configured and operating correctly, the DHCP server will hear the broadcast and respond with a DHCPOFFER message. If a DHCP server does not exist on the local subnet, there must be a DHCP/BootP Relay Agent on this local subnet to forward the DHCPDISCOVER message to a subnet that contains a DHCP server.

This relay agent can either be a dedicated host (for example, Microsoft Windows Server), or router (for example, a Cisco router configured with interface level IP helper statements).

DHCPOFFER

A DHCP server that receives a DHCPDISCOVER message may respond with a DHCPOFFER message on UDP port 68 (BootP client). The client receives the DHCPOFFER and moves into the Selecting state. This DHCPOFFER message contains initial configuration information for the client. For example, the DHCP server will fill in the yiaddr field of the DHCPOFFER message with the requested IP address. The subnet mask and default gateway are specified in the options field, subnet mask and router options, respectively. Other common options in the DHCPOFFER message include IP Address lease time, renewal time, domain name server, and NetBIOS name server (WINS). The DHCP server will send the DHCPOFFER to the broadcast address, but will include the clients hardware address in the chaddr field of the offer, so the client knows that it is the intended destination. In the event that the DHCP server is not on the local subnet, the DHCP server will send the DHCPOFFER, as a unicast packet, on UDP port 67, back to the DHCP/BootP Relay Agent from which the DHCPDISCOVER came. The DHCP/BootP Relay Agent will then either broadcast or unicast the DHCPOFFER on the local subnet on UDP port 68, depending on the Broadcast flag set by the Bootp client.

DHCPREQUEST

After the client receives a DHCPOFFER, it responds with a DHCPREQUEST message, indicating its intent to accept the parameters in the DHCPOFFER, and moves into the Requesting state. The client may receive multiple DHCPOFFER messages, one from each DHCP server that received the original DHCPDISCOVER message. The client chooses one DHCPOFFER and responds to that DHCP server only, implicitly declining all other DHCPOFFER messages. The client identifies the selected server by populating the Server Identifier option field with the DHCP server's IP address. The DHCPREQUEST is also a broadcast, so all DHCP servers that sent a DHCPOFFER will see the DHCPREQUEST, and each will know whether its DHCPOFFER was accepted or declined. Any additional configuration options that the client requires will be included in the options field of the DHCPREQUEST message. Even though the client has been offered an IP address, it will send the DHCPREQUEST message with a source IP address of 0.0.0.0. At this time, the client has not yet received verification that it is clear to use the IP address.

DHCPACK

After the DHCP server receives the DHCPREQUEST, it acknowledges the request with a DHCPACK message, thus completing the initialization process. The DHCPACK message has a source IP address of the DHCP server, and the destination address is once again a broadcast and contains all the parameters that the client requested in the DHCPREQUEST message. When the client receives the DHCPACK, it enters into the Bound state, and is now free to use the IP address to communicate on the network. Meanwhile, the DHCP server stores the lease in its database and uniquely identifies it using the client identifier or chaddr, and the associated IP address. Both the client and server will use this combination of identifiers to refer to the lease. The client identifier is the Mac address of the device plus the media type.

Before the DHCP client begins using the new address, the DHCP client must calculate the time parameters associated with a leased address, which are Lease Time (LT), Renewal Time (T1), and Rebind Time (T2). The typical default LT is 72 hours. You can use shorter lease times to conserve addresses, if needed.

DHCPNAK

If the selected server is unable to satisfy the DHCPREQUEST message, the DHCP server will respond with a DHCPNAK message. When the client receives a DHCPNAK message, or does not receive a response to a DHCPREQUEST message, the client restarts the configuration process by going into the Requesting state. The client will retransmit the DHCPREQUEST at least four times within 60 seconds before restarting the Initializing state.

DHCPDECLINE

The client receives the DHCPACK and will optionally perform a final check on the parameters. The client performs this procedure by sending Address Resolution Protocol (ARP) requests for the IP address provided in the DHCPACK. If the client detects that the address is already in use by receiving a reply to the ARP request, the client will send a DHCPDECLINE message to the server and restart the configuration process by going into the Requesting state.

DHCPINFORM

If a client has obtained a network address through some other means or has a manually configured IP address, a client workstation may use a DHCPINFORM request message to obtain other local configuration parameters, such as the domain name and Domain Name Servers (DNSs). DHCP servers receiving a DHCPINFORM message construct a DHCPACK message with any local configuration parameters appropriate for the client without allocating a new IP address. This DHCPACK will be sent unicast to the client.

DHCPRELEASE

A DHCP client may choose to relinquish its lease on a network address by sending a DHCPRELEASE message to the DHCP server. The client identifies the lease to be released by the use of the client identifier field and network address in the DHCPRELEASE message. If you need to extend the current DHCP pool range, remove the current pool of addresses and specify the new range of IP addresses under the DHCP pool. In order to remove specific IP addresses or a range of addresses that you want to be in the DHCP pool, use the command ip dhcp excluded-address.

Note: If devices use BOOTP, infinite length leases are shown in the DHCP bindings of routers.

Renewing the Lease

Since the IP address is only leased from the server, the lease must be renewed from time to time. When one half of the lease time has expired (T1=0.5 x LT), the client will try to renew the lease. The client enters the Renewing state and sends a DHCPREQUEST message to the server, which holds the current lease. The sever will reply to the request to renew with a DHCPACK message if it agrees to renew the lease. The DHCPACK message will contain the new lease and any new configuration parameters, in the event that any changes are made to the server during the time of the previous lease. If the client is unable to reach the server holding the lease for some reason, it will attempt to renew the address from any DHCP server after the original DHCP server has not responded to the renewal requests within a time T2. The default value of T2 is ( 7/8 x LT). This means T1 < T2< LT.

If the client previously had a DHCP assigned IP address and it is restarted, the client will specifically request the previously leased IP address in a DHCPREQUEST packet. This DHCPREQUEST will still have the source IP address as 0.0.0.0, and the destination as the IP broadcast address 255.255.255.255.

A client sending a DHCPREQUEST during a reboot must not fill in the server indentifier field, and must instead fill in the requested IP address option field. Strictly RFC compliant clients will populate the ciaddr field with the address requested instead of the DHCP option field. The DHCP server will accept either method. The behavior of the DHCP server depends on a number of factors, such as in the case of Windows NT DHCP servers, the version of the operating system being used, as well as other factors, such as superscoping. If the DHCP server determines that the client can still use the requested IP address, it will either remain silent or send a DHCPACK for the DHCPREQUEST. If the server determines that the client cannot use the requested IP address, it will send a DHCPNACK back to the client. The client will then move to the Initializing state, and send a DHCPDISCOVER message.

Note: The DHCP server assigns the bottom IP address from a pool of IP addresses to the DHCP clients. When the lease of the bottom address expires, it is assigned to another client if it is requested. You cannot make any changes in the order DHCP addresses are assigned.

DHCP Packet

The DHCP message is variable in length and consists of fields listed in the table below.

Note: This packet is a modified version of the original BootP packet.

Field Bytes Name Description
op 1 OpCode Identifies the packet as an request or reply: 1=BOOTREQUEST, 2=BOOTREPLY
htype 1 Hardware Type Specifies the network hardware address type.
hlen 1 Hardware Length Specifies the length hardware address length.
hops 1 Hops The client sets the value to zero and the value increments if the request is forwarded across a router.
xid 4 Transaction ID A random number that is chosen by the client. All DHCP messages exchanged for a given DHCP transaction use the ID (xid).
secs 2 Seconds Specifies number of seconds since the DHCP process started.
flags 2 Flags Indicates whether the message will be broadcast or unicast.
ciaddr 4 Client IP address Only used when client knows its IP address as in the case of the Bound, Renew, or Rebinding states.
yiaddr 4 Your IP address If the client IP address is 0.0.0.0, the DHCP server will place the offered client IP address in this field.
siaddr 4 Server IP address If the client knows the IP address of the DHCP server, this field will be populated with the DHCP server address. Otherwise, it is used in DHCPOFFER and DHCPACK from DHCP server.
giaddr 4 Router IP address (GI ADDR) The Gateway IP address, filled in by the DHCP/BootP Relay Agent.
chaddr 16 Client MAC address The DHCP client MAC address.
sname 64 Server name The optional server host name.
file 128 Boot file name The boot file name.
options variable Option parameters The optional parameters that can be provided by the DHCP server. RFC 2132 gives all possible options.

Client-Server Conversation for Client Obtaining DHCP Address Where Client and DHCP Server Reside on Same Subnet

Packet Description Source MAC Addr Destination MAC Addr Source IP Addr Destination IP Addr
DHCPDISCOVER Client Broadcast 0.0.0.0 255.255.255.255
DHCPOFFER DHCPServer Broadcast DHCPServer 255.255.255.255
DHCPREQUEST Client Broadcast 0.0.0.0 255.255.255.255
DHCPACK DHCPServer Broadcast DHCPServer 255.255.255.255

Role of DHCP/BootP Relay Agent

Routers, by default, will not forward broadcast packets. Since DHCP client messages use the destination IP address of 255.255.255.255 (all Nets Broadcast), DHCP clients will not be able to send requests to a DHCP server on a different subnet unless the DHCP/BootP Relay Agent is configured on the router. The DHCP/BootP Relay Agent will forward DHCP requests on behalf of a DHCP client to the DHCP server. The DHCP/BootP Relay Agent will append its own IP address to the source IP address of the DHCP frames going to the DHCP server. This allows the DHCP server to respond via unicast to the DHCP/BootP Relay Agent. The DHCP/BootP Relay Agent will also populate the Gateway IP address field with the IP address of the interface on which the DHCP message is received from the client. The DHCP server uses the Gateway ip address field to determine the subnet from which the DHCPDISCOVER, DHCPREQUEST, or DHCPINFORM message originates.

Configuring DHCP/BootP Relay Agent Feature on Cisco IOS Router

Configuring a Cisco router to forward BootP or DHCP requests is simple - configure an IP helper-address pointing to the DHCP/BootP server, or pointing to the subnet broadcast address of the network the server is on. For example, consider the following network diagram:

To forward the BootP/DHCP request from the client to the DHCP server, the ip helper-address interface command is used. The IP helper-address can be configured to forward any UDP broadcast based on UDP port number. By default, the IP helper-address will forward the following UDP broadcasts:

  • Trivial File Transfer Protocol (TFTP) (port 69)

  • DNS (port 53), time service (port 37)

  • NetBIOS name server (port 137)

  • NetBIOS datagram server (port 138)

  • Boot Protocol (DHCP/BootP) client and server datagrams (ports 67 and 68)

  • Terminal Access Control Access Control System (TACACS) service (port 49)

  • IEN-116 name service (port 42)

IP helper-addresses can direct UDP broadcasts to a unicast or broadcast IP address. However, it is not recommended to use the IP helper-address to forward UDP broadcasts from one subnet to the broadcast address of another subnet, due to the large amount of broadcast flooding that may occur. Multiple IP helper-address entries on a single interface are supported as well, as shown below:

Cisco routers do not support load balancing of DHCP servers that are configured as DHCP Relay Agents. Cisco routers forward the DHCPDISCOVER message to all the helper addresses mentioned for that interface. Having two or more DHCP servers to serve a subnet only increases the DHCP traffic as the DHCPDISCOVER, DHCPOFFER, and DHCPREQUEST / DHCPDECLINE messages are exchanged between each pair of DHCP client and server.

Setting Manual Bindings

There are two ways to set up manual bindings; one is for the Windows host, and the other is for non-Windows hosts. There are two different commands used to configure; one is for Microsoft DHCP clients, and the other is for non-Microsoft DHCP clients:DHCP client-identifier (manual binding - Microsoft DHCP clients) and DHCP hardware-address (manual binding - non-Microsoft DHCP clients). The reason for two different commands is that a PC that runs with Windows modifies its MACs, and a 01 is added at the beginning of the address. These are the sample configurations:

  • The following is the configuration for Microsoft DHCP clients

  • The following is the configuration for non-Microsoft DHCP clients

How to make DHCP Work on Secondary IP Segments

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. DHCP traffic uses the broadcast address. When the DHCP request is received by the router interface, it forwards it to the DHCP server (when IP helper-address is configured) with a source address of the primary IP configured on the interface to let the DHCP server know which IP pool it must use (for the client) in the DHCP reply packet.

There is no way for the router to know if the DHCP broadcast request comes from a device that is on the secondary IP network configured on the interface. As a workaround, sub-interface configuration (provided that the device connected to the router supports dot1q tagging) to separate the two subnets can be configured, so both of them get their correspondent IP addresses properly.

If the secondary address is the preferred way, there is another workaround, which is to enable the global configuration command ip dhcp smart-relay. This has a limitation in that it only uses the secondary IP to relay the DHCP request if there is no response from the DHCP server after three consecutive requests for the primary address pool.

DHCP Client-Server Conversation with DHCP Relay Function

The table below illustrates the process for a DHCP client to obtain an IP address from a DHCP server. This table is modeled after the network diagram above. Each numerical value in the diagram represents a packet that is described below. This table is a point of reference for understanding the packet flow of DHCP client-server conversation. This table is also useful for determining where DHCP problems may be occurring.

Packet Client IP Address Server IP Address GI Address Packet Source MAC Address Packet Source IP Address Packet Destination MAC Address Packet Destination IP Address
1. DHCPDISCOVER is sent from client. 0.0.0.0 0.0.0.0 0.0.0.0 0005.DCC9.C640 0.0.0.0 ffff.ffff.fffff (broadcast) 255.255.255.255
2. The router receives the DHCPDISCOVER on the E1 interface. The router recognizes that this packet is a DHCP UDP broadcast. The router will now act as a DHCP/BootP Relay Agent and fill in the Gateway IP address field with the incoming interface IP address, change the source IP address to an incoming interface IP address, and forward the request directly to the DHCP server. 0.0.0.0 0.0.0.0 192.168.1.1 Interface E2 MAC Address 192.168.1.1 MAC Address of DHCP Server 192.168.2.2
3. The DHCP server has received the DHCPDISCOVER and is sending a DHCPOFFER to the DHCP Relay Agent. 192.168.1.2 192.168.2.2 192.168.1.1 MAC Address of DHCP Server 192.168.2.2 Interface E2 MAC Address 192.168.1.1
4. The DHCP Relay Agent receives a DHCPOFFER, and will forward the DHCPOFFER broadcast on the local LAN. 192.168.1.2 192.168.2.2 192.168.1.1 Interface E1 MAC Address 192.168.1.1 ffff.ffff.ffff (broadcast) 255.255.255.255
5. DHCPREQUEST sent from client. 0.0.0.0 0.0.0.0 0.0.0.0 0005.DCC9.C640 0.0.0.0 ffff.ffff.fffff (broadcast) 255.255.255.255
6. The router receives the DHCPREQUEST on the E1 Interface. The router recognizes that this packet is DHCP UDP broadcast. The router will now act as a DHCP Relay Agent and fill in the Gateway IP address field with the incoming interface IP Address, change the source IP address to an incoming interface IP address, and forward the request directly to the DHCP server. 0.0.0.0 0.0.0.0 192.168.1.1 Interface E2 MAC Address 192.168.1.1 MAC Address of DHCP Server 192.168.2.2
7. The DHCP server has received the DHCPREQUEST and is sending a DHCPACK to the DHCP/BootP Relay Agent. 192.168.1.2 192.168.2.2 192.168.1.1 MAC Address of DHCP Server 192.168.2.2 Interface E2 MAC Address 192.168.1.1
8. The DHCP/BootP Relay Agent receives the DHCPACK, and will forward the DHCPACK broadcast on the local LAN. The client will accept the ACK and use the client's IP address. 192.168.1.2 192.168.2.2 192.168.1.1 Interface E1 MAC Address 192.168.1.1 ffff.ffff.ffff (broadcast) 255.255.255.255

Pre-Execution Enviroment (PXE) Bootup DHCP Considerations

Pre-Execution Environment (PXE) allows a workstation to boot from a server on a network prior to booting the operating system on the local hard drive. A network administrator does not have to physically visit the specific workstation and manually boot it. Operating systems and other software, such as diagnostic programs, can be loaded onto the device from a server over the network. PXE environment uses DHCP to configure it's IP address.

The DHCP/BootP Relay Agent configuration must be done on the router if the DHCP server is located on another routed segment of the network. The ip helper-address command on the local router interface must be configured. Refer to the Configuring DHCP/BootP Relay Agent Feature on Cisco IOS Router section of this document for configuration information.

Understanding and Troubleshooting DHCP Using Sniffer Traces

Mac Manual Dhcp Connection Problems

Decoding Sniffer Trace of DHCP Client and Server on Same LAN Segment

The sniffer trace below is comprised of six frames. These six frames illustrate a working scenario for DHCP, where the DHCP client and server reside on the same physical or logical segment. When troubleshooting DHCP, it is important to match your sniffer trace to the traces below. There may be some differences compared to the traces below, but the general packet flow should be exactly the same. The packet trace follows previous discussions of how DHCP works.

Decoding Sniffer Trace of DHCP Client and Server Separated by a Router that is Configured as a DHCP Relay Agent

Sniffer-B Trace

Sniffer-A Trace

Troubleshooting DHCP when Client Workstations are Unable to Obtain DHCP Addresses

Case Study #1: DHCP Server on Same LAN Segment or VLAN as DHCP Client

When the DHCP server and client reside on the same LAN segment or VLAN and the client is unable to obtain an IP address from a DHCP server, it is unlikely that the local router is causing a DHCP problem. The problem is most likely related to the devices that connect the DHCP server and DHCP client. However, the problem may be with the DHCP server or client itself. Following the troubleshooting modules below should determine what device is causing the issue.

Note: To configure the DHCP server on a per vlan basis, define different DHCP pools for every VLAN serving DHCP addresses to your clients.

Case Study #2: DHCP Server and DHCP Client are Separated by a Router Configured for DHCP/BootP Relay Agent Functionality

When the DHCP server and client reside on the different LAN segments or VLANs, the router functioning as a DHCP/BootP Relay Agent is responsible for forwarding the DHCPREQUEST to the DHCP server. Additional troubleshooting steps are required to troubleshoot the DHCP/BootP Relay Agent, as well as the DHCP server and client. Following the troubleshooting modules below should determine which device is causing the issue.

DHCP Server on Router Fails to Assign Adresses with a POOL EXHAUSTED Error

It is possible that some addresses are still held by clients, even if they are released from the pool. This can be verified by the show ip dhcp conflict output. An address conflict occurs when two hosts use the same IP address. At the address assignment, the DHCP checks for conflicts with ping and gratuitous ARP.

If a conflict is detected, the address is removed from the pool. The address is assigned until the administrator resolves the conflict. Configure no ip dhcp conflict logging to resolve this issue.

DHCP Troubleshooting Modules

Understanding Where DHCP Problems Can Occur

DHCP problems can arise due to a multitude of reasons. The most common reasons are configuration issues. However, many DHCP problems can be caused by software defects in operating systems, Network Interface Card (NIC) drivers, or DHCP/BootP Relay Agents running on routers. Due to the number of potentially problematic areas, a systematic approach to troubleshooting is required.

Short List of Possible Causes of DHCP Problems:

  • Catalyst switch default configuration

  • DHCP/BootP Relay Agent configuration

  • NIC compatibility issue or DHCP feature issue

  • Faulty NIC or improper NIC driver installation

  • Intermittent network outages due to frequent spanning tree computations

  • Operating system behavior or software defect

  • DHCP server scope configuration or software defect

  • Cisco Catalyst switch or IOS DHCP/BootP Relay Agent software defect

  • Unicast Reverse Path Forwarding (uRPF) check failing because the DHCP offer is received on a different interface than expected. When the Reverse Path Forwarding (RPF) feature is enabled on an interface, a Cisco router can drop Dynamic Host Configuration Protocol (DHCP) and BOOTstrap Protocol (BOOTP) packets that have source addresses of 0.0.0.0 and destination addresses of 255.255.255.255. The router can also drop all IP packets that have a multicast IP destination at the interface. This issue is documented in CSCdw31925 (registered customers only) .

  • DHCP database agent is not used, but DHCP conflict logging is not disabled

This document will use troubleshooting modules below to determine the root cause, as indicated in the list above.

Mac Manual Dhcp Connection

A. Verify Physical Connectivity

This procedure is applicable to all case studies.

First, verify physical connectivity of a DHCP client and server. If connected to a Catalyst switch, verify that both the DHCP client and server have physical connectivity.

For Catalyst CatOS switches such as the 2948G, 4000, 5000, and 6000 series switches, use the show port <mod#>/<port_range> command to note the port status. If the port status is anything other than connected, the port will not pass any traffic, including DHCP client requests. The output from the commands is as follows:

For IOS based switches such as the Catalyst 2900XL/3500XL/2950/3550, the equivalent command to show port status is show interface <interface>. If the state of the interface is anything other than <interface> is up, line protocol is up, the port will not pass traffic, including DHCP client requests. The output from the commands is as follows:

If the physical connection has been verified and there is indeed no link between the Catalyst switch and DHCP client, consult the Troubleshooting Cisco Catalyst Switches to NIC Compatibility Issues document for additional troubleshooting in regards to the physical layer connectivity issue.

Mac Manual Dhcp Connection

Excessive data link errors cause ports on some Catalyst switches to go into an errdisabled state. Refer to Recovering From errDisable Port State on the CatOS Platforms and Errdisable Port State Recovery on the Cisco IOS Platforms, which describe the errdisable state, explain how to recover from it, and provide examples of recovery from this state.

B. Test Network Connectivity by Configuring Client Workstation with Static IP Address

This procedure is applicable to all case studies.

When troubleshooting any DHCP Issue, it is important to verify network connectivity by configuring a static IP address on a client workstation. If the workstation is unable to reach network resources despite having a statically configured IP address, the root cause of the problem is not DHCP. At this point, network connectivity troubleshooting is required.

C. Verify Issue as a Startup Problem

This procedure is applicable to all case studies.

If the DHCP client is unable to obtain an IP address from the DHCP server on startup, attempt to obtain an IP address from the DHCP server by manually forcing the client to send a DHCP request. Issue the following steps to manually obtain an IP address from a DHCP server for the operating systems listed below.

Microsoft Windows 95/98/ME: Click the Start button, and run the WINIPCFG.exe program. Click the Release All button, followed by the Renew All button. Is the DHCP client now able to obtain an IP address?

Microsoft Windows NT/2000: Open a command prompt window by typing cmd in the Start/Run field. Issue the command ipconfig/renew in the command prompt window, as shown below. Is the DHCP client now able to obtain an IP Address?

If the DHCP client is able to obtain an IP address by manually renewing the IP address after the PC has completed the bootup process, the issue is most likely a DHCP startup issue. If the DHCP client is attached to a Cisco Catalyst switch, the problem is most likely due to a configuration issue dealing with STP portfast and/or channeling and trunking. Other possibilities include NIC card issues and switch port startup issues. Troubleshooting Steps D and E should be reviewed to rule out switch port configuration and NIC card issues as the root cause of the DHCP problem.

D. Verify Switch Port Configuration (STP Portfast and Other Commands)

If the switch is a Catalyst 2900/4000/5000/6000, verify that the port has STP portfast enabled and trunking/channeling disabled. The default configuration is STP portfast disabled and trunking/channeling auto, if applicable. For the 2900XL/3500XL/2950/3550 switches, STP portfast is the only required configuration. These configuration changes resolve the most common DHCP client issues that occur with an initial installation of a Catalyst switch.

For more documentation regarding the necessary switch port configuration requirements for DHCP to operate properly when connected to Catalyst switches, please review the following document:

After reviewing the configuration guidelines in the document above, return to this document for additional troubleshooting.

E. Check for Known NIC Card or Catalyst Switch Issues

If the Catalyst switch configuration is correct, it is possible that a software compatibility issue may exist on the Catalyst switch or DHCP client's NIC that could be causing DHCP issues. The next step in troubleshooting is to review the following document and rule out any software issues with the Catalyst switch or NIC that may be contributing to the problem:

Knowledge of the DHCP client's operating system as well as specific NIC information such as the manufacturer, model, and driver version will be needed to properly rule out any compatibility issues.

F. Distinguishing whether DHCP Clients Obtain IP Address on the Same Subnet or VLAN as DHCP Server

It is important to distinguish whether or not DHCP is functioning correctly when the client is on same subnet or VLAN as the DHCP server. If the DHCP is working correctly on the same subnet or VLAN as the DHCP server, the DHCP issue may be with the DHCP/BootP Relay Agent. If the problem persists even with testing DHCP on the same subnet or VLAN as the DHCP server, the problem may actually be with the DHCP server.

G. Verify Router DHCP/BootP Relay Configuration

Issue the steps below to verify the configuration:

  1. When configuring DHCP relay on a router, verify that the ip helper-address command is located on the correct interface. The ip helper-address command must be present on the inbound interface of the DHCP client workstations and must be directed to the correct DHCP server.

  2. Verify that the global configuration command no service dhcp is not present. This configuration parameter will disable all DHCP server and relay functionality on the router. The default configuration, service dhcp, will not appear in the configuration, and is the default configuration command. If the service dhcp is not enabled, the clients do not receive the IP addresses from the DHCP server.

    Note: In routers that run older Cisco IOS releases, the ip bootp server command handles the DHCP relay agent function instead of the service dhcp command. Because of this, the ip bootp server command needs to be enabled in these routers if the ip helper-address command is configured to forward DHCP UDP broadcasts and properly act as a DHCP relay agent on behalf of the DHCP client.

  3. When applying ip helper-address commands to forward UDP broadcasts to a subnet broadcast address, verify that no ip directed-broadcast is not configured on any outbound interface that the UDP broadcast packets needs to traverse. The no ip directed-broadcast will block on any translation of a directed broadcast to physical broadcasts. This interface configuration is default configuration in software versions 12.0 and higher.

  4. Forwarding DHCP broadcasts to the DHCP server's subnet broadcast address is an occasional software issue. When troubleshooting DHCP, always attempt to forward DHCP UDP broadcasts to the DHCP server's IP address, as shown below:

H. Subscriber Identification (82) Option Turned On

The DHCP relay agent information (option 82) feature enables the DHCP relay agents (Catalyst switches) to include information about itself and the attached client when it forwards DHCP requests from a DHCP client to a DHCP server.

The DHCP server can use this information to assign IP addresses, perform access control, and set quality of service (QoS) and security policies (or other parameter-assignment policies) for each subscriber of a service-provider network.

When DHCP snooping is enabled on a switch, it automatically enables option 82.

If the DHCP server is not configured to handle the packets with option 82, it ceases to allocate the address to that request.

In order to resolve this issue, disable the subscriber identification option (82) in the switches (relay agents) with the global configuration command, no ip dhcp relay information option.

I. DHCP Database Agent and DHCP Conflict Logging

A DHCP database agent is any host—for example, an FTP, TFTP, or RCP server—that stores the DHCP bindings database. You can configure multiple DHCP database agents, and you can configure the interval between database updates and transfers for each agent. Use the ip dhcp database command to configure a database agent and database agent parameters.

If you choose not to configure a DHCP database agent, disable the recording of DHCP address conflicts on the DHCP server. Execute the no ip dhcp conflict logging command to disable the DHCP address conflict logging. Clear the previously logged conflicts with clear ip dhcp conflict.

If this fails to disable the conflict logging, this error message appears:

J. Check CDP for IP Phone Connections

When the switchport that is connected to the Cisco IP phone has Cisco Discovery Protocol (CDP) disabled, the DHCP server cannot assign an appropriate IP address to the phone. The DHCP server tends to assign the IP address that belongs to the data VLAN / subnet of the switchport. 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. There are no explicit steps required to bind the dhcp service to the voice vlan.

K. Removing Down SVI Disrupts DHCP Snooping Operation

On the Cisco Catalyst 6500 series switches, an SVI (in shutdown state) is created automatically after it configures the DHCP to snoop for a particular VLAN. The presence of this SVI has direct implications on the correct operation of DHCP snooping.

DHCP snooping on the Cisco Catalyst 6500 series switches that run Native IOS is implemented mostly on Route Processor (RP or MSFC), not on Switch Processor (SP or Supervisor). The Cisco Catalyst 6500 series intercepts packets in hardware with VACLs that supply the packets to a Local Target Logic (LTL) subscribed to by the RP. Once the frames enter the RP, they first need to be associated with an L3 Interface (SVI) IDB before they can be passed off to the snooping part. Without an SVI, this IDB does not exist, and the packets get dropped in the RP.

L. Limited Broadcast Address

When a DHCP client sets the broadcast bit in a DHCP packet, the DHCP server and relay agent send DHCP messages to clients with the all-ones broadcast address (255.255.255.255). If the ip broadcast-address command has been configured to send a network broadcast, the all-ones broadcast sent by DHCP is overridden. In order to remedy this situation, use the ip dhcp limited-broadcast-address command to ensure that a configured network broadcast does not override the default DHCP behavior.

Some DHCP clients can only accept an all-ones broadcast and are not able to acquire a DHCP address unless this command is configured on the router interface connected to the client.

M. Debugging DHCP Using Router debug Commands

Verify Router is Receiving DHCP Request Using debug Commands

On routers that support software processing of DHCP packets, you can verify whether a router is receiving the DHCP request from the client. The DHCP process will fail if the router is not receiving requests from the client. This troubleshooting step involves configuring an access-list for debugging output. This access-list is for debugging purposes only and is not intrusive to the router.

In global configuration mode, enter the following access-list:

access-list 100 permit ip host 0.0.0.0 host 255.255.255.255

In exec mode, enter the following debug command:

debug ip packet detail 100

Sample output:

From the output above, it is clear that the router is receiving the DHCP requests from the client. This output only shows a summary of the packet and not the packet itself. Therefore, it is not possible to determine if the packet is correct. Nevertheless, the router did receive a broadcast packet with the source and destination IP and UDP ports that are correct for DHCP.

Verify Router is Receiving DHCP Request and Forwarding Requests to DHCP Server Using debug Commands

Additional entries in the access-list can be added to see if the router is communicating successfully with the DHCP server. Again, these debugs do not look into the packet, but you can confirm whether or not the DHCP relay agent is forwarding requests to the DHCP server.

In global configuration mode, create the following access-list:

access-list 100 permit ip host 0.0.0.0 host 255.255.255.255

access-list 100 permit udp host <dhcp_relay_agent> host <dhcp_server> eq 67

access-list 100 permit udp host <dhcp_server> host <dhcp_relay_agent> eq 67

For example:

access-list 100 permit ip host 0.0.0.0 host 255.255.255.0

access-list 100 permit udp host 192.168.1.1 host 192.168.2.2 eq 67

access-list 100 permit udp host 192.168.1.1 host 192.168.2.2 eq 68

access-list 100 permit udp host 192.168.2.2 host 192.168.1.1 eq 67

access-list 100 permit udp host 192.168.2.2 host 192.168.1.1 eq 68

In exec mode, enter the following debug command:

From the output above, it is clear that the router is receiving the DHCP requests from the client and forwarding the request, per the DHCP/BootP Relay Agent configuration, to the DHCP server. The DHCP server also replied directly to the DHCP/BootP Relay Agent. This output only shows a summary of the packet and not the packet itself. Therefore, it is not possible to determine if the packet is correct or whether the server is replying with a DHCPNAK. Nevertheless, the router did receive a broadcast packet with the source and destination IP and UDP ports that are correct for DHCP, and there is two-way communication with the DHCP server.

Verify Router is Receiving and Forwarding DHCP Request Using debug ip udp Command

The debug ip udp command can be used to trace the path of a DHCP request through a router. However, this debug is intrusive in a production environment, since all processed switched UDP packets will be displayed to the console. This debug should not be used in production.

Warning: The debug ip udp command is intrusive, and may cause high Central Processing Unit (CPU) utilization.

In exec mode, enter the following debug command:

debug ip udp

Sample output:

Verify Router is Receiving and Forwarding DHCP Request Using debug ip dhcp server packet Command

If the router IOS is 12.0.x.T or 12.1 and supports the IOS DHCP server functionality, additional debugging can be done using the debug ip dhcp server packet command. This debug was intended for use with the IOS DHCP server feature, but can be used for troubleshooting the DHCP/BootP Relay Agent feature as well. As with the previous troubleshooting steps, router debugs do not provide an exact determination of the problem since the actual packet cannot be viewed. However, debugs do allow inferences to be made regarding DHCP processing.

In exec mode, enter the following debug command:

debug ip dhcp server packet

Running Multiple Debugs Simultaneously

When running multiple debugs simultaneously, a fair amount of information can be discovered regarding the operation of the DHCP/BootP Relay Agent and server. Using the above troubleshooting outlines, you can make inferences about where the DHCP/BootP Relay Agent functionality may not be operating correctly.

Obtain Sniffer Trace and Determine Root Cause of DHCP Problem

Using router debugging techniques will not always determine the exact root cause of a DHCP problem. The ultimate step in resolving a DHCP issue is to obtain a sniffer trace and note where the process is not functioning correctly. DHCP packet traces can be deciphered by referencing the Decoding Sniffer Trace of DHCP Client and Server on Same LAN Segment and Decoding Sniffer Trace of DHCP Client and Server Separated by Router Configured as a DHCP Relay Agent sections of this document.

For information on obtaining sniffer traces using the Switched Port Analyzer (SPAN) feature on Catalyst switches, refer to the following document:

  • Configuring the Catalyst Switched Port Analyzer (SPAN).

Alternative Method of Packet Decoding Using debug on Router

By using the

debug ip packet detail dump <acl> command on a Cisco router, it is possible to get an entire packet in hex displayed in the system log or Command Line Interface (CLI). Using the Verify Router is Receiving DHCP Request Using debug Commands and Verify Router is Receiving DHCP Request and Forwarding Request to DHCP Server Using debug Commands sections above, along with the dump keyword added to the access-list, will provide the same debug information, but with the packet detail in hex. To determine the contents of the packet, the packet will need to translated. An example is given in Appendix A.

Keywords Entered after the ip dhcp pool command option {option_number} ASCII are in Double Quotes

A Cisco router with a DHCP option with the option number configured can encounter a failure if it tries to parse the URL because any keywords entered after the ip dhcp pool command option option number ASCII are in double quotes after the router is reloaded. This behavior is seen on devices that run the IOS 12.4(17a), which is a known bug and is documented in CSCsk96976 (registered customers only) .

This issue is resolved in IOS versions 12.4(17b), 12.4(18a) and later, and 12.4(19)T1.

Appendix A: IOS DHCP Sample Configuration

The DHCP server database is organized as a tree. The root of the tree is the address pool for natural networks, branches are subnetwork address pools, and leaves are manual bindings to clients. Subnetworks inherit network parameters and clients inherit subnetwork parameters. Therefore, common parameters, for example the domain name, should be configured at the highest (network or subnetwork) level of the tree.

For more information on how to configure DHCP and the commands associated with it, refer to the following link:

Related Information

DHCP makes it simple to configure network access for your home network, and port forwarding makes it easy to those computers from anywhere. By configuring static DHCP on your router, you can combine the best of both worlds.

The Problem with DHCP and Port Forwarding

DHCP is great. You configure your router to automatically assign IP addresses and the computers on your network just plain work. Port forwarding is useful because you can access your router from outside of your network and be redirected to the computer you need inside of your network. The problem is that these two wonderful things rely on one premise: your internal IP addresses don’t change. If your router changes the IP that is assigned to a machine by DHCP, then you have to reconfigure Port Forwarding. Many programs try to get around this fact by offering Universal Plug and Play (UPnP) port forwarding features, but not everything does.

Newer routers often have the ability to remember which IP address was assigned to which computer, so if they disconnect and reconnect their IP doesn’t change. Often, though, a router reset will wipe this cache and start assigning IPs on a first-come, first-served basis. Tons of older routers don’t even have this ability, and immediately assign new IP addresses. With IP addresses changing, you have to reconfigure your port forwarding settings often, otherwise you may lose the ability to connect to your home computers.

You can do this on plenty of modern routers, but we’re going to use DD-WRT for this guide. We’ve touted DD-WRT’s ability many times before, and it’s not for nothing. This amazing custom router firmware has a solution to this mess: static DHCP, also known as DHCP reservation. While configuring your router for DHCP, you have the ability to enter the MAC addresses of your computers’ network cards and enter which IP address to assign them. DD-WRT will automatically take care of the rest! If you have a different router, you can try following along using your router’s own admin page–the instructions should be somewhat similar.

Finding Your MAC Address

The only real work you’ll have to do is find the MAC address of each computer’s attached networking card. If you’re using wireless then you should find the MAC of your wireless card, and if you’re wired then use the Ethernet card.

Just go down to the icon in your system tray for your connection and click it. Mine is wireless.

Right-click on your current active connection and click on Status.

Click on the “Details…” button.

Your MAC address for this device is listed as “Physical Address.”

OS X users can check under their System Settings and click on Network. If you click on the various tabs for your connection, you should find a “Physical ID,” “Ethernet ID,” or “MAC Address.” Ubuntu users can type “ifconfig” in Terminal. You’ll see various network adapters, each displaying its own hardware address. Do this for all of the computers in your network that you need port forwarding for. The others will just get their IPs assigned automatically by DHCP.

DD-WRT and Static DHCP

Mac dhcp release

Now that you have a list of MAC addresses for each of your computers, open up a browser tab and head over to your router’s DD-WRT interface. Click on Setup, and under Basic Setup, make sure DHCP is turned on.

Scroll down to “Network Address Server Settings (DHCP)” and make a note of the starting IP address and the maximum number of users. The addresses you configure should fall within this range. Here, my range of IPs would be 192.168.1.100 – 192.168.1.114.

Now, click on the Services tab up top.

Under the DHCP Server section, you can see that there’s a list of “Static Leases” click on the Add button to add a new one.

Enter the MAC address of each computer, give each one a name so you know which is which, and then assign them an IP address. You won’t be able to add the same IP address to two different MAC address, so make sure each MAC has a unique IP. If your version of DD-WRT also has a space to enter the “Client Lease Time,” a safe setting would 24 hours, or 1440 minutes.

That’s it! Be sure to click on both the Save button and the Apply Settings button, and wait for the changes to take effect. The settings should automatically change when each computer’s lease expires, though you can reconnect from each computer if you want the changes to take effect immediately.

Now, whether your computer loses its connect, the router gets power cycled, or the DHCP lease expires, each computer you entered into the list will stick to its assigned IP. Furthermore, you won’t have to manually configure static IPs on each machine! Port forwarding won’t have to be a pain ever again.

Does your router support DHCP reservations? Do you have a more clever use for this system? Share your thoughts in the comments!

READ NEXT
  • › How to Enable Google Chrome’s New Extensions Menu
  • › How to Stop Spammers From Attacking Your Google Calendar
  • › How to Power Off Your Samsung Galaxy Note 10 or 10 Plus
  • › How to Switch from a Windows PC to a Mac
  • › Want to Survive Ransomware? Here’s How to Protect Your PC