惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Jina AI
Jina AI
MyScale Blog
MyScale Blog
量子位
月光博客
月光博客
J
Java Code Geeks
A
About on SuperTechFans
H
Hackread – Cybersecurity News, Data Breaches, AI and More
U
Unit 42
WordPress大学
WordPress大学
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
腾讯CDC
G
Google Developers Blog
博客园 - 【当耐特】
Engineering at Meta
Engineering at Meta
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
宝玉的分享
宝玉的分享
IT之家
IT之家
N
Netflix TechBlog - Medium
Microsoft Security Blog
Microsoft Security Blog
博客园 - 叶小钗
B
Blog
Martin Fowler
Martin Fowler
P
Proofpoint News Feed
B
Blog RSS Feed

lololowe的博客

NAT 回流解决方案 M-LAG跨设备链路聚合组 mDNS简介与配置 PVE通过 Cloud-init 部署 Cloud Images 教程 给 VSCode 添加网络设备配置的语法高亮 给 VSCode 添加网络设备配置的语法高亮 单板级可靠性与设备级可靠性 Eth-Trunk 原理及配置 《防火墙项目化实战 (基于华为eNSP)》笔记 华为VLAN高级特性与协议详解 DNS 跨平台托管 CVE-2026-0073 安卓调试桥漏洞复现 使用 Bettercap 进行 HTTPS 中间人攻击:SSL 剥离和 HSTS 绕过 Yakit测试PortSwigger靶场-未授权访问 visio导入Mermaid流程图(SVG格式) 什么是 TiT (TLS in TLS) 特征以及如何消除特征 部署 Wireguard VPN 实现异地组网 Redis未授权访问漏洞复现 实现防御ARP劫持与主动反击 华为VRP系统基本操作 mrs文件转换与查看 电脑垃圾清理技巧分享 QQ音乐 2015-2025 年度听歌报告链接汇总 基于DevStack快速部署OpenStack
iStack 堆叠原理及配置
lololowe · 2026-08-12 · via lololowe的博客
计算机网络网络设备配置计算机网络iStack

1. iStack(堆叠)理论

1.1. 堆叠优势

传统组网通常会在多台交换机设备之间利用Eth-Trunk捆绑链路带宽,利用VRRP虚拟一个默认网关,并利用MSTP破除环路。

这种场景下链路利用率偏低,并且维护成本偏高,而堆叠(iStack)的优势便显露出来,堆叠可以将最多9系列的设备,通过专用堆叠线缆连接起来,使这些设备在逻辑上虚拟成一台设备,共同参与数据转发,共用一套配置,极大简化了管理成本以及扩展了端口数量。

主要突出特性如下:

  1. 高可靠性:堆叠组中的交换机可以实现跨设备链路聚合,例如参与堆叠的是两台框式交换机,而链路聚合的成员端口分布在两台设备的不同板卡上,这样即使某台设备的板卡故障,甚至整机故障,另一台设备也能保障链路聚合不中断。这样就实现了将链路可靠性从单板级提高到了设备级
  2. 扩展端口数量
  3. 增大带宽:可以将多台交换机的多个端口聚合成一个链路聚合组,提高链路带宽
  4. 简化组网:多台设备虚拟成一台设备,在逻辑上只需要对一台设备进行管理,简化了管理成本,并且不需要STP等协议进行破环

1.2. 堆叠概念

1.2.1. 成员角色

角色 定义
主交换机(Master) 管理整个堆叠系统,一个堆叠系统只有一台主交换机
备交换机(Standby) 主交换机故障时接替其工作,一个堆叠系统只有一台备交换机
从交换机(Slave) 除了主交换机和备交换机以外的所有设备都是从交换机,备交换机故障时,会接替其工作

堆叠系统的控制平面由主交换机统一管理;所有成员交换机(Master + Standby + Slave)都参与转发平面进行业务流量转发。

1.2.2. 角色选举参数

参数 释义
堆叠 ID 范围0~8,用于标识每台成员交换机,也做为每台交换机的槽位号(如1/0/0和2/0/0的1和2),因此不能重复
堆叠优先级 用于选举交换机的角色,值越大,优先级越高
堆叠MAC地址 由系统MAC地址(display system mac-address)决定,堆叠优先级一致时,系统MAC地址越小,优先级越高

1.2.3. 连接拓扑

链型连接: 串行链路,适合长距离堆叠,节省成本以及端口

alt text

环形连接: 首尾相连,具有更高的可靠性,成本也更高

alt text

1.2.4. 堆叠方式

堆叠方式 效果
堆叠卡堆叠 使用堆叠线缆互连两台交换机自带的堆叠口(或者堆叠插卡),然后自动组建堆叠
业务口专用堆叠线缆堆叠 使用堆叠线缆互连两台交换机的业务口,然后自动组建堆叠
业务口普通线缆堆叠 使用普通线缆互连两台交换机的业务口,然后手动配置堆叠逻辑端口与相关参数以组建堆叠

1.3. 堆叠选举

alt text

主交换机选举完成后,主交换机会收集所有成员交换机的拓扑信息,并分配堆叠ID(槽位号),然后按照相同的规则选举备交换机和从交换机。

角色选举和拓扑收集完成之后,所有成员交换机会同步主交换机的系统软件版本和配置文件。

1.4. 堆叠分裂(脑裂)

由于堆叠系统中的所有成员设备的IP和MAC都相同,因此当堆叠系统之间的链路故障时,会导致堆叠分裂,从而产生多个具有相同IP地址和MAC地址的设备。为此建议配置MAD双主检测功能来降脑裂低对业务的影响。

2. 堆叠配置

推荐个网页工具:

2.1. 堆叠

使用ENSP Pro 模拟业务口普通线缆堆叠,S-1为主设备,S-2为备设备,堆叠配置完成前不进行连线。

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    <HUAWEI>system-view
    [HUAWEI]sysname S-1
    [S-1]stack
    [S-1-stack]stack member 1 priority 150
    [S-1-stack]quit
    [S-1]interface Stack-Port 1/1
    [S-1-Stack-Port1/1]port member-group interface GE 1/0/9 to GE 1/0/10
    Warning: After the configuration is complete,
    1.The interface(s) (GE1/0/9-1/0/10) will be converted to member of Stack-Port.
    2.The current operation will clear all configurations on the interface and save all configurations on the device. Manually back up the configuration file before the operation.
    3.The interface(s) may go Error-Down because there is no shutdown configuration on the interfaces. Continue? [Y/N]:y
    Warning: All running configurations of the interface will be cleared immediately. Continue? [Y/N]:y
    Info: Operating, please wait for a moment.........done.
    [S-1-Stack-Port1/1]return
    <S-1>save
    Warning: The current configuration will be written to the device. Continue? [Y/N]:y
    Now saving the current configuration to the slot 1
    Info: Save the configuration successfully.
    <S-1>
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    <HUAWEI>system-view
    [HUAWEI]sysname S-2
    [S-2]stack
    [S-2-stack]stack member 1 renumber 2
    [S-2-stack]quit
    [S-2]interface Stack-Port 1/2
    [S-2-Stack-Port1/2]port member-group interface GE 1/0/9 to GE 1/0/10
    Warning: After the configuration is complete,
    1.The interface(s) (GE1/0/9-1/0/10) will be converted to member of Stack-Port.
    2.The current operation will clear all configurations on the interface and save all configurations on the device. Manually back up the configuration file before the operation.
    3.The interface(s) may go Error-Down because there is no shutdown configuration on the interfaces. Continue? [Y/N]:y
    Warning: All running configurations of the interface will be cleared immediately. Continue? [Y/N]:y
    Info: Operating, please wait for a moment.........done.
    [S-2-Stack-Port1/2]return
    <S-2>save
    Warning: The current configuration will be written to the device. Continue? [Y/N]:y
    Now saving the current configuration to the slot 1
    Info: Save the configuration successfully.
    <S-2>
    S-1:
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    <S-1>display stack configuration verbose 
    ---------------Configuration on slot 1 Begin---------------
    stack
    stack member 1 renumber 1
    *stack member 1 priority 150
    undo stack member 1 competition-priority-first
    stack member 1 competition-delay 0

    interface Stack-Port1/1
    port member-group interface GE1/0/9
    port member-group interface GE1/0/10
    ----------------Configuration on slot 1 End----------------
    <S-1>
    <S-1>
    S-2:
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    <S-2>display stack configuration verbose 
    ---------------Configuration on slot 1 Begin---------------
    stack
    *stack member 1 renumber 2
    stack member 1 priority 100
    undo stack member 1 competition-priority-first
    stack member 1 competition-delay 0

    interface Stack-Port1/2
    port member-group interface GE1/0/9
    port member-group interface GE1/0/10
    ----------------Configuration on slot 1 End----------------
    <S-2>

    互连S-1和S-2的g1/0/9和g1/0/10,形成环形堆叠:

    alt text

    连线后,堆叠优先级小的S-2会自动重启,重启后最直观的改变就是设备名同步变成了主设备的名称”S-1”。之后主要是通过槽位号(堆叠ID)区分设备。

    两台设备已通过堆叠合二为一,因此命令输出都将一致。
    S-2设备的槽位号变为堆叠ID号2。

    S-1:
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    <S-1>display stack
    -------------------------------------------------------------------------------------
    MemberID Role MAC Priority DeviceType Description
    -------------------------------------------------------------------------------------
    1 Master fac7-f460-0010 100 LSW
    2 Standby fac7-f460-0020 100 LSW
    -------------------------------------------------------------------------------------
    <S-1>
    <S-1>display stack configuration verbose
    ---------------Configuration on slot 1 Begin---------------
    stack
    stack member 1 renumber 1
    *stack member 1 priority 150
    undo stack member 1 competition-priority-first
    stack member 1 competition-delay 0

    interface Stack-Port1/1
    port member-group interface GE1/0/9
    port member-group interface GE1/0/10
    ----------------Configuration on slot 1 End----------------

    ---------------Configuration on slot 2 Begin---------------
    stack
    stack member 2 renumber 2
    stack member 2 priority 100
    undo stack member 2 competition-priority-first
    stack member 2 competition-delay 0

    interface Stack-Port2/2
    port member-group interface GE2/0/9
    port member-group interface GE2/0/10
    ----------------Configuration on slot 2 End----------------
    <S-1>

    2.2. 跨设备链路聚合(LACP)

    堆叠组下连一台接入交换机做跨设备链路聚合,堆叠组的Eth-Trunk1接口设为二层模式,关联VLAN10,做接入层的网关:
    alt text

      1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      11
      12

      vlan 10
      int vlan 10
      ip add 192.168.10.254 24


      int eth1
      port link-type trunk
      port trunk allow-pass vlan 10
      mode lacp-static
      trunkport GE 1/0/1
      trunkport GE 2/0/1
      ACC:
      1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      11
      12
      13
      14
      vlan 10


      interface GE1/0/1
      port link-type access
      port default vlan 10


      interface Eth-Trunk1
      port link-type trunk
      port trunk allow-pass vlan 10
      mode lacp-static
      trunkport GE 1/0/9
      trunkport GE 1/0/10
      PC

      alt text

      PC可以ping通自己的网关:
      alt text

      将S-1关机,链路聚合组只会停止断掉的一端(Unselect),整体不受影响:
      alt text

      PC通信不受影响:
      alt text

      S-2变为主交换机:
      alt text

      重新将S-1开机,主交换机仍然为S-2,因为已经运行的交换机比处于启动状态的交换机优先竞争为主交换机:
      alt text

      2.3. MAD多主检测

      删除S-1与S-2之间的堆叠连线,模拟链路故障导致堆叠分裂。分裂后两设备都会成为主交换机,从而导致网络故障(网络中出现重复的IP和MAC地址):

      alt text

      为了解决堆叠分裂后出现多台配置一致的主交换机,还需要配置双主检测MAD来实现对堆叠分裂的检测、冲突处理以及故障恢复。

      这里采用两端设备业务口g1/0/2直连检测的方式来配置MAD:

        1
        2
        3
        4
        [S-1]int g1/0/2
        [S-1-GE1/0/2]dual-active detect mode direct
        Warning: The interface will block common data packets, except BPDU packets. Continue? [Y/N]:y
        <S-1>save
        1
        2
        3
        4
        [S-1]int g2/0/2
        [S-1-GE2/0/2]dual-active detect mode direct
        Warning: The interface will block common data packets, except BPDU packets. Continue? [Y/N]:y
        <S-1>save
        S-1:

        alt text
        S-1 关闭了除保留端口外的所有业务端口:
        alt text

        S-2:

        alt text
        业务口正常运行:
        alt text

        恢复S-1和S-2之间的堆叠连线,等待设备重启并恢复正常堆叠状态:

        alt text

        3. 参考

        https://support.huawei.com/enterprise/zh/doc/EDOC1100102782/39614ae1
        https://info.support.huawei.com/info-finder/encyclopedia/zh/%E5%A0%86%E5%8F%A0.html
        https://cn.o3community.huawei.com/h5/blog-detail?blogId=42b7cff9-42b1-44e5-802c-b5ced3c47d5c&lang=zh_CN

        头像头像

        lololowe

        恬淡无为

        打赏作者

        感谢你赐予我前进的力量

        • Bitcoin

          Bitcoin

        • Ethereum

          Ethereum

        本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 lololowe的博客