1. Checking the Communication Between the DHCP Client and Server
Assume that the DHCP client (usually a PC) and server (switch) are located in the same network segment, and there is no relay agent between them. When you configure an IP address on the DHCP client, ensure that the IP address is in the same network segment as the IP address of the VLANIF interface of the DHCP server. Ping the IP address of the VLANIF interface from the DHCP client.
If the DHCP client and server are on different network segments and a relay agent is deployed, check the link between the client and relay agent and the link between the relay agent and server.
If the ping command fails, check the link connectivity and resolve the issue.
2. Checking Whether DHCP Packet Forwarding on the Intermediate Link Is Correct
If the DHCP client and server are on the same network segment, directly connect the client to the server to check whether the client can obtain an IP address.
If the client can obtain an IP address, DHCP packet forwarding on the intermediate link is abnormal. Check whether there are problems such as high CPU usage and configuration of DHCP snooping without a trusted interface on a device along the intermediate link.
If the client cannot obtain an IP address, check whether the server is correctly configured and whether available IP addresses exist.
If the client cannot be directly connected to the server, obtain packets on the client and server respectively to check whether DHCP packets are properly exchanged.
3.Checking Basic DHCP Configuration
A DHCP server allocates IP addresses to clients using a global or interface address pool. You can run the display current-configuration | include dhcp command to check DHCP configuration. If no DHCP configuration is available, follow the example provided below to configure the DHCP server.
Example: Configure a DHCP server to assign IP addresses in the address pool on VLANIF 100.
<HUAWEI> system-view [HUAWEI] dhcp enable [HUAWEI] interface vlanif 100 //Allocate IP addresses to clients in VLAN 100. [HUAWEI-Vlanif100] ip address 10.1.1.2 24 [HUAWEI-Vlanif100] dhcp select interface //Use the interface address pool to allocate IP addresses, and IP addresses to allocate are on the same network segment as that of the VLANIF 100 interface.
NOTE:
The S2700 and S5700LI series switches cannot function as DHCP servers, so related commands cannot be configured on these switches.
4.Checking for Available IP Addresses in the Address Pool
Run the display ip pool name ip-pool-name command to check whether there are available IP addresses in the global address pool, or run the display ip pool interface vlanif command to check whether there are available IP addresses in the interface address pool.
[HUAWEI] display ip pool interface vlanif2 Pool-name : Vlanif2 Pool-No : 3 Lease : 1 Days 0 Hours 0 Minutes Domain-name : - DNS-server0 : - NBNS-server0 : - Netbios-type : - Position : Interface Status : Unlocked Gateway-0 : 1.100.100.1 Mask : 255.255.255.0 VPN instance : -- ----------------------------------------------------------------------------- Start End Total Used Idle(Expired) Conflict Disable ----------------------------------------------------------------------------- 1.100.100.1 1.100.100.254 253 1 252(0) 0 0 -----------------------------------------------------------------------------
If the value of Idle (Expired) is 0, IP addresses in the address pool are used up. To provide sufficient IP addresses to clients, you can adjust the mask length.
If the Conflict value is large, a large number of IP addresses conflict with each other. In this case, run the reset ip pool command to reset the address pool and reclaim IP addresses.
The following are typical configuration errors and methods of resolving these problems.
The mask is incorrectly set. In this case, adjust the mask length of the address pool.
Error: The IP address number of single interface pool must be less than 65536.
The reserved IP address cannot be configured. In this case, check whether this IP address has been assigned to a client or is in use.
Error: Only idle or expired IP address can be disabled.
An IP address cannot be bound to a MAC address. In this case, check whether this IP address has been assigned to a client or is in use.
Error: The IP address's status is error.
An IP address you want to bind to a MAC address or you want to reserve is not in the address pool. In this case, choose an IP address from the address pool.
Error: The IP address is not in the pool.
The procedure is as follows:
Run the display ip pool { interface interface-pool-name | name ip-pool-name } used command on the device working as the DHCP server to check used IP addresses.
Adjust the mask length of the address pool on the device working as the DHCP server to change the address pool range.
In the scenario where IP addresses are not assigned:
Configure the global address pool.
<HUAWEI> system-view [HUAWEI] ip pool pool1 [HUAWEI-ip-pool-pool1] undo network [HUAWEI-ip-pool-pool1] network 10.1.1.0 mask 24 //Adjust the mask length.
Configure the interface address pool.
<HUAWEI> system-view [HUAWEI] interface vlanif 100 [HUAWEI-Vlanif100] ip address 10.1.1.1 24 //Adjust the mask length. [HUAWEI-Vlanif100] dhcp select interface //Enable the interface address pool function again.
In the scenario where IP addresses are assigned:
On the device working as the DHCP server, reclaim IP addresses (only for the global address pool), configure the function of avoiding repeated IP address allocation, and then adjust the mask length of the address pool to change the address pool range.
Configure the global address pool.
<HUAWEI> reset ip pool name pool1 all //Reclaim all IP addresses. <HUAWEI> system-view [HUAWEI] dhcp server ping packet 3 //Configure the function of avoiding repeated IP address allocation. [HUAWEI] dhcp server ping timeout 100 //Configure the function of avoiding repeated IP address allocation. [HUAWEI] ip pool pool1 [HUAWEI-ip-pool-pool1] undo network [HUAWEI-ip-pool-pool1] network 10.1.1.0 mask 24 //Adjust the mask length.
Configure the interface address pool.
<HUAWEI> system-view [HUAWEI] dhcp server ping packet 3 //Configure the function of avoiding repeated IP address allocation. [HUAWEI] dhcp server ping timeout 100 //Configure the function of avoiding repeated IP address allocation. [HUAWEI] interface vlanif 100 [HUAWEI-Vlanif100] ip address 10.1.1.1 24 //Adjust the mask length. [HUAWEI-Vlanif100] dhcp select interface //Enable the interface address pool function again.
5.Checking STP Status
Slow STP convergence may result in a low speed for obtaining an IP address. If an STP interface is blocked, clients may not be able to obtain IP addresses. STP flapping may cause exceptions when clients obtain IP addresses. You can use the following methods to reduce or prevent the impact of STP exceptions:
Configure the port directly connected to clients as an edge port.
<HUAWEI> system-view [HUAWEI] interface gigabitethernet 0/0/1 [HUAWEI-GigabitEthernet0/0/1] stp edged-port enable //Configure GE0/0/1 as an edge port.
If no loop is detected, disable STP.
[HUAWEI] stp disable
6.Checking for DHCP Attacks or Unauthorized Devices
Multiple DHCP attacks may occur on the network, for example, bogus DHCP server attacks, DHCP server DoS attacks, and bogus DHCP packet attacks. These attacks may cause clients to fail to obtain IP addresses from the DHCP server. To prevent DHCP attacks, configure DHCP snooping on a switch.
If an end user connects a router with DHCP functions to the network, the client may fail to obtain a desired IP address from the DHCP server. Therefore, check whether an end user has connected any small-sized router to the network. If yes, disconnected it from the network. If troubleshooting is inconvenient, configure DHCP snooping to prevent this problem.
Example: Configure DHCP snooping.
<HUAWEI> system-view [HUAWEI] dhcp enable [HUAWEI] dhcp snooping enable [HUAWEI] interface gigabitethernet 0/0/1 [HUAWEI-GigabitEthernet0/0/1] dhcp snooping enable [HUAWEI-GigabitEthernet0/0/1] dhcp snooping trusted //You must configure DHCP snooping on the interface connected to an authorized DHCP server.
7.Collecting Information and Seeking Technical Support
If the fault persists, collect related information and seek technical support.
Collecting Fault Information
Collect operation results of the preceding steps and record the results in a file.
Collect all diagnostic information and export the information to a file.
Run the display diagnostic-information file-name command in the user view to collect diagnostic information and save the information to a file.
<HUAWEI> display diagnostic-information dia-info.txt Now saving the diagnostic information to the device 100% Info: The diagnostic information was saved to the device successfully.
When the diagnostic file is generated, you can export the file from the device using FTP, SFTP, or SCP. .
NOTICE:
You can run the dir command in the user view to check whether the file is generated.
You can also run the display diagnostic-information command and save terminal logs in a diagnostic file on a disk. .
If this command displays a long output, press Ctrl+C to abort this command.
This command displays diagnostic information, which helps locate faults but may affect system performance. For example, CPU usage may become high. Therefore, do not use this command when the system is running properly.
Running the display diagnostic-information command simultaneously on multiple terminals connected to the device is prohibited. This is because CPU usage of the device may obviously increase and the device performance may be degraded.
Collect the log and trap information on the device and export the information to files.
Run the save logfile all command in the user view to save the logs in the user log buffer area and diagnostic log buffer area to the user log file and diagnostic log file, respectively.
<HUAWEI> save logfile all Info: Save logfile successfully. Info: Save diagnostic logfile successfully.
When the diagnostic file is generated, you can export the file from the device using FTP, SFTP, or SCP.
NOTE:
You can also run the display logbuffer and display trapbuffer commands to view the log and trap information on the device, and save the information in diagnostic files on a disk.
Leave a comment