《2022年2022年利用TFPT备份还原交换机配置文件 2.pdf》由会员分享,可在线阅读,更多相关《2022年2022年利用TFPT备份还原交换机配置文件 2.pdf(4页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
1、】【实验 0016】【利用 TFPT备份还原交换机配置文件】【实验名称】利用 TFPT 备份还原交换机配置文件。【实验目的】能够从 TFTP 服务器备份、恢复设备配置。【背景描述】假设某台交换机的配置文件由于误操作或其他某种原因被破坏了,现在需要从TFTP 服务器上的备份配置文件中恢复。本实验以 1 台 S2126G 交换机为例,交换机名为SwitchA 。1 台 PC 机通过串口( Com)连接到交换机的控制(Console)端口,通过网卡(NIC )连接到交换机的fastethernet 0/1 端口。假设 PC 机的 IP 地址和网络掩码分别为192.168.0.137,255.255.
2、255.0,PC 机上已安装和打开了 TFTP Server 程序,且在PC 机已经准备好了新的交换机操作系统。【实现功能】使网络管理员可以备份配置文件,并且将配置恢复到交换机上。【实验设备】S2126G(1 台) 、直连线( 1 条)【实验拓扑】【实验步骤】步骤 1. 在交换机上配置管理接口IP 地址。SwitchA(config)# interface vlan 1 !进入交换机管理接口配置模式SwitchA(config-if)# ip address 192.168.0.138 255.255.255.0 !配置交换机管理接口IP 地址SwitchA(config-if)# no sh
3、utdown !开启交换机管理接口验证测试:验证交换机管理IP 地址配置和开启,TFTP 服务器与交换机有网络连通性。SwitchA#show ip interface 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 1 页,共 4 页 - - - - - - - - - Interface : VL1 Description : Vlan 1 OperStatus : up ManagementStatus : Enabled Primary Internet address: 1
4、92.168.0.138/24 Broadcast address : 255.255.255.255 PhysAddress : 00d0.f8fe.1e48 SwitchA#ping 192.168.0.137 !验证交换机与TFTP 服务器具有网络连通性Sending 5, 100-byte ICMP Echos to 192.168.0.137, timeout is 2000 milliseconds. ! Success rate is 100 percent (5/5) Minimum = 1ms Maximum = 2ms, Average = 1ms 步骤 2. 备份交换机配
5、置文件。在主机上开启TFTP 服务工具,并指定根目录。SwitchA#copy running-config startup-config ! 保存交换机的当前配置SwitchA#copy startup-config tftp ! 备份交换机配置到TFTP 服务器Address of remote host 192.168.0.137 ! 按提示输入TFTP 服务器 IP 地址Destination filename config.text? ! 选择要保存的配置文件名称! %Success : Transmission success,file length 302 验证测试:验证已保存配
6、置文件。打开 TFTP 服务器上的配置文件C:config.text ,文件内容显示如下:! version 1.0 ! hostname SwitchA enable secret level 1 5 $2)sv13Y*T7+.t4ZV/,|7Q(W&-/- enable secret level 15 5 $2NqZ13IOrJ%(84MpK*.tQxB/7 ! interface fastEthernet 0/5 switchport access vlan 10 ! interface vlan 1 no shutdown ip address 192.168.0.138 255.
7、255.255.0 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 2 页,共 4 页 - - - - - - - - - ! end 步骤 3. 从主机恢复交换机配置。switchA#delete flash:config.text !删除原有的配置文件SwitchA#copy tftp startup-config ! 加载配置到交换机的初始配置文件中Source filename ?config.text !按提示输入源文件名Address of remote host 192
8、.168.0.137 !按提示输入TFTP 服务器的IP 地址%Success : Transmission success,file length 302 验证测试:验证交换机已经更改为新的配置。SwitchA#show configure ! 验证交换机的初始配置文件Using 302 out of 4194304 bytes ! version 1.0 ! hostname SwitchA enable secret level 1 5 $2)sv13Y*T7+.t4ZV/,|7Q(W&-/- enable secret level 15 5 $2NqZ13IOrJ%(84MpK*.
9、tQxB/7! interface fastEthernet 0/5 switchport access vlan 10 ! interface vlan 1 no shutdown ip address 192.168.0.138 255.255.255.0 ! end 步骤 4. 重启交换机,使新的配置生效。SwitchA#reload ! 重启交换机System configuration has been modified. Save? yes/no:n !选择 no Proceed with reload? confirm 【注意事项】在恢复配置到交换机上之前,须验证交换机与PC 机
10、( TFTP Server)具有网络连通性。【参考配置】SwitchA#show running-config Building configuration. Current configuration : 302 bytes 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 3 页,共 4 页 - - - - - - - - - ! version 1.0 ! hostname SwitchA enable secret level 1 5 $2H.Y*T3;C,tZV4H.41u_;C,tQ8U0D+S! interface fastEthernet 0/5 switchport access vlan 10 ! interface vlan 1 no shutdown ip address 192.168.0.138 255.255.255.0 ! end 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 4 页,共 4 页 - - - - - - - - -