1. 程式人生 > >交換機的配置文件備份到TFTP和FTP服務器

交換機的配置文件備份到TFTP和FTP服務器

配置文件 備份 TFTP FTP CISCO

技術分享圖片
1、構建拓撲
2、配置地址
Switch>
Switch>en
Switch#conf t
Switch(config)#hostname 666 修改交換機名字
666(config)#interface vlan 1 進入虛擬接口
666(config-if)#ip address 192.168.1.1 255.255.255.0 配置管理地址
666(config-if)#no shutdown 激活接口

666#copy running-config startup-config 保存當前運行文件到備份文件

配置服務器地址 192.168.1.2

3、把交換機運行文件保存到TFTP服務器

666#copy running-config tftp 運行文件保存到TFTP服務器
Address or name of remote host []? 192.168.1.2 服務器地址
Destination filename [666-confg]? 配置文件在服務器上的名字,不定義默認為666-config

Writing running-config....!!
[OK - 981 bytes] 保存成功提示

檢查服務器的config 選項下有沒有剛上傳的666-config ,如果有說明保存成功

(修改交換機名稱為 555 再保存一次到服務器 )
666(config)#ho
666(config)#hostname 555 修改交換機名稱為 555
555(config)#end
555#copy running-config tftp
Address or name of remote host []? 192.168.1.2
Destination filename [555-confg]? 555

Writing running-config...!!
[OK - 981 bytes]

981 bytes copied in 0 secs
555#

555 con0 is now available

4、從TFTP服務器下載配置文件到 running-config 和下載到 startup-config

555#copy tftp running-config TFTP服務器下載配置文件到 running-config
Address or name of remote host []? 192.168.1.2 服務器地址
Source filename []? 666-confg 源文件名稱
Destination filename [running-config]? 目標 文件

Accessing tftp://192.168.1.2/666-confg...
Loading 666-confg from 192.168.1.2: !
[OK - 981 bytes] 成功提示

981 bytes copied in 0.001 secs (981000 bytes/sec)
666# ---文件直接運行,可以看到運行了666的配置文件
%SYS-5-CONFIG_I: Configured from console by console

服務器下載文件555到 startup-config

666#
666#copy tftp startup-config 服務器下載文件到 startup-config

Address or name of remote host []? 192.168.1.2 服務器地址
Source filename []? 555 源文件名
Destination filename [startup-config]?

Accessing tftp://192.168.1.2/555...
Loading 555 from 192.168.1.2: !
[OK - 981 bytes] 復制成功提示

981 bytes copied in 0.001 secs (981000 bytes/sec)
666#rel 沒有直接運行555的文件 ,要知道原因
666#reload 重啟設備
Loading "flash:/c2950-i6q4l2-mz.121-22.EA4.bin"...
########################################################################## [OK]
Restricted Rights Legend

%SYS-5-CONFIG_I: Configured from console by console

555> 重啟後加載555的配置文件

配置文件備份到FTP服務器

技術分享圖片

1、 配置服務器地址和PC地址
2、 配置交換機管理並給交換機命名
Switch>en
Switch#conf t
Switch(config)#interface vlan 1
Switch(config-if)#ip add 192.168.1.2 255.255.255.0
Switch(config-if)#no shutdown
Switch(config-if)#exit
Switch(config)#hostname 555
555(config)#end

3、FTP服務器上配置用戶名和密碼

技術分享圖片

4.pc端登錄FTP服務器
技術分享圖片

5、把交換機配置文件上傳FTP服務器

555#copy running-config ftp:
Address or name of remote host []? 192.168.1.1
Destination filename [555-confg]? 555
Ftp username Or password is not set !, Please set and try again... 提示沒有設置用戶名和密碼
555#conf t
555(config)#ip ftp username 123
555(config)#ip ftp password 666

這裏是本實驗的關鍵點,配置用戶名和密碼要和服務上的用戶名和密碼匹配

555(config)#end
555#copy running-config ftp:
Address or name of remote host []? 192.168.1.1
Destination filename [555-confg]? 555

Writing running-config...
[OK - 1023 bytes] 上傳成功

1023 bytes copied in 0.187 secs (5000 bytes/sec)
555#

交換機的配置文件備份到TFTP和FTP服務器