一、网络故障排查10大核心方法
01 物理层速查:别让网线耽误大事
- 检查清单:
-
- 网线是否松动?换根线测试
- 交换机端口指示灯状态(绿色常亮=正常)
- 光纤接口是否清洁(使用专业清洁笔)
- 经典案例:某机房因老鼠咬断网线导致全网瘫痪
02 IP配置验证:地址是通行证

# Windows
ipconfig /all # 查看IP、网关、DNS
# Linux
ip a # 或 ifconfig
# 华为设备
display ip interface brief
# 思科设备
show ip interface brief
常见问题:169.254.x.x(APIPA地址)→ DHCP服务异常
03 基础连通性测试(Ping三件套)
ping 127.0.0.1 # 环回地址(测试本机协议栈)
ping 本机IP # 测试网卡驱动
ping 网关 # 测试局域网连通性
ping 8.8.8.8 # 测试互联网访问
ping -l 1472 目标IP # 测试MTU(逐步减到能通)
04 路由追踪:绘制网络路径图

# Windows
tracert www.baidu.com
# Linux
traceroute -n www.baidu.com
# 华为设备
tracert -a 源IP 目标IP
# 思科设备
traceroute 目标IPsource源IP
05 ARP表检查:MAC地址解析真相

# Windows
arp -a
# Linux
arp -n
# 华为设备
display arp
# 思科设备
show arp
异常现象:多个IP对应同一MAC(ARP欺骗迹象)
06 DNS解析验证:域名背后的秘密

nslookup www.baidu.com
dig www.baidu.com +trace # 完整解析过程
# 清除缓存
ipconfig /flushdns # Windows
systemd-resolve --flush-caches # Linux
替代方案:修改hosts文件临时绕过DNS问题
07 端口检测:服务的守门人
# Telnet测试(需开启客户端功能)
telnet 目标IP 80 # 测试HTTP服务
# 专业工具
nc -zv 目标IP 22 # 测试SSH端口
进阶方案:Nmap全端口扫描
nmap -p 1-65535 目标IP
08 流量抓包:看见看不见的数据
# Wireshark过滤器示例
tcp.port == 80 and ip.addr == 192.168.1.100
# Tcpdump命令
tcpdump -i eth0 -nn'host 203.0.113.5 and port 443'
关键线索:SYN无应答→防火墙阻断;RST包→服务未监听
09 日志分析:设备的自白书

# 华为设备
display logbuffer
# 思科设备
show logging
# Linux
journalctl -u network.service
# Windows
事件查看器 → Windows日志 → 系统
重点搜索:%LINK-3-UPDOWN、%OSPF-5-ADJCHG等关键日志
010 配置回滚:后悔药要吃对
# 华为设备
startup saved-configuration backup.cfg
reboot
# 思科设备
configure replace flash:backup-config
黄金法则:重大变更前必须备份!
二、路由问题专项排查(5层深度检查)
01 路由表完整性检查

# 华为
display ip routing-table
# 思科
show ip route
# 重点查看:
- 默认路由是否存在(0.0.0.0/0)
- 目标网段是否有精确/聚合路由
02 路由协议状态诊断

OSPF:
display ospf peer # 华为
show ip ospf neighbor # 思科
BGP:
display bgp peer # 华为
show bgp neighbors # 思科
关键指标:邻居状态需为Full/Established
03 策略路由(PBR)干扰排查
# 华为
display traffic-policy applied-record
# 思科
show route-map
常见问题:策略路由优先级高于正常路由表
04 路由环路检测
# 查看路由跳数
display ip routing-table 目标网段 verbose # 华为
show ip route 目标网段 longer-prefixes # 思科
危险信号:TTL值异常递减、路由条目重复出现
05 路由协议重分发验证
# 华为
display rip 1 route
display ospf lsdb
# 思科
show ip protocols
show ip ospf database
重点检查:重分发时的路由过滤与度量值设置
三、经典故障案例库
案例1:路由黑洞
- 现象:能ping通网关但无法访问外网
- 排查:
- tracert停在核心交换机
- 检查核心交换机路由表缺少默认路由
- 修复:添加ip route-static 0.0.0.0 0.0.0.0下一跳
案例2:OSPF邻居震荡
- 现象:日志频繁出现邻居状态变化
- 排查:
- 检查两端Area ID、认证密码
- 使用display ospf error查看错误类型
- 修复:统一Area ID并配置MD5认证
案例3:BGP路由泄露
- 现象:国际流量异常绕行第三国
- 排查:
- show bgp发现异常AS_PATH
- 检查路由策略是否错误导出本地路由
- 修复:添加route-map FILTER deny阻断异常路由
四、网络工程师的终极工具包

END
发表回复