A-A+

cisio路由和交换IOS系统的备份和恢复的方法

2015年11月24日 站长资讯 暂无评论

在做思科路由和交换机的ios的备份和恢复操作之前,最好能先将路由和交换机系统进行备份,首先需要一台tftp服务器,并且保证它们在同一子网中。tftp服务器的作用是,将备份的bin文件存放在上面,恢复的时候从服务器上获取bin文件。

进入路由特权模式下(#)

通过show flash命令找到要备份的系统文件:c1841-advipservicesk9-mz.124-15.T1.bin

  1. Router#show flash  
  2. System flash directory:  
  3. File  Length   Name/status  
  4.   3   33591768 c1841-advipservicesk9-mz.124-15.T1.bin  
  5.   2   28282    sigdef-category.xml  
  6.   1   227537   sigdef-default.xml  
  7. [33847587 bytes used, 30168797 available, 64016384 total]  
  8. 63488K bytes of processor board System flash (Read/Write)  

通过copy flash tftp命令并回车

粘贴上要备份的系统文件名,并输入tftp服务器的IP地址

  1. Router#copy flash tftp  
  2. Source filename []? c1841-advipservicesk9-mz.124-15.T1.bin  
  3. Address or name of remote host []? 192.168.1.2  
  4. Destination filename [c1841-advipservicesk9-mz.124-15.T1.bin]?  
  5. Writing c1841-advipservicesk9-mz.124-15.T1.bin...!!!!!!!!!!!!!!!!!!!!  
  6. [OK - 33591768 bytes]  
  7. 33591768 bytes copied in 2.601 secs (12914000 bytes/sec)  

恢复的过程刚好反过来

输入copy tftp flash命令、tftp服务器IP地址、备份的系统文件名称

  1. Router#copy tftp flash  
  2. Address or name of remote host []? 192.168.1.2  
  3. Source filename []? c1841-advipservicesk9-mz.124-15.T1.bin  
  4. Destination filename [c1841-advipservicesk9-mz.124-15.T1.bin]?  
  5. %Warning:There is a file already existing with this name  
  6. Do you want to over write? [confirm]  
  7. Erase flash: before copying? [confirm]  
  8. Erasing the flash filesystem will remove all files! Continue? [confirm]  

恢复的时候要特别小心,会将flash中的内容全部覆盖掉,所以有3次确认。

这种恢复是在能进系统的情况下,如果连特权模式都无法进入,恢复如下(以上两种方法路由、交换都可以,此方法交换机不行)

重启路由,按ctrl+break进入rommon模式下面

输入tftpdnld

  1. rommon 2 > IP_ADDRESS=192.168.1.1  
  2. rommon 3 > IP_SUBNET_MASK=255.255.255.0  
  3. rommon 4 > DEFAULT_GATEWAY=192.168.1.1  
  4. rommon 5 > TFTP_SERVER=192.168.1.2  
  5. rommon 6 > TFTP_FILE=c1841-advipservicesk9-mz.124-15.T1.bin  
  6. rommon 7 > tftpdnld  

出现Do you wish to continue? y/n: [n]: 输入y就开始恢复了完成之后重启一下就好了。

这个rommon模式相当于windows下的DOS模式,注意上面的IP_ADDRESS和GATEWAY写路由自己的IP并且全部要大写。

标签:

给我留言