链路聚合--动态模式配置以及转发规律

链路聚合–动态模式配置以及转发规律

项目背景

为实现sw1和sw2之间链路宽带够用,可连接多条线路,配置链路聚合

项目拓扑图

在这里插入图片描述

项目需求

  1. 按照图示连接好线缆

  2. 配置动态链路聚合,GE1/0/1、GE1/0/2加入至聚合1号组内

  3. 配置以目的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接口
在这里插入图片描述

从上面三个接口的抓包结果看,说明信息随机分配到此接口进行转发
在LACP-static模式下配置链路聚合的具体步骤如下: ### 配置步骤 1. **进入系统视图** ```shell system-view ``` 2. **创建Eth-Trunk接口** ```shell interface Eth-Trunk 1 ``` 3. **设置Eth-Trunk的工作模式为LACP-static** ```shell lacp mode static ``` 4. **添加成员接口到Eth-Trunk** ```shell interface GigabitEthernet 0/0/1 port link-type trunk port trunk allow-pass vlan 10 12 20 port trunk pvid vlan 12 port link-aggregation group 1 quit interface GigabitEthernet 0/0/2 port link-type trunk port trunk allow-pass vlan 10 12 20 port trunk pvid vlan 12 port link-aggregation group 1 quit ``` 5. **限制活动链路数量** ```shell interface Eth-Trunk 1 lacp max-active-linknumber 2 ``` ### 示例配置 假设在设备 `Agg 01` 和 `Agg 02` 上配置链路聚合: #### Agg 01 ```shell system-view interface Eth-Trunk 1 lacp mode static quit interface GigabitEthernet 0/0/1 port link-type trunk port trunk allow-pass vlan 10 12 20 port trunk pvid vlan 12 port link-aggregation group 1 quit interface GigabitEthernet 0/0/2 port link-type trunk port trunk allow-pass vlan 10 12 20 port trunk pvid vlan 12 port link-aggregation group 1 quit interface Eth-Trunk 1 lacp max-active-linknumber 2 quit ``` #### Agg 02 ```shell system-view interface Eth-Trunk 1 lacp mode static quit interface GigabitEthernet 0/0/1 port link-type trunk port trunk allow-pass vlan 10 12 20 port trunk pvid vlan 12 port link-aggregation group 1 quit interface GigabitEthernet 0/0/2 port link-type trunk port trunk allow-pass vlan 10 12 20 port trunk pvid vlan 12 port link-aggregation group 1 quit interface Eth-Trunk 1 lacp max-active-linknumber 2 quit ``` 以上步骤确保了在 `Agg 01` 和 `Agg 02` 之间配置了LACP-static模式的链路聚合,并且限制了活动链路数量为2。
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值