DHCP中继配置(华为ensp中所配置)

1.拓扑图:
DHCP中继配置(华为ensp中所配置)_第1张图片
2.各个路由器中的命令配置
AR1(服务器)
//启用DHCP
[Huawei]dhcp enable
//在接口配置IP,在路由器上配置静态路由(本实验使用的是OSPF使路由器连通)
[Huawei]inter g0/0/0
[Huawei-GigabitEthernet0/0/0]ip add 100.1.1.2 24
[Huawei]ospf
[Huawei-ospf-1]area 0
[Huawei-ospf-1-area-0.0.0.0]net 100.1.1.0 0.0.0.255
//建立地址池
[Huawei]ip pool niting
Info: It’s successful to create an IP address pool.
[Huawei-ip-pool-niting]gateway-list 192.168.1.254
[Huawei-ip-pool-niting]network 192.168.1.0 mask 255.255.255.0
[Huawei-ip-pool-niting]dns-list 2.2.2.2
[Huawei-ip-pool-niting]excluded-ip-address 192.168.1.1
//在服务器接口处开启全局DHCP
[Huawei]inter g0/0/0
[Huawei-GigabitEthernet0/0/0]dhcp select global

AR2
//开启DHCP,在接口处配置IP,使得路由器之间连通
[Huawei]dhcp enable
[Huawei]inter g0/0/1
[Huawei-GigabitEthernet0/0/1]ip add 10.1.1.2 24
[Huawei]inter g0/0/0
[Huawei-GigabitEthernet0/0/0]ip add 100.1.1.1 24
[Huawei]ospf
[Huawei-ospf-1]area 0
[Huawei-ospf-1-area-0.0.0.0]network 10.1.1.0 0.0.0.255
[Huawei-ospf-1-area-0.0.0.0]net 100.1.1.0 0.0.0.255

AR3(中继器)
//启用DHCP
[Huawei]dhcp enable
//在接口配置IP,在路由器上配置静态路由(本实验使用的是OSPF使路由器连通)
[Huawei]inter g0/0/0
[Huawei-GigabitEthernet0/0/0]ip add 10.1.1.1 24
[Huawei]inter g0/0/1
[Huawei-GigabitEthernet0/0/1]ip add 192.168.1.1 24
[Huawei]ospf
[Huawei-ospf-1]area 0
[Huawei-ospf-1-area-0.0.0.0]net 192.168.1.0 0.0.0.255
[Huawei-ospf-1-area-0.0.0.0]net 10.1.1.0 0.0.0.255
//在中继设备上设置DHCP组
[Huawei]dhcp server group niting
Info:It’s successful to create a DHCP server group.
//在组中添加DHCP服务器
[Huawei-dhcp-server-group-niting]dhcp-server 100.1.1.2(服务器接口的IP)
//在本地接口启动DHCP中继 同时映射该中继至DHCP组
[Huawei]inter g0/0/1 (与客户端相连接口IP)
[Huawei-GigabitEthernet0/0/1]dhcp select relay
[Huawei-GigabitEthernet0/0/1]dhcp relay server-select niting

**希望各位道友可以提点建议,然后有什么问题可以在评论区提出。一定努力解答!**

你可能感兴趣的:(DHCP)