隨著網路設備技術日新月異,思科路由器與交換機廣泛部署於企業骨幹網路。然而,若不慎刪除 Flash 中的 IOS 映像檔導致設備無法開機,唯有透過 Console 連接線配合 Xmodem 協定將 IOS 重新載入。本文將詳細解析兩種 Xmodem 恢復方案,助您快速讓設備「起死回生」。
此法透過調整 ROMMON 環境變數與終端機傳輸速率,大幅縮短傳輸時間,適合 IOS 檔案較大的情境。
rommon 模式。confreg 並依提示修改設定:rommon 1 > confreg
Configuration Summary
enabled are:
load rom after netboot fails
console baud: 9600
boot: image specified by the boot system commands
or default to: cisco2-C2600
do you wish to change the configuration? y/n [n]: y
enable "diagnostic mode"? y/n [n]: n
enable "use net in IP bcast address"? y/n [n]: n
disable "load rom after netboot fails"? y/n [n]: n
enable "use all zero broadcast"? y/n [n]: n
enable "break/abort has effect"? y/n [n]: n
enable "ignore system config info"? y/n [n]: n
change console baud rate? y/n [n]: y
enter rate: 0=9600, 1=4800, 2=1200, 3=2400
4=19200, 5=38400, 6=57600, 7=115200 [0]: 7
change the boot characteristics? y/n [n]: n
Configuration Summary
enabled are:
load rom after netboot fails
console baud: 115200
boot: image specified by the boot system commands
or default to: cisco2-C2600
do you wish to change the configuration? y/n [n]: n
You must reset or power cycle for new config to take effect
reset 重啟設備。關鍵動作:在按下 Enter 前,先將電腦裝置管理員中 COM 埠速率改為 115200,再將終端機軟體速率同步調整為 115200,否則會出現亂碼。xmodem -c <檔名.bin> 並從終端機選擇「傳送檔案」→ 協定選 Xmodem/Xmodem-1K → 選取 IOS 檔案開始傳輸。boot flash:<檔名.bin> 啟動系統。適合不想調整 Baud Rate、或終端機軟體不支援高速傳輸的初學者。缺點是傳輸較慢(大檔案約 60-90 分鐘)。
switch: 提示符(表示無 IOS)。switch: flash_init(初始化 Flash)switch: copy xmodem: flash:image_filename.bin(啟動 Xmodem 接收)C 字元時,於終端機選擇「傳送檔案」→ 協定 Xmodem/Xmodem-1K → 選取 IOS .bin 檔。File "xmodem:" successfully copied to ...)。switch: boot 啟動新 IOS,最後重新加電確認恢復正常。兩種方法各有優劣:方案一速度快但需同步調整兩端 Baud Rate;方案二操作直觀但耗時較長。建議網管根據現場條件選擇,並平時養成備份 IOS 至 TFTP/FTP 伺服器的習慣,才能從容應對 Flash 損毀或誤刪風險。