学习目标
· 掌握接口速率和双工模式的配置方法
· 掌握使用手动模式配置链路聚合的方法
· 掌握使用静态LACP模式配置链路聚合的方法
· 掌握在静态LACP模式下配置接口优先级的方法
步骤一. 以太网交换机基础配置
华为交换机接口默认开启了自协商功能。在本任务中,需要手动配置S1与S2上,G0/0/9和G0/0/10接口的速率及双工
模式。
1.首先修改交换机的设备名称,然后查看S1上G0/0/9和G0/0/10接口的详细信息。
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname S1
[S1]display interface GigabitEthernet 0/0/1
GigabitEthernet0/0/1 current state : UP
Line protocol current state : UP
Description:
…………
Input bandwidth utilization : 0%
Output bandwidth utilization : 0%
2.在修改接口的速率和双工模式之前应先关闭接口的自协商功能,然后将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]duplex full
[S1-GigabitEthernet0/0/9]quit
[S1]interface GigabitEthernet 0/0/10
[S1-GigabitEthernet0/0/10]undo negotiation auto
[S1-GigabitEthernet0/0/10]speed 100
[S1-GigabitEthernet0/0/10]duplex full
3.同样的方法将S2上的G0/0/9和G0/0/10接口的速率配置为100 Mbit/s,工作模式配置为全双工模式。
<Huawei>syste
Enter system view, return user view with Ctrl+Z.
[Huawei]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]duplex full
[S2-GigabitEthernet0/0/9]quit
[S2]interface GigabitEthernet 0/0/10
[S2-GigabitEthernet0/0/10]undo negotiation auto
[S2-GigabitEthernet0/0/10]speed 100
[S2-GigabitEthernet0/0/10]duplex full
4.验证S1上的G0/0/9和G0/0/10接口的速率和工作模式已配值
[S1]display interface GigabitEthernet 0/0/10
GigabitEthernet0/0/10 current state : UP
Line protocol current state : UP
Description:
Switch Port, PVID : 1, TPID : 8100(Hex), The Maximum Frame Length is 9216
IP Sending Frames' Format is PKTFMT_ETHNT_2, Hardware address is 4c1f-cc82-44e3
Last physical up time : 2019-04-01 14:48:19 UTC-08:00
Last physical down time : 2019-04-01 14:34:07 UTC-08:00
Current system time: 2019-04-01 14:54:12-08:00
Hardware address is 4c1f-cc82-44e3
Last 300 seconds input rate 0 bytes/sec, 0 packets/sec
Last 300 seconds output rate 0 bytes/sec, 0 packets/sec
Input: 19397 bytes, 163 packets
Output: 238 bytes, 2 packets
Input:
Unicast: 0 packets, Multicast: 163 packets
Broadcast: 0 packets
Output:
Unicast: 0 packets, Multicast: 2 packets
Broadcast: 0 packets
Input bandwidth utilization : 0%
Output bandwidth utilization : 0%
步骤二. 配置手动模式的链路聚合
5.在S1和S2上创建Eth-Trunk 1,然后将G0/0/9和G0/0/10接口加入Eth-Trunk 1(注意:将接口加入Eth-Trunk前需
确认成员接口下没有任何配置)。
<S1>sys
Enter system view, return user view with Ctrl+Z.
[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
[S1-GigabitEthernet0/0/10]eth-trunk 1
Info: This operation may take a few seconds. Please wait for a moment...done.
<S2>sys
Enter system view, return user view with Ctrl+Z.
[S2]interface Eth-Trunk 1
[S2-Eth-Trunk1]quit
[S2]interface GigabitEthernet 0/0/9
[S2-GigabitEthernet0/0/9]eth-trunk 1
Info: This operation may take a few seconds. Please wait for a moment...done.
[S2-GigabitEthernet0/0/9]quit
[S2]interface GigabitEthernet 0/0/10
[S2-GigabitEthernet0/0/10]eth-trunk 1
Info: This operation may take a few seconds. Please wait for a moment...done.
2.验证Eth-Trunk的配置结果。
[S1]display 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
GigabitEthernet0/0/9 Up 1
GigabitEthernet0/0/10 Up 1
[S2]display 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
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 1
标注的部分表明Eth-Trunk工作正常,成员接口都已正确加入。
骤三. 配置静态 LACP 模式的链路聚合
1.删除S1和S2上的G0/0/9和G0/0/10接口下的配置
<S1>system-view
Enter system view, return user view with Ctrl+Z.
[S1]interface GigabitEthernet 0/0/9
[S1-GigabitEthernet0/0/9]undo eth-trunk
Info: This operation may take a few seconds. Please wait for a moment...done.
[S1-GigabitEthernet0/0/9]quit
[S1]interface GigabitEthernet 0/0/10
[S1-GigabitEthernet0/0/10]undo eth-trunk
Info: This operation may take a few seconds. Please wait for a moment...done.
<S2>system-view
Enter system view, return user view with Ctrl+Z.
[S2]interface GigabitEthernet 0/0/9
[S2-GigabitEthernet0/0/9]undo eth-trunk
Info: This operation may take a few seconds. Please wait for a moment...done.
[S2-GigabitEthernet0/0/9]q
[S2]interface GigabitEthernet 0/0/10
[S2-GigabitEthernet0/0/10]undo eth-trunk
Info: This operation may take a few seconds. Please wait for a moment...done.
创建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-static
[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-static
[S2-Eth-Trunk1]quit
[S2]interface GigabitEthernet 0/0/9
[S2-GigabitEthernet0/0/9]eth-trunk 1
[S2-GigabitEthernet0/0/9]interface GigabitEthernet 0/0/10
[S2-GigabitEthernet0/0/10]eth-trunk 1
在S1上配置LACP的系统优先级为100,使其成为LACP主动端
[S1]lacp priority 100
配置接口的优先级确定活动链路。
[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
Eth-Trunk1's state information is:
Local:
LAG ID: 1 WorkingMode: STATIC
Preempt Delay: Disabled Hash arithmetic: According to SA-XOR-DA
System Priority: 100 System ID: 4c1f-cc45-aace
Least Active-linknumber: 1 Max Active-linknumber: 8
Operate status: up Number Of Up Port In Trunk: 2
----------------------------------------------------------------------------
ActorPortName Status PortType PortPri PortNo PortKey PortState Weight
GigabitEthernet0/0/9 Selected 100M 100 9 289 10111100 1
GigabitEthernet0/0/10 Selected 100M 100 10 289 10111100 1
Partner:
---------------------------------------------------------------------------
ActorPortName SysPri SystemID PortPri PortNo PortKey PortState
GigabitEthernet0/0/9 32768 4c1f-cc45-aacc 32768 9 289 10111100
GigabitEthernet0/0/10 32768 4c1f-cc45-aacc 32768 10 289 10111100
[S2]display eth-trunk 1
Eth-Trunk1's state information is:
Local:
LAG ID: 1 WorkingMode: STATIC
Preempt Delay: Disabled Hash arithmetic: According to SA-XOR-DA
System Priority: 32768 System ID: 4c1f-cc45-aacc
Least Active-linknumber: 1 Max Active-linknumber: 8
Operate status: up Number Of Up Port In Trunk: 2
----------------------------------------------------------------------------
ActorPortName Status PortType PortPri PortNo PortKey PortState Weight
GigabitEthernet0/0/9 Selected 100M 32768 9 289 10111100 1
GigabitEthernet0/0/10 Selected 100M 32768 10 289 10111100 1
Partner:
----------------------------------------------------------------------------
ActorPortName SysPri SystemID PortPri PortNo PortKey PortState
GigabitEthernet0/0/9 100 4c1f-cc45-aace 100 9 289 10111100
GigabitEthernet0/0/10 100 4c1f-cc45-aace 100 10 289 10111100
配置文件
[S1]display current-configuration
#
!Software Version V100R006C00SPC800
sysname S1
#
lacp priority 100
#
interface Eth-Trunk1
mode lacp-static
#
interface GigabitEthernet0/0/9
eth-trunk 1
lacp priority 100
undo neg