L7.首席
3913
0
513
在网络运维工作中,交换机作为数据传输的核心枢纽,其稳定性直接决定了网络的通畅与否。一旦发生故障,往往影响范围广,排障压力大。本文将系统梳理30个交换机高频故障场景,覆盖端口、连接、配置、性能及硬件等多个维度,每个故障均提供具体现象、原因分析及分步解决方案,旨在帮助网络运维人员快速定位并解决问题,提升排障效率。
现象:计算机连接至交换机端口后,网卡指示灯不亮,操作系统提示“网络电缆被拔出”。
可能原因:
解决步骤:
display interface GigabitEthernet 0/0/1
show ip interface brief
interface GigabitEthernet 0/0/1
undo shutdown
interface GigabitEthernet 0/1
no shutdown
现象:接入设备网络连接频繁中断,交换机系统日志中反复出现“GigabitEthernet 0/0/5 link status changed to down/up”的记录。
interface GigabitEthernet 0/0/5
speed 100
duplex full
interface GigabitEthernet 0/5
现象:配备千兆网卡的设备连接到交换机后,实际传输速度只有百兆,交换机对应端口的速率指示灯也显示为百兆模式。
display interface GigabitEthernet 0/0/3
show interface GigabitEthernet 0/3
speed 1000
现象:当某一端口接入设备后,所属网段网络严重卡顿,交换机CPU利用率飙升(>90%),其他端口通信异常。
display interface GigabitEthernet 0/0/8
show interface GigabitEthernet 0/8
shutdown
interface GigabitEthernet 0/0/8
storm-control broadcast pps 1000
interface GigabitEthernet 0/8
storm-control broadcast level 10
现象:PoE摄像头或无线AP接入交换机的PoE端口后,设备无法启动,没有供电指示灯。
display poe power
show power inline
interface GigabitEthernet 0/0/10
poe enable
interface GigabitEthernet 0/10
power inline auto
现象:新设备接入交换机端口后无法联网,交换机日志提示“Port security violation occurred on GigabitEthernet 0/0/12”。
可能原因:端口启用了安全功能(如MAC地址学习数量限制、静态MAC绑定),新设备的MAC地址不在许可列表中。
display port-security interface GigabitEthernet 0/0/12
show port-security interface GigabitEthernet 0/12
interface GigabitEthernet 0/0/12
port-security mac-address sticky
port-security mac-address 00e0-fc12-3456
interface GigabitEthernet 0/12
switchport port-security mac-address sticky
switchport port-security mac-address 00e0.fc12.3456
undo port-security enable
no switchport port-security
现象:交换机A(上级)与交换机B(下级)通过网线级联后,连接在B下的电脑无法ping通A的管理IP,也无法访问互联网。
interface GigabitEthernet 0/0/24
port link-type trunk
port trunk allow-pass vlan all
interface GigabitEthernet 0/24
switchport mode trunk
switchport trunk allowed vlan all
port trunk allow-pass vlan 10
switchport trunk allowed vlan 10
现象:连接在交换机A的VLAN 20中的设备,与连接在交换机B的VLAN 20中的设备无法相互ping通,但各自交换机内VLAN 20的设备间通信正常。
display port trunk
show interface trunk
vlan 20
interface Vlanif 20
ip address 192.168.20.1 255.255.255.0
ip address 192.168.20.2 255.255.255.0
现象:交换机下的设备可以ping通路由器的内网接口IP,但无法ping通外部地址(如8.8.8.8),而路由器本身外网连接正常。
ip route-static 0.0.0.0 0.0.0.0 192.168.1.1
acl number 2000
rule 5 permit source 192.168.1.0 0.0.0.255
nat outbound 2000
现象:交换机通过光模块和光纤连接后,光口指示灯不亮,管理界面显示“Optical module not detected”或“Link down”。
现象:AP连接交换机后,指示灯处于闪烁状态(未注册),无线控制器(AC)上无法发现该AP。
display ip dhcp binding
acl number 3000
rule 5 permit udp destination-port eq 5246
rule 10 permit udp destination-port eq 5247
现象:通过管理界面发现交换机CPU利用率长期超过80%,网络响应变慢,出现数据包丢失。
arp anti-attack check user-bind enable
ip arp inspection
arp static 192.168.1.1 00e0-fc99-8877
现象:交换机内存使用率超过90%,设备不定期自动重启,日志提示“Memory usage exceeds threshold, system will reboot”。
display process memory
show process memory
reset logbuffer
logbuffer size 1024
logbuffer age-time 24
clear logging
undo ospf 1
no router ospf 1
现象:多台设备通过同一个上行端口传输数据时,速度远低于端口标称带宽(例如千兆端口总流量仅100Mbps),导致业务体验差。
display qos policy interface GigabitEthernet 0/0/6
show policy-map interface GigabitEthernet 0/6
qos lr outbound 100000
undo
现象:发生故障后查看日志,发现提示“Log buffer is full, new logs will be discarded”,无法获取故障发生时的关键日志信息。
logbuffer size 4096
logging buffered 4096
loghost ip 192.168.100.50
logging 192.168.100.50
现象:三层交换机A(192.168.2.1/24)与三层交换机B(192.168.3.1/24)互联后,A下VLAN 2的设备无法ping通B下VLAN 3的设备。
display ip routing-table
show ip route
ip route-static 192.168.3.0 255.255.255.0 192.168.2.2
ip route-static 192.168.2.0 255.255.255.0 192.168.3.2
现象:电脑接入交换机端口后,获取到的IP地址属于VLAN 10,而该端口本应属于VLAN 20,导致无法访问VLAN 20内的服务器资源。
display port vlan
interface GigabitEthernet 0/0/7
port link-type access
port default vlan 20
show vlan brief
interface GigabitEthernet 0/7
switchport mode access
switchport access vlan 20
现象:本意是配置ACL禁止某一特定IP访问外网,结果配置后,网段内所有设备均无法访问外网,日志显示“ACL deny packet”。
display acl 3000
show access-lists 3000
rule 5 deny ip
rule 10 permit ip source 192.168.1.0 0.0.0.255
rule 5 deny ip source 192.168.1.10 0
traffic-filter outbound acl 3000
ip access-group 3000 out
现象:两台交换机之间配置了2个端口的链路聚合(Eth-Trunk/Port-channel),但只有一个端口有数据流量,另一个端口闲置,日志提示成员端口down。
interface Eth-Trunk 1
mode manual load-balance
mode lacp
interface Port-channel 1
channel-group 1 mode on
channel-group 1 mode active
lacp timeout fast
现象:网络启用了STP,但部分端口被错误阻塞,或者网络仍有卡顿,抓包发现存在重复数据帧。
display stp root
show spanning-tree root
stp priority 4096
spanning-tree vlan 1 priority 4096
interface GigabitEthernet 0/0/15
stp cost 10
interface GigabitEthernet 0/15
spanning-tree cost 10
stp enable
现象:交换机A(VLAN 10)下设备无法自动获取IP地址,而DHCP服务器位于交换机B(VLAN 20)下。手动配置IP后,设备可以ping通DHCP服务器。
dhcp relay server-ip 192.168.20.10
ip dhcp relay address 192.168.20.10
interface Vlanif 10
dhcp select relay
interface Vlan 10
ip helper-address 192.168.20.10
现象:连接电源后,交换机所有指示灯均不亮,无任何启动迹象。
现象:交换机在运行中无故重启,重启后风扇指示灯异常(闪烁或不亮),机身外壳触摸感觉异常烫手(>45°C)。
display environment
show environment temperature
现象:将光模块插入交换机的扩展接口模块后,管理界面提示“Module not supported”,对应的光口无法使用。
现象:使用Console线连接交换机与电脑后,在终端软件(如SecureCRT, PuTTY)中无法建立连接,提示“无法打开串口”或“连接超时”。
现象:查看交换机日志时,时间戳显示为很久以前的默认时间(如2020-01-01),与实际时间严重不符,给故障回溯带来困难。
clock datetime 14:30:00 2025-12-01
clock set 14:30:00 Dec 1 2025
ntp server 192.168.100.60
现象:忘记Console口或Web登录密码,多次尝试错误后无法进入设备进行配置。
可能原因:密码未妥善记录、人员交接遗漏或密码被意外修改。
解决步骤: 此操作会中断设备服务,请务必在业务低谷期进行,并提前确认是否有配置文件备份。
Ctrl+B
Admin@huawei.com
user-interface console 0
set authentication password cipher YourNewPassword
aaa
local-user admin password cipher YourWebPassword
local-user admin service-type http https
flash_init
dir flash:
rename flash:config.text flash:config.old
boot
copy flash:config.old running-config
copy running-config startup-config
现象:在浏览器输入交换机的管理IP地址后,无法打开Web管理页面(连接超时或拒绝),但通过Console口可以正常登录,交换机数据转发功能正常。
display http server
http server enable
https server enable
show ip http server status
ip http server
ip http secure-server
https://192.168.1.1:8443
现象:尝试配置某些较新功能(如高级PoE协议、特定链路聚合模式)时提示命令不支持,或设备日志中频繁出现软件异常报错,运行不稳定。
display version
show version
tftp 192.168.1.50 get new_version.cc
startup system-software new_version.cc
reboot
copy tftp://192.168.1.50/new_image.bin flash:
boot system flash:new_image.bin
write memory
reload
现象:配置将端口1的流量镜像到端口20后,在连接端口20的抓包电脑上使用Wireshark抓不到任何流量,或只能抓到少量广播包。
display port-mirroring
show monitor session 1
both
port-mirroring enable
port-mirroring session 1 source GigabitEthernet 0/0/1 both
port-mirroring session 1 destination GigabitEthernet 0/0/20
monitor session 1 source interface GigabitEthernet 0/1 both
monitor session 1 destination interface GigabitEthernet 0/20
高效的交换机故障排查应遵循系统化的思路,避免盲目操作。通常可以遵循以下原则:
display logbuffer
show logging
display interface
display cpu-usage
save
网络排障是一项实践性极强的技能,希望这份涵盖网络/系统中交换机常见故障的手册能成为你工具箱中的得力助手。如果你在实战中遇到更多复杂或有趣的案例,欢迎在云栈社区与其他同行交流探讨,共同积累经验。
收藏0回复 显示全部楼层 举报
发表回复 回帖后跳转到最后一页
手机版|小黑屋|网站地图|云栈社区 ( 苏ICP备2022046150号-2 )
GMT+8, 2026-3-4 05:20 , Processed in 0.477762 second(s), 42 queries , Gzip On.
Powered by Discuz! X3.5
© 2025-2026 云栈社区.