华为配置 之 链路聚合
简介:
链路聚合(Link Aggregation)是一种计算机网络技术,通过将多个物理端口汇聚在一起,形成一个逻辑端口,以实现出/入流量吞吐量在各成员端口的负荷分担。当交换机检测到其中一个成员端口的链路发生故障时,会停止在此端口上发送封包,并根据负荷分担策略在剩下的链路中重新计算报文的发送端口。
功能:
链路聚合的主要功能是增加链路带宽和实现链路相互备份。具体来说,当交换机检测到某个成员端口的链路发生故障时,会停止在此端口上发送封包,并在剩余的链路中重新计算报文的发送端口。这种机制确保了链路的可靠性和稳定性。
模式:
链路聚合可以分为手工模式和LACP模式。在手工模式下,Eth-Trunk的建立和成员接口的加入均由手动配置,所有链路都是活动链路,参与数据的转发。而在LACP模式下,设备间通过链路聚合控制协议数据单元(LACPDU)进行交互,通过协议协商确保对端是同一台设备、同一个聚合接口的成员接口。
优势:
(1)经济高效:不需要大规模的硬件升级,从而降低了成本
(2)灵活性:可以适应不同的网络环境和需求,管理员可以根据需要添加或删除物理链路
(3)提高可靠性:通过备份链路的机制,提高了网络的可靠性,即使一个链路故障,数据仍然可以通过其他链路传输。
指导性原则:
(1)华为网络设备最多允许同时8个端口绑定到一起
(2)一个Eth-Trunk内的所有端口必须使用相同的模式【手工、LACP】
(3)一个Eth-Trunk内的所有端口都必须具有相同的速率及双工模式;若成员端口的速率不同,则速率较低的端口有可能会发生拥塞,报文有可能会被丢弃
(4)一个端口不同在同一个时间内属于多个隧道组
(5)一个Eth-Trunk内的所有端口都必须配置到相同的VLAN中
(6)只能删除不包含任何成员端口的Eth-Trunk口
(7)二层Eth-Trunk口的成员端口必须是二层端口,三层Eth-Trunk口的成员端口必须是三层端口
(8)加入Eth-Trunk口的端口必须是Hybrid端口
(9)一个Eth-Trunk口不能再充当其他Eth-Trunk口的成员端口
(10)端口的加入Eth-Trunk口后,Eth-Trunk口负责学习MAC地址,而成员端口不再学习MAC地址
手工和LACP的区别:
手工:所有活动链路都参加数据的转发,平均分担流量
LACP:通过LACP报文进行协商,确定活动接口和非活动接口
链路聚合:
手工模式:
配置SW1:
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname Xzzzz911
[Xzzzz911]
Dec 15 2024 10:26:42-08:00 Xzzzz911 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011
.5.25.191.3.1 configurations have been changed. The current change number is 4,
the change loop count is 0, and the maximum number of records is 4095.
[Xzzzz911]undo info-center enable
Info: Information center is disabled.
[Xzzzz911]int Eth-Trunk 1
[Xzzzz911-Eth-Trunk1]q
[Xzzzz911]int Ethernet 0/0/1
[Xzzzz911-Ethernet0/0/1]eth-trunk 1
Info: This operation may take a few seconds. Please wait for a moment...done.
[Xzzzz911-Ethernet0/0/1]q
[Xzzzz911]int Ethernet 0/0/2
[Xzzzz911-Ethernet0/0/2]eth-trunk 1
Info: This operation may take a few seconds. Please wait for a moment...done.
[Xzzzz911-Ethernet0/0/2]q
配置SW2:
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname Xzzzz911
[Xzzzz911]undo info-center enable
Dec 15 2024 10:33:02-08:00 Xzzzz911 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011
.5.25.191.3.1 configurations have been changed. The current change number is 4,
the change loop count is 0, and the maximum number of records is 4095.
Info: Information center is disabled.
[Xzzzz911]int Eth-Trunk 1
[Xzzzz911-Eth-Trunk1]q
[Xzzzz911]int Ethernet 0/0/1
[Xzzzz911-Ethernet0/0/1]eth-trunk 1
Info: This operation may take a few seconds. Please wait for a moment...done.
[Xzzzz911-Ethernet0/0/1]q
[Xzzzz911]int Ethernet 0/0/2
[Xzzzz911-Ethernet0/0/2]eth-trunk 1
Info: This operation may take a few seconds. Please wait for a moment...done.
[Xzzzz911-Ethernet0/0/2]q
通过查看聚合情况,也可以发现e0/0/1和0/0/2端口聚合在一起了
然后将两个交换机之间的链路删除一个,可以发现两个PC客户端会有一段时间ping不通,但是过一会就可以ping通了,这就是链路聚合的作用
LACP模式:
将两个交换机之间的三个端口中第一二个端口设置为主要端口,第三个端口设置为备份端口,配置如下:
配置SW1:
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname Xzzzz911
[Xzzzz911]undo info-center enable
Info: Information center is disabled.
[Xzzzz911]int Eth-Trunk 1
[Xzzzz911-Eth-Trunk1]mode lacp-static
[Xzzzz911-Eth-Trunk1]q
[Xzzzz911]interface Ethernet0/0/1
[Xzzzz911-Ethernet0/0/1]eth-trunk 1
Info: This operation may take a few seconds. Please wait for a moment...done.
[Xzzzz911-Ethernet0/0/1]q
[Xzzzz911]interface Ethernet0/0/2
[Xzzzz911-Ethernet0/0/2]eth-trunk 1
Info: This operation may take a few seconds. Please wait for a moment...done.
[Xzzzz911-Ethernet0/0/2]q
[Xzzzz911]interface Ethernet0/0/3
[Xzzzz911-Ethernet0/0/3]eth-trunk 1
Info: This operation may take a few seconds. Please wait for a moment...done.
[Xzzzz911-Ethernet0/0/3]q
[Xzzzz911]lacp priority 100
[Xzzzz911]interface Ethernet0/0/1
[Xzzzz911-Ethernet0/0/1]lacp priority 100
[Xzzzz911-Ethernet0/0/1]q
[Xzzzz911]interface Ethernet0/0/2
[Xzzzz911-Ethernet0/0/2]lacp priority 100
[Xzzzz911-Ethernet0/0/2]q
[Xzzzz911]interface Eth-Trunk 1
[Xzzzz911-Eth-Trunk1]max active-linknumber 2
[Xzzzz911-Eth-Trunk1]q
配置SW2:
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname Xzzzz911
[Xzzzz911]undo info-center enable
Info: Information center is disabled.
[Xzzzz911]int Eth-Trunk 1
[Xzzzz911-Eth-Trunk1]mode lacp-static
[Xzzzz911-Eth-Trunk1]q
[Xzzzz911]interface Ethernet0/0/1
[Xzzzz911-Ethernet0/0/1]eth-trunk 1
Info: This operation may take a few seconds. Please wait for a moment...done.
[Xzzzz911-Ethernet0/0/1]q
[Xzzzz911]interface Ethernet0/0/2
[Xzzzz911-Ethernet0/0/2]eth-trunk 1
Info: This operation may take a few seconds. Please wait for a moment...done.
[Xzzzz911-Ethernet0/0/2]q
[Xzzzz911]interface Ethernet0/0/3
[Xzzzz911-Ethernet0/0/3]eth-trunk 1
Info: This operation may take a few seconds. Please wait for a moment...done.
[Xzzzz911-Ethernet0/0/3]q
[Xzzzz911]lacp priority 100
[Xzzzz911]interface Ethernet0/0/1
[Xzzzz911-Ethernet0/0/1]lacp priority 100
[Xzzzz911-Ethernet0/0/1]q
[Xzzzz911]interface Ethernet0/0/2
[Xzzzz911-Ethernet0/0/2]lacp priority 100
[Xzzzz911-Ethernet0/0/2]q
[Xzzzz911]interface Eth-Trunk 1
[Xzzzz911-Eth-Trunk1]max active-linknumber 2
[Xzzzz911-Eth-Trunk1]q
两个交换机之间就只用聚合链路来进行数据交换,不再使用生成树了
总结:
本次实验成功配置了华为交换机的链路聚合功能,实现了带宽增加、链路可靠性提高和负载均衡的目标。链路聚合技术是现代网络架构中不可或缺的一部分,它能够有效提升网络的性能和稳定性。通过本次实验,加深了对链路聚合技术的理解和应用,为未来的网络设计和优化提供了宝贵经验。
多练多看多总结