路由器的IOS和配置文件的备份、恢复、升级、删除
路由器IOS的备份、恢复、升级、删除
一、备份路由器的IOS
1. 查看路由器Flash的文件及空间
在对IOS进行恢复、升级等操作时,需要了解Flash的空间是否还有充足的空间保存新的IOS文件,否则原有文件会被覆盖。
test#show flash
System flash directory:
File Length Name/status
3 50938004 c2800nm-advipservicesk9-mz.124-15.T1.bin
2 28282 sigdef-category.xml
1 227537 sigdef-default.xml
[51193823 bytes used, 12822561 available, 64016384 total]
63488K bytes of processor board System flash (Read/Write)
2. 测试路由器与TFTP服务器的连通性
test#ping 10.1.1.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.1.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 0/0/1 ms
3. 进行IOS备份
test#copy flash tftp
Source filename []? c2800nm-advipservicesk9-mz.124-15.T1.bin
Address or name of remote host []? 10.1.1.2
Destination filename [c2800nm-advipservicesk9-mz.124-15.T1.bin]?
Writing c2800nm-advipservicesk9-mz.124-15.T1.bin...!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[OK - 50938004 bytes]
50938004 bytes copied in 0.436 secs (116830000 bytes/sec)
Source filename []?,从show flash的显示结果中,复制需要备份的IOS文件名,并粘贴到这里即可。
10.1.1.2为TFTP服务器的地址。
二、从TFTP服务器将IOS恢复过来
test#copy tftp flash
Address or name of remote host []? 10.1.1.2
Source filename []? c2800nm-advipservicesk9-mz.124-15.T1.bin
Destination filename [c2800nm-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]
Erasing device... eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee ...erased
Erase of flash: complete
Accessing tftp://10.1.1.2/c2800nm-advipservicesk9-mz.124-15.T1.bin...
Loading c2800nm-advipservicesk9-mz.124-15.T1.bin from 10.1.1.2: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[OK - 50938004 bytes]
50938004 bytes copied in 0.444 secs (8318386 bytes/sec)
三、升级IOS
test#copy tftp flash
Address or name of remote host []? 10.1.1.2
Source filename []? xxxx
四、删除Flash中的IOS文件
test#delete ?
WORD File to be deleted
flash: File to be deleted
test#delete flash:xxx(文件名)
配置文件的备份/恢复
与备份恢复IOS文件的操作基本相同。
备份配置文件到TFTP服务器的命令是copy running-config tftp
恢复配置文件的命令是copy tftp running-config
或copy tftp starup-config