赞
踩
来源:CSDN
作者:最铁头的网工 (全球首批HCIA-DATACOM认证者)
认证技术:关于HCIA-DATACOM认证技术知识会在我博客做持续更新。。。
本期分享:系列15点到16点半-技术热讯
感谢大家关注-最铁头的网工,请大家持续关注就可以了哦!关于进阶级手册在下方↓↓↓
众元教育-华为HCIA-DATACOM技术认证课:课程通道
众元教育-华为HCIA-DATACOM技术认证裙:414605852
随着网络规模不断扩大,用户对骨干链路的带宽和可靠性提出越来越高的要求。在传统技术中,常用更换高速率的接口板或更换支持高速率接口板的设备的方式来增加带宽,但这种方案需要付出高额的费用,而且不够灵活。
采用链路聚合技术可以在不进行硬件升级的条件下,通过将多个物理接口捆绑为一个逻辑接口,达到增加链路带宽的目的。在实现增大带宽目的的同时,链路聚合采用备份链路的机制,可以有效的提高设备之间链路的可靠性。链路聚合技术主要有以下三个优势:
本实验将通过手工和LACP模式的以太网链路聚合的配置,帮助学员了解以太网链路聚合技术的配置及原理。
在生成树实验中,Sl与S2之间的两条链路无法同时处于数据转发的状态。为了充分利用这两条链路的带宽,需要在S1和S2之间配置以太网链路聚合。
1.配置手工模式链路聚合
2.配置LACP模式链路聚合
3.通过修改参数控制活动链路
4.修改负载分担方式
# 创建Eth-Trunk接口
[S1]interface Eth-Trunk 1
interface eth-trunk命令用来进入已经存在的Eth-Trunk接口,或创建并进入Eth-Trunk接口。数字“1”代表接口编号,编号范围根据设备情况有所不同。
[S2]interface Eth-Trunk 1
# 设置Eth-Trunk 接口的聚合模式
mode命令用来配置Eth-Trunk的工作模式,有LACP模式和手工负载分担模式(手工模式)两种,缺省情况下,Eth-Trunk的工作模式为手工负载分担模式。此处S1上的模式配置仅为示范目的,实际操作时不需要。
[S1]interface GigabitEthernet 0/0/10
[S1-GigabitEthernet0/0/10]eth-trunk 1
Info: This operation may take a few seconds. Please wait for a moment...done.
[S1]interface GigabitEthernet 0/0/11
[S1-GigabitEthernet0/0/10]eth-trunk 1
Info: This operation may take a few seconds. Please wait for a moment...done.
[S1]interface GigabitEthernet 0/0/12
[S1-GigabitEthernet0/0/10]eth-trunk 1
Info: This operation may take a few seconds. Please wait for a moment...done.
可进入到成员接口的接口视图下,逐一添加到Eth-Trunk接口。也可以在Eth-Trunk接口视图下通过trunkport命令批量添加接口。
[S2-Eth-Trunk1]trunkport GigabitEthernet 0/0/10 to 0/0/12
Info: This operation may take a few seconds. Please wait for a moment...done.
[S1]display eth-trunk 1
Eth-Trunk1's state information is:
WorkingMode: NORMAL Hash arithmetic: According to SIP-XOR-DIP
Least Active-linknumber: 1 Max Bandwidth-affected-linknumber: 8
Operate status: up Number Of Up Port In Trunk: 3
--------------------------------------------------------------------------------
PortName Status Weight
GigabitEthernet0/0/10 Up 1
GigabitEthernet0/0/11 Up 1
GigabitEthernet0/0/12 Up 1
# 删除现有Eth-Trunk接口下的成员接口
[S1]interface Eth-Trunk 1
[S1-Eth-Trunk1]undo trunkport GigabitEthernet 0/0/10 to 0/0/12
Info: This operation may take a few seconds. Please wait for a moment...done.
[S2]interface Eth-Trunk 1
[S2-Eth-Trunk1]undo trunkport GigabitEthernet 0/0/10 to 0/0/12
Info: This operation may take a few seconds. Please wait for a moment...done.
在修改Eth-Trunk接口的聚合模式之前,需要确保Eth-Trunk中没有任何成员接口。
# 修改聚合模式
[S1]interface Eth-Trunk 1
[S1-Eth-Trunk1]mode lacp-static
[S2]interface Eth-Trunk 1
[S2-Eth-Trunk1]mode lacp-static
mode lacp-static指定Eth-Trunk工作模式为LACP模式。
注:部分版本的设备命令为mode lacp
# 将成员接口加入聚合组
[S1]interface Eth-Trunk 1
[S1-Eth-Trunk1]trunkport GigabitEthernet 0/0/10 to 0/0/12
Info: This operation may take a few seconds. Please wait for a moment...done.
[S2]interface Eth-Trunk 1
[S2-Eth-Trunk1]trunkport GigabitEthernet 0/0/10 to 0/0/12
Info: This operation may take a few seconds. Please wait for a moment...done.
# 查看Eth-Trunk接口状态
[S1]display eth-trunk 1 Eth-Trunk1's state information is: Local: LAG ID: 1 WorkingMode: STATIC Preempt Delay: Disabled Hash arithmetic: According to SIP-XOR-DIP System Priority: 32768 System ID: 4c1f-cc45-0ad9 Least Active-linknumber: 1 Max Active-linknumber: 8 Operate status: up Number Of Up Port In Trunk: 3 -------------------------------------------------------------------------------- ActorPortName Status PortType PortPri PortNo PortKey PortState Weight GigabitEthernet0/0/10 Selected 1GE 32768 11 305 10111100 1 GigabitEthernet0/0/11 Selected 1GE 32768 12 305 10111100 1 GigabitEthernet0/0/12 Selected 1GE 32768 13 305 10111100 1 Partner: -------------------------------------------------------------------------------- ActorPortName SysPri SystemID PortPri PortNo PortKey PortState GigabitEthernet0/0/10 32768 4c1f-ccd4-2145 32768 11 305 10111100 GigabitEthernet0/0/11 32768 4c1f-ccd4-2145 32768 12 305 10111100 GigabitEthernet0/0/12 32768 4c1f-ccd4-2145 32768 13 305 10111100
当网络正常时,只需要GigabitEthernet0/0/11和GigabitEthernet0/0/12接口处于转发状态,GigabitEthernet0/0/10接口作为备份。但当活动接口数量少于2时,直接关闭整个Eth-Trunk接口。
# 配置设备S1的LACP优先级,使其成为主动端设备
[S1]lacp priority 120
# 配置接口优先级,优选GigabitEthernetO/O/11和GigabitEthernet0/0/12接口
[S1]interface GigabitEthernet 0/0/10
[S1-GigabitEthernet0/0/10]lacp priority 40000
使能了LACP模式链路聚合的两端设备均会收发的LACPDU报文。
首先选举主动端设备:
1.比较系统优先级字段,如果对端的系统优先级高于本端的系统优先级(默认为32768,越小越优),则确定对端为LACP主动端。
2.如果系统优先级相同,比较两端设备的MAC地址,MAC地址小的一端为LACP主动端。
选出主动端后,两端都会以主动端的接口优先级来选择活动接口,接口优先级越小越优,默认为32768。
# 配置Eth-trunk活动接口数上限阈值和下限阈值
[S1]interface Eth-Trunk 1
[S1-Eth-Trunk1]max active-linknumber 2
[S1-Eth-Trunk1]least active-linknumber 2
在一个Eth-Trunk接口内,活动接口数可以影响到Eth-Trunk接口的状态和带宽。Eth-Trunk接口的带宽是所有处于Up状态的成员口带宽之和。为保证Eth-Trunk接口的状态和带宽,可以设置以下两个阈值,以减小成员链路状态的变化带来的影响。
[S1]interface Eth-Trunk 1
[S1-Eth-Trunk1]lacp preempt enable
在LACP模式下,当活动链路中出现故障链路时,系统会从备用链路中选择优先级最高的链路替代故障链路;如果被替代的故障链路恢复了正常,而且该链路的优先级又高于替代自己的链路。这种情况下,如果使能了LACP优先级抢占功能,高优先级链路会抢占低优先级链路,回切到活动状态。lacp preempt enable命令用来使能LACP模式下LACP优先级抢占的功能,缺省情况下,优先级抢占处于禁止状态。
# 查看当前Eth-Trunk接口状态
[S1]display eth-trunk 1 Eth-Trunk1's state information is: Local: LAG ID: 1 WorkingMode: STATIC Preempt Delay Time: 30 Hash arithmetic: According to SIP-XOR-DIP System Priority: 100 System ID: 4c1f-ccd5-2676 Least Active-linknumber: 2 Max Active-linknumber: 2 Operate status: up Number Of Up Port In Trunk: 2 -------------------------------------------------------------------------------- ActorPortName Status PortType PortPri PortNo PortKey PortState Weight GigabitEthernet0/0/10 Unselect 1GE 40000 11 305 10100000 1 GigabitEthernet0/0/11 Selected 1GE 32768 12 305 10111100 1 GigabitEthernet0/0/12 Selected 1GE 32768 13 305 10111100 1 Partner: -------------------------------------------------------------------------------- ActorPortName SysPri SystemID PortPri PortNo PortKey PortState GigabitEthernet0/0/10 32768 4c1f-cc9a-4769 32768 11 305 10110000 GigabitEthernet0/0/11 32768 4c1f-cc9a-4769 32768 12 305 10111100 GigabitEthernet0/0/12 32768 4c1f-cc9a-4769 32768 13 305 10111100
当前GigabitEthernet0/0/11和GigabitEthernet0/0/12处于激活状态。
# 手工关闭GigabitEthernet0/0/12模拟链路故障
[S1]interface GigabitEthernet 0/0/12
[S1-GigabitEthernet0/0/12]shutdown
[S1]display eth-trunk 1 Eth-Trunk1's state information is: Local: LAG ID: 1 WorkingMode: STATIC Preempt Delay Time: 30 Hash arithmetic: According to SIP-XOR-DIP System Priority: 100 System ID: 4c1f-ccd5-2676 Least Active-linknumber: 2 Max Active-linknumber: 2 Operate status: up Number Of Up Port In Trunk: 2 -------------------------------------------------------------------------------- ActorPortName Status PortType PortPri PortNo PortKey PortState Weight GigabitEthernet0/0/10 Selected 1GE 40000 11 305 10111100 1 GigabitEthernet0/0/11 Selected 1GE 32768 12 305 10111100 1 GigabitEthernet0/0/12 Unselect 1GE 32768 13 305 10100010 1 Partner: -------------------------------------------------------------------------------- ActorPortName SysPri SystemID PortPri PortNo PortKey PortState GigabitEthernet0/0/10 32768 4c1f-cc9a-4769 32768 11 305 10111100 GigabitEthernet0/0/11 32768 4c1f-cc9a-4769 32768 12 305 10111100 GigabitEthernet0/0/12 0 0000-0000-0000 0 0 0 10100011
GigabitEthernet 0/0/10已经转为激活状态。
# 再手工关闭GigabitEthernet 0/0/11模拟链路故障
[S1]interface GigabitEthernet 0/0/12
[S1-GigabitEthernet0/0/12]shutdown
[S1]display eth-trunk 1 Eth-Trunk1's state information is: Local: LAG ID: 1 WorkingMode: STATIC Preempt Delay Time: 30 Hash arithmetic: According to SIP-XOR-DIP System Priority: 100 System ID: 4c1f-ccd5-2676 Least Active-linknumber: 2 Max Active-linknumber: 2 Operate status: down Number Of Up Port In Trunk: 0 -------------------------------------------------------------------------------- ActorPortName Status PortType PortPri PortNo PortKey PortState Weight GigabitEthernet0/0/10 Unselect 1GE 40000 11 305 10100000 1 GigabitEthernet0/0/11 Unselect 1GE 32768 12 305 10100010 1 GigabitEthernet0/0/12 Unselect 1GE 32768 13 305 10100010 1 Partner: -------------------------------------------------------------------------------- ActorPortName SysPri SystemID PortPri PortNo PortKey PortState GigabitEthernet0/0/10 32768 4c1f-cc9a-4769 32768 11 305 10110000 GigabitEthernet0/0/11 0 0000-0000-0000 0 0 0 10100011 GigabitEthernet0/0/12 0 0000-0000-0000 0 0 0 10100011
由于设置了Eth-Trunk的活动链路下限阈值为2,所以聚合组中可用活动接口数量少于2时,整个聚合组对应的接口将会被关闭。尽管此时GigabitEthernet0/0/10处于UP状态,但是仍处于Unselect状态。
# 开启上一步中关闭的接口
[S1]interface GigabitEthernet 0/0/11
[S1-GigabitEthernet0/0/11]undo shutdown
[S1]interface GigabitEthernet 0/0/12
[S1-GigabitEthernet0/0/12]undo shutdown
# 大约30秒后,查看当前Eth-Trunk1的接口状态
[S1]display eth-trunk 1 Eth-Trunk1's state information is: Local: LAG ID: 1 WorkingMode: STATIC Preempt Delay Time: 30 Hash arithmetic: According to SIP-XOR-DIP System Priority: 100 System ID: 4c1f-ccd5-2676 Least Active-linknumber: 2 Max Active-linknumber: 2 Operate status: up Number Of Up Port In Trunk: 2 -------------------------------------------------------------------------------- ActorPortName Status PortType PortPri PortNo PortKey PortState Weight GigabitEthernet0/0/10 Unselect 1GE 40000 11 305 10100000 1 GigabitEthernet0/0/11 Selected 1GE 32768 12 305 10111100 1 GigabitEthernet0/0/12 Selected 1GE 32768 13 305 10111100 1 Partner: -------------------------------------------------------------------------------- ActorPortName SysPri SystemID PortPri PortNo PortKey PortState GigabitEthernet0/0/10 32768 4c1f-cc9a-4769 32768 11 305 10110000 GigabitEthernet0/0/11 32768 4c1f-cc9a-4769 32768 12 305 10111100 GigabitEthernet0/0/12 32768 4c1f-cc9a-4769 32768 13 305 10111100
由于使能了Eth-Trunk接口的抢占功能,所以当GigabitEthernet0/0/11和GigabitEthernet0/0/12接口进入UP状态之后,这两个接口的接口的优先级高于GigabitEthernet0/0/10,所以GigabitEthernet0/0/10会进入unselect状态。同时因为系统为了保证链路的稳定性,默认的抢占延时为30秒,所以要在30秒后才会发生抢占。
# 修改Eth-Trunk接口的负载分担模式为基于目的IP地址
[S1]interface Eth-Trunk 1
[S1-Eth-Trunk1]load-balance dst-ip
当需要将Eth-Trunk接口的流量分散到不同的链路上,最后能到达统一目的地时,使用load-balance命令配置Eth-Trunk接口负载分担模式,以确保出方向的流量在各物理链路间进行合理的负载分担,避免链路阻塞。由于负载分担只对出方向的流量有效,因此链路两端接口的负载分担模式可以不一致,两端互不影响。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。