转载自:https://support.huawei.com/hedex/hdx.do?docid=EDOC1100318314&id=ZH-CN_TOPIC_0000001513042494

Eth-Trunk简介

定义

Eth-Trunk又叫以太网链路聚合,它通过将多条以太网物理链路捆绑在一起成为一条逻辑链路,从而实现增加链路带宽的目的。同时,这些捆绑在一起的链路通过相互间的动态备份,可以有效地提高链路的可靠性。

目的

随着网络规模不断扩大,用户对骨干链路的带宽和可靠性提出越来越高的要求。在传统技术中,常用更换高速率的单板或更换支持高速率单板的设备的方式来增加带宽,但这种方案需要付出高额的费用,而且不够灵活。

Eth-Trunk采用链路聚合技术,可以在不进行硬件升级的条件下,通过将多个物理接口捆绑为一个逻辑接口,达到增加链路带宽的目的。在实现增大带宽目的的同时,Eth-Trunk采用备份链路的机制,可以有效的提高设备之间链路的可靠性。

Eth-Trunk主要有以下三个优势:

  • 增加带宽

    链路聚合接口的最大带宽可以达到各成员接口带宽之和。

  • 提高可靠性

    当某条活动链路出现故障时,流量可以切换到其他可用的成员链路上,从而提高链路聚合接口的可靠性。

  • 负载分担

    在一个链路聚合组内,可以实现在各成员活动链路上的负载分担。

基本概念

如图1所示,DeviceA与DeviceB之间通过三条以太网物理链路相连,将这三条链路捆绑在一起,就成为了一条逻辑链路,这条逻辑链路的最大带宽等于原先三条以太网物理链路的带宽总和,从而达到了增加链路带宽的目的;同时,这三条以太网物理链路相互备份,当某条活动链路出现故障时,流量可以切换到其他可用的成员链路上,有效地提高了链路的可靠性。

图1 Eth-Trunk示意图
zh-cn_image_0000001176741201.gif

下面介绍Eth-Trunk的一些基本概念。

链路聚合组和链路聚合接口

如图2所示,链路聚合组LAG(Link Aggregation Group)是指将若干条以太链路捆绑在一起所形成的逻辑链路,也称为Eth-Trunk链路。

每个聚合组唯一对应着一个逻辑接口,这个逻辑接口称之为链路聚合接口或Eth-Trunk接口。Eth-Trunk接口可以作为普通的以太网接口来使用,实现各种路由协议以及其他业务。与普通以太网接口的差别在于:转发的时候链路聚合组需要从成员接口中选择一个或多个接口来进行数据转发。

成员接口和成员链路

如图2所示,组成Eth-Trunk接口的各个物理接口称为成员接口。成员接口对应的链路称为成员链路。

图2 链路聚合组与链路聚合接口、成员接口和成员链路的关系示意图
zh-cn_image_0000001130781536.png

活动接口和非活动接口、活动链路和非活动链路

Eth-Trunk接口的成员接口存在活动接口和非活动接口两种。转发数据的接口称为活动接口,不转发数据的接口称为非活动接口。

活动接口对应的链路称为活动链路,非活动接口对应的链路称为非活动链路。

活动接口数上限阈值

设置活动接口数上限阈值的目的是在保证带宽的情况下提高网络的可靠性。当活动接口数目达到上限阈值时,再向Eth-Trunk接口中添加成员接口,不会增加Eth-Trunk活动接口的数目,超过上限阈值的链路状态将被置为Down,作为备份链路。

例如,有8条无故障链路在一个Eth-Trunk接口内,每条链路都能提供1G的带宽,现在最多需要5G的带宽,那么上限阈值就可以设为5或者更大的值。其他的链路就自动进入备份状态以提高网络的可靠性。

手工模式链路聚合不支持活动接口数上限阈值的配置。

活动接口下限阈值

设置活动接口数下限阈值是为了保证最小带宽,当活动链路数目小于下限阈值时,Eth-Trunk接口的状态转为Down。在多链路冗余场景下,可以通过设置活动接口数下限阈值,保证主链路带宽不够的情况下切换至备用链路。

链路聚合模式

根据是否启用链路聚合控制协议LACP(Link Aggregation Control Protocol),链路聚合的模式分为手工模式和LACP模式,具体请参见手工模式Eth-TrunkLACP模式Eth-Trunk

手工模式Eth-Trunk

手工模式Eth-Trunk,Eth-Trunk的建立、成员接口的加入由手工配置,没有链路聚合控制协议LACP的参与。如果某条活动链路故障,链路聚合组自动在剩余的活动链路中平均分担流量。当需要在两个直连设备之间提供一个较大的链路带宽,而其中一端或两端设备都不支持LACP协议时,可以配置手工模式Eth-Trunk。

如图1所示,DeviceA与DeviceB之间创建Eth-Trunk,手工模式下三条活动链路都参与数据转发并分担流量。当一条链路故障时,故障链路无法转发数据,链路聚合组自动在剩余的两条活动链路中分担流量。

图1 手工模式Eth-Trunk
zh-cn_image_0000001176661401.png

LACP模式Eth-Trunk

LACP模式Eth-Trunk,Eth-Trunk的建立、成员接口的加入也需要手工配置,最大的区别就是链路聚合控制协议LACP的参与。

作为链路聚合技术,手工模式Eth-Trunk可以实现多个物理接口聚合成一个Eth-Trunk接口来提高带宽,同时能够检测到同一聚合组内的成员链路有断路等有限故障,但是无法检测到链路层故障、链路错连等故障。为了提高Eth-Trunk的容错性,同时能提供备份功能,保证成员链路的高可靠性,出现了链路聚合控制协议LACP(Link Aggregation Control Protocol)。

LACP是基于IEEE802.3ad标准的一种实现链路动态聚合与解聚合的协议,以供设备根据自身配置自动形成聚合链路并启动聚合链路收发数据,LACP模式就是采用LACP的一种链路聚合模式。聚合链路形成以后,LACP负责维护链路状态,在聚合条件发生变化时,自动调整链路聚合。

如图所示,DeviceA与DeviceB之间创建Eth-Trunk,需要将DeviceA上的四个接口与DeviceB捆绑成一个Eth-Trunk。由于错将DeviceA上的一个接口与DeviceC相连,这将会导致DeviceA向DeviceB传输数据时可能会将本应该发到DeviceB的数据发送到DeviceC上。而手工模式的Eth-Trunk不能及时检测到此故障。

如果在DeviceA和DeviceB上都启用LACP协议,经过协商后,Eth-Trunk就会选择正确连接的链路作为活动链路来转发数据,从而DeviceA发送的数据能够正确到达DeviceB。

图1 Eth-Trunk错连示意图
zh-cn_image_0000001130781630.png

LACP模式下Eth-Trunk建立过程

LACP通过链路聚合控制协议数据单元LACPDU(Link Aggregation Control Protocol Data Unit)与对端交互信息。在LACP模式的Eth-Trunk中加入成员接口后,这些接口将通过发送LACPDU向对端通告自己的系统优先级、MAC地址、接口优先级、接口号和操作Key(用来判断各接口相连对端是否在同一聚合组以及各接口带宽是否一致等)等信息。对端接收到这些信息后,将这些信息与自身接口所保存的信息比较,用以选择能够聚合的接口,双方对哪些接口能够成为活动接口达成一致,确定活动链路。

LACP模式中,系统LACP优先级和接口LACP优先级是两个重要的参数,直接影响链路聚合主动端和活动接口的选择。

  • 系统LACP优先级

    系统LACP优先级是为了区分两端设备优先级的高低而配置的参数。LACP模式下,两端设备所选择的活动接口必须保持一致,否则链路聚合组就无法建立。此时可以使其中一端具有更高的优先级,另一端根据高优先级的一端来选择活动接口即可。系统LACP优先级值越小优先级越高。

  • 接口LACP优先级

    接口LACP优先级是为了区别同一个Eth-Trunk接口中的不同成员接口被选为活动接口的优先程度,优先级高的接口将优先被选为活动接口。接口LACP优先级值越小,优先级越高。

如果您想了解LACPDU报文的详细结构,可以使用报文格式查询工具

LACP模式Eth-Trunk建立的过程如下:

  1. 在LACP模式的Eth-Trunk中加入成员接口后,两端互相发送LACPDU报文。

    如图2所示,在DeviceA和DeviceB上创建Eth-Trunk并配置为LACP模式,然后向Eth-Trunk中手工加入成员接口。此时成员接口上便启用了LACP协议,两端互发LACPDU报文。

    图2 LACP模式Eth-Trunk互发LACPDU
    zh-cn_image_0000001130621834.png

  2. 确定主动端和活动链路。

    如图3所示,两端设备均会收到对端发来的LACPDU报文。以DeviceB为例,当DeviceB收到DeviceA发送的报文时,DeviceB会查看并记录对端信息,然后比较系统优先级字段,如果DeviceA的系统优先级高于本端的系统优先级,则确定DeviceA为LACP主动端。如果DeviceA和DeviceB的系统优先级相同,比较两端设备的MAC地址,MAC地址小的一端为LACP主动端。

    选出主动端后,两端都会以主动端的接口优先级来选择活动接口,如果主动端的接口优先级都相同则选择接口编号比较小的为活动接口。两端设备选择了一致的活动接口后,活动链路组便可以建立起来,这些活动链路以负载分担的方式转发数据。

    图3 LACP模式确定主动端和活动链路的过程
    zh-cn_image_0000001176661381.png

    LACP抢占

如图4所示,接口Port1、Port2和Port3为Eth-Trunk的成员接口,DeviceA为主动端,活动接口数上限阈值为2,三个接口的LACP优先级分别为10、20、30。当通过LACP协议协商完毕后,接口Port1和Port2因为优先级较高被选作活动接口,Port3成为备份接口。

图4 LACP抢占场景
zh-cn_image_0000001176741291.png

使能LACP抢占功能后,聚合组会始终保持高优先级的接口作为活动接口的状态。以下两种情况需要使能LACP抢占功能:

  • Port1接口出现故障而后又恢复了正常。当接口Port1出现故障时被Port3所取代,如果Eth-Trunk接口未使能LACP抢占功能,则故障恢复时Port1将处于备份状态;如果使能了LACP抢占功能,当Port1故障恢复时,由于接口优先级比Port3高,将重新成为活动接口,Port3再次成为备份接口。
  • 如果希望Port3接口替换Port1、Port2中的一个接口成为活动接口,可以使能LACP抢占功能,并配置Port3的接口LACP优先级较高。如果没有使能LACP抢占功能,即使将备份接口的优先级调整为高于当前活动接口的优先级,系统也不会重新选择活动接口。

LACP抢占延时

抢占延时是LACP抢占发生时,处于备用状态的链路将会等待一段时间后再切换到转发状态。配置抢占延时是为了避免由于某些链路状态频繁变化而导致Eth-Trunk数据传输不稳定的情况。

如图4所示,Port1由于链路故障切换为非活动接口,此后该链路又恢复了正常。若系统使能了LACP抢占功能并配置了抢占延时,Port1重新切换回活动状态就需要经过抢占延时的时间。

活动链路与非活动链路切换

LACP模式Eth-Trunk两端设备中任何一端检测到以下事件,都会触发聚合组的链路切换:

  • 链路Down事件。
  • LACP协议发现链路故障。
  • 接口不可用。
  • 在使能了LACP抢占功能的前提下,更改备份接口的优先级高于当前活动接口的优先级。

在以上故障场景中,可以按照如下步骤进行切换:

  1. 关闭故障链路。
  2. 从备份链路中选择优先级最高的链路接替活动链路中的故障链路。
  3. 优先级最高的备份链路转为活动状态并转发数据,完成切换。

LACP模式实现方式

链路聚合协议LACP分为静态LACP模式和动态LACP模式,其特点如下。

静态LACP模式

如图5所示,两台直接相连的设备都支持LACP协议,在两台设备上配置静态LACP模式Eth-Trunk接口,实现流量的负载分担与链路的冗余备份。静态LACP模式应用场景比较广泛,在向用户提供备份链路的同时,又提供一定的故障保护能力。当有一条链路出现故障时,系统能够自动选择一条优先级最高的可用备份链路变为活动链路。

图5 静态LACP模式Eth-Trunk接口示意图
zh-cn_image_0000001218111834.png

动态LACP模式

  • 静态LACP模式下,LACP协商失败后Eth-Trunk变为Down,不能转发数据。
  • 动态LACP模式下,LACP协商失败后Eth-Trunk变为Down,但其成员接口继承Eth-Trunk的VLAN属性状态变为Indep,可独立进行二层数据转发。

当部署动态LACP模式Eth-Trunk接口的设备能够收到对端的LACP协议报文时,两端设备将通过LACP协议报文进行聚合参数协商。协商成功后的聚合链路功能与两端都配置为静态LACP模式Eth-Trunk接口的链路一样。

图6

  • 当服务器A重启后为空配置时,LACP协商失败,此时动态LACP协议可保证服务器A通过Eth-Trunk成员接口从文件服务器B获取到配置文件。
  • 当DeviceA收到服务器A的LACP协议报文时,服务器A和DeviceA将通过LACP协议报文进行聚合参数协商。

图6 动态LACP模式Eth-Trunk接口示意图
zh-cn_image_0000001262471731.png

动态LACP模式Eth-Trunk仅用于华为公司设备与服务器互连的场景。其他场景下,建议部署静态LACP模式Eth-Trunk,如果部署动态LACP,则网络会有成环风险。

手工模式和LACP模式Eth-Trunk的对比

表1

维度 手工模式 LACP模式
Eth-Trunk的建立方式 Eth-Trunk接口的创建、成员接口的加入由手工配置,没有链路聚合控制协议的参与。 Eth-Trunk接口的创建、成员接口的加入由手工配置,LACP协议参与链路动态调整,负责链路状态维护。在聚合条件发生变化时,自动调整或解散链路聚合。
设备是否需要支持LACP协议 不需要 需要
数据转发 正常情况下,所有链路都是活动链路。所有活动链路均参与数据转发。如果某条活动链路故障,链路聚合组自动在剩余的活动链路中分担流量。 正常情况下,部分链路是活动链路。所有活动链路均参与数据转发。如果某条活动链路故障,链路聚合组自动在非活动链路中选择一条链路作为活动链路,参与数据转发的链路数目不变。
检测故障 只能检测到同一聚合组内的成员链路有断路等故障,无法检测到链路断连、错连等故障。 不仅能够检测到同一聚合组内的成员链路有断路等故障,还可以检测到链路故障、链路错连等故障。

Eth-Trunk缺省配置

参数 缺省值
链路聚合模式 手工模式
系统LACP优先级 32768
接口LACP优先级 32768
LACP抢占 去使能

创建Eth-Trunk接口并配置链路聚合模式

前提条件

在配置Eth-Trunk之前,需完成以下任务:

连接接口,使接口的物理层状态为Up。

背景信息

手工模式Eth-Trunk适用于对端设备不支持LACP协议的场景;动态LACP模式Eth-Trunk仅用于华为公司设备与服务器互连的场景;其他场景下,建议部署静态LACP模式Eth-Trunk,如果部署动态LACP,则网络会有成环风险。

操作步骤

  1. 进入系统视图。

    system-view
  2. 创建Eth-Trunk接口并进入Eth-Trunk接口视图。

    interface eth-trunk trunk-id
  3. (可选)将Eth-Trunk接口切换为二层模式或三层模式,请根据当前接口模式自行选择是否要执行此步骤。

    仅S6730-H-V2、S5755-H、S5732-H-V2系列支持该步骤。

    切换为二层模式:

    portswitch   

    切换成三层模式:

    undo portswitch
    • Eth-Trunk接口支持二层Eth-Trunk接口和三层Eth-Trunk接口:当需要将Eth-Trunk接口加入VLAN或进行二层转发时,需要配置二层Eth-Trunk接口,此时Eth-Trunk接口的三层功能和标识被禁止,并将采用系统MAC地址;当需要通过Eth-Trunk接口承载三层数据报文时,需要配置三层Eth-Trunk接口,此时可以在Eth-Trunk接口上配置IP地址,MAC地址及MTU值等。
    • Eth-Trunk接口的二三层模式不影响成员接口的加入,成员接口既可以加入二层Eth-Trunk,也可以加入三层Eth-Trunk。
  4. 配置链路聚合模式。

    mode { manual load-balance | lacp-static | lacp-dynamic }

    缺省情况下,链路聚合模式为manual load-balance

    manual load-balance表示手工模式Eth-Trunk,该模式下所有链路都参与负载分担;lacp-static表示静态LACP模式Eth-Trunk,lacp-dynamic表示动态LACP模式Eth-Trunk。

  5. (可选)去使能Eth-Trunk的静态LACP稳定优选功能。

    lacp stable-preferred disable

    缺省情况下,使能Eth-Trunk的静态LACP稳定优选功能。

    该功能仅在配置为静态LACP模式的Eth-Trunk生效。

向Eth-Trunk接口中加入成员接口

背景信息

  • 在Eth-Trunk接口视图下添加具体的成员接口,分为批量添加和单个添加两种方式。
  • 在需要加入Eth-Trunk的接口视图下将该接口加入相应的Eth-Trunk接口。

链路聚合前需要了解的注意事项

  • 成员接口加入Eth-Trunk时,必须为缺省的接口类型,成员接口不能配置某些业务(如静态MAC地址),如果配置设备会报错。
  • Eth-Trunk链路两端相连的物理接口的数量、速率、双工方式、流控配置必须一致。
  • Eth-Trunk链路两端相连的物理接口的jumbo(超大帧长度)建议配置为一致。
  • 如果本端设备接口加入了Eth-Trunk,与该接口直连的对端接口也必须加入Eth-Trunk,两端才能正常通信。
  • 两台设备对接时需要保证两端设备上链路聚合的模式一致。
  • 链路聚合可以聚合不同速率、不同双工模式的成员接口;且成员接口可以同时包含光口和电口。
  • Eth-Trunk接口不能嵌套,即成员接口不能是Eth-Trunk接口。
  • LACP模式Eth-Trunk可以聚合不同单板、不同速率及不同双工模式的成员接口。但是不同速率的成员接口不能同时处于转发状态,半双工模式的成员接口无法转发。请在配置前检查成员接口所在单板、接口速率以及双工模式。

在添加成员接口后,如果对Eth-Trunk接口执行命令shutdown,Eth-Trunk接口的物理状态为Administratively DOWN,则成员接口的配置文件会自动显示shutdown,且物理状态也变为Administratively DOWN

操作步骤

  • 在Eth-Trunk接口视图下向Eth-Trunk中添加成员接口

    1. 进入系统视图。

      system-view
    2. 进入Eth-Trunk接口视图。

      interface eth-trunk trunk-id
    3. 执行以下两种方法之一进行成员接口的添加:

      • 批量添加成员接口。

        trunkport interface-type { interface-number1 [ to interface-number2 ] } &<1-16>
      • 添加单个成员接口。

        trunkport interface-type interface-number
  • 在成员接口视图下向Eth-Trunk中添加成员接口

    1. 进入系统视图。

      system-view
    2. 进入Eth-Trunk接口视图。

      interface eth-trunk trunk-id
    3. 进入要捆绑到此Eth-Trunk接口的成员接口的接口视图。

      interface interface-type interface-number
    4. 将当前接口加入Eth-Trunk接口。

      eth-trunk trunk-id

后续处理

当在设备本端和对端配置完创建Eth-Trunk接口并配置链路聚合模式向Eth-Trunk接口中加入成员接口,Eth-Trunk功能即可正常使用,可以继续在Eth-Trunk接口上配置相关业务。如果需要调整Eth-Trunk的状态参数,可以参考(可选)配置手工模式Eth-Trunk参数(可选)配置LACP模式Eth-Trunk参数

链路聚合后需要了解的注意事项

  • 一个以太网接口只能加入到一个Eth-Trunk接口,如果需要加入其他Eth-Trunk接口,必须先退出原来的Eth-Trunk接口。

  • 当成员接口加入Eth-Trunk后,学习MAC地址或ARP地址时是按照Eth-Trunk来学习的,而不是按照成员接口来学习。

  • Eth-Trunk成员接口退出Eth-Trunk接口或者物理接口加入Eth-Trunk接口时,建议先把成员接口/物理接口shutdown,退出/加入Eth-Trunk后再undo shutdown

  • 删除Eth-Trunk接口时需要先删除Eth-Trunk接口中的所有成员接口。

检查配置结果

操作步骤

  • 执行命令display eth-trunk [ trunk-id [ interface interface-type interface-number | verbose ] | brief ],查看Eth-Trunk的配置信息。
  • 执行命令display eth-trunk membership trunk-id,查看Eth-Trunk的成员接口信息。

举例:配置手工模式Eth-Trunk

组网需求

如图所示,DeviceA和DeviceB之间存在多条链路,需要提供较大的带宽来实现流量负载分担,同时也希望能够提供一定的冗余度,保证数据传输和链路的可靠性。

图1 配置手工模式Eth-Trunk组网图

本例中interface1、interface2、interface3分别代表10GE1/0/1、10GE1/0/2、10GE1/0/3。

zh-cn_image_0000001130621750.png

操作步骤

  1. 在DeviceA和DeviceB上分别创建Eth-Trunk1并配置为手工模式。

    # 配置DeviceA。

    <HUAWEI> system-view
    [HUAWEI] sysname DeviceA
    [DeviceA] interface eth-trunk 1
    [DeviceA-Eth-Trunk1] portswitch
    [DeviceA-Eth-Trunk1] mode manual load-balance

    # 配置DeviceB。

    <HUAWEI> system-view
    [HUAWEI] sysname DeviceB
    [DeviceB] interface eth-trunk 1
    [DeviceB-Eth-Trunk1] portswitch
    [DeviceB-Eth-Trunk1] mode manual load-balance
  2. 向DeviceA和DeviceB的Eth-Trunk接口中加入成员接口。

    # 配置DeviceA。

    [DeviceA-Eth-Trunk1] trunkport 10ge 1/0/1 to 1/0/3 
    [DeviceA-Eth-Trunk1] quit

    # 配置DeviceB。

    [DeviceB-Eth-Trunk1] trunkport 10ge 1/0/1 to 1/0/3 
    [DeviceB-Eth-Trunk1] quit

检查配置结果

在任意视图下执行display eth-trunk 1命令,检查Eth-Trunk是否创建成功,及成员接口是否正确加入。

[DeviceA] display eth-trunk 1
Eth-Trunk1's state information is: 
Working Mode: Normal           Hash Arithmetic: profile default
Least Active-linknumber: 1     Max Bandwidth-affected-linknumber: 128
Operating Status: up           Number of Up Ports in Trunk: 3
--------------------------------------------------------------------------------
PortName                        Status       Weight
10GE1/0/1                       Up           1
10GE1/0/2                       Up           1
10GE1/0/3                       Up           1

从以上信息看出Eth-Trunk 1中包含3个成员接口10GE**1/0/110GE**1/0/210GE**1/0/3,成员接口的状态都为Up。Eth-Trunk 1的“Operating Status”为Up**。

配置脚本

  • DeviceA

    #
    sysname DeviceA
    # 
    interface Eth-Trunk1
     portswitch
    # 
    interface 10GE1/0/1 
     eth-trunk 1
    # 
    interface 10GE1/0/2
     eth-trunk 1
    # 
    interface 10GE1/0/3
     eth-trunk 1
    #
    return
  • DeviceB

    #
    sysname DeviceB
    # 
    interface Eth-Trunk1
     portswitch
    # 
    interface 10GE1/0/1 
     eth-trunk 1
    # 
    interface 10GE1/0/2
     eth-trunk 1
    # 
    interface 10GE1/0/3
     eth-trunk 1
    #
    return

举例:配置静态LACP模式Eth-Trunk

组网需求

如图所示,DeviceA和DeviceB之间存在多条链路,在两台设备上配置静态LACP模式链路聚合组,提高两设备之间的带宽与可靠性,具体要求如下:

  • 两条活动链路具有负载分担的能力。
  • 两设备间的链路具有1条冗余备份链路,当活动链路出现故障链路时,备份链路替代故障链路,保持数据传输的可靠性。

图1 配置静态LACP模式Eth-Trunk组网图

本例中interface1、interface2、interface3分别代表10GE1/0/1、10GE1/0/2、10GE1/0/3。

zh-cn_image_0000001176661315.png

操作步骤

  1. 在DeviceA和DeviceB上分别创建Eth-Trunk1并配置为静态LACP模式。

    # 配置DeviceA。

    <HUAWEI> system-view
    [HUAWEI] sysname DeviceA
    [DeviceA] interface eth-trunk 1
    [DeviceA-Eth-Trunk1] mode lacp-static
    [DeviceA-Eth-Trunk1] quit

    # 配置DeviceB。

    <HUAWEI> system-view
    [HUAWEI] sysname DeviceB
    [DeviceB] interface eth-trunk 1
    [DeviceB-Eth-Trunk1] mode lacp-static
    [DeviceB-Eth-Trunk1] quit
  2. 向DeviceA和DeviceB的Eth-Trunk接口中加入成员接口。

    # 配置DeviceA。

    [DeviceA] interface 10ge 1/0/1
    [DeviceA-10GE1/0/1] eth-trunk 1
    [DeviceA-10GE1/0/1] quit
    [DeviceA] interface 10ge 1/0/2
    [DeviceA-10GE1/0/2] eth-trunk 1
    [DeviceA-10GE1/0/2] quit
    [DeviceA] interface 10ge 1/0/3
    [DeviceA-10GE1/0/3] eth-trunk 1
    [DeviceA-10GE1/0/3] quit

    # 配置DeviceB。

    [DeviceB] interface 10ge 1/0/1
    [DeviceB-10GE1/0/1] eth-trunk 1
    [DeviceB-10GE1/0/1] quit
    [DeviceB] interface 10ge 1/0/2
    [DeviceB-10GE1/0/2] eth-trunk 1
    [DeviceB-10GE1/0/2] quit
    [DeviceB] interface 10ge 1/0/3
    [DeviceB-10GE1/0/3] eth-trunk 1
    [DeviceB-10GE1/0/3] quit
  3. 在DeviceA上配置系统优先级为100,DeviceB上保持缺省值,使DeviceA成为LACP主动端。

    [DeviceA] lacp priority 100
  4. 在DeviceA上配置活动接口上限阈值为2,剩余一条作为冗余备份链路。

    [DeviceA] interface eth-trunk 1
    [DeviceA-Eth-Trunk1] lacp max active-linknumber 2
    [DeviceA-Eth-Trunk1] quit
  5. 在DeviceA上配置接口优先级确定活动链路。

    [DeviceA] interface 10ge 1/0/1
    [DeviceA-10GE1/0/1] lacp priority 100
    [DeviceA-10GE1/0/1] quit
    [DeviceA] interface 10ge 1/0/2
    [DeviceA-10GE1/0/2] lacp priority 100
    [DeviceA-10GE1/0/2] quit

检查配置结果

# 查看各Device设备的Eth-Trunk信息,查看链路是否协商成功。

[DeviceA] display eth-trunk 1
Eth-Trunk1's state information is:
Local:
LAG ID: 1                       Working Mode: Static
Preempt Delay: Disabled         Hash Arithmetic: profile default
System Priority: 100            System ID: xxxx-xxxx-xxxx
Least Active-linknumber: 1      Max Active-linknumber: 2
Operating Status: up            Number Of Up Ports In Trunk: 2
Timeout Period: Slow
--------------------------------------------------------------------------------
ActorPortName          Status   PortType PortPri PortNo PortKey PortState Weight
10GE1/0/1              Selected 10GE     100     1      20289   10111100  1
10GE1/0/2              Selected 10GE     100     2      20289   10111100  1
10GE1/0/3              Unselect 10GE     32768   3      20289   10100000  1

Partner:
--------------------------------------------------------------------------------
ActorPortName          SysPri   SystemID        PortPri PortNo PortKey PortState
10GE1/0/1              32768    xxxx-xxxx-xxxx 32768   4      20289   10111100
10GE1/0/2              32768    xxxx-xxxx-xxxx 32768   5      20289   10111100
10GE1/0/3              32768    xxxx-xxxx-xxxx 32768   6      20289   10100000
[DeviceB] display eth-trunk 1
Eth-Trunk1's state information is:
Local:
LAG ID: 1                       Working Mode: Static
Preempt Delay: Disabled         Hash Arithmetic: profile default
System Priority: 32768          System ID: xxxx-xxxx-xxxx
Least Active-linknumber: 1      Max Active-linknumber: 128
Operating Status: up            Number Of Up Ports In Trunk: 2
Timeout Period: Slow
--------------------------------------------------------------------------------
ActorPortName          Status   PortType PortPri PortNo PortKey PortState Weight
10GE1/0/1              Selected 10GE     32768   4      20289   10111100  1
10GE1/0/2              Selected 10GE     32768   5      20289   10111100  1
10GE1/0/3              Unselect 10GE     32768   6      20289   10100000  1

Partner:
--------------------------------------------------------------------------------
ActorPortName          SysPri   SystemID        PortPri PortNo PortKey PortState
10GE1/0/1              100      xxxx-xxxx-xxxx  100     1      20289   10111100
10GE1/0/2              100      xxxx-xxxx-xxxx  100     2      20289   10111100
10GE1/0/3              100      xxxx-xxxx-xxxx  32768   3      20289   10100000

通过以上显示信息可以看到,DeviceA的系统优先级为100,高于DeviceB的系统优先级。Eth-Trunk的成员接口中10GE**1/0/110GE**1/0/2成为活动接口,处于“Selected”状态,接口10GE**1/0/3**处于“Unselect”状态,同时实现冗余备份功能。

配置脚本

  • DeviceA

    #
    sysname DeviceA
    #
    lacp priority 100
    #
    interface Eth-Trunk1 
     mode lacp-static                                                               
     lacp max active-linknumber 2                                                    
    #
    interface 10GE1/0/1
     eth-trunk 1
     lacp priority 100
    #
    interface 10GE1/0/2
     eth-trunk 1
     lacp priority 100
    #
    interface 10GE1/0/3
     eth-trunk 1
    #
    return
  • DeviceB

    #
    sysname DeviceB
    #
    interface Eth-Trunk1 
     mode lacp-static                                                                                                          
    #
    interface 10GE1/0/1
     eth-trunk 1
    #
    interface 10GE1/0/2
     eth-trunk 1
    #
    interface 10GE1/0/3
     eth-trunk 1
    #
    return

举例:配置动态LACP模式Eth-Trunk

组网需求

如图所示,服务器A与DeviceA建立动态LACP模式链路聚合,两端设备将通过动态LACP协议报文进行链路聚合协商。

图1 动态LACP模式Eth-Trunk组网图

本例中interface1、interface2、interface3分别代表10GE1/0/1、10GE1/0/2、10GE1/0/3。

zh-cn_image_0000001176661303.png

操作步骤

  1. 在DeviceA上创建动态LACP模式Eth-Trunk接口,并将以太网物理接口加入Eth-Trunk接口。

    <HUAWEI> system-view
    [HUAWEI] sysname DeviceA
    [DeviceA] interface eth-trunk 1
    [DeviceA-Eth-Trunk1] mode lacp-dynamic
    [DeviceA-Eth-Trunk1] quit
    [DeviceA] interface 10ge 1/0/1
    [DeviceA-10GE1/0/1] eth-trunk 1
    [DeviceA-10GE1/0/1] quit
    [DeviceA] interface 10ge 1/0/2
    [DeviceA-10GE1/0/2] eth-trunk 1
    [DeviceA-10GE1/0/2] quit
    [DeviceA] interface 10ge 1/0/3
    [DeviceA-10GE1/0/3] eth-trunk 1
    [DeviceA-10GE1/0/3] quit
  2. 在DeviceA上配置活动接口上限阈值为2。

    [DeviceA] interface eth-trunk 1
    [DeviceA-Eth-Trunk1] lacp max active-linknumber 2
    [DeviceA-Eth-Trunk1] quit
  3. 在DeviceA上配置接口优先级确定活动链路。

    [DeviceA] interface 10ge 1/0/1
    [DeviceA-10GE1/0/1] lacp priority 100
    [DeviceA-10GE1/0/1] quit
    [DeviceA] interface 10ge 1/0/2
    [DeviceA-10GE1/0/2] lacp priority 100
    [DeviceA-10GE1/0/2] quit

检查配置结果

# 在DeviceA上执行display eth-trunk命令查看Eth-Trunk信息。

[DeviceA] display eth-trunk 1
Eth-Trunk1's state information is:                                                                                                  
Local:                                                                                                                              
LAG ID: 1                       Working Mode: Dynamic                                                                               
Preempt Delay: Disabled         Hash Arithmetic: profile default                                                                    
System Priority: 32768          System ID: xxxx-xxxx-xxxx                                                                           
Least Active-linknumber: 1      Max Active-linknumber: 2                                                                            
Operating Status: up            Number Of Up Ports In Trunk: 0                                                                      
Timeout Period: Slow
--------------------------------------------------------------------------------                                                    
ActorPortName          Status   PortType PortPri PortNo PortKey PortState Weight                                                    
10GE1/0/1              Indep    10GE    100     0      321     10100010  1                                                         
10GE1/0/2              Indep    10GE    100     1      321     10100010  1                                                         
10GE1/0/3              Indep    10GE    32768   2      321     10100010  1                                                         

Partner:                                                                                                                            
--------------------------------------------------------------------------------                                                    
ActorPortName          SysPri   SystemID        PortPri PortNo PortKey PortState                                                    
10GE1/0/1              0        xxxx-xxxx-xxxx 0       0      0       10100011                                                     
10GE1/0/2              0        xxxx-xxxx-xxxx 0       0      0       10100011                                                     
10GE1/0/3              0        xxxx-xxxx-xxxx 0       0      0       10100011

通过以上显示信息可以看到,Eth-Trunk的ID是1,Eth-Trunk的模式是动态LACP模式,Eth-Trunk的成员接口10GE**1/0/110GE**1/0/210GE**1/0/3的状态都为Indep**。

# 当DeviceA能够收到服务器A的LACP协议报文,且两端通过LACP协议报文链路聚合协商成功,在DeviceA上执行display eth-trunk命令查看Eth-Trunk信息。

[DeviceA] display eth-trunk 1
Eth-Trunk1's state information is:                                                                                                  
Local:                                                                                                                              
LAG ID: 1                       Working Mode: Dynamic                                                                               
Preempt Delay: Disabled:        Hash Arithmetic: profile default                                                                    
System Priority: 32768          System ID: xxxx-xxxx-xxxx                                                                           
Least Active-linknumber: 1      Max Active-linknumber: 2                                                                            
Operating Status: up            Number Of Up Ports In Trunk: 2                                                                      
Timeout Period: Slow
--------------------------------------------------------------------------------                                                    
ActorPortName          Status   PortType PortPri PortNo PortKey PortState Weight                                                    
10GE1/0/1              Selected 10GE     100     0      321     10111100  1                                                         
10GE1/0/2              Selected 10GE     100     1      321     10111100  1                                                         
10GE1/0/3              Unselect 10GE     32768   2      321     10100000  1                                                         

Partner:                                                                                                                            
--------------------------------------------------------------------------------                                                    
ActorPortName          SysPri   SystemID        PortPri PortNo PortKey PortState                                                    
10GE1/0/1              32768    xxxx-xxxx-xxxx 32768   0      321     10111100                                                     
10GE1/0/2              32768    xxxx-xxxx-xxxx 32768   1      321     10111100                                                     
10GE1/0/3              32768    xxxx-xxxx-xxxx 32768   2      321     10100000

通过以上显示信息可以看到,Eth-Trunk的ID是1、Eth-Trunk的模式是动态LACP模式,Eth-Trunk的成员接口中10GE**1/0/110GE**1/0/2成为活动接口,处于Selected状态,接口10GE**1/0/3处于Unselect**状态。

配置脚本

DeviceA

#
sysname DeviceA
#
interface Eth-Trunk1
 mode lacp-dynamic
 lacp max active-linknumber 2
#
interface 10GE1/0/1
 eth-trunk 1
 lacp priority 100
#
interface 10GE1/0/2
 eth-trunk 1
 lacp priority 100
#
interface 10GE1/0/3
 eth-trunk 1
#
return

举例:配置LACP模式的跨设备Eth-Trunk

组网需求

如图所示,DeviceA跨设备接入DeviceB和DeviceC,在DeviceA上部署LACP模式的Eth-Trunk接口,成员接口分别与DeviceB和DeviceC的10GE1/0/1~10GE1/0/2连接,10GE1/0/1~10GE1/0/2的接口速率和双工模式相同,现在需要使流量可以在两台设备上负载分担。

图1 跨设备Eth-Trunk组网图

本例中interface1、interface2、interface3、interface4分别代表10GE1/0/1、10GE1/0/2、10GE1/0/3、10GE1/0/4。

zh-cn_image_0000001130621760.png

配置思路

采用如下的思路配置跨设备LACP模式链路聚合:

  1. 分别在DeviceA、DeviceB、DeviceC上创建Eth-Trunk1,并配置为静态LACP模式,将成员接口加入Eth-Trunk1。
  2. 在DeviceB和DeviceC上配置相同的LACP系统ID。
  3. 在DeviceB和DeviceC上配置相同的系统LACP优先级。
  4. 在DeviceC上配置Eth-Trunk成员接口在LACP协议中的编号扩展,使成员接口编号均增加32768,避免和设备DeviceB上的成员接口在LACP协议中的编号相同。

操作步骤

  1. 分别在DeviceA、DeviceB和DeviceC上创建Eth-Trunk1并配置为LACP模式,并将成员接口加入Eth-Trunk1。

    # 配置DeviceA。

    <HUAWEI> system-view
    [HUAWEI] sysname DeviceA
    [DeviceA] interface eth-trunk 1
    [DeviceA-Eth-Trunk1] mode lacp-static
    [DeviceA-Eth-Trunk1] trunkport 10ge 1/0/1 to 1/0/4
    [DeviceA-Eth-Trunk1] quit

    # 配置DeviceB。

    <HUAWEI> system-view
    [HUAWEI] sysname DeviceB
    [DeviceB] interface eth-trunk 1
    [DeviceB-Eth-Trunk1] mode lacp-static
    [DeviceB-Eth-Trunk1] trunkport 10ge 1/0/1 to 1/0/2

    # 配置DeviceC。

    <HUAWEI> system-view
    [HUAWEI] sysname DeviceC
    [DeviceC] interface eth-trunk 1
    [DeviceC-Eth-Trunk1] mode lacp-static
    [DeviceC-Eth-Trunk1] trunkport 10ge 1/0/1 to 1/0/2
  2. 配置DeviceB和DeviceC的系统ID为00e0-fc00-0000。

    # 配置DeviceB。

    [DeviceB-Eth-Trunk1] lacp system-id 00e0-fc00-0000
    [DeviceB-Eth-Trunk1] quit

    # 配置DeviceC。

    [DeviceC-Eth-Trunk1] lacp system-id 00e0-fc00-0000
    [DeviceC-Eth-Trunk1] quit
  3. 在DeviceB和DeviceC上配置系统LACP优先级为100。

    # 配置DeviceB。

    [DeviceB] lacp priority 100

    # 配置DeviceC。

    [DeviceC] lacp priority 100
  4. 在DeviceC上配置Eth-Trunk成员接口编号扩展,使成员接口编号均增加32768。

    [DeviceC] interface eth-trunk 1
    [DeviceC-Eth-Trunk1] lacp port-id-extension enable
    [DeviceC-Eth-Trunk1] quit

检查配置结果

# 查看各Device设备的Eth-Trunk信息,查看链路是否协商成功。

[DeviceA] display eth-trunk 1
Eth-Trunk1's state information is:
Local:
LAG ID: 1                       Working Mode: Static
Preempt Delay: Disabled         Hash Arithmetic: profile default
System Priority: 100            System ID: 00e0-fc12-1111
Least Active-linknumber: 1      Max Active-linknumber: 128
Operating Status: up            Number Of Up Ports In Trunk: 4
Timeout Period: Slow
--------------------------------------------------------------------------------
ActorPortName          Status   PortType PortPri PortNo PortKey PortState Weight
10GE1/0/1              Selected 10GE     32768   3      321     10111100  1
10GE1/0/2              Selected 10GE     32768   1      321     10100010  1
10GE1/0/3              Selected 10GE     32768   4      321     10111100  1
10GE1/0/4              Selected 10GE     32768   2      321     10100010  1

Partner:
--------------------------------------------------------------------------------
ActorPortName          SysPri   SystemID        PortPri PortNo PortKey PortState
10GE1/0/1              100      00e0-fc00-0000  32768   32769  321     10111100
10GE1/0/2              100      00e0-fc00-0000  32768   32770  321     10111100
10GE1/0/1              100      00e0-fc00-0000  32768   4      321     10111100
10GE1/0/2              100      00e0-fc00-0000  32768   5      321     10111100
[DeviceB] display eth-trunk 1
Eth-Trunk1's state information is:
Local:
LAG ID: 1                       Working Mode: Static
Preempt Delay: Disabled         Hash Arithmetic: profile default
System Priority: 100            System ID: 00e0-fc00-0000
Least Active-linknumber: 1      Max Active-linknumber: 128
Operating Status: up            Number Of Up Ports In Trunk: 2
Timeout Period: Slow
--------------------------------------------------------------------------------
ActorPortName          Status   PortType PortPri PortNo PortKey PortState Weight
10GE1/0/1              Selected 10GE     32768   4      321     10111100  1
10GE1/0/2              Selected 10GE     32768   5      321     10111100  1

Partner:
--------------------------------------------------------------------------------
ActorPortName          SysPri   SystemID        PortPri PortNo PortKey PortState
10GE1/0/3              100      00e0-fc12-1111  32768   4      321     10111100
10GE1/0/4              100      00e0-fc12-1111  32768   2      321     10100010
[DeviceC] display eth-trunk 1
Eth-Trunk1's state information is:
Local:
LAG ID: 1                       Working Mode: Static
Preempt Delay: Disabled         Hash Arithmetic: profile default
System Priority: 100            System ID: 00e0-fc00-0000
Least Active-linknumber: 1      Max Active-linknumber: 128
Operating Status: up            Number Of Up Ports In Trunk: 2
Timeout Period: Slow
--------------------------------------------------------------------------------
ActorPortName          Status   PortType PortPri PortNo PortKey PortState Weight
10GE1/0/1              Selected 10GE     32768   32769  321     10111100  1
10GE1/0/2              Selected 10GE     32768   32770  321     10111100  1

Partner:
--------------------------------------------------------------------------------
ActorPortName          SysPri   SystemID        PortPri PortNo PortKey PortState
10GE1/0/1              100      00e0-fc12-1111  32768   3      321     10111100
10GE1/0/2              100      00e0-fc12-1111  32768   1      321     10100010

通过以上显示信息可以看到,各Device的Operating Status均为Up,表明Eth-Trunk1已经协商成功。DeviceB和DeviceC上的成员接口成为活动接口,处于“Selected”状态,表示DeviceB和DeviceC上的成员接口均可以负载分担。DeviceC的PortNo显示成员接口的LACP编号已经增加32768。

配置脚本

  • DeviceA

    #
    sysname DeviceA
    #
    interface Eth-Trunk1
     mode lacp-static
    # 
    interface 10GE1/0/1
     eth-trunk 1
    #
    interface 10GE1/0/2
     eth-trunk 1
    #
    interface 10GE1/0/3
     eth-trunk 1
    #
    interface 10GE1/0/4
     eth-trunk 1
    #
    return
  • DeviceB

    #
    sysname DeviceB
    #
    lacp priority 100
    #
    interface Eth-Trunk1
     mode lacp-static
     lacp system-id 00e0-fc00-0000
    #
    interface 10GE1/0/1
     eth-trunk 1
    #
    interface 10GE1/0/2
     eth-trunk 1
    #
    return
  • DeviceC

    #
    sysname DeviceC
    #
    lacp priority 100
    #
    interface Eth-Trunk1
     mode lacp-static
     lacp system-id 00e0-fc00-0000
     lacp port-id-extension enable
    #
    interface 10GE1/0/1
     eth-trunk 1
    #
    interface 10GE1/0/2
     eth-trunk 1
    #
    return