新楼几十台交换机没人逐台调?华为Commander零配置部署自动激活
本文整理自华为官方发布的配置指导,命令与步骤均按原始文档呈现,供现场实施参考。
新设备上电自动获取地址、自动找到Commander、按型号下载配置激活,装机师傅只管上架插线,连MAC和ESN都不用提前报备。
整体思路分几步?
新办公楼交付,几十台全新交换机上架,MAC清单没报齐、Console排期排不开,割接时间却一天天逼近。华为交换机的Commander零配置部署就是给这种场景准备的:新设备上电后自动获取地址、自动找到Commander、按型号下载对应的配置文件并激活,装机师傅只管上架插线。配合网络拓扑收集功能,连每台设备的MAC地址和ESN都不用提前报备,线缆插好,拓扑自己就画出来了。
整体思路分四步:文件服务器备好待下发文件;DHCP把新设备引导到Commander;Commander收集拓扑认出每一台Client;最后按台指定下载文件并留足激活延时。
新设备怎么被引到Commander?
先在DHCP服务器上建全局地址池,用option 148把Commander地址塞给新设备:
<HUAWEI> system-view
[HUAWEI] sysname SwitchB
[SwitchB] dhcp enable
[SwitchB] interface vlanif 30
[SwitchB-Vlanif30] ip address 192.168.3.2 24
[SwitchB-Vlanif30] dhcp select global
[SwitchB-Vlanif30] quit
[SwitchB] ip pool easy-operation
[SwitchB-ip-pool-easy-operation] network 192.168.1.0 mask 255.255.255.0
[SwitchB-ip-pool-easy-operation] gateway-list 192.168.1.6
[SwitchB-ip-pool-easy-operation] option 148 ascii ipaddr=192.168.1.6;
[SwitchB-ip-pool-easy-operation] quit
新设备与DHCP服务器不在同一网段时,在Commander侧配DHCP中继:
<HUAWEI> system-view
[HUAWEI] sysname SwitchA
[SwitchA] dhcp enable
[SwitchA] interface vlanif 10
[SwitchA-Vlanif10] ip address 192.168.1.6 24
[SwitchA-Vlanif10] dhcp select relay
[SwitchA-Vlanif10] dhcp relay server-ip 192.168.3.2
[SwitchA-Vlanif10] quit
Commander上开启零配置部署功能,并登记SFTP文件服务器:
[SwitchA] easy-operation commander ip-address 192.168.1.6
[SwitchA] easy-operation commander enable
[SwitchA] easy-operation
[SwitchA-easyoperation] sftp-server 192.168.2.2 username admin password EasyOperation
[SwitchA-easyoperation] quit
不报MAC和ESN怎么认设备?
装机师傅没报MAC和ESN时,打开拓扑收集与Client自动加入,再指定集群管理VLAN,把新设备"看"进来:
[SwitchA] ndp enable
[SwitchA] ntdp enable
[SwitchA] ntdp timer 5
[SwitchA] easy-operation
[SwitchA-easyoperation] topology enable
[SwitchA-easyoperation] client auto-join enable
[SwitchA-easyoperation] quit
[SwitchA] cluster enable
[SwitchA] cluster
[SwitchA-cluster] mngvlanid 10
[SwitchA-cluster] quit
收集完成后查看拓扑,把Client编号和现场设备一一对上:
[SwitchA] display easy-operation topology
<-->:normal device <??>:lost device
Total topology node number: 3
------------------------------------------------------------------------------
[SwitchA: 00E0-FC8F-0447](Commander)
|-(GE1/0/1)<-->(GE0/0/1)[HUAWEI: 00E0-FC34-3190](Client 1)
| |-(GE0/0/2)<-->(GE0/0/1)[HUAWEI: 00E0-FC75-EDFF] (Client 3)
文件怎么按台下发、效果怎么验?
按编号为每台Client指定配置文件与自定义文件;设备串联组网时,给尾部设备留够激活延时,避免前一台还没下完文件后一台就开跑:
[SwitchA] easy-operation
[SwitchA-easyoperation] client 1 configuration-file s5700-hi.cfg custom-file header1.txt
[SwitchA-easyoperation] client 3 configuration-file s5700-x-li.cfg custom-file header2.txt
[SwitchA-easyoperation] activate-file delay 900
验证看两处:用display easy-operation configuration核对全局配置,确认拓扑收集与自动加入已打开;部署开始后用display easy-operation download-status盯每台Client的下载阶段与状态,全部跑完即可交付。
这套打法的价值在于把"装机"变成"到货即上线":文件服务器里按型号备好配置模板,新设备插电就走流程,后续扩容照方抓药,换下来的设备也能靠自动备份的配置快速还原。贵州诚鑫致达科技在给分支机构做批量开局时就用这套方式,几十台设备的部署周期从几天压到半天,运维交接时也少了一堆手抄配置的口令清单。
依据:华为官方典型配置案例(2026-11 版)。