超详细!链路聚合实验全流程实操手册

链路聚合

链路聚合是将多个物理链路捆绑成一个逻辑链路,以增加链路带宽、提高可靠性和实现负载均衡的技术。

原理

将多个物理链路的带宽进行合并,形成一个更高带宽的逻辑链路。同时,通过一定的算法,将数据流量均匀地分配到各个物理链路上,实现负载均衡。当其中某个物理链路出现故障时,流量会自动切换到其他正常的物理链路上,从而提高了网络的可靠性。

优点

增加带宽:多个物理链路的带宽相加,能为网络提供更高的数据传输速率,满足大量数据传输的需求。
提高可靠性:当一条物理链路出现故障时,数据可以通过其他正常链路传输,不会导致网络中断,增强了网络的容错能力。
负载均衡:数据流量能够均匀地分布在各个链路上,避免了单个链路负载过高,而其他链路闲置的情况,充分利用了网络资源。

应用场景

数据中心:服务器之间需要大量的数据传输,链路聚合可以提供高带宽和高可靠性,确保数据中心内部网络的稳定运行。
园区网核心层和汇聚层:用于连接核心交换机和汇聚交换机,承载大量的用户数据流量,通过链路聚合可以提高网络的传输能力和可靠性。
广域网连接:在连接不同地区的网络时,链路聚合可以将多个低速链路合并成一个高速链路,提高广域网的连接质量和稳定性。

实验拓扑

请添加图片描述

实验需求
  1. 按照图示配置PC3和PC4的IP地址
  2. 在SW1和SW3的三条直连链路上配置链路聚合,实现链路冗余,并可以增加传输带宽
  3. SW1和SW2之间的直连链路要配置为Trunk类型,允许所有VLAN通过
  4. 中断SW1和SW2之间的一条直连链路,测试PC3和PC4是否仍然能够继续访问
实验步骤
  1. 按照拓扑图示配置IP地址

  2. 在SW1和SW2的直连链路上配置链路聚合,实现链路冗余,并可以增加传输带宽

    <H3C>sys
     System View: return to User View with Ctrl+Z.
    [H3C]sysname SW1
    [SW1]interface Bridge-Aggregation 1
    [SW1-Bridge-Aggregation1]quit
    [SW1]interface GigabitEthernet 1/0/1
    [SW1-GigabitEthernet1/0/1]port link-aggregation group 1
    [SW1-GigabitEthernet1/0/1]int g1/0/2
    [SW1-GigabitEthernet1/0/2]port link-aggregation group 1
    [SW1-GigabitEthernet1/0/2]int g1/0/3
    [SW1-GigabitEthernet1/0/3]port link-aggregation group 1
    [SW1-GigabitEthernet1/0/3]quit
    [SW1]
    
    <H3C>sys
    System View: return to User View with Ctrl+Z.
    [H3C]sysname SW2
    [SW2]interface Bridge-Aggregation 1
    [SW2-Bridge-Aggregation1]quit
    [SW2]interface GigabitEthernet 1/0/1
    [SW2-GigabitEthernet1/0/1]port link-aggregation group 1
    [SW2-GigabitEthernet1/0/1]int g1/0/2
    [SW2-GigabitEthernet1/0/2]port link-aggregation group 1
    [SW2-GigabitEthernet1/0/2]int g1/0/3
    [SW2-GigabitEthernet1/0/3]port link-aggregation group 1
    [SW2-GigabitEthernet1/0/3]quit
    [SW2]
    
    //查看链路聚合状态,发现已经成功运行
    [SW1]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: Static
    Loadsharing Type: Shar
      Port             Status  Priority Oper-Key
    --------------------------------------------------------------------------------
      GE1/0/1          S       32768    1
      GE1/0/2          S       32768    1
      GE1/0/3          S       32768    1
    [SW1]
    
  3. SW1和SW2之间的直连链路要配置为Trunk类型,允许所有VLAN通过

    [SW1]interface Bridge-Aggregation 1
    [SW1-Bridge-Aggregation1]port link-type trunk
    Configuring GigabitEthernet1/0/1 done.
    Configuring GigabitEthernet1/0/2 done.
    Configuring GigabitEthernet1/0/3 done.
    [SW1-Bridge-Aggregation1]port trunk permit vlan all
    Configuring GigabitEthernet1/0/1 done.
    Configuring GigabitEthernet1/0/2 done.
    Configuring GigabitEthernet1/0/3 done.
    [SW1-Bridge-Aggregation1]quit
    [SW1]
    
    [SW2]interface Bridge-Aggregation 1
    [SW2-Bridge-Aggregation1]port link-type trunk
    Configuring GigabitEthernet1/0/1 done.
    Configuring GigabitEthernet1/0/2 done.
    Configuring GigabitEthernet1/0/3 done.
    [SW2-Bridge-Aggregation1]port trunk permit vlan all
    Configuring GigabitEthernet1/0/1 done.
    Configuring GigabitEthernet1/0/2 done.
    Configuring GigabitEthernet1/0/3 done.
    [SW2-Bridge-Aggregation1]quit
    [SW2]
    

    //测试能够ping通
    在这里插入图片描述

  4. 中断SW1和SW2之间的一条直连链路,测试PC3和PC4是否仍然能够继续访问

    [SW1]interface GigabitEthernet 1/0/1
    [SW1-GigabitEthernet1/0/1]shutdown
    %Mar 12 10:32:42:447 2025 SW1 LAGG/6/LAGG_INACTIVE_PHYSTATE: Member port GE1/0/1 of aggregation group BAGG1 changed to the inactive state, because the physical state of the port is down.
    %Mar 12 10:32:42:447 2025 SW1 IFNET/3/PHY_UPDOWN: Physical state on the interface GigabitEthernet1/0/1 changed to down.
    %Mar 12 10:32:42:447 2025 SW1 IFNET/5/LINK_UPDOWN: Line protocol state on the interface GigabitEthernet1/0/1 changed to down.
    

    //查看接口状态

    [SW1-GigabitEthernet1/0/1]display this
    #
    interface GigabitEthernet1/0/1
     port link-mode bridge
     port link-type trunk
     port trunk permit vlan all
     combo enable fiber
     shutdown
     port link-aggregation group 1
    #
    return
    [SW1-GigabitEthernet1/0/1]display ip interface brief
    *down: administratively down
    (s): spoofing  (l): loopback
    Interface                Physical Protocol IP Address      Description
    MGE0/0/0                 down     down     --              --
    [SW1-GigabitEthernet1/0/1]quit
    [SW1]display this
    #
     sysname SW1
    #
     irf mac-address persistent timer
     irf auto-update enable
     undo irf link-delay
     irf member 1 priority 1
    #
     lldp global enable
    #
     system-working-mode standard
     xbar load-single
     password-recovery enable
     lpu-type f-series
    #
     stp global enable
    #
     scheduler logfile size 16
    #
     domain default enable system
    #
    return
    [SW1]display ip interface brief
    *down: administratively down
    (s): spoofing  (l): loopback
    Interface                Physical Protocol IP Address      Description
    MGE0/0/0                 down     down     --              --
    [SW1]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: Static
    Loadsharing Type: Shar
      Port             Status  Priority Oper-Key
    --------------------------------------------------------------------------------
      GE1/0/1          U       32768    1
      GE1/0/2          S       32768    1
      GE1/0/3          S       32768    1
    [SW1]display link-aggregation summary
    Aggregation Interface Type:
    BAGG -- Bridge-Aggregation, BLAGG -- Blade-Aggregation, RAGG -- Route-Aggregation, SCH-B -- Schannel-Bundle
    Aggregation Mode: S -- Static, D -- Dynamic
    Loadsharing Type: Shar -- Loadsharing, NonS -- Non-Loadsharing
    Actor System ID: 0x8000, 44d0-468a-0100
    
    AGG        AGG   Partner ID              Selected  Unselected  Individual  Share
    Interface  Mode                          Ports     Ports       Ports       Type
    --------------------------------------------------------------------------------
    BAGG1      S     None                    2         1           0           Shar
    [SW1]
    

    //测试结果
    在这里插入图片描述
    在这里插入图片描述

### 华为ENSP中链路聚合的测试配置与实验 #### 实验准备 为了进行链路聚合的测试,在eNSP平台上构建了一个由两台交换机(命名为SW1和SW2)以及两台主机组成的简单网络拓扑结构[^1]。 #### 配置物理连接 确保每台交换机上的两个千兆以太网端口(例如G0/0/2和G0/0/3)被用于创建逻辑捆绑接口即Eth-Trunk。对于每一侧的交换机,执行如下命令来建立并配置这些接口: ```shell [S1]interface Eth-Trunk 1 [S1-Eth-Trunk1]mode lacp [S1-Eth-Trunk1]trunkport GigabitEthernet 0/0/2 to 0/0/3 ``` 上述过程同样适用于另一台交换机SW2,只需调整设备名称即可[^5]。 #### LACP协议设置 当采用动态LACP方式时,两端均需指定相同的系统优先级以便于更好地控制哪一方成为主动方;而接口级别的优先级则决定了哪些成员端口能够参与数据转发活动。通常情况下,默认的最大活跃链路数量设为8,但在某些场景下可根据际需求调整此参数至更小值如2[^4]。 #### 连通性验证 完成以上所有步骤之后,利用`ping`指令从一台主机向另外一台发送ICMP请求报文,以此检验跨过新形成的聚合链路后的通信状况是否良好。如果一切正常,则说明此次链路聚合配置成功。 此外,还可以借助特定命令检查当前状态下的聚合情况: ```shell display eth-trunk 1 ``` 这条语句可以展示有关第一个Eth-Trunk的信息,包括但不限于工作模式、成员端口号及其角色等细节[^3]。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值