链路聚合是将多个物理链路捆绑成一个逻辑链路的过程,它可以提高带宽、冗余性和可靠性。
手工模式:
<Huawei>sy
Enter system view, return user view with Ctrl+Z.
[Huawei]un in en
Info: Information center is disabled.
[Huawei]int eth-trunk 1
[Huawei-Eth-Trunk1]mode manual //默认为手工模式
[Huawei-Eth-Trunk1]trunkport e0/0/1 ? //只能绑定一个接口
<cr>
[Huawei-Eth-Trunk1]trunkport e 0/0/1 ? //能绑定多个接口
<0-0> Slot number
to Range link symbol
<cr>
[Huawei-Eth-Trunk1]trunkport e 0/0/1 0/0/2 to 0/0/4 //还可以绑定多个不连续的接口
Info: This operation may take a few seconds. Please wait for a moment...done.
[Huawei-Eth-Trunk1]port link-type trunk
[Huawei-Eth-Trunk1]port trunk allow-pass vlan all
[Huawei-Eth-Trunk1]q
[Huawei]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: 2
--------------------------------------------------------------------------------
PortName Status Weight
Ethernet0/0/1 Up 1
Ethernet0/0/2 Up 1
注:给 Eth-Trunk
端口配置 link-type
属性时,是不能给单条链路的端口配置 link-type
属性的,需要将端口类型恢复默认属性值
[Huawei-Eth-Trunk1]trunkport e 0/0/1 to 0/0/4
Info: This operation may take a few seconds. Please wait for a moment...
Error: The port has other configurations. Please clear them first.
The error port is Ethernet0/0/1.
LACP模式:
SW1
和SW2
配置一样
[SW1]int eth-trunk 1
[SW1-Eth-Trunk1]mode lacp-static //配置模式为lacp静态
[SW1-Eth-Trunk1]bpdu enable
[SW1-Eth-Trunk1]max active-linknumber 3 //最大活跃链接数为2
[SW1-Eth-Trunk1]trunkport e 0/0/1 to 0/0/4
[SW1-Eth-Trunk1]port link-type trunk
[SW1-Eth-Trunk1]port trunk allow vlan all
[SW1]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-ccea-632a
Least Active-linknumber: 1 Max Active-linknumber: 3
Operate status: down Number Of Up Port In Trunk: 0
--------------------------------------------------------------------------------
ActorPortName Status PortType PortPri PortNo PortKey PortState Weight
Ethernet0/0/1 Unselect 100M 32768 2 289 10100010 1
Ethernet0/0/2 Unselect 100M 32768 3 289 10100010 1
Ethernet0/0/3 Unselect 100M 32768 4 289 10100010 1
Ethernet0/0/4 Unselect 100M 32768 5 289 10100010 1
Partner:
--------------------------------------------------------------------------------
ActorPortName SysPri SystemID PortPri PortNo PortKey PortState
Ethernet0/0/1 0 0000-0000-0000 0 0 0 10100011
Ethernet0/0/2 0 0000-0000-0000 0 0 0 10100011
Ethernet0/0/3 0 0000-0000-0000 0 0 0 10100011
Ethernet0/0/4 0 0000-0000-0000 0 0 0 10100011
LACP模式下修改系统优先级,越小越优先
[SW1]lacp priority 100 //默认为32768
在SW2
上能够看到SW1
系统LACP优先级变化情况
[SW2-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-cc0a-3cc8
Least Active-linknumber: 1 Max Active-linknumber: 3
Operate status: up Number Of Up Port In Trunk: 3
--------------------------------------------------------------------------------
ActorPortName Status PortType PortPri PortNo PortKey PortState Weight
Ethernet0/0/1 Selected 100M 32768 2 289 10111100 1
Ethernet0/0/2 Selected 100M 32768 3 289 10111100 1
Ethernet0/0/3 Unselect 100M 32768 4 289 10100000 1
Ethernet0/0/4 Selected 100M 32768 5 289 10111100 1
Partner:
--------------------------------------------------------------------------------
ActorPortName SysPri SystemID PortPri PortNo PortKey PortState
Ethernet0/0/1 100 4c1f-ccea-632a 32768 2 289 10111100
Ethernet0/0/2 100 4c1f-ccea-632a 32768 3 289 10111100
Ethernet0/0/3 100 4c1f-ccea-632a 32768 4 289 10100000
Ethernet0/0/4 100 4c1f-ccea-632a 32768 5 289 10111100
在SW2
上看到Ethernet0/0/3
接口是未激活状态,修改接口上的LACP优先级把接口激活
[SW2-Ethernet0/0/3]lacp priority 100
[SW2]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-cc0a-3cc8
Least Active-linknumber: 1 Max Active-linknumber: 3
Operate status: up Number Of Up Port In Trunk: 3
--------------------------------------------------------------------------------
ActorPortName Status PortType PortPri PortNo PortKey PortState Weight
Ethernet0/0/1 Selected 100M 32768 2 289 10111100 1
Ethernet0/0/2 Selected 100M 32768 3 289 10111100 1
Ethernet0/0/3 Selected 100M 100 4 289 10111100 1
Ethernet0/0/4 Unselect 100M 32768 5 289 10100000 1
Partner:
--------------------------------------------------------------------------------
ActorPortName SysPri SystemID PortPri PortNo PortKey PortState
Ethernet0/0/1 100 4c1f-ccea-632a 32768 2 289 10111100
Ethernet0/0/2 100 4c1f-ccea-632a 32768 3 289 10111100
Ethernet0/0/3 100 4c1f-ccea-632a 32768 4 289 10111100
Ethernet0/0/4 100 4c1f-ccea-632a 32768 5 289 10100000
总结
该文章初衷是为了实现链路聚合的ensp实验,仅供参考
本人是一个网络爱好者,也是初学者,喜欢琢磨一些基础知识,以上都是网上学习时的笔记,由于技术和表达能力都有限,希望优秀的你能看懂
生命不息,学习不止,奋斗不止