Before a device can function as a DHCP server, you must enable DHCP. You can then enable the DHCP server function to operate based on an interface address pool or based on a global address pool.
Procedure
Enable the DHCP server function based on an interface address pool.
By default, the DHCP server function using the interface address pool is disabled on an interface
If the device functioning as the DHCP server provides the DHCP service for clients connected to multiple interfaces, repeat this step to enable the DHCP server function on all the interfaces.
Enable the DHCP server function based on a global address pool.
The device can select a global address pool based on the primary and secondary IP addresses of an interface only in scenarios where the DHCP server and DHCP clients are on the same network segment.
When clients connected to the interface configured with an IP address request IP addresses:
If the DHCP client and server are located in the same network segment (that is, no relay agent is deployed), the DHCP server selects the address pool based on the primary and secondary interface IP addresses. It preferentially allocates IP addresses from the address pool for the primary IP address. If IP addresses in this address pool are used up or this address pool is not configured, the DHCP server allocates IP addresses from the address pool for the secondary IP address.
If the DHCP server and client are located in different network segments (that is, a DHCP relay agent is used), the DHCP server selects the address pool in the same network segment as the IP address specified in the giaddr field of the received DHCP Request message.
Enable the interface to use the global address pool for providing the DHCP server function. (This step is optional if a DHCP relay agent is used.)