# DHCP中继 ![image-20240823163005579](https://picgo-noriu.oss-cn-beijing.aliyuncs.com/Images/image-20240823163005579.png) ### 一、配IP ### 二、配DHCP - **AR2** ``` u t m sys [Huawei]sys AR2-DHCP [AR2-DHCP]int g0/0/0 [AR2-DHCP-GigabitEthernet0/0/0]ip a 192.168.20.20 24 [AR2-DHCP-GigabitEthernet0/0/0]q [AR2-DHCP]dhcp enable [AR2-DHCP]ip pool ntd [AR2-DHCP-ip-pool-ntd]network 192.168.10.0 mask 24 [AR2-DHCP-ip-pool-ntd]gateway-list 192.168.10.254 [AR2-DHCP-ip-pool-ntd]dns-list 223.5.5.5 223.6.6.6 [AR2-DHCP-ip-pool-ntd]lease day 1 [AR2-DHCP-ip-pool-ntd]excluded-ip-address 192.168.10.253 [AR2-DHCP-ip-pool-ntd]quit [AR2-DHCP]int g 0/0/0 [AR2-DHCP-GigabitEthernet0/0/0]dhcp select global [AR2-DHCP-GigabitEthernet0/0/0]quit [AR2-DHCP]ip route-static 192.168.10.0 24 192.168.20.10 [AR2-DHCP]quit save ``` ### 三、配DHCP中继 - **AR1** ``` u t m sy [Huawei]sy AR1-ZJ [AR1-ZJ]int g0/0/0 [AR1-ZJ-GigabitEthernet0/0/0]ip a 192.168.20.10 24 [AR1-ZJ-GigabitEthernet0/0/0]int g0/0/1 [AR1-ZJ-GigabitEthernet0/0/1]ip a 192.168.10.254 24 [AR1-ZJ-GigabitEthernet0/0/1]quit [AR1-ZJ]dhcp enable [AR1-ZJ]int g0/0/1 [AR1-ZJ-GigabitEthernet0/0/1]dhcp select relay [AR1-ZJ-GigabitEthernet0/0/1]dhcp relay server-ip 192.168.20.20 [AR1-ZJ-GigabitEthernet0/0/1]return save ``` ![DHCP](https://picgo-noriu.oss-cn-beijing.aliyuncs.com/Images/DHCP.png)