🚀 开始:是否遇到数据包丢失或性能缓慢?
点击开始诊断过程。我们将指导您完成系统性的故障排除步骤。
↓
❓ 能否使用小数据包(64 字节)进行 ping 测试?
测试:ping -s 64 destination (Linux) 或 ping -l 64 destination (Windows)
↓
🔴 第 1/2 层问题 - 与 MTU 无关
如果小数据包测试失败,这属于连接性问题,而非 MTU/分片问题。
故障排除步骤:
- 检查物理连接和电缆完整性
- 验证接口状态:
show interface
- 检查接口上的错误/丢弃计数
- 验证路由和 ARP 表
- 检查防火墙规则和 ACLs
❓ 能否使用大数据包(1472 字节)进行 ping 测试?
测试:ping -s 1472 destination (Linux) 或 ping -l 1472 destination (Windows)
注意:1472 数据 + 20 IP + 8 ICMP = 1500 字节数据包
↓
✅ 未检测到 MTU 问题
大数据包工作正常。您的 MTU 配置是正确的。请查找其他性能问题。
推荐操作:
- 使用 TCP MSS 限制以达到最佳性能
- 如有需要,考虑降低接口 MTU
- 监控数据包丢失和重传
- 记录您的 MTU 设置,以备将来参考
❓ 能否设置 DF (Don't Fragment) 位进行 ping 测试?
测试:ping -M do -s 1472 destination (Linux) 或 ping -f -l 1472 destination (Windows)
↓
🔴 检测到 PMTUD 黑洞!
路径中某个地方过滤了 ICMP "Fragmentation Needed"(类型 3,代码 4)消息。
解决方案:
1. TCP MSS 限制 (推荐):
! Cisco IOS/IOS-XE
interface GigabitEthernet0/0
ip tcp adjust-mss 1460
! Juniper JunOS
set interfaces ge-0/0/0 unit 0 family inet tcp-mss 1460
# Linux iptables
iptables -t mangle -A FORWARD -p tcp --tcp-flags SYN,RST SYN \\
-j TCPMSS --set-mss 1460
2. 允许 ICMP 类型 3 代码 4:
! Cisco ACL
permit icmp any any packet-too-big
# iptables
iptables -A INPUT -p icmp --icmp-type fragmentation-needed -j ACCEPT
3. 降低接口 MTU:
! Cisco
interface GigabitEthernet0/0
ip mtu 1400
✅ PMTUD 工作正常
路径 MTU 发现功能正常。ICMP 消息没有被过滤。
推荐操作:
- 使用 TCP MSS 限制以达到最佳性能
- 如有需要,考虑降低接口 MTU
- 监控数据包丢失和重传
- 记录您的 MTU 设置,以备将来参考