Configuring a DHCP Server to Allocate IP Addresses to ClientsContextDHCP servers can allocate IP addresses to DHCP and BOOTP clients. Show
Creating an Address PoolContextAddress pools allow DHCP servers to allocate network parameters including IP addresses to clients. You can specify network parameters in an address pool, including an IP address range, gateway address, and the IP address of a DNS server. Address pools are classified into interface address pools and global address pools.
NOTE: Configuring interface address pools is recommended for scenarios where a DHCP server and clients reside on the same network segment. A DHCP server selects address pools according to the following rules:
Procedure
Enabling the DHCP Server FunctionContextAfter the DHCP server function is enabled on an interface, the DHCP function can allocate network parameters including IP addresses to clients. Procedure
Follow-up ProcedureA DHCP client sends a DHCP Discover message in broadcast mode. When multiple DHCP servers including bogus DHCP servers exist on a network segment, the DHCP client accepts only the first received DHCP Offer message and therefore may obtain an unexpected IP address from a bogus DHCP server. To ensure that a client obtains an IP address from the correct DHCP server, configure DHCP snooping on the client. For detailed configuration of DHCP snooping, see DHCP Snooping Configuration in Huawei AR Series IOT Gateway Configuration Guide - Security. (Optional) Configuring the Range of IP Addresses That Cannot Be Automatically Allocated to Clients from an Address PoolContextSome servers and clients may use specific IP addresses in an address pool, so that the DHCP server does not automatically allocate these IP addresses to other clients. For example, in an enterprise, a DHCP server allocates IP addresses on the network segment 192.168.1.0/24 to employee PCs. On this network segment, 192.168.1.1 is used as the gateway IP address, and 192.168.1.10 is used as the DNS server IP address. The DNS server IP address is manually configured to ensure stability, and other hosts obtain IP addresses using DHCP. Therefore, 192.168.1.10 must be excluded from the range of IP addresses that can be automatically allocated. NOTE: A DHCP server automatically excludes a gateway address configured using the gateway-list command and the IP addresses of interfaces that connect a DHCP server to clients. The DHCP server automatically adds these addresses to the list of IP addresses that cannot be automatically allocated. Procedure
(Optional) Configuring a DHCP Server to Allocate Fixed IP Addresses to Specified ClientsContextA DHCP server leases IP addresses to clients. When the lease expires, the clients must apply for new IP addresses. To ensure stability, certain clients require fixed IP addresses. In this case, configure the DHCP server to allocate fixed IP addresses to these clients. The MAC addresses of these clients are then bound to fixed IP addresses. When such a client applies to the DHCP server for an IP address, the DHCP server searches the binding entries for the MAC address of the client and allocates the matched IP address to the client. DHCP static allocation prevents manual configuration errors and facilitates unified management. Before performing this configuration task, ensure that the IP addresses for static allocation have not been allocated. (To check related information, run the display ip pool { interface interface-pool-name | name ip-pool-name } used command.) If such an IP address has been allocated, use another IP address or release the allocated address using the reset ip pool { interface pool-name | name ip-pool-name } start-ip-address [ end-ip-address ] command and perform the binding again. DHCP static allocation,IPSG Configuration, and static ARP all involve the binding of IP addresses and MAC addresses. For their usage scenarios and implementations, see the following Table 3-8. Table 3-8 Differences between DHCP static allocation, IPSG, and static ARP
Procedure
(Optional) Configuring an Address Lease TimeContextNOTE: This task does not take effect for BOOTP clients. Except for allocating fixed IP addresses to specified clients, a DHCP server can dynamically allocate IP addresses with leases to clients in scenarios where hosts temporarily access the network and the number of idle IP addresses is less than the total number of hosts. The lease time varies depending on network access requirements. By default, the IP address lease is one day.
Different address pools on a DHCP server can be configured with different IP address leases, but the IP addresses in the same address pool must be configured with the same lease. Procedure
(Optional) Configuring the Logging Function During IP Address AllocationContextWhen the DHCP server allocates IP addresses to clients, it records address allocation information to facilitate routine maintenance and fault location. After the logging function during IP address allocation of the DHCP server is configured, the DHCP server records logs about address allocation, conflict, lease renewal, and release. NOTE: If a large number of DHCP clients request for IP addresses after the logging function during IP address allocation of the DHCP server is configured, the server frequently records logs and therefore the device performance may be affected. Procedure
Checking the ConfigurationRun the display ip pool command to view the status of the logging function during IP address allocation of the DHCP server. Follow-up ProcedureConfigure the information center to display the IP address allocation logs recorded by the DHCP server on user terminals or log hosts or generate them in log files. For details on how to configure the information center, see Configuring Log Output in Huawei AR Series IOT Gateway Configuration Guide - Device Management - Information Center Configuration. (Optional) Configuring IP Address Conflict Detection Before a DHCP Server Allocates IP AddressesContextA DHCP server configured with IP address conflict detection checks whether an IP address to be allocated to a client conflicts with other IP addresses. After IP address conflict detection is configured, a DHCP server sends an ICMP Echo Request packet before it sends a DHCP Offer message. The packet contains the source and destination IP addresses, which are both a specified IP address. If the DHCP server does not receive an ICMP Echo Reply packet after the maximum waiting period (specified using the dhcp server ping timeout milliseconds command), the DHCP server continues to send the ICMP Echo Request packet until the maximum number of detection times (specified using the dhcp server ping packet number command) has been reached.
This configuration task takes effect for both the interface and global address pools. NOTE: If the detection period is too long, clients may fail to obtain IP addresses. Set the detection period to less than 8 seconds. Procedure
(Optional) Configuring a DHCP Server to Automatically Save IP Address Allocation InformationContextIf a DHCP server is restarted upon an upgrade or is faulty, IP address allocation information on the DHCP server is lost. After the restart, the DHCP server must re-allocate IP addresses. To prevent data loss and to support data recovery upon a restart, configure a DHCP server to automatically save IP address allocation information, including address leases and conflicting IP addresses, in files. When the DHCP server restarts, it can recover the data from the files. This configuration task takes effect for both the interface and global address pools. Procedure
(Optional) Associating an IP Address Pool with NQAContextAs shown in Figure 3-14 and Figure 3-15, the router functions as the backup DHCP server. You can associate the IP address pool on the router with NQA test instances to check the DHCP server status (including the link and DHCP server function). This can improve network reliability. When the DHCP server is working properly, the IP address pool on the router is locked, and PC1 and PC2 obtain IP addresses through the DHCP server. When NQA detects that the DHCP server is faulty, the IP address pool on the router is unlocked and assigns an IP address to PC3 that is newly online. When NQA detects that the DHCP server fault is rectified, the IP address pool on the router is locked again, and PC4 that is newly online obtains an IP address through the DHCP server. This function is configured only for a global address pool. NOTE: When the DHCP server is faulty, PC3 obtains an IP address from the router; when the DHCP server is recovered, the DHCP function is switched back to the DHCP server. At this time, if the IP address lease of PC3 has expired, the lease renewal will fail. After PC3 goes offline temporarily, it re-obtains an IP address from the DHCP server. In addition, the two IP addresses obtained by PC3 are different because the IP address pools on the DHCP server and router have different address ranges. Figure 3-14 Associating the IP address pool with NQA (router and client locating in the same network segment) Figure 3-15 Associating the IP address pool with NQA (router and client locating in different network segments) Procedure
Why is it necessary to restart the DHCP service?Starting, stopping, and restarting the DHCP service affects the running of the daemon only at the current session. For example, if you stop the DHCP service, the currently running daemon terminates but restarts when you reboot the system. DHCP data tables are not affected by stopping the service.
What is the purpose of installing the DHCP server role?A DHCP server dynamically assigns an IP address and other network configuration parameters to each device on a network so they can communicate with other IP networks. DHCP is an enhancement of an older protocol called BOOTP. DHCP is an important part of the DDI solution (DNS-DHCP-IPAM).
On which server will the DHCP server role normally be installed?Before you configure the DHCP service, you must install it on the server. DHCP is not installed by default during a typical installation of Windows Standard Server 2003 or Windows Enterprise Server 2003.
What is the functionality of a lease for a DHCP server?During the lease time, the DHCP server cannot assign that IP address to any other clients. The purpose of a lease is to limit the length of time that a client can use an IP address. A lease prevents unused clients from taking up IP addresses when there are more clients than addresses.
|