交换机的配置文件备份到TFTP和FTP服务器

交换机的配置文件备份到TFTP和FTP服务器
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服务器

交换机的配置文件备份到TFTP和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服务器上配置用户名和密码

交换机的配置文件备份到TFTP和FTP服务器

4.pc端登录FTP服务器
交换机的配置文件备份到TFTP和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#

转载于:https://blog.51cto.com/ronning/2092163