华为交换机如何配置以太网链路聚合(端口聚合)

环境:

S1730S-S48T4S-A

Version 5.170 (S1730 V200R021C01SPC200)

问题描述:

华为交换机如何配置以太网链路聚合(端口聚合)

1.Eth-Trunk

以太网链路聚合Eth-Trunk简称链路聚合,通过将多个物理接口捆绑为一个逻辑接口,可以在不进行硬件升级的条件下,达到增加链路带宽的目的。

链路聚合技术主要有以下三个优势:

    增加带宽

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

    提高可靠性

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

    负载分担

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

图1 Eth-Trunk示意图

在这里插入图片描述
2.E-Trunk是什么?

跨设备链路聚合E-Trunk

E-Trunk(Enhanced Trunk)是一种实现跨设备链路聚合的机制,基于LACP(单台设备链路聚合的标准)进行了扩展,能够实现多台设备间的链路聚合,从而把链路可靠性从单板级提高到了设备级。

E-Trunk机制主要应用于CE双归接入网络时,CE与PE间的链路保护以及对PE设备节点故障的保护。如图3-12所示,在没有使用E-Trunk前,CE通过Eth-Trunk链路只能单归到一个PE设备。如果Eth-Trunk出现故障或者PE设备故障,CE将无法与PE设备继续进行通信。使用E-Trunk后,CE可以双归到PE上,从而实现设备间保护

解决方案:

1.创建Eth-Trunk接口

interface eth-trunk 1

[S1730S]interface eth-trunk 1
[S1730S-Eth-Trunk1]
Sep 14 2022 09:08:11 S1730S DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.56813.5.25.191.3.1 configurations have been changed. The current change number is 1, the change loop count is 0, and the maximum number of records is 4095.
[S1730S-Eth-Trunk1]


(可选)执行命令mixed-rate link enable,使能允许不同速率端口加入同一Eth-Trunk接口的功能。

缺省情况下,设备未使能允许不同速率端口加入同一Eth-Trunk接口的功能

2.将接口加入到指定Eth-Trunk中

trunkport GigabitEthernet 0/0/48 to 0/0/49

[S1730S-Eth-Trunk1]trunkport GigabitEthernet 0/0/48 to 0/0/49
Error: This command cannot be executed on the device.
 
 本交换机不支持这个命令使用下面方法操作

进入具体端口视图,执行eth-trunk 1 加入
[S1730S-Eth-Trunk1]in GigabitEthernet 0/0/48       
[S1730S-GigabitEthernet0/0/48]eth-trunk 1
[S1730S-GigabitEthernet0/0/48]in GigabitEthernet 0/0/49
[S1730S-GigabitEthernet0/0/49]eth-trunk 1 

Sep 14 2022 09:26:21 S1730S DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.56813.5.25.191.3.1 configurations have been changed. The current change number is 6, the change loop count is 0, and the maximum number of records is 4095

3.配置链路聚合模式为LACP模式

mode lacp

S1730S-Eth-Trunk1]mode lacp
[S1730S-Eth-Trunk1]
Sep 14 2022 09:15:51 S1730S DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.56813.5.25.191.3.1 configurations have been changed. The current change number is 2, the change loop count is 0, and the maximum number of records is 4095.



缺省情况下,Eth-Trunk的工作模式为手工模式。

配置时需要保证本端和对端的聚合模式一致。即如果本端配置为LACP模式,那么对端设备也必须要配置为LACP模式。

存在成员接口的情况下,可以将Eth-Trunk的工作模式由手工模式切换为LACP模式,也可以由LACP模式切换为手工模式。但是如果Eth-Trunk加入了E-Trunk,则工作模式不能更改

配置小窍门

删除已存在的成员接口请在相应接口视图下执行命令undo eth-trunk或在Eth-Trunk视图下执行命令undo trunkport interface-type interface-number。


最后记得保存配置

4.查看Eth-Trunk接口的配置信息

display eth-trunk

[S1730S-GigabitEthernet0/0/49]display eth-trunk 
Eth-Trunk1's state information is:
Local:
LAG ID: 1                   WorkingMode: LACP                                 
Preempt Delay: Disabled     Hash arithmetic: According to SIP-XOR-DIP         
System Priority: 32768      System ID: 3cc7-86a8-83e8                         
Least Active-linknumber: 1  Max Active-linknumber: 8                          
Operate status: down        Number Of Up Port In Trunk: 0                     
--------------------------------------------------------------------------------
ActorPortName          Status   PortType PortPri PortNo PortKey PortState Weight
GigabitEthernet0/0/48  Unselect 1GE      32768   1      305     10100010  1     
GigabitEthernet0/0/49  Unselect 1GE      32768   2      305     10100010  1     

Partner:
--------------------------------------------------------------------------------
ActorPortName          SysPri   SystemID        PortPri PortNo PortKey PortState
GigabitEthernet0/0/48  0        0000-0000-0000  0       0      0       10100011
GigabitEthernet0/0/49  0        0000-0000-0000  0       0      0       10100011

5.查看Eth-Trunk的成员接口信息

display trunkmembership eth-trunk

[S1730S-GigabitEthernet0/0/49]display trunkmembership eth-trunk 1
Trunk ID: 1 
Used status: VALID 
TYPE: ethernet 
Working Mode : LACP 
Number Of Ports in Trunk = 2
Number Of Up Ports in Trunk = 0
Operate status: down 
  
Interface GigabitEthernet0/0/48, valid, operate down, weight=1
Interface GigabitEthernet0/0/49, valid, operate down, weight=1

6.查看Eth-Trunk接口的负载分担方式

[S1730S-GigabitEthernet0/0/49]display eth-trunk 1 load-balance
Eth-Trunk1's load-balance information:
 Load-balance Configuration            : SIP-XOR-DIP
 Load-balance options used per-protocol:
  L2  : Source XOR Destination MAC address, Vlan ID, Ingress-port
  IPv4: Source XOR Destination IP address, Source XOR Destination TCP/UDP port
  IPv6: Source XOR Destination IP address, Source XOR Destination TCP/UDP port

Eth-Trunk的负载分担是逐流进行的,逐流负载分担能保证包的顺序,保证了同一数据流的帧在同一条物理链路转发。而不同数据流在不同的物理链路上转发从而实现分担负载。

配置普通负载分担模式,可以基于报文的IP地址或MAC地址来分担负载;对于L2报文、IP报文和MPLS报文还可以配置增强型的负载分担模式。

由于负载分担只对出方向的流量有效,因此链路两端接口的负载分担模式可以不一致,两端互不影响。
Eth-Trunk的负载分担模式配置不合理,会导致数据流量在Eth-Trunk各活动链路的负载分担不均衡。配置负载分担模式时,需要关注:

    实际业务中用户需要根据业务流量特征选择配置合适的负载分担方式。业务流量中某种参数变化越频繁,选择与此参数相关的负载分担方式就越容易实现负载均衡。例如,如果报文的IP地址变化较频繁,那么选择基于dst-ip、src-ip或src-dst-ip的负载分担模式更有利于流量在各物理链路间合理的负载分担;如果报文的MAC地址变化较频繁,IP地址比较固定,那么选择基于dst-mac、src-mac或src-dst-mac的负载分担模式更有利于流量在各物理链路间合理的负载分担。

    当业务流量中主要为MPLS报文时,需要选择配置增强型负载分担方式,并在负载分担模板视图中通过mpls field命令配置MPLS报文的负载分担模式。

    在堆叠和Eth-Trunk综合组网中,当设备上Eth-Trunk接口下配置了流量本地优先转发功能时(通过local-preference enable命令配置,缺省处于使能状态),从本设备进入的流量优先通过本设备的成员口转发。如果本设备没有成员口,再从跨设备成员口转发。这样可以有效地节省堆叠设备间带宽,提高流量转发效率

配置普通负载分担方式

    执行命令system-view,进入系统视图。
    执行命令interface eth-trunk trunk-id,进入Eth-Trunk接口视图。
    执行命令load-balance {
    
     dst-ip | dst-mac | src-ip | src-mac | src-dst-ip | src-dst-mac },配置Eth-Trunk负载分担方式。

    缺省情况下,交换机上Eth-Trunk接口的负载分担模式为src-dst-ip。

7.将接口从指定Eth-Trunk中删除



将指定成员接口从聚合组中删除

删除成员接口有如下两种方式,请根据需要选择其一即可。

    在Eth-Trunk接口视图下执行命令undo trunkport interface-type {
    
     interface-number1 [ to interface-number2 ] } &<1-8>[HUAWEI] interface eth-trunk 1
    [HUAWEI-Eth-Trunk1] undo trunkport gigabitethernet 0/0/48

    在成员接口视图下执行命令undo eth-trunk。

    <HUAWEI> system-view
    [HUAWEI] interface gigabitethernet 0/0/1
    [HUAWEI-GigabitEthernet0/0/1] undo eth-trunk




8.删除Eth-Trunk接口

删除聚合组

将所有的成员接口从聚合组中删除,然后在系统视图下执行命令undo interface eth-trunk trunk-id。

<HUAWEI> system-view
[HUAWEI] undo interface eth-trunk 1

猜你喜欢

转载自blog.csdn.net/weixin_42672685/article/details/131590185