工作方式有两种:手工负载分担、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模式
基本概念
实验拓扑
[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 条评论) “” |