1. 程式人生 > >鏈路聚合配置

鏈路聚合配置

name abi 設置 per 協商 ctrl+ static pro ive

技術分享圖片

二層鏈路聚合配置

一、手工負載分擔模式配置

(1)

LSW1:

<Huawei>sys

Enter system view, return user view with Ctrl+Z.

[Huawei]sysn LSW1

[LSW1]int eth-trunk 1 //創建編號為1的eth-trunk端口

[LSW1-Eth-Trunk1]mode ?

lacp-static Static working mode

manual Manual working mode

註意:eth-trunk工作模式分為手工負載分擔模式和lacp模式兩種

[LSW1-Eth-Trunk1]mode manual load-balance //配置為手工分鐘分擔模式

[LSW1-Eth-Trunk1]trunkport GigabitEthernet 0/0/1 to 0/0/3 //將物理端口G0/0/1,G0/0/2,G0/0/3加入eth-trunk 1 端口

[LSW1-Eth-Trunk1]dis eth-trunk 1 //查看eth-trunk端口信息

Eth-Trunk1's state information is:

WorkingMode: NORMAL Hash arithmetic: According to SIP-XOR-DIP

Least Active-linknumber: 1 Max Bandwidth-affected-linknumber: 8

Operate status: up Number Of Up Port In Trunk: 3

--------------------------------------------------------------------------------

PortName Status Weight

GigabitEthernet0/0/1 Up 1

GigabitEthernet0/0/2 Up 1

GigabitEthernet0/0/3 Up 1

(2)LSW2也需要同樣的配置

<Huawei>sys

Enter system view, return user view with Ctrl+Z.

[Huawei]sysn LSW2

[LSW2]int eth-trunk 1

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

[LSW2-Eth-Trunk1]trunkport GigabitEthernet 0/0/1 to 0/0/3

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

[LSW2-Eth-Trunk1]dis eth-trunk 1

Eth-Trunk1's state information is:

WorkingMode: NORMAL Hash arithmetic: According to SIP-XOR-DIP

Least Active-linknumber: 1 Max Bandwidth-affected-linknumber: 8

Operate status: up Number Of Up Port In Trunk: 3

--------------------------------------------------------------------------------


PortName Status Weight

GigabitEthernet0/0/1 Up 1

GigabitEthernet0/0/2 Up 1

GigabitEthernet0/0/3 Up 1


(3)

回顯信息中WorkingMode: NORMAL ,表示eth-trunk1的工作模式為收工負載分擔模式,eth-trunk1包含了3個成員端口G0/0/1,G0/0/2,G0/0/3,

此時,兩臺設備之間的三條物理鏈路聚合在一起,已綁定成為一條邏輯上的鏈路。


二、靜態LACP模式配置

(1)刪除LSW1和LSW2上的G0/0/1,G0/0/2和G0/0/3接口下的配置。

LSW1:

[LSW1]int g0/0/1

[LSW1-GigabitEthernet0/0/1]undo eth-trunk

[LSW1-GigabitEthernet0/0/1]int g0/0/2

[LSW1-GigabitEthernet0/0/2]undo eth-trunk

[LSW1-GigabitEthernet0/0/2]int g0/0/3

[LSW1-GigabitEthernet0/0/3]undo eth-trunk

[LSW1-GigabitEthernet0/0/3]q

[LSW1]


LSW2:

[LSW2]int g0/0/1

[LSW2-GigabitEthernet0/0/1]undo eth-trunk

[LSW2-GigabitEthernet0/0/1]int g0/0/2

[LSW2-GigabitEthernet0/0/2]undo eth-trunk

[LSW2-GigabitEthernet0/0/2]int g0/0/3

[LSW2-GigabitEthernet0/0/3]undo eth-trunk

[LSW2-GigabitEthernet0/0/3]q

[LSW2]


(2)創建eth-trunk端口,配置為lacp模式,將g0/0/1,g0/0/2,g0/0/3加入eth-trunk端口

LSW1:

[LSW1]int Eth-Trunk 1

[LSW1-Eth-Trunk1]mode lacp

[LSW1-Eth-Trunk1]trunkport GigabitEthernet 0/0/1 to 0/0/3

[LSW1-Eth-Trunk1]dis eth-trunk 1 //查看鏈路協商信息

Local:

LAG ID: 1 WorkingMode: STATIC //此處工作模式為lacp-static

Preempt Delay: Disabled Hash arithmetic: According to SIP-XOR-DIP

System Priority: 32768 System ID: 4c1f-cce2-765e

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/1 Unselect 1GE 32768 2 305 10100010 1

GigabitEthernet0/0/2 Unselect 1GE 32768 3 305 10100010 1

GigabitEthernet0/0/3 Unselect 1GE 32768 4 305 10100010 1


Partner:

--------------------------------------------------------------------------------

ActorPortName SysPri SystemID PortPri PortNo PortKey PortState

GigabitEthernet0/0/1 0 0000-0000-0000 0 0 0 10100011

GigabitEthernet0/0/2 0 0000-0000-0000 0 0 0 10100011

GigabitEthernet0/0/3 0 0000-0000-0000 0 0 0 10100011


LSW2:

[LSW2]interface Eth-Trunk 1

[LSW2-Eth-Trunk1]mode lacp

[LSW2-Eth-Trunk1]trunkport GigabitEthernet 0/0/1 to 0/0/3

[LSW2-Eth-Trunk1]dis eth-trunk 1

Eth-Trunk1's state information is:

Local:

LAG ID: 1 WorkingMode: STATIC

Preempt Delay: Disabled Hash arithmetic: According to SIP-XOR-DIP

System Priority: 32768 System ID: 4c1f-cc59-12d7

Least Active-linknumber: 1 Max Active-linknumber: 8

Operate status: up Number Of Up Port In Trunk: 3

--------------------------------------------------------------------------------

ActorPortName Status PortType PortPri PortNo PortKey PortState Weight

GigabitEthernet0/0/1 Selected 1GE 32768 2 305 10111100 1

GigabitEthernet0/0/2 Selected 1GE 32768 3 305 10111100 1

GigabitEthernet0/0/3 Selected 1GE 32768 4 305 10111100 1


Partner:

--------------------------------------------------------------------------------

ActorPortName SysPri SystemID PortPri PortNo PortKey PortState

GigabitEthernet0/0/1 32768 4c1f-cce2-765e 32768 2 305 10111100

GigabitEthernet0/0/2 32768 4c1f-cce2-765e 32768 3 305 10111100

GigabitEthernet0/0/3 32768 4c1f-cce2-765e 32768 4 305 10111100

(3)修改最大活動端口數為2 ,使g0/0/1和g0/0/2處於select狀態,g0/0/3處於unselect狀態。

LSW1:

[LSW1]interface Eth-Trunk 1

[LSW1-Eth-Trunk1]max active-linknumber 2 //設置最大活動端口數為2

LSW2:

[LSW2]interface Eth-Trunk 1

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


查看:

[LSW1]dis Eth-Trunk 1

Eth-Trunk1's state information is:

Local:

LAG ID: 1 WorkingMode: STATIC

Preempt Delay: Disabled Hash arithmetic: According to SIP-XOR-DIP

System Priority: 32768 System ID: 4c1f-cce2-765e

Least Active-linknumber: 1 Max Active-linknumber: 2

Operate status: up Number Of Up Port In Trunk: 2

--------------------------------------------------------------------------------

ActorPortName Status PortType PortPri PortNo PortKey PortState Weight

GigabitEthernet0/0/1 Selected 1GE 32768 2 305 10111100 1

GigabitEthernet0/0/2 Selected 1GE 32768 3 305 10111100 1

GigabitEthernet0/0/3 Unselect 1GE 32768 4 305 10100000 1 //此處g0/0/3鏈路已處於unselect狀態


Partner:

--------------------------------------------------------------------------------

ActorPortName SysPri SystemID PortPri PortNo PortKey PortState

GigabitEthernet0/0/1 32768 4c1f-cc59-12d7 32768 2 305 10111100

GigabitEthernet0/0/2 32768 4c1f-cc59-12d7 32768 3 305 10111100

GigabitEthernet0/0/3 32768 4c1f-cc59-12d7 32768 4 305 10100000


當g0/0/1或者g0/0/2的端口處於中斷狀態時,lacp將會自動協商,將g0/0/3轉變為轉發(select)狀態,維持鏈路的正常,這就是lacp模式的作用


========

三層鏈路聚合配置與二層鏈路聚合配置類似,假如在路由器上配置三層鏈路聚合,需要先創建Eth-Trunk接口,然

後在Eth-Trunk邏輯口上執行undo portswitch命令,把聚合鏈路從二層轉為三層鏈路。執行undo portswitch命令後,可以為Eth-Trunk邏輯口

分配一個IP地址。


鏈路聚合配置