<Huawei>system-view //进入系统视图
[Huawei]interface GigabitEthernet 0/0/0 //进入接口GigabitEthernet 0/0/0
[Huawei-GigabitEthernet0/0/0]undo shutdown //开启接口
[Huawei-GigabitEthernet0/0/0]ip address 192.168.3.254 255.255.255.0 //配置IP地址
[Huawei-GigabitEthernet0/0/0]quit //退回系统视图
[Huawei]ip route-static 192.168.1.0 255.255.255.0 192.168.3.1 //配置去往192.168.1.0网段的路由表
[Huawei]ip route-static 192.168.2.0 255.255.255.0 192.168.3.1 //配置去往192.168.1.0网段的路由表
四、配置DHCP池
[Huawei]ip pool li //新建地址池li
[Huawei-ip-pool-li]network 192.168.1.0 mask 255.255.255.0 配置网段
[Huawei-ip-pool-li]gateway-list 192.168.1.254 //配置网关
[Huawei-ip-pool-li]dns-list 8.8.8.8 //配置DNS服务器
[Huawei]interface GigabitEthernet 0/0/0 //进入接口 GigabitEthernet 0/0/0
[Huawei-GigabitEthernet0/0/0]dhcp select global //开启全局配置IP
[Huawei-GigabitEthernet0/0/0]quit 退回系统视图
[Huawei]ip pool li //新建地址池zhi
[Huawei-ip-pool-li]network 192.168.2.0 mask 255.255.255.0 配置网段
[Huawei-ip-pool-li]gateway-list 192.168.2.254 //配置网关
[Huawei-ip-pool-li]dns-list 114.114.114.114 //配置DNS服务器
六、在交换机上配置中继
[Huawei]interface vlan 2 //进入虚拟接口vlan 2
[Huawei-Vlanif3]dhcp select relay //开启中继服务
[Huawei-Vlanif3]dhcp relay server-ip 192.168.3.254 //配置中继服务
[Huawei-Vlanif3]quit //退回系统视图
[Huawei]interface vlan 3 //进入虚拟接口vlan 3
[Huawei-Vlanif3]dhcp select relay //开启中继服务
[Huawei-Vlanif3]dhcp relay server-ip 192.168.3.254 //配置中继服务
五、验证
ENSP环境中不同vlan实现DHCP功能以及DHCP中继的配置
原文地址:http://blog.51cto.com/13725021/2118138