路由器崩潰 (Crash/Reload) 發生時,保存記憶體映像 (Core Dump) 與關鍵診斷資訊是根因分析關鍵。本文詳細說明:Core Dump 定義與重要性、三大必收集 Show 指令、FTP 傳輸 Core Dump 配置、手動觸發 Core Dump、Crashinfo 檔案位置與分析流程,助網管第一時間保留現場證據。
show version:硬體清單、IOS 版本、記憶體/閃存大小、啟動時間、重啟原因、配置暫存器值。show context:重啟原因、堆疊追蹤、錯誤 PC/RA 位址、記憶體區段資訊。show tech-support:綜合配置、日誌、介面、路由、記憶體、CPU 等海量資訊 (輸出極大,建議重導檔案)。! 1. 確保 FTP 連通性 (先測試備份配置)
Router# copy running-config ftp:
Address or name of remote host []? 10.1.1.100
Source username []? ftpuser
Source password []? ftppass
Destination filename [router-confg]? running-backup
! 2. 全域配置 Core Dump 目標
Router(config)# ip ftp source-interface Loopback0
Router(config)# ip ftp username ftpuser
Router(config)# ip ftp password ftppass
Router(config)# exception protocol ftp
Router(config)# exception dump 10.1.1.100
Router(config)# exception core-file router-core
Router(config)# exception memory fragment
Router(config)# exception linecard all
Router(config)# end
Router# write memory
Router# write core
! 會將完整記憶體傾印至配置的 FTP 伺服器,耗時較久,需確保記憶體足夠
⚠️ 僅在裝置失靈 (Hung) 非 Crash 時使用,生產環境嚴禁隨意執行。
bootflash: 或 flash:,檔名如 crashinfo_20240115-143022。more flash:crashinfo_xxx 即可閱讀,提供給 TAC 加速分析。show version、show context、show tech-support、show logging。service timestamps debug datetime msec localtimeservice timestamps log datetime msec localtimelogging buffered 100000exception crashinfo (預設開啟)copy running-config tftp 備份配置。「未雨綢繆配置 Core Dump,臨危不亂保留現場」,是資深網管的必修課。