您的位置:首页 > 其它

CISCO路由器/交换机的配置文件备份及还原

2010-07-04 10:33 633 查看
对路由器和交换机配置文件进行备份就像对PC机系统备份一样,为了以后在系统被破坏时,用来对路由器和交换机的还原。
由于是实验环境,下面就规划一个比较简单地拓扑,如图:




对路由器进行基本配置
Router(config)#hostname r1
r1(config)#interface f0/0
r1(config-if)#ip address 192.168.1.1 255.255.255.0
r1(config-if)#no shutdown
r1(config)#line console 0
r1(config-line)#password cisco
r1(config-line)#login
r1(config)#line vty 0 4
r1(config-line)#password admin
r1(config-line)#login
r1(config)#banner motd #
Enter TEXT message. End with the character '#'.
THIS IS A GATEWAY ROUTER
#
r1#wr
对交换机进行基本配置
sw(config)#interface vlan 1
sw(config-if)#ip address 192.168.1.2 255.255.255.0
sw(config-if)#no shutdown
sw(config)#banner motd #
Enter TEXT message. End with the character '#'.
THIS IS A SWITCH
#
sw#wr
对路由器配置文件备份
r1#copy startup-config tftp
Address or name of remote host []? 192.168.1.10 服务器的IP
Destination filename [r1-confg]? router.conf 备份文件名
.!!
[OK - 404 bytes]
404 bytes copied in 3.234 secs (0 bytes/sec)
备份成功!!!
对交换机配置文件备份
sw#copy startup-config tftp
Address or name of remote host []? 192.168.1.10 服务器IP
Destination filename [sw-confg]? switch.conf 备份文件名
!!
[OK - 967 bytes]
967 bytes copied in 0.156 secs (6000 bytes/sec)
备份成功
注:备份配置文件名没有文件格式限制
为了验证备份的文件是否完整,还原备份文件到路由器和交换机上
修改路由器的描述信息
原描述信息是:THIS IS A GATEWAY ROUTER
修改描述信息为:router
从TFTP服务器上还原路由器的配置文件
r1# copy tftp running-config
Address or name of remote host []? 192.168.1.10
Source filename []? router.conf
Destination filename [running-config]? 直接回车 默认为running-config
Loading router.conf from 192.168.1.10: !
[OK - 404 bytes]
通过查看running-config和startup-config的描述信息不同,可以判定备份的配置文件是可行的
用同样地方法对交换机还原配置文件
sw#copy tftp running-config
Address or name of remote host []? 192.168.1.10
Source filename []? switch.conf
Destination filename [running-config]? 直接回车 默认为running-config
Loading switch.conf from 192.168.1.10: !
[OK - 967 bytes]
967 bytes copied in 0.109 secs (8871 bytes/sec)
备份文件可以存储在其他移动设备里,既方便又安全。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  交换机 CISCO 文件