Stack istack
Huawei network device (USG firewall + S/CE switch) CLI skills pack for OpenClaw AI agent — also usable as a standalone cheatsheet.
npx -y skills add nanxiaoyao/network-huawei-skills --skill stack-istackAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
This skill should be used when the user asks to configure or troubleshoot Huawei S-series switch stacking (iStack). Covers stack establishment via stack-port or service-port mode, master/slave/standby election, member join/leave, dual-active detection (DAD/MAD), stack split & merge, in-service upgrade, and stack troubleshooting. Applicable platforms S/CE switches: S1720/S2700/S5700/S6720 V200R011C10+ (iStack) and CloudEngine 5800-9800 V200R022C00+ (Stack).
SKILL.md
8.4 KB, ~3.1k tokens by cl100k_base, as published. Nobody here has run it
华为 S 系列堆叠 iStack 配置技能 (stack-istack)
适用平台 S1720/S2700/S5700/S6720 V200R011C10+ 文档来源 华为产品文档 dc_cfg_istack_*
iStack 把多台物理交换机虚拟成一台逻辑设备 统一管理 跨设备链路聚合 提带宽和冗余
触发场景
- 新建堆叠 / 加堆叠成员
- 堆叠成员上下线
- 堆叠主备倒换
- 堆叠分裂 / 多主检测 MAD
- 堆叠合并
- 跨设备链路聚合配置
- 堆叠升级
- 堆叠口异常 link DOWN
堆叠基本概念
| 角色 | 说明 |
|---|---|
| Master | 主 唯一 控制整个堆叠 |
| Standby | 备 主故障时升主 |
| Slave | 从 转发数据 多个 |
| Stack-Port / Service-Port | 堆叠口 |
| Stack ID | 堆叠成员编号 1-9 |
| Stack Priority | 优先级 数值大优先 默认 100 |
堆叠模式
1 Stack-Port 模式(专用堆叠口)
某些高端机型有专用堆叠卡或端口(如 S6720 后端口)
2 Service-Port 模式(业务口转堆叠)
常用 把业务口物理光口转为堆叠口 适合 S5700/S6720 等
配置六步走(Service-Port 模式)
1 配置堆叠 ID 与优先级
# 第一台 计划做 Master
system-view
stack
stack member 1 priority 200 # 优先级高 当 Master
stack member 1 renumber 1 # 设 ID 为 1(如有需要)
# 第二台
stack
stack member 1 renumber 2 # 设 ID 为 2
stack member 2 priority 150
2 配置堆叠口
# 第一台
interface stack-port 1/1
quit
interface 10GE 1/0/1
shutdown
stack-port 1/1
undo shutdown
quit
# 第二台
interface stack-port 2/1
quit
interface 10GE 1/0/1
shutdown
stack-port 2/1
undo shutdown
3 保存配置并重启
save
reboot
重启后两台设备会建立堆叠 编号统一
4 验证堆叠
display stack
display stack configuration
display stack peers
display device
5 配置 MAD(多主检测 防分裂双主)
方式 A 直连模式(DAD)
两台堆叠成员之间用直连线(MAD 检测口)单独跑 MAD
interface GigabitEthernet 1/0/24
mad detect mode direct
quit
interface GigabitEthernet 2/0/24
mad detect mode direct
方式 B 中继模式(通过聚合口)
通过 Eth-Trunk 上的 mad 协议跨堆叠检测
interface Eth-Trunk 1
mad detect mode relay
方式 C 代理模式
通过外部交换机做 MAD 代理
6 配置跨设备链路聚合
interface Eth-Trunk 10
mode lacp-static
quit
# 一个成员口在堆叠成员 1 上
interface 10GE 1/0/2
eth-trunk 10
# 另一个成员口在堆叠成员 2 上
interface 10GE 2/0/2
eth-trunk 10
对下游表现为一个聚合 实现跨框冗余
命令体系
堆叠管理
| 命令 | 视图 | 说明 |
|---|---|---|
| stack | system | 进入堆叠视图 |
| stack member <id> priority <num> | stack | 优先级 数值大优先 |
| stack member <old-id> renumber <new-id> | stack | 改 ID |
| stack member <id> domain <num> | stack | 堆叠域(多个堆叠隔离用) |
| stack slot <id> | system | 单板视图(CE 系列) |
堆叠口
| 命令 | 视图 | 说明 |
|---|---|---|
| interface stack-port <member-id>/<port-id> | system | 进入堆叠口 |
| stack-port <member-id>/<port-id> | interface | 业务口转堆叠口 |
| undo stack-port | interface | 转回业务口 |
MAD
| 命令 | 视图 | 说明 |
|---|---|---|
| mad detect mode { direct | relay | proxy } | interface | MAD 模式 |
| mad domain <num> | system | MAD 域 |
| mad enable | system | 全局启用 MAD |
| mad reserve interface <if> | system | 故障保留口(恢复期用) |
查看
| 命令 | 说明 |
|---|---|
| display stack | 堆叠总览 |
| display stack configuration | 堆叠配置 |
| display stack peers | 邻居成员 |
| display stack neighbor | 堆叠口邻居 |
| display stack mad | MAD 状态 |
| display device | 物理设备 |
| display interface stack-port | 堆叠口状态 |
升级与维护
| 命令 | 说明 |
|---|---|
| stack slot <id> reboot | 重启指定成员 |
| stack master switchover | 主备倒换 |
| stack upgrade fast | 快速升级(启 ISSU) |
完整范式 两台 S5720 堆叠 + MAD 直连 + 跨框聚合上联
# 设备 1(计划做 Master)
system-view
sysname Stack-1
stack
stack member 1 priority 200
quit
interface 10GE 0/0/1
shutdown
stack-port 1/1
undo shutdown
quit
interface 10GE 0/0/2
shutdown
stack-port 1/2
undo shutdown
quit
# MAD 直连
interface GigabitEthernet 0/0/24
mad detect mode direct
quit
mad enable
# 跨框聚合
interface Eth-Trunk 10
mode lacp-static
quit
interface 10GE 0/0/5 # 成员 1 的 10GE 5
eth-trunk 10
# 设备 2 同步 设 ID 2 优先级 100 完成堆叠口与 MAD 直连
# 重启后两台合并 配置共享 跨框聚合自动建立
常见陷阱
- 堆叠口加错(业务口没转为 stack-port)→ 堆叠建不起来
- 堆叠 ID 冲突 → 一台堆叠不能加入
- 没配 MAD → 堆叠分裂时双主 业务严重异常
- 优先级写反 → 期望的主反成备
- 堆叠版本不一致 → ISSU 失败 强制升级才能合并
- 跨框聚合成员都在同一物理框 → 失去跨框冗余意义
- 业务口转堆叠口前没 shutdown → 转换失败
排查流程
堆叠建不起来
display stack看每个成员是否识别到对端display interface stack-port看堆叠口物理状态- 版本一致?
display version - ID 冲突?检查每台 sysview 下
stack member配置
堆叠分裂(脑裂)
display stack mad看 MAD 状态- 物理:堆叠线是否好
- 紧急:手动让一台进 recovery 模式 防双主
相关文件
- references/stack-commands.md 完整命令
- references/stack-troubleshooting.md 分裂/合并/升级
⚠️ S 系列 iStack vs CE 系列 Stack 重要差异
S 系列和 CE 系列堆叠概念相同但命令视图和语法有差别,务必按平台选用。
关键差异对照
| 项 | S 系列 (iStack) | CE 系列 (Stack) |
|---|---|---|
| 进入堆叠视图 | stack 进入堆叠视图后操作 | 同:stack |
| 堆叠成员配置 | stack member <id> priority <num>(系统视图直接配) | 在堆叠视图下:stack member <id> priority <num> |
| 堆叠域 | stack member <id> domain <num> | 同 |
| 物理口转堆叠口 | 接口下 shutdown → stack-port <m>/<port> → undo shutdown | 接口下 port mode stack → 再用 stack-port 接口聚合 |
| 多口绑定堆叠口 | 单口逐个绑 | interface stack-port 1/1 → port member-group interface 10ge 1/0/1 to 1/0/4(一次绑多个) |
| 修改成员 ID | stack member <old> renumber <new> | stack member <old> renumber <new> inherit-config |
| 配置提交 | save 后重启 | commit 提交,再 save,再重启 |
| 端口自动配置 | 转 stack 后保留默认 | 转后自动加 port crc-statistics trigger error-down |
CE Stack 完整配置范式
< HUAWEI > system-view
[~HUAWEI] sysname SwitchA
[*HUAWEI] commit # CE 必须 commit
[~SwitchA] stack
[~SwitchA-stack] stack member 1 priority 150
[*SwitchA-stack] stack member 1 domain 10
[*SwitchA-stack] quit
[*SwitchA] commit
# 转换业务口为堆叠口
[~SwitchA] interface stack-port 1/1
[*SwitchA-Stack-Port1/1] port member-group interface 10ge 1/0/1 to 1/0/4
[*SwitchA-Stack-Port1/1] commit
CE 验证命令
display stack # 查角色 优先级 MAC
display stack configuration # 配置详情
display stack topology # 拓扑(环/链式)
CE 输出格式略不同(含 Oper/Conf 区分实际生效与配置)
通用结论
本技能 SKILL.md 默认描述的是 S 系列 iStack 范式。如果你在用 CE 系列,重点关注:
- 所有配置改动后必须
commit - 物理口转堆叠口:先
port mode stack再stack-port <id> - 多个物理口可批量绑入同一堆叠口(
port member-group)
MAD 多主检测(S/CE 通用)
两系列 MAD 命令一致:mad detect mode { direct | relay | proxy }、mad enable、mad domain <num>
What ships with it: 2 files
8.0 KB alongside SKILL.md
references/
- stack-commands.md3.8 KB
- stack-troubleshooting.md4.2 KB
Gives 0 of the 12 instructions most debug triage skills give in ~3.1k tokens
Counted across 839 of the 1,149 authors here whose files we hold, read 2026-08-07
- Investigate root cause before proposing any fixin 102 of 839, across 67 files
- Read error messages completelyin 89 of 839, across 49 files
- Create a failing test case before fixingin 84 of 839, across 46 files
- Reproduce the issue consistentlyin 82 of 839, across 41 files
- Change one variable at a timein 82 of 839, across 42 files
- Check recent changesin 74 of 839, across 36 files
- Write the regression test before fixingin 74 of 839, across 40 files
- Fix the root cause not the symptomin 60 of 839, across 45 files
- Implement a single fix at a timein 59 of 839, across 20 files
- Trace data flow backward to the sourcein 50 of 839, across 20 files
- Remove all debug instrumentationin 49 of 839, across 13 files
- Form a single hypothesisin 48 of 839, across 18 files
Said here and by no other author read
- Set stack member IDs uniquely
- Set the highest priority on the intended master
- Shut down physical ports before converting them to stack ports
- Enable multi-active detection
- Distribute link aggregation group members across physical stack members
- Save configuration and reboot to establish stacking
Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once. Length counted with cl100k_base; the agent that loads this file may tokenize it differently.