Cyber_Security_Notes/A. 第一阶段/拓扑练习/0823_DHCP中继.md

59 lines
1.4 KiB
Markdown
Raw Normal View History

2024-08-23 18:11:58 +08:00
# DHCP中继
![image-20240823163005579](https://picgo-noriu.oss-cn-beijing.aliyuncs.com/Images/image-20240823163005579.png)
### 一、配IP
### 二、配DHCP
- **AR2**
```
<Huawei>u t m
<Huawei>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
<AR2-DHCP>save
```
### 三、配DHCP中继
- **AR1**
```
<Huawei>u t m
<Huawei>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
<AR1-ZJ>save
```
![DHCP](https://picgo-noriu.oss-cn-beijing.aliyuncs.com/Images/DHCP.png)