DHCP中继代理
配置思路:
1、PC端开启DHCP服务
2、配置DHCP服务器
3、配置DHCP中继
4、验证
搭建拓扑图
1、PC端开启DHCP服务
选择DHCP,点击应用
在这里插入图片描述

2、配置DHCP服务器

system-view
[Huawei]system DHCP #启用DHCP服务
[DHCP]dhcp enable
[DHCP]ip pool pool_01 #创建地址池
[DHCP-ip-pool-pool_01]gateway-list 192.168.1.254
[DHCP-ip-pool-pool_01]network 192.168.1.0 mask 24
[DHCP-ip-pool-pool_01]dns-list 8.8.8.8
[DHCP-ip-pool-pool_01]quit
[DHCP]inter g0/0/0 #此接口的DHCP配置信息
[DHCP-GigabitEthernet0/0/0]ip address 10.10.10.1 24
[DHCP-GigabitEthernet0/0/0]dhcp select global
[DHCP-GigabitEthernet0/0/0]quit
[DHCP]ip route-static 192.168.1.0 24 10.10.10.2 #添加静态路由

3、配置DHCP中继

system-view
[Huawei]system R2
[R2]inter g0/0/0
[R2-GigabitEthernet0/0/0]ip address 10.10.10.2 24
[R2-GigabitEthernet0/0/0]quit
[R2]inter g0/0/1
[R2-GigabitEthernet0/0/1]ip address 192.168.1.254 24
[R2-GigabitEthernet0/0/1]quit
[R2]dhcp enable
interface GigabitEthernet0/0/1
[R2-GigabitEthernet0/0/1]dhcp select relay #启用DHCP中继代理模式
[R2-GigabitEthernet0/0/1]dhcp relay server-ip 10.10.10.1 #指定DHCP服务器地址
[R2-GigabitEthernet0/0/1]quit

4、验证
在命令行中输入ipconfig能够获取到IP地址
在这里插入图片描述

Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐