A-A+
cisio路由和交换IOS系统的备份和恢复的方法
在做思科路由和交换机的ios的备份和恢复操作之前,最好能先将路由和交换机系统进行备份,首先需要一台tftp服务器,并且保证它们在同一子网中。tftp服务器的作用是,将备份的bin文件存放在上面,恢复的时候从服务器上获取bin文件。
进入路由特权模式下(#)
通过show flash命令找到要备份的系统文件:c1841-advipservicesk9-mz.124-15.T1.bin
- Router#show flash
- System flash directory:
- File Length Name/status
- 3 33591768 c1841-advipservicesk9-mz.124-15.T1.bin
- 2 28282 sigdef-category.xml
- 1 227537 sigdef-default.xml
- [33847587 bytes used, 30168797 available, 64016384 total]
- 63488K bytes of processor board System flash (Read/Write)
通过copy flash tftp命令并回车
粘贴上要备份的系统文件名,并输入tftp服务器的IP地址
- Router#copy flash tftp
- Source filename []? c1841-advipservicesk9-mz.124-15.T1.bin
- Address or name of remote host []? 192.168.1.2
- Destination filename [c1841-advipservicesk9-mz.124-15.T1.bin]?
- Writing c1841-advipservicesk9-mz.124-15.T1.bin...!!!!!!!!!!!!!!!!!!!!
- [OK - 33591768 bytes]
- 33591768 bytes copied in 2.601 secs (12914000 bytes/sec)
恢复的过程刚好反过来
输入copy tftp flash命令、tftp服务器IP地址、备份的系统文件名称
- Router#copy tftp flash
- Address or name of remote host []? 192.168.1.2
- Source filename []? c1841-advipservicesk9-mz.124-15.T1.bin
- Destination filename [c1841-advipservicesk9-mz.124-15.T1.bin]?
- %Warning:There is a file already existing with this name
- Do you want to over write? [confirm]
- Erase flash: before copying? [confirm]
- Erasing the flash filesystem will remove all files! Continue? [confirm]
恢复的时候要特别小心,会将flash中的内容全部覆盖掉,所以有3次确认。
这种恢复是在能进系统的情况下,如果连特权模式都无法进入,恢复如下(以上两种方法路由、交换都可以,此方法交换机不行)
重启路由,按ctrl+break进入rommon模式下面
输入tftpdnld
- rommon 2 > IP_ADDRESS=192.168.1.1
- rommon 3 > IP_SUBNET_MASK=255.255.255.0
- rommon 4 > DEFAULT_GATEWAY=192.168.1.1
- rommon 5 > TFTP_SERVER=192.168.1.2
- rommon 6 > TFTP_FILE=c1841-advipservicesk9-mz.124-15.T1.bin
- rommon 7 > tftpdnld
出现Do you wish to continue? y/n: [n]: 输入y就开始恢复了完成之后重启一下就好了。
这个rommon模式相当于windows下的DOS模式,注意上面的IP_ADDRESS和GATEWAY写路由自己的IP并且全部要大写。