华为交换机 PoE 供电配置与功率管理实战 - 夜莺博客

华为交换机 PoE 供电配置与功率管理实战

PoE 看起来只是"插上就供电",真正出问题的时候却往往和功率预算有关:整机 PoE 电源不够时后上线的 PD 会被下电,AP 和摄像头在用电高峰轮流掉线,排查时又看不到任何告警。华为 S 系列交换机提供了完整的 PoE 功率管理命令,可以把"谁优先供电""每个口最多给多少瓦""整机还剩多少功率"都管起来。本文给出配电规划常用的几条命令和验证方法。

PoE 的默认行为

华为交换机上,接口的 PoE 功能缺省处于使能状态。也就是说交换机检测到符合标准的 PD 设备接入后会自动协商并供电,不需要额外配置。只有在下面几种情况下才需要手工介入:

  • 希望对某个接口限制最大输出功率,防止单口异常设备拉爆整机预算;
  • 希望为关键设备(AP、门禁、摄像头)保留供电优先级;
  • 希望 shutdown 接口的同时切断供电(缺省情况下 shutdown 不影响 PoE 供电)。

使能与关闭接口 PoE

<HUAWEI> system-view
[HUAWEI] interface gigabitethernet 1/0/1
[HUAWEI-GigabitEthernet1/0/1] poe enable
[HUAWEI-GigabitEthernet1/0/1] quit

一个容易踩的坑:接口执行 shutdown 并不会停止对外供电。要让接口真正断电,必须在接口视图下执行 undo poe enable。如果需要让 shutdown 与供电联动,可以配置 poe track shutdown。

限制接口最大输出功率

按已知设备的实际功耗设置上限是最有效的保护手段。华为的 poe power 参数单位是毫瓦:

[DeviceA] interface gigabitethernet 1/0/1
[DeviceA-GigabitEthernet1/0/1] poe power 15000
Warning: This operation may power off the PD connected to this port. Continue? [Y/N]:y
[DeviceA-GigabitEthernet1/0/1] quit
[DeviceA] interface gigabitethernet 1/0/2
[DeviceA-GigabitEthernet1/0/2] poe power 20000
[DeviceA-GigabitEthernet1/0/2] quit

15 000 对应 15W(典型 IP Phone),20 000 对应 20W。注意设置该命令时如果新上限低于当前实际功耗,设备会直接对 PD 下电,所以要在维护窗口内操作。

配置供电优先级

当整机 PoE 功率不足时,交换机按下电优先级决定牺牲谁。优先级从高到低为 critical > high > low(缺省 low)。

[DeviceA] interface gigabitethernet 1/0/1
[DeviceA-GigabitEthernet1/0/1] poe priority critical
Warning: This operation may power off some PDs with lower priority. Continue? [Y/N]:y
[DeviceA-GigabitEthernet1/0/1] quit
[DeviceA] interface gigabitethernet 1/0/4
[DeviceA-GigabitEthernet1/0/4] poe priority high
[DeviceA-GigabitEthernet1/0/4] quit

把 AP 的上联口和门口门禁设为 critical,普通 IP 电话设 low,可以让功率紧张时有明确的取舍,而不是随机掉电。

验证与容量核算

<HUAWEI> display poe power-state slot 1
<HUAWEI> display poe power
<HUAWEI> display poe information

display poe power-state slot 1 按端口列出供电状态、是否使能、优先级和当前是否在供电(powering/on)。做配电规划时把各端口实测功率相加,与整机 PoE 电源功率对比,预留 20% 左右余量;PoE+(802.3at)端口单口上限 30W,PoE++(802.3bt)更高,但整机预算往往才是真正的瓶颈。

另外,如果部署地区的市电频率是 60Hz,需要下发 poe anti-interference frequency 60,否则抗市电干扰的滤波参数不匹配,可能引起异常掉电。

常见问题

  • PD 反复上下电:通常是整机功率不足触发优先级下电,先看 display poe power 的剩余功率。
  • 接口 shutdown 但设备仍带电:属于缺省行为,用 undo poe enable 或配置 poe track shutdown。
  • 非标准 PD 不供电:可配置兼容非标准 PD 功能,或使用 poe force-power(视产品版本支持情况而定)。

相关的华为设备运维文章还有 华为交换机端口镜像配置:观察端口、1:N 与 N:1 场景(抓包定位 PoE 掉电期间的报文)、华为交换机 NTP 时间同步配置实战(含认证与排障)(统一设备时间便于对齐掉电日志),以及 GPON OLT to ONU Provisioning: Profile Configuration 中 ONU 供电预算的规划思路。

原文链接:https://support.huawei.com/enterprise/zh/doc/EDOC1100559695/efb299e0