版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。
一、组网需求
1、DHCP作为公司汇聚交换机,在上面配置DHCP全局地址池,然后接入交换机根据不同vlan会获取到不同网段IP地址。
2、网络拓扑
二、操作步骤
1、客户端
1)创建DHCP服务器组,并为DHCP服务器组添加DHCP服务器对应网段的网关IPsystem-view [Huawei]sysname Client [Client]dhcp server group dhcp1 [Client-dhcp-server-group-dhcp1]dhcp-server 192.168.1.1 [Client-dhcp-server-group-dhcp1]q [Client]dhcp server group dhcp2 [Client-dhcp-server-group-dhcp2]dhcp-server 192.168.2.1 [Client-dhcp-server-group-dhcp2]q
2)创建vlan
[Client]vlan batch 10 20
3)使能全局DHCP功能
[Client]dhcp enable
4)开启vlanif中继功能并配置接口IP,指定DHCP服务器。
[Client]interface Vlanif 10 [Client-Vlanif10]dhcp select relay [Client-Vlanif10]ip address 192.168.1.2 24 [Client-Vlanif10]dhcp relay server-select dhcp1 [Client-Vlanif10]q [Client]interface Vlanif 20 [Client-Vlanif20]dhcp select relay [Client-Vlanif20]ip address 192.168.2.2 24 [Client-Vlanif20]dhcp relay server-select dhcp2 [Client-Vlanif20]q
5)配置接口
[Client]interface GigabitEthernet 0/0/1 [Clien