问小白 wenxiaobai
资讯
历史
科技
环境与自然
成长
游戏
财经
文学与艺术
美食
健康
家居
文化
情感
汽车
三农
军事
旅行
运动
教育
生活
星座命理

华为交换机配置链路聚合(手工模式链路聚合和lacp模式聚合)

创作时间:
作者:
@小白创作中心

华为交换机配置链路聚合(手工模式链路聚合和lacp模式聚合)

引用
CSDN
1.
https://blog.csdn.net/qq_33292195/article/details/121923939

华为交换机配置链路聚合
链路聚合(Eth-Trunk),是将多个物理接口捆绑为一个逻辑接口,实现增加链路带宽、提高可靠性、提供负载分担的目的。
链路聚合两种模式:手工负载分担模式(默认模式,默认负载均衡方式src-dst-ip),LACP模式(推荐)。

一、手工模式

在手工模式下,Eth-Trunk的建立、成员接口的加入由手工配置,没有LACP的参与。手工模式下所有活动链路都参与数据的转发,平均分担流量。如果某条活动链路发生故障,链路聚合组会自动在剩余的活动链路中平均分担流量。

当需要在两个直连设备之间提供一个较大的链路带宽,而其中一端或两端设备都不支持LACP协议时,可以配置手工模式链路聚合。

SW1配置

[SW1]interface Eth-Trunk 1  
[SW1-Eth-Trunk1]mode manual load-balance //选择为手动负载分担,缺省即为手工模式,可不配置  
[SW1-Eth-Trunk1]load-balance ? //查看可配置的模式,缺省为src-dst-ip,  
dst-ip According to destination IP hash arithmetic  
dst-mac According to destination MAC hash arithmetic  
src-dst-ip According to source/destination IP hash arithmetic //缺省的配置  
src-dst-mac According to source/destination MAC hash arithmetic  
src-ip According to source IP hash arithmetic  
src-mac According to source MAC hash arithmetic  
[SW1-Eth-Trunk1]load-balance src-dst-ip //此处使用src-dst-ip  
[SW1-Eth-Trunk1]trunkport GigabitEthernet 0/0/1 to 0/0/2 //把GE0/0/1到GE0/0/2加入  

// 配置Eth-Trunk 1为trunk模式,并放通vlan 10 和20  
[SW1]interface Eth-Trunk 1  
[SW1-Eth-Trunk1]port link-type trunk  
[SW1-Eth-Trunk1]port trunk allow-pass vlan 10 20  

SW2配置

[SW2]interface Eth-Trunk 1  
[SW2-Eth-Trunk1]mode manual load-balance  
[SW2-Eth-Trunk1]load-balance src-dst-ip  
[SW2-Eth-Trunk1]trunkport GigabitEthernet 0/0/1 to 0/0/2  

// 配置Eth-Trunk 1为trunk并放通vlan10和20  
[SW2]interface Eth-Trunk 1  
[SW2-Eth-Trunk1]port link-type trunk  
[SW2-Eth-Trunk1]port trunk allow-pass vlan 10 20  

使用命令display eth-trunk 1查看配置结果。

二、LACP模式

当需要在两个直连设备间提供一个较大的链路带宽并且设备都支持LACP协议时,建议使用LACP模式。LACP模式不仅可以实现增加带宽、提高可靠性、负载分担的目的,而且可以提高Eth-Trunk的容错性、提供备份功能。

在LACP模式下,部分链路是活动链路,所有活动链路均参与数据转发。如果某条活动链路故障,链路聚合组自动在非活动链路中选择一条链路作为活动链路,来参与数据转发。

如下图SW1和SW2各自的GE0/0/1、GE0/0/2、GE0/0/3加入链路聚合中,GE0/0/3作为备份链路。

配置过程

SW1配置

[SW1]interface Eth-Trunk 2 //创建eth-trunk 2聚合口  
[SW1-Eth-Trunk2]mode lacp-static //配置模式为lacp静态模式  
[SW1-Eth-Trunk2]trunkport GigabitEthernet 0/0/1 to 0/0/3 //把GE0/0/1 到GE0/0/3加入到聚合组  

// 在SW1上配置系统优先级为100,使其成为LACP主动端  
[SW1]lacp priority 100  

// 在SW1上配置活动接口上限阈值为2  
[SW1]interface Eth-Trunk 2  
[SW1-Eth-Trunk2]max active-linknumber 2  

// 在SW1进入物理接口配置接口优先级,确定活动链路,此处只配置GE1和GE2口,GE3口保持默认值32768。  
[SW1]interface GigabitEthernet 0/0/1  
[SW1-GigabitEthernet0/0/1]lacp priority 100  
[SW1]interface GigabitEthernet 0/0/2  
[SW1-GigabitEthernet0/0/2]lacp priority 100  

// 配置Eth-Trunk2接口为trunk,并允许VLAN10和VLAN20通过(vlan配置过程省略)  
[SW1]interface Eth-Trunk 2  
[SW1-Eth-Trunk2]port link-type trunk  
[SW1-Eth-Trunk2]port trunk allow-pass vlan 10 20  

SW2配置

[SW2]interface Eth-Trunk 2  
[SW2-Eth-Trunk2]mode lacp-static //配置模式为lacp静态模式  

// 分别把GE0/0/1、GE0/0/2、GE0/0/3加入到聚合口(此处采用的另一种方法,不是批量加入了)  
[SW2]interface GigabitEthernet 0/0/1  
[SW2-GigabitEthernet0/0/1]eth-trunk 2  
[SW2]interface GigabitEthernet 0/0/2  
[SW2-GigabitEthernet0/0/2]eth-trunk 2  
[SW2]interface GigabitEthernet 0/0/3  
[SW2-GigabitEthernet0/0/3]eth-trunk 2  

// SW2上优先级保持默认,在SW2上配置活动接口上限阈值为2  
[SW2]interface Eth-Trunk 2  
[SW2-Eth-Trunk2]max active-linknumber 2  

// 配置Eth-Trunk2接口为trunk,并允许VLAN10和VLAN20通过(vlan配置过程省略)  
[SW2]interface Eth-Trunk 2  
[SW2-Eth-Trunk2]port link-type trunk  
[SW2-Eth-Trunk2]port trunk allow-pass vlan 10 20  

使用命令display eth-trunk 2分别在SW1和SW2上查看接口情况。

故障模拟

在SW1上shutdown GE0/0/1口,查看聚合口情况,GE0/0/3已切换为选中状态。

[SW1]interface GigabitEthernet 0/0/1  
[SW1-GigabitEthernet0/0/1]shutdown  

三、交换机和其它设备常用的链路聚合采用的模式

  1. 和服务器互联时,
    服务器和接入设备的链路聚合模式要匹配。当服务器选择静态链接聚合方式,对应接入设备应该选择手工模式;当服务器选择IEEE 802.3ad动态链接聚合方式,对应接入设备应该选择LACP模式。

  2. 和堆叠设备互联时,
    交换机与堆叠系统通过链路聚合互联,同时使能Eth-Trunk接口流量本地优先转发功能,在保证数据流量可靠传输的同时可以减小堆叠设备之间的带宽承载压力,提高了流量转发效率。

© 2023 北京元石科技有限公司 ◎ 京公网安备 11010802042949号