华为路由交换学习篇-链路聚合

221 阅读4分钟

​本文已参与「新人创作礼」活动,一起开启掘金创作之路。

链路聚合模式

手工负载分担模式

手工配置Eth-Trunk 、成员接口的加入,不需要链路聚合控制协议的参与

手工负载分担模式下所有活动链路都参与数据转发,平均分担流量,因此成为负载分担模式

如果设备不支持LACP协议时,可以使用手工负载分担模式

见实验一

LACP模式

LACP模式分类

二层链路聚合

Eth-Trunk技术可以用来绑定相同类型的端口,在一个二层交换机上,一般把接入层交换机与分布层交换机之间的链路称作二层链路聚合

二层链路聚合的实现(见实验二)

三层链路聚合

三层Eth-Trunk用于分布层到分布层以及分布层到核心层的部署,在配置Eth-Trunk时要求链路两边的端口使用相同的方式进行配置

三层链路聚合的实现(见实验三)

实验一 手工负载分担模式配置

实验拓扑图

配置VLAN和trunk

[S3-GigabitEthernet0/0/1]di th

interface GigabitEthernet0/0/1

 port link-type trunk

 port trunk allow-pass vlan 10

[S5-GigabitEthernet0/0/1]di th

interface GigabitEthernet0/0/1

 port link-type trunk

 port trunk allow-pass vlan 20

[S4-GigabitEthernet0/0/1]di th

interface GigabitEthernet0/0/1

 port link-type trunk

 port trunk allow-pass vlan 10

[S6-GigabitEthernet0/0/1]di th

interface GigabitEthernet0/0/1

 port link-type trunk

 port trunk allow-pass vlan 20

[S1-GigabitEthernet0/0/4]di th

interface GigabitEthernet0/0/4

 port link-type trunk

 port trunk allow-pass vlan 10

[S1-GigabitEthernet0/0/5]di th

interface GigabitEthernet0/0/5

 port link-type trunk

 port trunk allow-pass vlan 20

[S2-GigabitEthernet0/0/4]di th

interface GigabitEthernet0/0/4

 port link-type trunk

 port trunk allow-pass vlan 10

[S2-GigabitEthernet0/0/5]di th

interface GigabitEthernet0/0/5

 port link-type trunk

 port trunk allow-pass vlan 20

配置S1和S2之间的Eth-Trunk

S1

int Eth-Trunk 1 //创建链路聚合组 1

trunkport g 0/0/1 to 0/0/3 //直接把接口加入以太通道

验证

S2

int Eth 1

trunkport g 0/0/1 to 0/0/3

验证

发现状态都是UP,但是我们还没来得及配置,怎么都开了,注意:在默认情况下Eth-Trunk的工作模式为手工模式

对S1和S2配置

[S1]int Eth-Trunk 1

[S1-Eth-Trunk1]mode manual load-balance

[S2]int Eth-Trunk 1

[S2-Eth-Trunk1]m m l

配置S1和S2的Eth-Trunk为Trunk,并放行流量VLAN10 、VLAN 20

[S1-Eth-Trunk1]p l t

[S1-Eth-Trunk1]p t a v 10 20

[S2-Eth-Trunk1]p l t

[S2-Eth-Trunk1]p t a v 10 20

配置Eth-Trunk负载分担模式

在S1和S2的配置负载分担模式为源MAC地址

[S1-Eth-Trunk1]load-balance src-dst-mac

[S2-Eth-Trunk1]load src-dst-mac

配置接口阈值

[S1-Eth-Trunk1]least active-linknumber 3

[S2-Eth-Trunk1]l a 3

检查最终现象

实验二 静态LACP二层链路配置实验

实验拓扑图

创建链路聚合组10

[S1]int Eth-Trunk 10

[S2]int Eth-Trunk 10

链路聚合模式为静态LACP模式

[S1-Eth-Trunk10]mode lacp-static

[S2-Eth-Trunk10]mode lacp-static

将接口加入到聚合组10

[S1-Eth-Trunk10]trunkport e 0/0/1 to 0/0/3

[S2-Eth-Trunk10]trunkport e 0/0/1 to 0/0/3

检查配置结果

手动定义接口活动阈值

[S1-Eth-Trunk10]max active-linknumber 2

修改LACP优先级

[S1]lacp priority 100

修改接口优先级

[S1]int e 0/0/1

[S1-Ethernet0/0/1]lacp priority 100

开启抢占功能

[S1-Eth-Trunk10]lacp preempt enable

配置负载分担方式

[S1-Eth-Trunk10]load-balance src-dst-mac

[S2-Eth-Trunk10]load src-dst-mac 

检查

实验三 静态LACP模式三层链路配置实验

实验拓扑图

定义链路聚合组Eth-Trunk 1,开启三层链路聚合

[R1]int Eth-Trunk 1 //定义组1

[R1-Eth-Trunk1]undo portswitch //开启三层

[R1-Eth-Trunk1]ip add 12.1.1.2 24 //配置IP地址

[R2]int Eth-Trunk 1

[R2-Eth-Trunk1]undo portswitch

[R2-Eth-Trunk1]ip add 12.1.1.2 24

配置模式为静态

[R1-Eth-Trunk1]mode lacp-static

[R2-Eth-Trunk1]mode lacp-static

把接口加入链路聚合组1

[R1-Eth-Trunk1]trunkport g 0/0/0 to 0/0/2

[R2-Eth-Trunk1]trunkport g 0/0/0 to 0/0/2

检查

测试网络联通

附加:

定义上线活动接口阈值2

[R1-Eth-Trunk1]max active-linknumber 2

设置R1的系统优先级为10

[R1]lacp priority 100

定义R1的G0/0/0到G0/0/1的接口优先级为100

[R1]int g 0/0/1

[R1-GigabitEthernet0/0/1]lacp priority 100

[R1-GigabitEthernet0/0/1]int g 0/0/0

[R1-GigabitEthernet0/0/0]lacp priority 100

开启抢占功能

[R1-Eth-Trunk1]lacp preempt enable