Configuration Guide
IP Service Configuration
DHCP Server Configuration
11 min
introduction introduction 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 explanation of principles explanation of principles 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 ip address acquisition process ip address acquisition process the dhcp process involves the following fundamental stages 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 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 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 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 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 configuring the device as a dhcp server configuring the device as a dhcp server dhcp server configuration dhcp server configuration 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 | interface vlan vlan id dhcp select server configuring dhcp option configuring dhcp option 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 create a dhcp client classification group define a group that will classify dhcp clients based on specific criteria, such as option 93 dhcp class \<name> if match rule \<id> option 93 hex \<value> 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 dhcp option group \<id> option 43 hex \<hex value> example to configure a tftp server tftp server \<ip address> 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 dhcp pool \<name> class \<name> option group \<id> configuring the device as a dhcp client configuring the device as a dhcp client 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
