目录
1.拓扑图
2.以太网交换机基础配置
3.配置手动模式的链路聚合
4.配置静态 LACP 模式的链路聚合
5.配置文件
1.拓扑图
2.以太网交换机基础配置
华为交换机接口默认开启了自协商功能,需要手动配置S1与 S2上G0/0/9和G0/0/10接口的速率。
首先修改交换机的设备名称,然后查看S1上G0/0/9和G0/0/10接口的详细信息。
<Quidway>system-view
[Quidway]sysname S1
[S1]display interface GigabitEthernet 0/0/9
[S1]display interface GigabitEthernet 0/0/1
在修改接口的速率之前应先关闭接口的自协商功能,然后将S1上的G0/0/9 和G0/0/10接口的速率配置为100 Mbit/s。
[S1]interface GigabitEthernet 0/0/9
[S1-GigabitEthernet0/0/9]undo negotiation auto
[S1-GigabitEthernet0/0/9]speed 100
[S1-GigabitEthernet0/0/9]quit
[S1]interface GigabitEthernet 0/0/10
[S1-GigabitEthernet0/0/10]undo negotiation auto
[S1-GigabitEthernet0/0/10]speed 100
同样的方法将S2上的G0/0/9和G0/0/10接口的速率配置为100 Mbit/s。
<Quidway>system-view
[Quidway]sysname S2
[S2]interface GigabitEthernet 0/0/9
[S2-GigabitEthernet0/0/9]undo negotiation auto
[S2-GigabitEthernet0/0/9]speed 100
[S2-GigabitEthernet0/0/9]quit
[S2]interface GigabitEthernet 0/0/10
[S2-GigabitEthernet0/0/10]undo negotiation auto
[S2-GigabitEthernet0/0/10]speed 100
验证S1上的G0/0/9和G0/0/10接口的速率已配置成功。
[S1]display interface GigabitEthernet 0/0/9
显示:
GigabitEthernet0/0/9 current state : UP Line protocol current state : UP
···
Speed : 100, Loopback: NONE Duplex: FULL, Negotiation:DISABLE
[S1]display interface GigabitEthernet 0/0/10
显示:
GigabitEthernet0/0/10 current state : UP
Line protocol current state : UP
···
Speed : 100, Loopback: NONE Duplex: FULL, Negotiation: DISABLE
3.配置手动模式的链路聚合
在S1和S2上创建Eth-Trunk 1,然后将G0/0/9和G0/0/10接口加入 Eth-Trunk 1(注意:将接口加入Eth-Trunk前需确认成员接口下没有任何配置)。
[S1]interface Eth-Trunk 1
[S1-Eth-Trunk1]quit
[S1]interface GigabitEthernet 0/0/9
[S1-GigabitEthernet0/0/9]eth-trunk 1
[S1-GigabitEthernet0/0/9]quit
[S1]interface GigabitEthernet 0/0/10
[S1-GigabitEthernet0/0/10]eth-trunk 1
[S2]interface Eth-Trunk 1
[S2-Eth-Trunk1]quit
[S2]interface GigabitEthernet 0/0/9
[S2-GigabitEthernet0/0/9]eth-trunk 1
[S2-GigabitEthernet0/0/9]quit
[S2]interface GigabitEthernet 0/0/10
[S2-GigabitEthernet0/0/10]eth-trunk 1
验证Eth-Trunk的配置结果。
[S1]display eth-trunk
显示:
Operate status: up
···
GigabitEthernet0/0/9 Up 1
GigabitEthernet0/0/10 Up 1
Operate status: up
···
PortName Status Weight
GigabitEthernet0/0/9 Up 1
GigabitEthernet0/0/10 Up
4.配置静态 LACP 模式的链路聚合
删除S1和S2上的G0/0/9和G0/0/10接口下的配置。
[S1]interface GigabitEthernet 0/0/9
[S1-GigabitEthernet0/0/9]undo eth-trunk
[S1-GigabitEthernet0/0/9]quit
[S1]interface GigabitEthernet 0/0/10
[S1-GigabitEthernet0/0/10]undo eth-trunk
[S2]interface GigabitEthernet 0/0/9
[S2-GigabitEthernet0/0/9]undo eth-trunk
[S2-GigabitEthernet0/0/9]quit
[S2]interface GigabitEthernet 0/0/10
[S2-GigabitEthernet0/0/10]undo eth-trunk
创建Eth-Trunk 1并配置该Eth-Trunk为静态LACP模式。然后将G0/0/9和 G0/0/10接口加入Eth-Trunk 1。
[S1]interface Eth-Trunk 1
[S1-Eth-Trunk1]mode lacp
[S1-Eth-Trunk1]quit
[S1]interface GigabitEthernet 0/0/9
[S1-GigabitEthernet0/0/9]eth-trunk 1
[S1-GigabitEthernet0/0/9]quit
[S1]interface GigabitEthernet 0/0/10
[S1-GigabitEthernet0/0/10]eth-trunk 1
[S2]interface Eth-Trunk 1
[S2-Eth-Trunk1]mode lacp
[S2-Eth-Trunk1]quit
[S2]interface GigabitEthernet 0/0/9
[S2-GigabitEthernet0/0/9]eth-trunk 1
[S2-GigabitEthernet0/0/9]quit
[S2]interface GigabitEthernet 0/0/10
[S2-GigabitEthernet0/0/10]eth-trunk 1
查看交换机上Eth-Trunk的信息,查看链路是否协商成功。
[S1]display eth-trunk
显示:
LAG ID: 1 WorkingMode: LACP
Preempt Delay: Disabled Hash arithmetic: According to SIP-XOR-DIP
System Priority: 32768 System ID: d0d0-4ba6-aab0
Least Active-linknumber: 1 Max Active-linknumber: 8
Operate status: up Number Of Up Port
在S1上配置LACP的系统优先级为100,使其成为LACP主动端。
[S1]lacp priority 10
配置接口的优先级确定活动链路。
[S1]interface GigabitEthernet 0/0/9
[S1-GigabitEthernet0/0/9]lacp priority 100
[S1-GigabitEthernet0/0/9]quit
[S1]interface GigabitEthernet 0/0/10
[S1-GigabitEthernet0/0/10]lacp priority 100
验证Eth-Trunk的配置结果。
[S1]display eth-trunk 1
显示:
System Priority: 100 System ID: d0d0-4ba6-aab0Least Active-linknumber: 1 Max Active-linknumber: 8
Operate status: up Number Of Up Port In Trunk: 2
···
Operate status: up
5.配置文件
[S1]display current-configuration
#
!Software Version V200R008C00SPC500
sysname S1
#
lacp priority 100
#
interface Eth-Trunk1
mode lacp
#
interface GigabitEthernet0/0/9
eth-trunk 1
lacp priority 100
undo negotiation auto
speed 100
#
interface GigabitEthernet0/0/10
eth-trunk 1
lacp priority 100
undo negotiation auto
speed 100
#
return
[S2]display current-configuration
#
!Software Version V200R008C00SPC500
sysname S2
#
interface Eth-Trunk1
mode lacp
#
interface GigabitEthernet0/0/9
eth-trunk 1
undo negotiation auto
speed 100
#
interface GigabitEthernet0/0/10
eth-trunk 1
undo negotiation auto
speed 100
#
return