首页/网络/网络设备配置速查/NAT 超时与老化:长连接业务掉线的根因
本包目录(508 条)
设备开局与基础配置61 条接口与链路73 条VLAN 与二层交换60 条路由(静态 / OSPF)62 条ACL 与安全65 条
NAT 与出口31 条
DHCP 与地址服务32 条堆叠、高可用与备份升级52 条设备排障72 条

NAT 超时与老化:长连接业务掉线的根因

默认 NAT 老化时间对长连接(SSH 空闲、数据库连接池、SIP 心跳)往往偏短,超时后连接被静默回收,表现为“隔几分钟断一次”。

网络设备配置速查网络更新于 2026-10-12
场景长连接被中途断开
适用三厂(参数名与默认值各不相同)
思路延长 tcp/udp 超时,或让应用侧发心跳包维持会话

思科 IOS

思科 IOS
ip nat translation timeout 86400
ip nat translation tcp-timeout 86400
ip nat translation udp-timeout 300
show ip nat translations | include tcp
show run | include ip nat translation

华为 VRP

华为 VRP
display nat session all
display nat session all verbose     # 观察剩余老化时间
! 会话老化时间由系统视图下的会话管理参数控制(命令随版本,建议用 ? 补全确认)

H3C Comware

H3C Comware
display nat session all
display nat session verbose
display current-configuration | include aging
差异:思科可在全局精确设置 tcp/udp/icmp 超时;华为/H3C 相关参数随版本与平台不同,建议先用 display nat session verbose 观察实际剩余时间,再决定调参或改用应用侧心跳。

易错点

  • 把 timeout 设得过长会导致 NAT 会话表被僵尸会话占满,新连接建不起来

数据来源与参考

  • Cisco IOS ip nat translation 超时参数
  • 华为 VRP NAT 会话老化说明
  • H3C Comware NAT 会话老化说明

相关工具

​‌‌​​‌​​​‌‌​‌‌‌‌​‌‌​​​‌‌​‌‌‌​​‌‌​​‌​‌‌‌​​‌‌‌​​​‌​‌‌​‌​​‌​‌‌‌​​​‌​‌‌​‌​​‌​‌‌​​​‌‌​‌‌‌​‌​​​‌‌​‌‌‌‌​​‌​‌‌‌​​‌‌​​​‌‌​‌‌​‌‌‌‌​‌‌​‌‌​‌