华为交换机-链路聚合

链路聚合工作方式

工作方式有两种:手工负载分担、LACP模式。两种方式的对比:

1、手工负载分担及配置和实验

华为交换机-链路聚合

[sw1]interface Eth-Trunk 1 #1为ID,范围1-63

[sw1-Eth-Trunk1]mode ?

lacp-static Static working mode

manual Manual working mode

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

[sw1-Eth-Trunk1]q

[sw1]int g0/0/1

[sw1-GigabitEthernet0/0/1]eth-trunk 1

[sw1-GigabitEthernet0/0/1]q

[sw1]int g0/0/2

[sw1-GigabitEthernet0/0/2]eth-trunk 1

[sw1-GigabitEthernet0/0/2]q


华为交换机-链路聚合

sw2也是完全一样的

2、LACP模式

基本概念

  • 系统LACP优先级:系统LACP优先级是为了区分两端设备优先级的高低而配置的参数。LACP模式下,两端设备所选择的活动接口必须保持一致,否则链路聚合组就无法建立。此时可以使其中一端具有更高的优先级,另一端根据高优先级的一端来选择活动接口即可。系统LACP优先级值越小优先级越高。
  • 接口LACP优先级:接口LACP优先级是为了区别同一个Eth-Trunk中的不同接口被选为活动接口的优先程度,优先级高的接口将优先被选为活动接口。接口LACP优先级值越小,优先级越高。
  • 成员接口间M:N备份:LACP模式链路聚合由LACP确定聚合组中的活动和非活动链路,又称为M:N模式,即M条活动链路与N条备份链路的模式。这种模式提供了更高的链路可靠性,并且可以在M条链路中实现不同方式的负载均衡。

实验拓扑


华为交换机-链路聚合

[sw1]interface Eth-Trunk 1 #创建1个聚合接口,ID为1

[sw1-Eth-Trunk1]mode lacp-static #模式设为lacp静态

[sw1-Eth-Trunk1]trunkport e0/0/1 #把接口加进来

Info: This operation may take a few seconds. Please wait for a moment...done.

[sw1-Eth-Trunk1]trunkport e0/0/2

Info: This operation may take a few seconds. Please wait for a moment...done.

[sw1-Eth-Trunk1]trunkport e0/0/3

Info: This operation may take a few seconds. Please wait for a moment...done.

[sw1-Eth-Trunk1]trunkport e0/0/4

Info: This operation may take a few seconds. Please wait for a moment...done.

[sw1-Eth-Trunk1]dis port vlan

[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]q

[sw1]lacp priority 100

#优先级默认是32768,我们只在sw1上配置,SW2不配置默认为32768,也就是说我们让SW1为主

[sw1]int Eth-Trunk 1

[sw1-Eth-Trunk1]least active-linknumber 1

#配置最小链路数量,其实这里默认就是1不需要配置

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

#配置最大链路数量为2,

[sw1-Eth-Trunk1]int e0/0/1

[sw1-Ethernet0/0/1]lacp priority 10

[sw1-Ethernet0/0/1]int e0/0/2

[sw1-Ethernet0/0/2]lacp priority 20

[sw1-Ethernet0/0/2]int e0/0/3

[sw1-Ethernet0/0/3]lacp priority 30

[sw1-Ethernet0/0/3]int e0/0/4

[sw1-Ethernet0/0/4]lacp priority 40

#配置接口的优先级,就是哪个down了,另外下一个补上,相当于替补队员的顺序

[sw1]int eth-trunk 1

[sw1-Eth-Trunk1]lacp preempt enable #配置抢占

[sw1-Eth-Trunk1]lacp preempt delay ?

INTEGER<10-180> Value of preemption delay time, the default value is 30 (in

second) 默认30秒,范围可以是10-180

[sw1-Eth-Trunk1]lacp preempt delay 30 #这里就先配置30


[sw2]interface Eth-Trunk1

[sw2-Eth-Trunk1] mode lacp-static

[sw2-Eth-Trunk1] max bandwidth-affected-linknumber 2##影响生成树cost值

[sw2-Eth-Trunk1] lacp preempt enable

[sw2-Eth-Trunk1]interface Ethernet0/0/1

[sw2-Ethernet0/0/1] eth-trunk 1

Info: This operation may take a few seconds. Please wait for a moment...done.

[sw2-Ethernet0/0/1] lacp priority 10

[sw2-Ethernet0/0/1]interface Ethernet0/0/2

[sw2-Ethernet0/0/2] eth-trunk 1

Info: This operation may take a few seconds. Please wait for a moment...done.

[sw2-Ethernet0/0/2] lacp priority 20

[sw2-Ethernet0/0/2]interface Ethernet0/0/3

[sw2-Ethernet0/0/3] eth-trunk 1

Info: This operation may take a few seconds. Please wait for a moment...done.

[sw2-Ethernet0/0/3] lacp priority 30

[sw2-Ethernet0/0/3]interface Ethernet0/0/4

[sw2-Ethernet0/0/4] eth-trunk 1

Info: This operation may take a few seconds. Please wait for a moment...done.

[sw2-Ethernet0/0/4] lacp priority 40

[sw2-Ethernet0/0/4]

[sw2-Ethernet0/0/4]q

[sw2]lacp pr

[sw2]lacp priority 200 #也可以不配置,默认为32768,SW1为100

发表评论
留言与评论(共有 0 条评论) “”
   
验证码:

相关文章

推荐文章