本文說明如何使用簡單式檔案傳輸通訊協定(TFTP)伺服器或遠端複製通訊協定(RCP)伺服器應用程式,將Cisco IOS®軟體安裝到「從快閃記憶體執行」Cisco路由器上。提供的示例基於Cisco 1600系列路由器,但它適用於「所使用的元件」一節中提到的所有平台。
註:本檔案中的資訊是根據Cisco IOS軟體版本12.1及更新版本。
本文件沒有特定需求。
本文中的資訊係根據以下軟體和硬體版本:
Cisco 1600系列路由器
Cisco 2000系列路由器
Cisco 2500系列路由器
Cisco 3000系列路由器
思科AS5100系列存取伺服器
思科AS5200系列存取伺服器
本文中的資訊是根據特定實驗室環境內的裝置所建立。文中使用到的所有裝置皆從已清除(預設)的組態來啟動。如果您的網路正在作用,請確保您已瞭解任何指令可能造成的影響。
如需文件慣例的詳細資訊,請參閱思科技術提示慣例。
Cisco建議在升級Cisco IOS軟體映像之前,保留路由器/存取伺服器組態的備份。
TFTP伺服器或RCP伺服器應用程式必須安裝在TCP/IP就緒的工作站或PC上。安裝應用後,必須完成以下步驟來執行最低級別的配置:
將TFTP應用程式配置為作為TFTP伺服器(而不是TFTP客戶端)運行。
指定出站檔案目錄。這是Cisco IOS軟體映像的儲存目錄(請參閱步驟2)。 大多數TFTP應用程式都提供設定常式來協助完成這些配置任務。
附註: 許多TFTP或RCP應用程式可從獨立的軟體供應商處獲得,也可作為共用軟體從全球資訊網上的公共源處獲得。
從Download Software區域將Cisco IOS軟體映像下載到工作站或PC中。
確保您下載的Cisco IOS軟體映像同時支援您的硬體和所需的功能。您可以使用Cisco Software Advisor工具(僅限註冊客戶)驗證硬體和功能支援。 您還必須檢查動態RAM(DRAM)和快閃記憶體的記憶體要求,以確保路由器具有足夠的DRAM和快閃記憶體來載入所選Cisco IOS軟體版本。有關為您的路由器選擇正確的Cisco IOS軟體版本的詳細資訊,請參閱如何選擇Cisco IOS軟體版本。
完成以下步驟,便可從快閃記憶體安裝中執行:
注意:對於RCP應用程式,請將RCP替換為TFTP的每次出現。例如,使用copy rcp flash命令而不是copy tftp flash命令。
建立到路由器的控制檯會話。
即使可以通過telnet會話連線到路由器,也強烈建議通過控制檯埠直接連線到路由器。原因在於,如果在升級過程中出現錯誤,則可能需要在物理位置靠近路由器以將其重新通電。此外,在升級過程中,當路由器重新啟動時,您將丟失telnet連線。
反轉電纜(通常是黑色扁平電纜)用於將路由器的控制檯埠連線到PC的一個COM埠。
將PC連線到路由器的控制檯埠後,您需要開啟PC上的超級終端機,然後使用以下設定:
Speed 9600 bits per second 8 databits 0 parity bits 1 stop bit No Flow Control
註:如果在超級終端會話中收到任何垃圾字元,則意味著您未正確設定超級終端屬性,或者路由器的配置暫存器被設定為控制檯連線速度高於9600 bps的非標準值。使用show version命令檢查配置暫存器的值(顯示在最後一行),並確保將其設定為0x2102或0x102。必須重新載入路由器才能考慮此更改。一旦您確定在路由器端將控制檯速度設定為9600 bps,您應該檢查超級終端屬性是否按上述方式設定。有關設定超級終端屬性的詳細資訊,請參閱為控制檯連線應用正確的終端模擬器設定。
引導問題 — 連線到路由器的控制檯埠後,您可能會注意到路由器處於ROMmon模式或引導模式。這兩種模式用於恢復和/或診斷過程。如果您沒有看到通常的路由器提示,請使用這些建議繼續升級程式安裝。
路由器在rommon模式下啟動,當您發出dir flash:指令:
rommon 1 > dir flash: device does not contain a valid magic number dir: cannot open device "flash:" rommon 2 >
當您看到此錯誤消息時,表示快閃記憶體為空或檔案系統已損壞。有關如何解決此問題的資訊,請參閱使用ROMmon的Xmodem控制檯下載過程。
路由器在引導模式下啟動,控制檯上會顯示以下消息:
router(boot)> device does not contain a valid magic number boot: cannot open "flash:" boot: cannot determine first file name on device "flash:"
當您在控制檯輸出中收到這些錯誤消息時,意味著快閃記憶體為空或檔案系統已損壞。通過完成本文檔中提供的步驟,在快閃記憶體上複製一個有效的映像。
將路由器或訪問伺服器配置為引導至Rxboot模式。
在這些平台上,Cisco IOS軟體映像實際上直接從快閃記憶體運行。因此,如果您處於使用者許可權EXEC模式(router#),就無法將Cisco IOS軟體映像從TFTP伺服器複製到快閃記憶體。 從該輸出中可以看到,在使用者特權EXEC模式下,快閃記憶體是只讀的。
Router#show flash: PCMCIA flash directory: File Length Name/status 1 9615124 c1600-sy-l.122-7b.bin [9615188 bytes used, 7162024 available, 16777212 total] 16384K bytes of processor board PCMCIA flash (Read ONLY) Router#
您必須更改配置暫存器值,才能將路由器或接入伺服器配置為引導至Rxboot模式。
檢查配置暫存器的當前值。您可以在show version指令輸出的最後一行中看到它。它通常設定為0x2102或0x102。在後續步驟中將需要此值。
將配置暫存器更改為0x2101值。這將使路由器準備引導至RXboot模式:
Router>enable Password: ! --- Enter the password here. Router# Router#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router(config)#config-register 0x2101 Router(config)#^Z Router# %SYS-5-CONFIG_I: Configured from console by console !--- It is not necessary to save the configuration here, as the !--- configuration register has already been changed in NVRAM. Router#reload
注意:如果透過Telnet連線,重新載入後作業階段就會遺失。請等待幾分鐘,然後重試。強烈建議您不要遠端執行Cisco IOS軟體升級,因為大多數災難恢復過程要求您實際位於安裝路由器的位置。
為下一次重新載入恢復以前的配置暫存器值。
註:當路由器處於啟動模式時,請勿儲存配置。避免使用save命令(write memory或copy running-config startup-config),並對任何建議您儲存當前配置的提示回答no。如果在路由器處於此模式時儲存配置,可以部分或完全清除配置。
在以下命令中,用****一步中記錄的配置暫存器值替換該值:
Router(boot)> Router(boot)>enable Password: Router(boot)#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router(boot)(config)#config-register 0x**** Router(boot)(config)#^Z Router(boot)#
注意:如果您不記得先前設定的配置暫存器的值,則可以在此步驟中使用0x2102。
檢驗TFTP伺服器是否與路由器具有IP連線。
TFTP伺服器必須與路由器建立網路連線,並且必須能ping通要進行TFTP軟體升級的路由器的IP地址。為此,路由器介面和TFTP伺服器必須具備:
相同範圍的IP地址,或
已配置預設網關。
將新軟體Cisco IOS軟體映像從TFTP伺服器複製到路由器或訪問伺服器。
現在您已建立IP連線並在充當TFTP伺服器的電腦與路由器之間執行Ping,便可以將Cisco IOS軟體映像複製到快閃記憶體中。
注意:複製之前,請確保您已在PC上啟動TFTP伺服器軟體,並且您具有在TFTP伺服器根目錄中提到的檔名。思科建議在升級前保留路由器或存取伺服器組態的備份。升級本身不會影響組態(儲存在非揮發性RAM(NVRAM)中)。 但是,如果沒有正確執行正確的步驟,則可能會發生這種情況。
對於RCP應用程式,請用RCP替換TFTP的每次出現。例如,使用copy rcp flash命令而不是copy tftp flash命令。
Router (boot)#copy tftp flash
指定TFTP伺服器的IP地址。
出現提示時,輸入TFTP伺服器的IP地址,如下例所示:
Address or name of remote host [255.255.255.255]? 172.17.247.195
指定新Cisco IOS軟體映像的檔名。
出現提示時,輸入要安裝的Cisco IOS軟體映像的檔名,如下例所示:
Source file name? c1600-y-l.122-7b.bin
注意:檔名區分大小寫,因此請確保正確輸入檔名。
指定目標映像檔名。
這是新軟體映像載入到路由器時將使用的名稱。映像可以命名任何內容,但常見做法是輸入相同的映像檔名。
Destination file name [c1600-y-l.112-18.P]? c1600-y-l.122-7b.bin
在回答「是」或「否」之前清除快閃記憶體裝置。
當您看到以下提示時:
Erase flash device before writing? [confirm] yes/no
在複製新的軟體映像之前,輸入yes以清除路由器快閃記憶體中現有的軟體映像。
輸入no以保留現有的軟體映像。驗證您是否有足夠的記憶體來儲存兩者。
複製過程需要幾分鐘。時間因網路而異。在複製過程中,會顯示指示已訪問哪些檔案的消息。
感歎號(!)表示複製過程正在進行。各個驚歎號(!)表示已成功傳輸十個資料包。在將映像寫入快閃記憶體後,將對映像進行校驗和驗證。完成軟體升級後,必須使用新映像重新載入路由器或訪問伺服器。
重新載入之前,請確認映像安裝。
確認映像已正確安裝在快閃記憶體中,並且boot system命令指向要載入的正確檔案。
若要重新載入,請輸入:
Router(boot)#reload *Mar 1 00:30:49.972: %SYS-5-CONFIG_I: Configured from console by console System configuration has been modified. Save? [yes/no]: NO Proceed with reload? [confirm] YES
驗證路由器是否使用正確的映像運行。
重新載入完成後,路由器應執行所需的Cisco IOS軟體映像。發出show version命令以驗證升級。
Router >enable Password: Router#show version Cisco Internetwork Operating System Software IOS (tm) 1600 Software (C1600-NY-L), Version 12.0(9), RELEASE SOFTWARE (fc1) Copyright (c) 1986-2002 by cisco Systems, Inc. Compiled Tue 05-Mar-02 01:14 by pwade Image text-base: 0x08039850, data-base: 0x02005000 ROM: System Bootstrap, Version 11.1(10)AA, EARLY DEPLOYMENT RELEASE SOFTWARE (fc1) ROM: 1600 Software (C1600-BOOT-R), Version 11.1(10)AA, EARLY DEPLOYMENT RELEASE SOFTWARE (fc1) Router uptime is 7 minutes System returned to ROM by reload System image file is "flash:c1600-ny-l.120-9.bin" cisco 1602 (68360) processor (revision C) with 7680K/2560K bytes of memory. Processor board ID 14236252, with hardware revision 00000000 Bridging software. X.25 software, Version 3.0.0. 1 Ethernet/IEEE 802.3 interface(s) 1 Serial network interface(s) On-board Switched 56K Line Interface. System/IO memory with parity disabled 2048K bytes of DRAM onboard 8192K bytes of DRAM on SIMM System running from FLASH 7K bytes of non-volatile configuration memory. 12288K bytes of processor board PCMCIA flash (Read ONLY) Configuration register is 0x2102 !-- This is the original value of the configuration register. Router#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router(config)#config-register 0x2101 Router(config)#^Z Router# *Mar 1 00:03:32.656: %SYS-5-CONFIG_I: Configured from console by console Router#reload Proceed with reload? [confirm] *Mar 1 00:02:00: %SYS-5-RELOAD: Reload requested System Bootstrap, Version 11.1(10)AA, EARLY DEPLOYMENT RELEASE SOFTWARE (fc1) Copyright (c) 1997 by cisco Systems, Inc. C1600 processor with 10240 Kbytes of main memory Restricted Rights Legend Use, duplication, or disclosure by the Government is subject to restrictions as set forth in subparagraph (c) of the Commercial Computer Software - Restricted Rights clause at FAR sec. 52.227-19 and subparagraph (c) (1) (ii) of the Rights in Technical Data and Computer Software clause at DFARS sec. 252.227-7013. cisco Systems, Inc. 170 West Tasman Drive San Jose, California 95134-1706 Cisco Internetwork Operating System Software IOS (tm) 1600 Software (C1600-BOOT-R), Version 11.1(10)AA, EARLY DEPLOYMENT RELEASE SOFTWARE (fc1) Copyright (c) 1986-1997 by cisco Systems, Inc. Compiled Tue 18-Mar-97 14:01 by ccai Image text-base: 0x04018060, data-base: 0x02005000 cisco 1602 (68360) processor (revision C) with 9728K/512K bytes of memory. Processor board ID 14236252 X.25 software, Version 2.0, NET2, BFE and GOSIP compliant. 1 Ethernet/IEEE 802.3 interface. 1 Serial network interface. On-board Switched 56K Line Interface. System/IO memory with parity disabled 8K bytes of non-volatile configuration memory. 12288K bytes of processor board PCMCIA flash (Read/Write) Press RETURN to get started! 00:00:14: %LINK-3-UPDOWN: Interface Ethernet0, changed state to up Router(boot)>enable Password: Router(boot)# Router(boot)#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router(boot)(config)#config-register 0x2102 Router(boot)(config)#^Z Router(boot)# Router(boot)#ping 172.17.247.195 Type escape sequence to abort. Sending 5, 100-byte ICMP Echoes to 172.17.247.195, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 1/200/1000 ms Router(boot)#copy tftp flash PCMCIA flash directory: File Length Name/status 1 5235300 /c1600-ny-l.120-9 [5235364 bytes used, 7347548 available, 12582912 total] Address or name of remote host [255.255.255.255]? 172.17.247.195 Source file name? c1600-y-l.122-7b.bin Destination file name [c1600-y-l.122-7b.bin]? y Accessing file 'c1600-y-l.122-7b.bin' on 172.17.247.195... Loading c1600-y-l.122-7b.bin from 172.17.247.195 (via Ethernet0): ! [OK] Erase flash device before writing? [confirm] NO !--- Enter "Yes" if your router does not have enough memory in the !--- Flash for both Cisco IOS software images. Copy 'c1600-y-l.122-7b.bin' from server as 'c1600-y-l.122-7b.bin' into Flash WITH erase? [yes/no]N Loading c1600-y-l.122-7b.bin from 172.17.247.195 (via Ethernet0): !!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! [OK - 7120752/12582912 bytes] Verifying checksum... OK (0xA523) Flash device copy took 00:06:28 [hh:mm:ss] Router(boot)#reload *Mar 1 00:30:49.972: %SYS-5-CONFIG_I: Configured from console by consoled System configuration has been modified. Save? [yes/no]: NO Proceed with reload? [confirm] YES *Mar 1 00:13:15: %SYS-5-RELOAD: Reload requested System Bootstrap, Version 11.1(10)AA, EARLY DEPLOYMENT RELEASE SOFTWARE (fc1) Copyright (c) 1997 by cisco Systems, Inc. C1600 processor with 10240 Kbytes of main memory Restricted Rights Legend Use, duplication, or disclosure by the Government is subject to restrictions as set forth in subparagraph (c) of the Commercial Computer Software - Restricted Rights clause at FAR sec. 52.227-19 and subparagraph (c) (1) (ii) of the Rights in Technical Data and Computer Software clause at DFARS sec. 252.227-7013. cisco Systems, Inc. 170 West Tasman Drive San Jose, California 95134-1706 Cisco Internetwork Operating System Software IOS (tm) 1600 Software (C1600-Y-L), Version 12.2(7b), RELEASE SOFTWARE (fc1) Copyright (c) 1986-2002 by cisco Systems, Inc. Compiled Tue 05-Mar-02 01:14 by pwade Image text-base: 0x08039850, data-base: 0x02005000 cisco 1602 (68360) processor (revision C) with 7680K/2560K bytes of memory. Processor board ID 14236252, with hardware revision 00000000 Bridging software. X.25 software, Version 3.0.0. 1 Ethernet/IEEE 802.3 interface(s) 1 Serial network interface(s) On-board Switched 56K Line Interface. System/IO memory with parity disabled 2048K bytes of DRAM onboard 8192K bytes of DRAM on SIMM System running from FLASH 7K bytes of non-volatile configuration memory. 12288K bytes of processor board PCMCIA flash (Read ONLY) Press RETURN to get started!
發出show version命令,以驗證是否已載入正確的Cisco IOS軟體映像,以及配置暫存器是否為0x2102。
Router >enable Router# show version Cisco Internetwork Operating System Software IOS (tm) 1600 Software (C1600-Y-L), Version 12.2(7b), RELEASE SOFTWARE (fc1) Copyright (c) 1986-2002 by cisco Systems, Inc. Compiled Tue 05-Mar-02 01:14 by pwade Image text-base: 0x08039850, data-base: 0x02005000 ROM: System Bootstrap, Version 11.1(10)AA, EARLY DEPLOYMENT RELEASE SOFTWARE (fc1) ROM: 1600 Software (C1600-BOOT-R), Version 11.1(10)AA, EARLY DEPLOYMENT RELEASE SOFTWARE (fc1) Router uptime is 7 minutes System returned to ROM by reload System image file is "flash:c1600-y-l.122-7b.bin" cisco 1602 (68360) processor (revision C) with 7680K/2560K bytes of memory. Processor board ID 14236252, with hardware revision 00000000 Bridging software. X.25 software, Version 3.0.0. 1 Ethernet/IEEE 802.3 interface(s) 1 Serial network interface(s) On-board Switched 56K Line Interface. System/IO memory with parity disabled 2048K bytes of DRAM onboard 8192K bytes of DRAM on SIMM System running from FLASH 7K bytes of non-volatile configuration memory. 12288K bytes of processor board PCMCIA flash (Read ONLY) Configuration register is 0x2102