聚合链路的概述
以太网链路聚合——Eth-trunk多链路汇聚,将多条物理链路变为一条Eth-trunk的逻辑链路,从而实现增加链路带宽的目的。聚合链路分为手工模式和LACP模式。
聚合链路的原理
逻辑链路的带宽增加了大约(n-1)倍,这里,n为聚合的路数。另外,聚合后,可靠性大大提高,因为,n条链路中只要有一条可以正常工作,则这个链路就可以工作。除此之外,链路聚合可以实现负载均衡。因为,通过链路聚合连接在一起的两个(或多个)交换机(或其他网络设备),通过内部控制,也可以合理地将数据分配在被聚合连接的设备上,实现负载分担。链路聚合又可以分为手工模式和LACP模式 ,一般来说建议使用LACP模式。LACP模式不仅可以实现增加带宽、提高可靠性、负载分担的目的,而且可以提空Eth-trunk的容错性、提供备份功能。
LACP模式下,部分链路是活动链路,所有活动链路均参与数据转发。如果某条活动链路故障,链路聚合组自动在非活动链路中选择一条链路作为活动链路,使得参与数据转发的链路数目不变。
聚合链路的配置
lsw1
<SW1>sys
Enter system view, return user view with Ctrl+Z.
[SW1]un in en
Info: Information center is disabled.
### 链路聚合
[SW1]lacp priority 1000 ###优先级
[SW1]int Eth-Trunk 1
[SW1-Eth-Trunk1]bpdu enable
[SW1-Eth-Trunk1]mode lacp-static
[SW1-Eth-Trunk1]max active-linknumber 2
[SW1-Eth-Trunk1]int e0/0/1
[SW1-Ethernet0/0/1]eth-trunk 1
[SW1-Ethernet0/0/1]
[SW1-Ethernet0/0/1]int e0/0/2
[SW1-Ethernet0/0/2]eth-trunk 1
[SW1-Ethernet0/0/2]
[SW1-Ethernet0/0/2]int e0/0/3
[SW1-Ethernet0/0/3]eth-trunk 1
###Trunk端口类型
[SW1-Ethernet0/0/3]q
[SW1]int eth-trunk 1
[SW1-Eth-Trunk1]port link-type trunk
[SW1-Eth-Trunk1]port trunk allow-pass vlan all
###查看端口情况
[SW1-Eth-Trunk1]dis trunkmembership eth-trunk 1
Interface Ethernet0/0/1, valid, operate up, weight=1
Interface Ethernet0/0/2, valid, operate up, weight=1
Interface Ethernet0/0/3, valid, operate down, weight=1
###关闭端口
[SW1]int e0/0/1
[SW1-Ethernet0/0/1]shutdown
[SW1-Ethernet0/0/1]int e0/0/2
[SW1-Ethernet0/0/2]shutdown
[SW1-Ethernet0/0/2]
[SW1]vlan batch 10 20 30 40 50
[SW1]int e0/0/4
[SW1-Ethernet0/0/4]p l a
[SW1-Ethernet0/0/4]p d v 10
[SW1-Ethernet0/0/4]un sh
[SW1-Ethernet0/0/1]int e0/0/5
[SW1-Ethernet0/0/5]p l a
[SW1-Ethernet0/0/5]p d v 20
[SW1-Ethernet0/0/5]un sh
[SW1-Ethernet0/0/5]int e0/0/6
[SW1-Ethernet0/0/6]p l t
[SW1-Ethernet0/0/6]p t a v a
[SW1-Ethernet0/0/6]un sh
lsw2
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys SW2
[SW2]un in en
Info: Information center is disabled.
[SW2]int eth-trunk 1
[SW2-Eth-Trunk1]bpdu enable
[SW2-Eth-Trunk1]mode lacp-static
[SW2-Eth-Trunk1]
[SW2-Eth-Trunk1]int e0/0/1
[SW2-Ethernet0/0/1]eth-trunk 1
[SW2-Ethernet0/0/1]
[SW2-Ethernet0/0/1]int e0/0/2
[SW2-Ethernet0/0/2]eth-trunk 1
[SW2-Ethernet0/0/2]
[SW2-Ethernet0/0/2]int e0/0/3
[SW2-Ethernet0/0/3]eth-trunk 1
[SW2-Ethernet0/0/3]q
[SW2]int eth-trunk 1
[SW2-Eth-Trunk1]port link-type trunk
[SW2-Eth-Trunk1]port trunk allow-pass vlan all