准备实验环境 首先在三台交换机创建vlan并且将各个接口加入到各自vlan,单数为vlan10,复数为vlan20 然后配置链路聚合和lacp,(之间是含有先后顺序的,先进入eth-trunk组,配置中继链路即允许所有vlan通过,然后配置lacp,最后再将接口加入到eth-trunk组中) R1路由器的链路配置即单臂路由,(路由器的链路聚合配置首先加入eth-trunk组,使用命令(undo portswitch)让路由二层变三层。之后再将接口捆绑起来,最后配置单臂路由)在AR1配置dhcp使pc机可以自动获得IP地址 其他路由器的链路聚合都是同样的操作,先进入eth-trunk组让二层变三层,然后配置ip地址,指路由 全部都做好后在pc上点击dhcp,查看是否能够自动获取到,能获取到就说明配置完成了 测试lacp是否配置正确,随便在一个交换机上关闭接口来模拟网络测试 这边看到接口已经模拟完成 使用pc来ping通测试,可以看到一开始一直超时,之后恢复正常说明lacp配置正确(-t可以一直ping ctrl+c是停止测试)

具体命令如下!

1.首先在三台交换机创建vlan并且将各个接口加入到各自vlan,单数为vlan10,复数为vlan20

sys un in en(关闭提示信息) vlan batch 10 20(创建vlan) exit int e0/0/1 port link-type access port default vlan 10 int e0/0/2 port link-type access port default vlan 20

2.然后配置链路聚合和lacp,(之间是含有先后顺序的,先进入eth-trunk组,配置中继链路即允许所有vlan通过,然后配置lacp,最后再将接口加入到eth-trunk组中)

int Eth-Trunk 2 port link-type trunk port trunk allow-pass vlan all mode lacp-static lacp timeout fast lacp preempt enable max active-linknumber 2 bpdu enable q interface Eth-Trunk 2 trunkport Ethernet 0/0/3 to 0/0/5 q

3.R1路由器的链路配置即单臂路由,(路由器的链路聚合配置首先加入eth-trunk组,使用命令(undo portswitch)让路由二层变三层。之后再将接口捆绑起来,最后配置单臂路由)在AR1配置dhcp使pc机可以自动获得IP地址

<Huawei>sys Enter system view, return user view with Ctrl+Z. [Huawei]un in en Info: Information center is disabled. [Huawei]int e [Huawei]int Eth-Trunk 1 [Huawei-Eth-Trunk1]undo portswitch [Huawei-Eth-Trunk1]trunkport GigabitEthernet 0/0/0 to 0/0/1 Info: This operation may take a few seconds. Please wait for a moment...done. [Huawei-Eth-Trunk1]int Eth-Trunk 1.10 [Huawei-Eth-Trunk1.10]dot1q termination vid 10 [Huawei-Eth-Trunk1.10]arp broadcast enable [Huawei-Eth-Trunk1.10]ip add 192.168.10.1 24 [Huawei-Eth-Trunk1.10]q [Huawei]dhcp e [Huawei]dhcp enable Info: The operation may take a few seconds. Please wait for a moment.done. [Huawei]int Eth-Trunk 1.10 [Huawei-Eth-Trunk1.10]dhcp select interface [Huawei-Eth-Trunk1.10]dhcp server dns-list 1.1.1.1 [Huawei-Eth-Trunk1.10]int Eth-Trunk 1.20 [Huawei-Eth-Trunk1.20]dot1q termination vid 20 [Huawei-Eth-Trunk1.20]arp broadcast enable [Huawei-Eth-Trunk1.20]ip add 192.168.20.1 24 [Huawei-Eth-Trunk1.20]dhcp select interface [Huawei-Eth-Trunk1.20]dhcp server dns-list 2.2.2.2 [Huawei-Eth-Trunk1.20]q

* 4.其他路由器的链路聚合都是同样的操作,先进入eth-trunk组让二层变三层,然后配置ip地址,指路由**

(ar1)[Huawei]int Eth-Trunk 3 [Huawei-Eth-Trunk3]undo portswitch [Huawei-Eth-Trunk3]trunkport GigabitEthernet 4/0/0 Info: This operation may take a few seconds. Please wait for a moment...done. [Huawei-Eth-Trunk3]trunkport GigabitEthernet 0/0/2 Info: This operation may take a few seconds. Please wait for a moment...done. [Huawei-Eth-Trunk3]ip add 12.0.0.1 24 [Huawei-Eth-Trunk3]q [Huawei]ip route-static 0.0.0.0 0.0.0.0 12.0.0.2

(ar2)[Huawei]int Eth-Trunk 3 [Huawei-Eth-Trunk3]undo portswitch [Huawei-Eth-Trunk3]trunkport g4/0/0 Info: This operation may take a few seconds. Please wait for a moment...done. [Huawei-Eth-Trunk3]trunkport g0/0/0 Info: This operation may take a few seconds. Please wait for a moment...done. [Huawei-Eth-Trunk3]ip add 12.0.0.2 24 [Huawei-Eth-Trunk3]q [Huawei]int Eth-Trunk 4 [Huawei-Eth-Trunk4]undo portswitch [Huawei-Eth-Trunk4]trunkport g0/0/1 Info: This operation may take a few seconds. Please wait for a moment...done. [Huawei-Eth-Trunk4]trunkport g0/0/2 Info: This operation may take a few seconds. Please wait for a moment...done. [Huawei-Eth-Trunk4]ip add 23.0.0.2 24 [Huawei-Eth-Trunk4]q [Huawei]ip route-static 192.168.10.0 24 12.0.0.1 [Huawei]ip route-static 192.168.20.0 24 12.0.0.1‘

(ar3)<Huawei>sys Enter system view, return user view with Ctrl+Z. [Huawei]un in en Info: Information center is disabled. [Huawei]int Eth-Trunk 4 [Huawei-Eth-Trunk4]undo portswitch [Huawei-Eth-Trunk4]trunkport g0/0/1 Info: This operation may take a few seconds. Please wait for a moment...done. [Huawei-Eth-Trunk4]trunkport g0/0/0 Info: This operation may take a few seconds. Please wait for a moment...done. [Huawei-Eth-Trunk4]ip add 23.0.0.3 24 [Huawei-Eth-Trunk4]q [Huawei]ip route-static 0.0.0.0 0.0.0.0 23.0.0.2