简介

    本文档介绍如何将系统映像从一台设备复制到同一路由器中的另一台设备,以及从一台路由器复制到另一台路由器。

    先决条件

    要求

    本文档没有任何特定的要求。

    使用的组件

    本文档中的信息不限于特定的软件和硬件版本,而是基于Cisco 2500系列路由器和Cisco 3600系列路由器。

    本文档中的信息都是基于特定实验室环境中的设备编写的。本文档中使用的所有设备最初均采用原始(默认)配置。如果您的网络处于活动状态,请确保您了解所有命令的潜在影响。

    规则

    有关文档规则的详细信息,请参阅 Cisco 技术提示规则。

    复制到同一路由器内的设备

    下表提供了用于将系统映像从一个设备复制到另一个设备的命令选项。这些方法因平台而异。

    命令汇总

    下表列出了可从TFTP服务器复制映像的不同位置。有关这些选项的详细信息,请参阅配置基础配置指南

    Router#copy tftp ?
    
    语法说明
    bootflash: 复制到 bootflash:文件系统
    disk0: 复制到 disk0:文件系统
    disk1: 复制到 disk1:文件系统
    flash: 复制到 flash:文件系统
    flh: 复制到 flh:文件系统
    ftp: 复制到 ftp:文件系统
    lex: 复制到 lex:文件系统
    null: 复制到 null:文件系统
    nvram: 复制到 nvram:文件系统
    rcp: 复制到 rcp:文件系统
    running-config 更新(合并到)当前系统配置
    slot0: 复制到 slot0:文件系统
    slot1: 复制到 slot1:文件系统
    startup-config 复制到启动配置
    system: 复制到 system:文件系统
    tftp: 复制到 tftp:文件系统

    复制映像最常用的三个命令是:

    • copy tftp flash

    • copy rcp flash

    • copy slot0:slot1:

    以下示例说明如何在Cisco 3600系列路由器上将系统映像从一个设备复制到另一个设备(例如,从一个插槽/磁盘复制到另一个插槽/磁盘)。

    详细示例

    router#show slot0:
    
    !--- This command is used to view the contents of slot 0
    
    -#- ED --type-- --crc--- -seek-- nlen -length- -----date/time------  name
    1 .D unknown 5E8B84E6 209D8 11 2392 Jan 22 2000 00:22:42 flashconfig 
    2 ..  image 5E7BAE19 B623C4 22 11802988 Jan 22 2000 00:23:18 rsp-jsv-mz.120-8.0.2.T  
    
    router#show slot1:
    
    !--- This command is used to view the contents of slot 1
    
    -#- ED --type-- --crc--- -seek-- nlen -length- -----date/time------  name 
    1 .. unknown 6A2B4BA7 6FA9E0 20 7186784 Jul 30 1999 15:05:19 rsp-jv-mz.111-26.CC1 
    2 .. config 631F0D8B 6FB1EC 6 1929 Oct 19 1999 06:15:49 config 
    3 .. config  631F0D8B 6FB9F8 7 1929 Oct 19 1999 06:16:03 config1 

    下面显示的 copy命令用于将系统映像文件从一个设备复制到另一个设备。在下一个示例中,系统映像从slot0复制到slot1

    router#copy slot0: slot1 
    Source  filename []? rsp-jsv-mz.120-8.0.2.T 
    
    !--- Enter the file name of the system image to be copied
    
    Destination filename [slot1]? 
    
    Erase slot1: before copying? [confirm]Erasing the slot1 filesystem will remove 
    all files! Continue? [confirm]
    Erasing device... eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
    eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee 
    ...erasedeeErase of slot1: complete
    Copy in progress...CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
    CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
    CCCCCCCCCCC
    
    
    ! --- Output Suppressed
    
    
    Verifying checksum...  OK (0xE884)11802988 bytes copied in 346.312 secs 
    (38481 bytes/sec) 

    从一台路由器复制到另一台路由器

    要将Cisco IOS软件映像从用作TFTP服务器的路由器复制到另一台路由器,请参阅此过程步骤。该示例中的两个路由器都是 Cisco 2500 系列路由器。在本示例中,Router1是TFTP服务器,Router2是Cisco IOS软件映像复制到的路由器。

    开始之前,请使用 ping 命令检验Router1和Router2之间的连通性。

    1. 使用show flash命令检查Router1上的映像大小。

      Router1#show flash
      System flash directory:
      File Length Name/status
      1 15694836 /c2500-js-l.122-10b
      
       !--- Cisco IOS image file to be copied
      
      [15694900 bytes used, 1082316 available, 16777216 total]
      16384K bytes of processor board System flash (Read ONLY)
      
    2. 使用show flash命令检查Router2上的映像大小,以验证Router2上是否有足够的空间可供复制系统映像文件。

      Router2#show flash   
      
      System flash directory: 
      File  Length   Name/status 
      
       1   11173264  c2500-jos56i-l.120-9.bin 
      [11173328 bytes used, 5603888 available, 16777216 total]     
      16384K bytes of processor board System flash (Read ONLY) 
      

      注意:如果有足够的空间来复制系统映像文件,则可以保留原始文件,并且新文件可以复制到额外的内存空间中。如果没有足够的可用空间(如本例所示),则需要清除闪存中的当前文件。比较好的做法是使用copy flash tftp命令将当前系统映像备份到TFTP服务器。

    3. 使用configure terminal命令将Router1配置为TFTP服务器。

      Router1#configure terminal
      Enter configuration commands, one per line.  End with CNTL/Z. 
      
      Router1(config)#tftp-server ?   
        bootflash:  Allow URL file TFTP load requests  
        disk0:      Allow URL file TFTP load requests  
        disk1:      Allow URL file TFTP load requests  
        flash:      Allow URL file TFTP load requests   
        flh:        Allow URL file TFTP load requests   
        lex:        Allow URL file TFTP load requests   
        null:       Allow URL file TFTP load requests   
        nvram:      Allow URL file TFTP load requests   
        slot0:      Allow URL file TFTP load requests  
        slot1:      Allow URL file TFTP load requests  
        system:     Allow URL file TFTP load requests 

      注意:先前为tftp-server命令提供的选项因平台而异。

      Router1(config)#tftp-server flash:? 
      flash:/c2500-js-l.122-10b 
      
      !--- The Cisco IOS image file name.
      
      Router1(config)#tftp-server flash:/c2500-js-l.122-10b 
      
      !--- This command configures the router as a TFTP server.
      
      Router1(config)#^Z 
      
    4. 配置TFTP服务器后,使用copy tftp flash命令将指定的映像从Router1下载到Router2。

      Router2#copy tftp flash                         
                                ****  NOTICE  ****
      Flash load helper v1.0
      This process will accept the copy options and then terminate
      the current system image to use the ROM based image for the copy.
      Routing functionality will not be available during that time.
      If you are logged in via telnet, this connection will terminate.
      Users with console access can see the results of the copy operation.                         
                              ---- ******** ----
      Proceed? [confirm]
      Address or name of remote host []? 10.10.10.1 
      
      !--- Enter the IP address of the TFTP Server
      
      Source filename []? /c2500-js-l.122-10b
      
      
      !--- This is the filename of the Cisco IOS image 
      !--- that you want to copy from the TFTP server
      Destination filename [c2500-js-l.122-10b]? !--- Press 'Enter' Accessing tftp://10.10.10.1//c2500-js-l.122-10b... Erase flash: before copying? [confirm] 18:37:54: %SYS-5-RELOAD: Reload requested !--- The reload is platform-specific and is only for the
      !--- Run-from-flash systems.*
      ** System going down for Flash upgrade ** %SYS-4-CONFIG_NEWER: Configurations from version 12.2 may not be correctly understood. %FLH: /c2500-js-l.122-10b from 10.10.10.1 to flash ... System flash directory: File Length Name/status 1 15694836 /c2500-js-l.122-10b [15694900 bytes used, 1082316 available, 16777216 total] Accessing file '/c2500-js-l.122-10b' on 10.10.10.1... Loading /c2500-js-l.122-10b from 10.10.10.1 (via Ethernet0): ! [OK] Erasing device... eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee eeeeeeeeeeeeee ...erased Loading /c2500-js-l.122-10b from 10.10.10.1 (via Ethernet0): !!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!! [OK - 15694836/16777216 bytes] Verifying checksum... OK (0x58D2) !--- System Image file has been successfully copied Flash copy took 0:07:37 [hh:mm:ss] %FLH: Re-booting system after download F3: 14732748+962056+889336 at 0x3000060 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) 2500 Software (C2500-JS-L), Version 12.2(10b), RELEASE SOFTWARE (fc1) Copyright (c) 1986-2002 by cisco Systems, Inc. ..........
    5. 验证新的系统镜像是否成功复制到 Router2 的闪存中。

      Router2#show flash   
      System flash directory:
      File Length Name/status
      1 15694836 /c2500-js-l.122-10b 
      
      !--- Cisco IOS image file has been copied
      
      [15694900 bytes used, 1082316 available, 16777216 total]
      16384K bytes of processor board System flash (Read ONLY)

      * 只有在使用从闪存中运行的系统时路由器才会重新加载。有关详细信息,请参阅复制到闪存中从闪存运行系统

    注意:要将启动配置文件从一个设备复制到另一个设备,请参阅使用TFTP复制配置文件。

    相关信息