作为一个网络管理员或是工程师, 不仅仅是知道怎么去操作cisco路由器或其他cisco设备; 还应该有未雨绸缪的意识, 当设备遭到非物理破坏(非硬件破坏,只是操作系统被破坏)时, 能够快速地让它们恢复正常工作; 或是对于新买的设备(没有操作系统),怎么才能让它们运作起来? 其实,对于硬件来说,一般不易遭到破坏, 一旦被破坏了,想恢复也难了。 所谓未雨绸缪,也即是在系统正常运作的时候, 将系统备份到服务器上,以便需要时,可以直接从服务器上还原; 1)将cisco路由器的IOS

作为一个网络管理员或是工程师,
不仅仅是知道怎么去操作cisco路由器或其他cisco设备;
还应该有未雨绸缪的意识,
当设备遭到非物理破坏(非硬件破坏,只是操作系统被破坏)时,
能够快速地让它们恢复正常工作;
或是对于新买的设备(没有操作系统),怎么才能让它们运作起来?
其实,对于硬件来说,一般不易遭到破坏,
一旦被破坏了,想恢复也难了。
所谓未雨绸缪,也即是在系统正常运作的时候,
将系统备份服务器上,以便需要时,可以直接从服务器上还原;


1)将cisco路由器的IOS备份到tftp服务器并且还原;
a、搭建TFTP服务器;
其实,非常简单,只需要下载一个TFTP工具软件,
而后安装,完成后将tftp应用程序打开;
对于安装tftp软件的PC也就是一台TFTP服务器;
b、在tftp服务器上进行简单设置;
如图:(59)



在tftp控制台上,
选择中间按钮(符似蝴蝶)打开,
自定义一下TFTP log以及tftp root的文件路径,方便管理;
c、联通TFTP服务器与路由器
(对于PC作为服务器,使用交叉线连接);
TFTP服务器ip192.168.1.6,
路由器连接到服务器使用的ethernet口ip192.168.1.66,
ping一下,检查一下是否联通;


d、进行系统的备份;
(说明:在备份和还原时,必须明确哪是服务器,哪是客户端;
因为执行操作一直是在客户端;)
进入路由器执行操作(客户端):
louzuoen(config)#int ethernet 0
louzuoen(config-if)#ip add 192.168.1.66 255.255.255.0
(配置路由器连接到服务器使用的ethernet口ip)
louzuoen(config-if)#no sh
louzuoen(config-if)#end

louzuoen#sh run
(查看配置的IP)
Building configuration...

Current configuration : 890 bytes
!
version 12.1
no service single-slot-reload-enable
service timestamps debug uptime
service timestamps log uptime
service password-encryption
service udp-small-servers
service tcp-small-servers
!
hostname louzuoen
!
enable secret 5 $1$Yt6O$vZjJOceMfnm23jXbeM8A8/
enable password 7 124C5147
!
ip subnet-zero
no ip domain-lookup
!
interface Ethernet0
ip address 192.168.1.66 255.255.255.0
no ip route-cache
no ip mroute-cache
line con 0
exec-timeout 0 0
password 7 005D4753560B
logging synchronous
login
line aux 0
transport input all
line vty 0 4
password 7 144E465E5E54
login
!
end

louzuoen#ping 192.168.1.6
(测试一下联通性)
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.6, timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 1/2/4 ms

louzuoen#sh flash
(查看一下flash即查看其中的目录)
System flash directory:
File Length   Name/status
1   8039948 louzuoen
(注意一下:此flash中只有一个目录;若有多个目录(存放IOS文件),
在备份时必须指定相应的目录,如copy flash:目录名 tftp)
[8040012 bytes used, 8737204 available, 16777216 total]
16384K bytes of processor board System flash (Read ONLY)
(此时flash只读,因为系统从flash启动,系统正在使用flash中的IOS)

louzuoen#copy fla tftp
(copy时,注意copy+源+目的)
Source filename []? louzuoen
Address or name of remote host []? 192.168.1.6
(远程主机的IP,也即tftp服务器的IP)
Destination filename [louzuoen]?
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!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!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
(在备份时必须注意,若其中出现了原点‘.’,
则表示文件有丢失,必须执行组合键ctrl+shift+6强行中止,重新备份)
8039948 bytes copied in 183.660 secs (43934 bytes/sec)
(全部为‘!’,备份成功)
louzuoen#

 

e、进行系统的还原;
(1)模拟环境;
louzuoen#conf t
Enter configuration commands, one per line. End with CNTL/Z.
louzuoen(config)#co
louzuoen(config)#config-register 0x2101
(修改寄存值,让路由器从ROM中迷你的IOS启动)
louzuoen(config)#end
louzuoen#rel
(重启设备)
System configuration has been modified. Save? [yes/no]:

System configuration has been modified. Save? [yes/no]: y
(保存之前的所有配置)
Building configuration...
[OK]
Proceed with reload? [confirm]

00:10:27: %SYS-5-RELOAD: Reload requested
System Bootstrap, Version 11.0(10c)XB2, PLATFORM SPECIFIC RELEASE SOFTWARE (fc1)
......
          
Press RETURN to get started!

User Access Verification

Password:

louzuoen(boot)>en
(迷你模式)
Password:
louzuoen(boot)#show fla

System flash directory:
File Length   Name/status
1   8039948 louzuoen
[8040012 bytes used, 8737204 available, 16777216 total]
16384K bytes of processor board System flash (Read/Write)
(show flash,此时flash可读可写,因为系统从ROM中迷你的IOS启动)

louzuoen(boot)#era fla
(擦除flash中的目录,模拟flash中没有IOS)

System flash directory:
File Length   Name/status
1   8039948 louzuoen
[8040012 bytes used, 8737204 available, 16777216 total]

Erase flash device? [confirm]
Are you sure? [yes/no]: y
Erasing device... eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
(表示正在擦除)
ee ...erased
(2)执行系统还原;
louzuoen(boot)#copy tftp fla
(将tftp服务器上备份好的IOS还原到flash中)

System flash directory:
No files in System flash
[0 bytes used, 16777216 available, 16777216 total]
Address or name of remote host [255.255.255.255]? 192.168.1.6
Source file name? louzuoen
(tftp服务器上的备份文件名)
Destination file name [louzuoen]?
Accessing file 'louzuoen' on 192.168.1.6...
Loading louzuoen from 192.168.1.6 (via Ethernet0): ! [OK]
(表示可以访问到指定的文件)

Erase flash device before writing? [confirm]

Copy 'louzuoen' from server
as 'louzuoen' into Flash WITH erase? [yes/no]y
(在还原之前,进行flash的初始化即格式化)
Erasing device... eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
ee ...erased
Loading louzuoen from 192.168.1.6 (via Ethernet0): !!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!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hh:mm:ss]

louzuoen(boot)#conf t
Enter configuration commands, one per line. End with CNTL/Z.
louzuoen(boot)(config)#con
louzuoen(boot)(config)#config-register 0x2102
(修改寄存值,让路由器从flash中启动)
louzuoen(boot)(config)#end
louzuoen(boot)#rel
0:07:33: %SYS-5-CONFIG_I: Configured from console by console
louzuoen(boot)#rel
(重启,路由器从flash中启动)
......
Press RETURN to get started!

User Access Verification

Password:

louzuoen>en

Password:
louzuoen#show fla

System flash directory:
File Length   Name/status
1   8039948 louzuoen
[8040012 bytes used, 8737204 available, 16777216 total]
16384K bytes of processor board System flash (Read ONLY)
(flash只读)(责任编辑:admin)