---
title: DHCP Server Configuration
slug: enterprise-v6p1/dhcp-server-configuration
createdAt: 2025-12-05T06:54:36.155Z
---

# <font color="#1d50a2">Introduction</font>

The Dynamic Host Configuration Protocol (DHCP) is a technology used for centralized management and configuration of user IP addresses. Following the RFC 2131 standard, DHCP operates in a client/server communication model, where DHCP clients send requests to DHCP servers. These servers allocate IP addresses to clients with a designated usage period known as the lease time.

This allocation mechanism is suitable for scenarios involving hosts that require temporary network access or cases where the total number of network hosts is substantial, and the available addresses are limited. It is especially useful when hosts do not need a permanent network connection.

# <font color="#1d50a2">Explanation of Principles</font>

A typical DHCP network setup involves three primary roles:

- **DHCP Server**

The DHCP server is responsible for selecting an IP address from an available address pool and assigning it to a DHCP client. Additionally, it can provide other network parameters such as the default gateway address, DNS server addresses, and WINS server addresses. The DHCP server can handle DHCP request packets within its local subnet as well as DHCP request packets forwarded across subnets through DHCP relays.

- **DHCP Client**

The DHCP client actively sends DHCP request packets using the BOOTP or DHCP protocol to obtain an IP address and other network parameters. Typical DHCP clients include devices like IP phones, personal computers, mobile phones, diskless workstations, and more.

- **DHCP Relay**

When a DHCP client broadcasts a request packet, DHCP servers within the same subnet can receive and process these requests. However, if the DHCP client and the DHCP server are not within the same subnet, the DHCP server will not directly receive the client's request. In such cases, a DHCP relay is used to forward the DHCP packets. Unlike traditional IP packet forwarding, the DHCP relay receives DHCP request or response packets, reconstructs new DHCP unicast packets, and forwards them through the Layer 3 network.

::Image[]{src="https://app.archbee.com/api/optimize/zl-MD6bX0o2Ab3p8w66u1/7OeEr3oO-dJ4Kqcys2QFv-20251202-104910.png" size="70" width="656" height="182" position="center" showCaption="false"}

## <font color="#1d50a2">IP Address Acquisition Process</font>

The DHCP process involves the following fundamental stages:

1. Discovery and Request Stage:

When a device (DHCP client) joins a network or requires reconfiguration of network information, it broadcasts a DHCP Discover message to all devices in the local network. This message is sent to locate available DHCP servers.

2. Offer and Selection Stage:

After one or more DHCP servers within the network receive the DHCP Discover message, they respond with a DHCP Offer broadcast message. This message contains available IP addresses, lease durations, subnet masks, default gateways, and other configuration details.

3. Request and Acknowledgment Stage:

Upon receiving multiple DHCP Offer messages, the DHCP client typically chooses one of them and sends a DHCP Request broadcast message to the chosen server. This indicates the client's acceptance of the offered configuration from that specific server.

4. Acknowledgment and Lease Stage:

Upon receiving the DHCP Request message from the client, the DHCP server sends a DHCP Acknowledgment broadcast message to confirm the allocation of the IP address and other configuration details. This confirms that the client has successfully acquired the network configuration.

5. Renewal and Release:

Before the lease expires, the client attempts to renew the lease by contacting the DHCP server halfway through the lease duration. If the client no longer requires the configuration or leaves the network, it can send a DHCP Release message to relinquish the allocated IP address and configuration settings.

# <font color="#1d50a2">Configuring the Device as a DHCP Server</font>

## <font color="#1d50a2">DHCP Server Configuration</font>

| **Operation**                                                      | **Command**                                                                                            | **Description** |
| ------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | --------------- |
| Enter the system  configuration view                               | **configure  terminal**                                                                                |                 |
| Create  a DHCP address pool and enter the DHCP configuration view  | **dhcp pool** *name*                                                                                   |                 |
| Configure  the dynamic allocation subnet for the DHCP address pool | **network** *ip-address mask*                                                                          |                 |
| Specify  the IP address range for dynamic IP allocation            | **address-pool** i*p-address ip-address*                                                               |                 |
| Configure  the gateway for DHCP clients                            | **routers** *ip-address*                                                                               |                 |
| Configure  DNS addresses for DHCP clients                          | **dns** *ip-address*                                                                                   |                 |
| Set  the lease duration for dynamically allocated IP addresses     | **lease-time** *default-time max-time*                                                                 |                 |
| Configure  the TFTP server address for DHCP clients                | **tftp-server** *server-name*                                                                          |                 |
| Specify  the boot file name for DHCP clients                       | **bootfile-name** *bootfile*                                                                           |                 |
| Set  the next server IP address for DHCP clients                   | **next-server** *ip-address*                                                                           |                 |
| Bind  the DHCP server to the interfac                              | **interface  ethernet**  *id&#x20;*\| **interface vlan&#x20;***vlan-id*   <br />**dhcp select server** |                 |

## <font color="#1d50a2">Configuring DHCP Option</font>

The DHCP server can use the DHCP Option feature to recognize specific vendor information from the DHCP client's request packets. This allows the server to allocate customized network parameters based on the client's vendor or specific needs.

1. Create a DHCP Client Classification Group
   Define a group that will classify DHCP clients based on specific criteria, such as option 93

```text
dhcp class <name>
if-match rule <ID> option 93 hex <value>
```

2. Create an Option Group
   Define an option group that will hold the custom DHCP options for the classified clients.Set the required DHCP options within this option group.
   Example to configure Option 43 for custom vendor information:

```text
dhcp option-group <ID>
option 43 hex <hex-value>
```

Example to configure a tftp server:

```text
tftp-server <ip-address>
```

3. Apply the Option Group to the DHCP Client Classification Group
   Bind the option group to the DHCP client classification group, so that clients matching the classification receive the custom options.

```text
dhcp pool <name>
class <name> option-group <ID>
```

##

Once the device is configured as a DHCP client, it can obtain an IP address and other information from the DHCP server. However, if the IP address assigned by the DHCP server to the interface falls within the same subnet as the IP address of another interface on the device, the interface will not use that IP address.

| **Operation**                           | **Command**                                     | **Description** |
| --------------------------------------- | ----------------------------------------------- | --------------- |
| Enter the system  configuration view    | **configure  terminal**                         |                 |
| Enter the interface  configuration view | **interface  ethernet**    **interface  vlan**  |                 |
| Enable DHCP on the  interface           | **ip  address dhcp-alloc**                      |                 |

#

