Huawei DHCP configuration and relay configuration

  • Nothing is unachievable

**

First introduce DHCP:

DHCP is a dynamic host configuration protocol, a good one, everyone who knows it will understand.
**
Tense and exciting experimental topology:
Insert picture description here

Approximate process:
router enable DHCP service-configure DHCP address pool-call DHCP address pool on outgoing interface-PC set DHCP

[R1]dhcp enable 

[R1]ip pool dhcp1
[R1-ip-pool-dhcp1]network 10.1.1.0 mask 255.255.255.0	
[R1-ip-pool-dhcp1]gateway-list 10.1.1.1
[R1-ip-pool-dhcp1]dns-list 10.1.1.1	
[R1-ip-pool-dhcp1]lease day 8
[R1-ip-pool-dhcp1]quit 

[R1]int g0/0/0	
[R1-GigabitEthernet0/0/0]dhcp  select global 	
[R1-GigabitEthernet0/0/0]ip add 10.1.1.1 24
[R1-GigabitEthernet0/0/0]quit

test:
Insert picture description here

Q: DHCP workflow?

第一步:客户端通过广播发送DHCP discover 报文寻找服务器端

第二步:服务器端通过单播发送DHCP offer 报文向客户端提供IP地址等网络信息。

第三步:客户端通过广播DHCP request 报文告知服务器端本地选择使用哪个IP地址

第四步:服务器通过DHCP ack报文告知客户端IP地址是合法可用的。


DHCP relay configuration:

Insert picture description here

Look at the picture and analyze:
R2 is used as a DHCP service, and R1 is used as a relay to allocate IP to PC1 and PC2 respectively

Go dry.

Process:
The configuration is roughly the same as the DHCP configuration, the only thing that needs to be done is the configuration on the relay router

R2配置
[Huawei]dhcp enable 

[Huawei]ip pool s1
[Huawei-ip-pool-s1]network 10.1.1.0 mask 255.255.255.0
[Huawei-ip-pool-s1]gateway-list 10.1.1.1
[Huawei-ip-pool-s1]lease day 8

[Huawei]ip pool s2
[Huawei-ip-pool-s1]network 20.1.1.0 mask 255.255.255.0
[Huawei-ip-pool-s1]gateway-list 20.1.1.1
[Huawei-ip-pool-s1]lease day 8

[Huawei]int e0/0/0
[Huawei-Ethernet0/0/0]ip add 192.168.1.1 24

R1配置:
[Huawei]int e0/0/1
[Huawei-Ethernet0/0/1]ip add 192.168.1.2 24

[Huawei-Ethernet0/0/0]int e0/0/1
[Huawei-Ethernet0/0/0]ip add 20.1.1.1 24
[Huawei-Ethernet0/0/0]dhcp select relay
[Huawei-Ethernet0/0/0]dhcp relay server-select 192.168.1.1

[Huawei-Ethernet0/0/0]int e0/0/0
[Huawei-Ethernet0/0/1]ip add 10.1.1.1 24
[Huawei-Ethernet0/0/1]dhcp select relay
[Huawei-Ethernet0/0/1]dhcp relay server-select 192.168.1.1

为了达到全网互通,做个rip

Insert picture description here

Guess you like

Origin blog.csdn.net/Nocker888/article/details/104373506