CISCO路由器/交換機的配置文件備份及還原

 
對路由器和交換機配置文件進行備份就像對PC機系統備份一樣,爲了以後在系統被破壞時,用來對路由器和交換機的還原。
由於是實驗環境,下面就規劃一個比較簡單地拓撲,如圖:
clip_p_w_picpath001[9]
 
對路由器進行基本配置
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)
備份文件可以存儲在其他移動設備裏,既方便又安全。
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章