DHCP中继实验

2023-12-19 20:49:42

DHCP中继实验

在这里插入图片描述
1.R1和R2配置ip地址,并打通路由
R1

[Huawei-GigabitEthernet0/0/0]ip address 192.168.10.1 24
[Huawei]ip route-static 192.168.20.0 255.255.255.0 192.168.10.2

R2

[Huawei-GigabitEthernet0/0/0]ip address 192.168.10.2 24
[Huawei-GigabitEthernet0/0/1]ip address 192.168.20.1 24
[Huawei]ip route-static 0.0.0.0 0.0.0.0 192.168.10.1

2.R1配置DHCP服务

[Huawei-ip-pool-test]gateway-list 192.168.20.1 
[Huawei-ip-pool-test]network 192.168.20.0 mask 255.255.255.0 
[Huawei-ip-pool-test]dns-list 114.114.114.114
[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/0]dhcp select global 

3.R2配置DHCP中继,dhcp报文为广播报文,无法通过三层接口,所以dhcp中继需要在与终端连接的接口配置

[Huawei]dhcp enable 
[Huawei-GigabitEthernet0/0/1]dhcp select relay
[Huawei-GigabitEthernet0/0/1]dhcp relay server-ip 192.168.10.1
[Huawei-GigabitEthernet0/0/1]dhcp select global 

4.终端成功获取地址
在这里插入图片描述

文章来源:https://blog.csdn.net/yao12_/article/details/132700172
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。