链路聚合–动态模式配置以及转发规律
项目背景
为实现sw1和sw2之间链路宽带够用,可连接多条线路,配置链路聚合
项目拓扑图
项目需求
-
按照图示连接好线缆
-
配置动态链路聚合,GE1/0/1、GE1/0/2加入至聚合1号组内
-
配置以目的IP为负载分担的依据
配置思路
第一步:按照图示连接好线缆
第二步:在SW1和SW2上创建链路聚合接口并设置为动态链路聚合
第三步:将物理接口加入至对应聚合接口的聚合组内
第四步:设置负载分担模式,选择基于目的IP地址的参数
实施
第一步:将两台pc的IP地址配置完成
第二步:在两台交换机上创建聚合链路1号接口,并修改链路聚合模式为动态聚合
[sw1]int Bridge-Aggregation 1
[sw1-Bridge-Aggregation1]link-aggregation mode dynamic
[sw2]int Bridge-Aggregation 1
[sw2-Bridge-Aggregation1]link-aggregation mode dynamic
第三步:将物理接口加入到聚合接口1号组内
[sw1]int range g1/0/2 to g1/0/4
[sw1-if-range]port link-aggregation group 1
[sw2]int rang GigabitEthernet 1/0/2 to GigabitEthernet 1/0/4
[sw2-if-range]port link-aggregation group 1
第四步:使用display link-aggregation verbose查看两台交换机的聚合接口和物理接口的属性类配置是否一致
[sw1-if-range]display link-aggregation verbose
Loadsharing Type: Shar -- Loadsharing, NonS -- Non-Loadsharing
Port: A -- Auto
Port Status: S -- Selected, U -- Unselected, I -- Individual
Flags: A -- LACP_Activity, B -- LACP_Timeout, C -- Aggregation,
D -- Synchronization, E -- Collecting, F -- Distributing,
G -- Defaulted, H -- Expired
Aggregate Interface: Bridge-Aggregation1
Aggregation Mode: Dynamic
Loadsharing Type: Shar
System ID: 0x8000, 8ef8-3c70-0200
Local:
Port Status Priority Oper-Key Flag
--------------------------------------------------------------------------------
GE1/0/2 S 32768 1 {ACDEF}
GE1/0/3 S 32768 1 {ACDEF}
GE1/0/4 S 32768 1 {ACDEF}
Remote:
Actor Partner Priority Oper-Key SystemID Flag
--------------------------------------------------------------------------------
GE1/0/2 3 32768 1 0x8000, 8ef8-38c4-0100 {ACDEF}
GE1/0/3 4 32768 1 0x8000, 8ef8-38c4-0100 {ACDEF}
GE1/0/4 5 32768 1 0x8000, 8ef8-38c4-0100 {ACDEF}
[sw2-if-range]display link-aggregation verbose
Loadsharing Type: Shar -- Loadsharing, NonS -- Non-Loadsharing
Port: A -- Auto
Port Status: S -- Selected, U -- Unselected, I -- Individual
Flags: A -- LACP_Activity, B -- LACP_Timeout, C -- Aggregation,
D -- Synchronization, E -- Collecting, F -- Distributing,
G -- Defaulted, H -- Expired
Aggregate Interface: Bridge-Aggregation1
Aggregation Mode: Dynamic
Loadsharing Type: Shar
System ID: 0x8000, 8ef8-38c4-0100
Local:
Port Status Priority Oper-Key Flag
--------------------------------------------------------------------------------
GE1/0/2 S 32768 1 {ACDEF}
GE1/0/3 S 32768 1 {ACDEF}
GE1/0/4 S 32768 1 {ACDEF}
Remote:
Actor Partner Priority Oper-Key SystemID Flag
--------------------------------------------------------------------------------
GE1/0/2 3 32768 1 0x8000, 8ef8-3c70-0200 {ACDEF}
GE1/0/3 4 32768 1 0x8000, 8ef8-3c70-0200 {ACDEF}
GE1/0/4 5 32768 1 0x8000, 8ef8-3c70-0200 {ACDEF}
第五步:查看接口相关信息
[sw1-if-range]display interface brief
Brief information on interfaces in route mode:
Link: ADM - administratively down; Stby - standby
Protocol: (s) - spoofing
Interface Link Protocol Primary IP Description
InLoop0 UP UP(s) --
MGE0/0/0 DOWN DOWN --
NULL0 UP UP(s) --
REG0 UP -- --
Brief information on interfaces in bridge mode:
Link: ADM - administratively down; Stby - standby
Speed: (a) - auto
Duplex: (a)/A - auto; H - half; F - full
Type: A - access; T - trunk; H - hybrid
Interface Link Speed Duplex Type PVID Description
BAGG1 UP 3G(a) F(a) A 1
FGE1/0/53 DOWN 40G A A 1
FGE1/0/54 DOWN 40G A A 1
GE1/0/1 UP 1G(a) F(a) A 1
GE1/0/2 UP 1G(a) F(a) A 1
GE1/0/3 UP 1G(a) F(a) A 1
GE1/0/4 UP 1G(a) F(a) A 1
GE1/0/5 DOWN auto A A 1
BAGG1就是你的聚合接口,它可以叠加物理接口的带宽,这里面的speed就是速率
第六步:设置链路聚合负载分担模式为基于目的ip
[sw1-Bridge-Aggregation1]link-aggregation load-sharing mode destination-ip
[sw2-Bridge-Aggregation1]link-aggregation load-sharing mode destination-ip
第七步:在pc上ping另一方,通过抓包查看负载分担效果
0/2接口(没有找到ping包)
0/3接口
0/4接口