华为交换机故障排查分析案例
目录
- 网络连通性故障
- VLAN 故障
- 生成树故障
- 链路聚合故障
- 路由协议故障
- DHCP 故障
- 安全特性故障
- 性能故障
- 硬件故障
- 故障排查方法论
1. 网络连通性故障
1.1 故障现象
- PC 无法访问网络
- Ping 不通网关
- 部分 VLAN 无法通信
1.2 排查步骤
步骤 1:检查物理连接
1 2 3 4 5 6 7 8 9 10 11 12 13
| <SW1> display interface GigabitEthernet 0/0/1
<SW1> display interface brief
<SW1> display interface GigabitEthernet 0/0/1 | include error|discard
|
步骤 2:检查 VLAN 配置
1 2 3 4 5 6 7 8 9 10 11
| <SW1> display vlan <SW1> display vlan 10
<SW1> display port vlan GigabitEthernet 0/0/1
<SW1> display mac-address <SW1> display mac-address vlan 10 <SW1> display mac-address interface GigabitEthernet 0/0/1
|
步骤 3:检查 IP 配置
1 2 3 4 5 6 7 8 9 10 11
| <SW1> display ip interface brief <SW1> display interface Vlanif 10
<SW1> display arp <SW1> display arp vlan 10
<SW1> ping 192.168.10.1 <SW1> ping -a 192.168.10.1 192.168.20.1
|
1.3 典型案例
案例 1:Access 端口 VLAN 配置错误
现象: PC 无法获取 IP,无法上网
排查:
1 2 3 4 5 6 7 8 9
| <SW1> display current-configuration interface GigabitEthernet 0/0/1
<SW1> display port vlan GigabitEthernet 0/0/1
|
问题: Access 设备连接了 Trunk 端口,且 PVID 不匹配
解决:
1 2 3 4
| <SW1> system-view [SW1] interface GigabitEthernet 0/0/1 [SW1-GigabitEthernet0/0/1] port link-type access [SW1-GigabitEthernet0/0/1] port default vlan 10
|
案例 2:VLANIF 接口 DOWN
现象: 同 VLAN 内可以通信,无法跨 VLAN 通信
排查:
1 2 3 4 5 6 7 8 9
| <SW1> display ip interface brief
<SW1> display interface Vlanif 10
<SW1> display vlan 10
|
问题: VLAN 10 没有 UP 的物理端口,VLANIF 自动 DOWN
解决:
1 2 3 4
|
[SW1] interface Vlanif 10 [SW1-Vlanif10] undo shutdown
|
2. VLAN 故障
2.1 故障现象
- VLAN 间无法通信
- 部分端口无法加入 VLAN
- VLAN 配置不生效
2.2 排查命令
1 2 3 4 5 6 7 8 9 10 11 12 13 14
| display vlan display vlan summary display vlan 10
display port vlan display port vlan interface GigabitEthernet 0/0/1
display mac-address vlan 10
display ip routing-table vlan 10
|
2.3 典型案例
案例 1:Trunk 端口未放行 VLAN
现象: 跨交换机同 VLAN 无法通信
排查:
1 2 3 4 5 6 7 8 9
| <SW1> display interface GigabitEthernet 0/0/24
<SW2> display interface GigabitEthernet 0/0/24
|
问题: SW2 的 Trunk 端口未放行 VLAN 20
解决:
1 2
| [SW2] interface GigabitEthernet 0/0/24 [SW2-GigabitEthernet0/0/24] port trunk allow-pass vlan 10 20
|
案例 2:VLAN 接口 IP 配置错误
现象: VLAN 间路由不通
排查:
1 2 3 4 5 6
| <SW1> display ip interface brief
<SW1> display current-configuration | include ip routing
|
问题: 未启用 IP 路由功能
解决:
3. 生成树故障
3.1 故障现象
3.2 排查命令
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| display stp display stp brief display stp interface GigabitEthernet 0/0/1
display stp region-configuration display stp instance 1
display stp statistics display stp tc
debugging stp bpdu
|
3.3 典型案例
案例 1:网络环路导致广播风暴
现象: 网络缓慢,CPU 利用率高,接口流量异常
排查:
1 2 3 4 5 6 7 8
| <SW1> display cpu-usage
<SW1> display interface brief | include up
<SW1> display stp brief
|
解决:
1 2 3 4 5 6 7 8 9 10 11 12 13
| [SW1] stp enable [SW1] stp mode rstp
[SW1] interface GigabitEthernet 0/0/1 [SW1-GigabitEthernet0/0/1] stp edged-port enable
[SW1] stp bpdu-protection
|
案例 2:根桥位置不当
现象: 次优路径,部分链路带宽浪费
排查:
1 2 3 4 5 6
| <SW1> display stp brief
<SW1> display stp | include Root
|
解决:
1 2 3 4 5 6 7 8 9
| [Core-SW] stp priority 0
[Core-SW] stp root primary
[Agg-SW] stp priority 4096
[Agg-SW] stp root secondary
|
4. 链路聚合故障
4.1 故障现象
- Eth-Trunk 接口 DOWN
- 成员接口未加入成功
- 负载分担不均
4.2 排查命令
1 2 3 4 5 6 7 8 9 10 11
| display eth-trunk display eth-trunk 1
display lacp statistics eth-trunk 1 display lacp peer eth-trunk 1
display load-balance display interface Eth-Trunk 1 | include rate
|
4.3 典型案例
案例 1:LACP 模式不匹配
现象: Eth-Trunk 无法 UP
排查:
1 2 3 4 5 6 7 8 9 10
| <SW1> display eth-trunk 1
<SW2> display eth-trunk 1
|
问题: 两端模式不匹配(一端 LACP,一端手工)
解决:
1 2 3
| [SW2] interface Eth-Trunk 1 [SW2-Eth-Trunk1] mode lacp
|
案例 2:成员接口配置不一致
现象: 部分成员接口无法加入 Eth-Trunk
排查:
1 2 3 4 5
| <SW1> display eth-trunk 1
<SW1> display interface GigabitEthernet 0/0/2
|
解决:
1 2 3 4 5 6
| [SW1] clear configuration interface GigabitEthernet 0/0/2
[SW1] interface GigabitEthernet 0/0/2 [SW1-GigabitEthernet0/0/2] eth-trunk 1
|
5. 路由协议故障
5.1 故障现象
5.2 排查命令
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| display ospf brief display ospf peer display ospf interface display ospf routing display ospf error
display ip routing-table display ip routing-table protocol static display ip routing-table protocol ospf
display bgp peer display bgp routing-table
|
5.3 典型案例
案例 1:OSPF 邻居无法建立
现象: OSPF 邻居状态停留在 INIT 或 2-WAY
排查:
1 2 3 4 5 6 7 8
| <SW1> display ospf peer
<SW1> display ospf interface Vlanif 10
|
常见问题及解决:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
| [SW1] ospf 1 [SW1-ospf-1] area 0
[SW1] interface Vlanif 10 [SW1-Vlanif10] ospf timer hello 10 [SW1-Vlanif10] ospf timer dead 40
[SW1-ospf-1-area-0.0.0.0] authentication-mode md5 1 cipher Huawei@123
[SW1-Vlanif10] ospf network-type broadcast
|
案例 2:路由震荡
现象: 路由频繁变化,网络不稳定
排查:
1 2 3 4 5
| <SW1> display ospf statistics
<SW1> display logbuffer | include OSPF
|
解决:
1 2 3 4 5 6 7 8 9 10
| [SW1] ospf 1 [SW1-ospf-1] spf-schedule-interval 5
[SW1] interface Vlanif 10 [SW1-Vlanif10] ospf cost 100
[SW1-ospf-1-area-0.0.0.0] abr-summary 192.168.0.0 255.255.0.0
|
6. DHCP 故障
6.1 故障现象
- 客户端无法获取 IP
- 获取到错误网段 IP
- IP 地址冲突
6.2 排查命令
1 2 3 4 5 6 7 8 9 10 11
| display dhcp server tree display dhcp server conflict display dhcp server free-ip
display dhcp server statistics
display dhcp snooping display dhcp snooping binding
|
6.3 典型案例
案例 1:DHCP 客户端无法获取 IP
现象: PC 获取到 169.254.x.x 地址
排查:
1 2 3 4 5
| <SW1> display dhcp server statistics
<SW1> display current-configuration | include dhcp
|
解决:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| [SW1] dhcp enable
[SW1] ip pool vlan10 [SW1-ip-pool-vlan10] network 192.168.10.0 mask 255.255.255.0 [SW1-ip-pool-vlan10] gateway-list 192.168.10.1 [SW1-ip-pool-vlan10] dns-list 114.114.114.114
[SW1] interface Vlanif 10 [SW1-Vlanif10] dhcp select global
[SW1] interface GigabitEthernet 0/0/24 [SW1-GigabitEthernet0/0/24] dhcp snooping trusted
|
案例 2:DHCP 地址耗尽
现象: 新客户端无法获取 IP
排查:
1 2 3 4 5
| <SW1> display dhcp server tree vlan 10
<SW1> display dhcp server free-ip
|
解决:
1 2 3 4 5 6 7 8 9
| [SW1] ip pool vlan10 [SW1-ip-pool-vlan10] network 192.168.10.0 mask 255.255.255.0 [SW1-ip-pool-vlan10] gateway-list 192.168.10.1 [SW1-ip-pool-vlan10] excluded-ip-address 192.168.10.1 192.168.10.10 [SW1-ip-pool-vlan10] lease day 1
<SW1> reset dhcp server tree all
|
7. 安全特性故障
7.1 故障现象
- 合法用户无法接入
- 端口安全误拦截
- 802.1X 认证失败
7.2 排查命令
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| display port-security display mac-address
display dot1x display dot1x connections
display dhcp snooping display dhcp snooping binding
display acl display traffic-filter applied-record
|
7.3 典型案例
案例 1:端口安全导致用户无法接入
现象: 更换 PC 后无法上网
排查:
1 2 3 4 5 6 7
| <SW1> display port-security interface GigabitEthernet 0/0/1
<SW1> display mac-address interface GigabitEthernet 0/0/1
|
解决:
1 2 3 4 5 6 7 8 9
| [SW1] interface GigabitEthernet 0/0/1 [SW1-GigabitEthernet0/0/1] undo port-security mac-address sticky
[SW1-GigabitEthernet0/0/1] port-security max-mac-count 5
[SW1-GigabitEthernet0/0/1] port-security protect-action restrict
|
案例 2:802.1X 认证失败
现象: 用户认证失败,无法接入网络
排查:
1 2 3 4 5 6 7 8
| <SW1> display dot1x connections
<SW1> display dot1x statistics
<SW1> display radius-configuration
|
解决:
1 2 3 4 5 6 7 8 9
| [SW1] test-aaa radius template radius1
[SW1] display current-configuration | include radius-server shared-key
[SW1] interface GigabitEthernet 0/0/1 [SW1-GigabitEthernet0/0/1] dot1x enable
|
8. 性能故障
8.1 故障现象
8.2 排查命令
1 2 3 4 5 6 7 8 9 10 11 12 13 14
| display cpu-usage display memory-usage
display interface | include rate|error|discard display interface GigabitEthernet 0/0/1
display qos queue statistics display qos queue interface
display storm-control
|
8.3 典型案例
案例 1:广播风暴
现象: 网络缓慢,接口流量异常
排查:
1 2 3 4 5
| <SW1> display interface brief
<SW1> display storm-control
|
解决:
1 2 3 4 5 6 7 8 9 10 11 12
| [SW1] interface GigabitEthernet 0/0/1 [SW1-GigabitEthernet0/0/1] storm-control broadcast min-rate 1000 max-rate 2000 [SW1-GigabitEthernet0/0/1] storm-control multicast min-rate 1000 max-rate 2000
[SW1] interface GigabitEthernet 0/0/1 [SW1-GigabitEthernet0/0/1] shutdown
|
案例 2:接口错包
现象: 接口有大量 error/discarded 包
排查:
1 2 3
| <SW1> display interface GigabitEthernet 0/0/1
|
解决:
1 2 3 4 5 6 7 8 9 10 11
| [SW1] interface GigabitEthernet 0/0/1 [SW1-GigabitEthernet0/0/1] duplex full [SW1-GigabitEthernet0/0/1] speed 1000
display transceiver interface GigabitEthernet 0/0/1
|
9. 硬件故障
9.1 故障现象
- 设备无法启动
- 接口频繁 UP/DOWN
- 风扇/电源告警
9.2 排查命令
1 2 3 4 5 6 7 8 9 10 11 12
| display device display version display elabel
display environment display fan display power
display transceiver interface
|
9.3 典型案例
案例 1:光模块故障
现象: 光口频繁 UP/DOWN
排查:
1 2 3 4 5
| <SW1> display transceiver interface GigabitEthernet 0/0/24
|
解决:
案例 2:电源故障
现象: 设备告警,部分模块不工作
排查:
1 2 3 4 5 6 7
| <SW1> display power
<SW1> display environment
|
解决:
10. 故障排查方法论
10.1 分层排查法
1 2 3 4 5
| 应用层 → 检查应用程序、服务配置 传输层 → 检查端口、连接状态 网络层 → 检查 IP、路由、ACL 数据链路层 → 检查 VLAN、MAC、STP 物理层 → 检查线缆、接口、硬件
|
10.2 对比法
1 2 3 4 5 6
| display current-configuration display saved-configuration
display baseline-configuration
|
10.3 分段法
1 2
| 源端 → 接入 → 汇聚 → 核心 → 汇聚 → 接入 → 目的端 逐段 Ping 测试,定位故障点
|
10.4 常用排查流程
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| display current-configuration display logbuffer display trapbuffer display diagnostic-information
ping test service test
|
10.5 诊断信息收集
1 2 3 4 5 6 7 8
| <SW1> display diagnostic-information
<SW1> display diagnostic-information > flash:/diag.txt
<SW1> display logbuffer > flash:/log.txt <SW1> display trapbuffer > flash:/trap.txt
|
附录:常用故障排查命令速查
连通性
1 2 3
| ping <ip> tracert <ip> telnet <ip> <port>
|
接口
1 2 3 4
| display interface brief display interface <interface> display mac-address display arp
|
VLAN
1 2 3
| display vlan display port vlan display interface Vlanif
|
路由
1 2 3
| display ip routing-table display ospf peer display bgp peer
|
安全
1 2 3
| display acl display port-security display dhcp snooping
|
系统
1 2 3 4
| display device display cpu-usage display memory-usage display logbuffer
|
文档版本: 1.0
最后更新: 2026-02-27
适用设备: 华为 S5700/S6700/S7700/S9700/CE 系列交换机