您的位置:首页 > 理论基础 > 计算机网络

第十二期小型网络构建-链路聚合

2018-01-19 18:07 393 查看

来自网络
链路聚合(Link Aggregation),是指将多个物理端口捆绑在一起,成为一个逻辑端口,以实现出/ 入流量在各成员端口中的负荷分担,交换机根据用户配置的端口负荷分担策略决定报文从哪一个成员端口发送到对端的交换机。当交换机检测到其中一个成员端口的链路发生故障时,就停止在此端口上发送报文,并根据负荷分担策略在剩下链路中重新计算报文发送的端口,故障端口恢复后再次重新计算报文发送端口。链路聚合在增加链路带宽、实现链路传输弹性和冗余等方面是一项很重要的技术。
如果聚合的每个链路都遵循不同的物理路径,则聚合链路也提供冗余和容错。通过聚合调制解调器链路或者数字线路,链路聚合可用于改善对公共网络的访问。链路聚合也可用于企业网络,以便在吉比特以太网交换机之间构建多吉比特的主干链路。
原理:
逻辑链路的带宽增加了大约(n-1)倍,这里,n为聚合的路数。另外,聚合后,可靠性大大提高,因为,n条链路中只要有一条可以正常工作,则这个链路就可以工作。除此之外,链路聚合可以实现负载均衡。因为,通过链路聚合连接在一起的两个(或多个)交换机(或其他网络设备),通过内部控制,也可以合理地将数据分配在被聚合连接的设备上,实现负载分担。
因为通信负载分布在多个链路上,所以链路聚合有时称为负载平衡。但是负载平衡作为一种数据中心技术,利用该技术可以将来自客户机的请求分布到两个或更多的服务器上。 聚合有时被称为反复用或IMUX。如果多路复用是将多个低速信道合成为一个单个的高速链路的聚合,那么反复用就是在多个链路上的数据“分散”。它允许以某种增量尺度配置分数带宽,以满足带宽要求。链路聚合也称为中继。
按需带宽或结合是指按需要添加线路以增加带宽的能力。在该方案中,线路按带宽的需求自动连接起来。聚合通常伴随着ISDN连接。基本速率接口支持两个64kbit/s的链路。一个可用于电话呼叫,而另一个可同时用于数据链路。可以结合这两个链路以建立l28kbit/s的数据链路。
链路聚合有如下优点:
1、增加网络带宽
链路聚合可以将多个链路捆绑成为一个逻辑链路,捆绑后的链路带宽是每个独立链路的带宽总和。
2、提高网络连接的可靠性
链路聚合中的多个链路互为备份,当有一条链路断开,流量会自动在剩下链路间重新分配。
链路聚合的方式主要有以下两种:
1、静态Trunk
静态Trunk将多个物理链路直接加入Trunk组,形成一条逻辑链路。
2、动态LACP
LACP(Link Aggregation Control Protocol,链路聚合控制协议)是一种实现链路动态汇聚的协议。LACP协议通过LACPDU(Link Aggregation Control Protocol Data Unit,链路聚合控制协议数据单元)与对端交互信息。
激活某端口的LACP协议后,该端口将通过发送LACPDU向对端通告自己的系统优先级、系统MAC地址、端口优先级和端口号。对端接收到这些信息后,将这些信息与自己的属性比较,选择能够聚合的端口,从而双方可以对端口加入或退出某个动态聚合组达成一致。
具体配置:
实验要求
设备 IP Mask 端口
交换机A 192.168.1.11 255.255.255.0 0/0/1-2 trunking
交换机B 192.168.1.12 255.255.255.0 0/0/3-4 trunking
PC1 192.168.1.101 255.255.255.0交换机A0/0/23
PC2 192.168.1.102 255.255.255.0交换机B0/0/24
如果链路聚合成功,则 PC1 可以ping 通 PC2。
实验步骤
第一步:正确连接网线,交换机全部恢复出厂设置,做初始配置,避免广播风暴【环路】出现
交换机A:
switch#config
switch(Config)#hostname switchA
switchA(Config)#interface vlan 1
switchA(Config-If-Vlan1)#ip address 192.168.1.11 255.255.255.0
switchA(Config-If-Vlan1)#no shutdown
switchA(Config-If-Vlan1)#exit
switchA(Config)#spanning-tree
MSTP is starting now, please wait...........
MSTP is enabled successfully.
switchA(Config)#
交换机B:
switch#config
switch(Config)#hostname switchB
switchB(Config)#interface vlan 1
switchB(Config-If-Vlan1)#ip address 192.168.1.12 255.255.255.0
switchB(Config-If-Vlan1)#no shutdown
switchB(Config-If-Vlan1)#exit
switchB(Config)#spanning-tree
MSTP is starting now, please wait...........
MSTP is enabled successfully.
switchB(Config)#
第二步:创建port group
交换机A:
switchA(Config)#port-group 1
switchA(Config)#
验证配置:
switchA#show port-group detail
Sorted by the ports in the group 1:

switchA#show port-group brief
Port-group number : 1
Number of ports in port-group : 0 Maxports in port-channel = 8
Number of port-channels : 0 Max port-channels : 1
switchA#
交换机B
switchB(Config)#port-group 2
switchB(Config)#
第三步:手工生成链路聚合组(第三、四步任选其一操作)
交换机A:
switchA(Config-Port-Range)#port-group 1 mode on
switchA(Config-Port-Range)#exit
验证配置:
switchA#show vlan
VLAN Name Type Media Ports

1 default Static ENET Ethernet0/0/3 Ethernet0/0/4
Ethernet0/0/5 Ethernet0/0/6
Ethernet0/0/7 Ethernet0/0/8
Ethernet0/0/9 Ethernet0/0/10
Ethernet0/0/11 Ethernet0/0/12
Ethernet0/0/13 Ethernet0/0/14
Ethernet0/0/15 Ethernet0/0/16
Ethernet0/0/17 Ethernet0/0/18
Ethernet0/0/19 Ethernet0/0/20
Ethernet0/0/21 Ethernet0/0/22
Ethernet0/0/23 Ethernet0/0/24
Port-Channel1
switchA# !port-channel1已经存在
交换机B:
switchB(Config)#int e 0/0/3-4
switchB(Config-Port-Range)#port-group 2 mode on
switchB(Config-Port-Range)#exit
验证配置:
switchB#show port-group brief
Port-group number : 2
Number of ports in port-group : 2 Maxports in port-channel = 8
Number of port-channels : 1 Max port-channels : 1
switchB#
第四步: LACP动态生成链路聚合组(第三、四步任选其一操作)
switchA(Conifg-Port-Range)#port-group 1 mode active
验证配置:
switchA#show vlan
VLAN Name Type Media Ports

1 default Static ENET Ethernet0/0/3 Ethernet0/0/4
Ethernet0/0/5 Ethernet0/0/6
Ethernet0/0/7 Ethernet0/0/8
Ethernet0/0/9 Ethernet0/0/1
Ethernet0/0/11 Ethernet0/0/1
Ethernet0/0/13 Ethernet0/0/1
Ethernet0/0/15 Ethernet0/0/1
Ethernet0/0/17 Ethernet0/0/1
Ethernet0/0/19 Ethernet0/0/2
Ethernet0/0/21 Ethernet0/0/2
Ethernet0/0/23 Ethernet0/0/2
Port-Channel1
switchA# !port-channel1已经存在
交换机B:
switchB(Config)#interface ethernet 0/0/3-4
switchB(Conifg-Port-Range)#port-group 2 mode passive
switchB(Config)#interface port-channel 2
switchB(Config-If-Port-Channel2)#
验证配置:
switchB#show port-group brief
Port-group number : 2
Number of ports in port-group : 2 Maxports in port-channel = 8
Number of port-channels : 1 Max port-channels : 1
switchB#
第五步:使用ping命令验证
使用PC1 ping PC2
交换机A 交换机B 结果 原因
0/0/1 0/0/3 通链路聚合组连接正确
0/0/2 0/0/4
0/0/1 0/0/3 通 拔掉交换机B端口4的网线,仍然可
0/0/2 以通(需要一点时间),此时用show
谢谢大家,此博文多数来自网络,谢谢支持
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  网络 基础 达内