《案例十八 利用tftp备份还原配置文件》由会员分享,可在线阅读,更多相关《案例十八 利用tftp备份还原配置文件(9页珍藏版)》请在金锄头文库上搜索。
1、案例十八案例十八 利用利用 TFTP 备份还原配置文件备份还原配置文件【背景描述背景描述】假设某台路由器的配置文件由于误操作或其他某种原因被破坏了,现在需要从 TFTP 服 务器上的备份配置文件中恢复。【实现功能实现功能】 使网络管理员可以备份配置文件,并且将配置恢复到交换机上。【使用设备使用设备】设备类型设备类型设备名称设备名称设备数量设备数量交换机交换机路由器路由器router1三层交换机三层交换机双绞线双绞线2计算机计算机1【案例拓扑案例拓扑】【实现过程实现过程】步骤步骤 1 先查看路由器的配置先查看路由器的配置RA#show running-configBuilding configu
2、ration.Current configuration: ! version 6.14(9coll) ! hostname “RA“ ! enable password 123 ! ip subnet-zero ! interface Loopback0ip address 1.1.1.1 255.255.255.0 ! interface FastEthernet0ip address 172.16.2.1 255.255.255.0 ! interface FastEthernet1ip address 12.1.1.2 255.255.255.0shutdown ! interface
3、 FastEthernet2no ip addressshutdown ! interface FastEthernet3no ip addressshutdown ! interface Serial0no ip addressshutdown ! interface Serial1ip address 12.1.1.1 255.255.255.0encapsulation frame-relayframe-relay inverse-arp !router ripversion 2network 172.16.0.0network 1.0.0.0network 12.0.0.0no aut
4、o-summary ! ip classless ! line con 0password 123login line aux 0 line vty 0 4login line vty 5 19login ! end 测试连通性:在路由器上测试连通性:在路由器上 ping 服务器地址服务器地址 RA#ping 172.16.2.10Type escape sequence to abort. Sending 5, 100-byte ICMP Echoes to 172.16.2.10, timeout is 2 seconds: ! Success rate is 100 percent (5
5、/5), round-trip min/avg/max = 1/1/4 ms步骤步骤 2 备份路由器配置备份路由器配置 RA#copy running-config tftp Remote host 172.16.2.10? Name of configuration file to write ra-confg? config.text Write file config.text on host 172.16.2.10? confirm Building configuration.Writing config.text ! OK 或者 RA#copy startup-config tft
6、p Remote host 172.16.2.10? Name of configuration file to write ra-confg? config.text Write file config.text on host 172.16.2.10? confirm Writing config.text ! OK 验证测试:验证验证测试:验证 TFTP 服务器上的配置文件服务器上的配置文件 打开 TFTP 服务器上的配置文件 C:config.text (用记事本就可以查看)! version 6.14(9coll) ! hostname “RA“ ! enable password
7、123 ! ip subnet-zero ! interface Loopback0ip address 1.1.1.1 255.255.255.0 ! interface FastEthernet0ip address 172.16.2.1 255.255.255.0 ! interface FastEthernet1ip address 12.1.1.2 255.255.255.0shutdown ! interface FastEthernet2no ip addressshutdown ! interface FastEthernet3no ip addressshutdown ! i
8、nterface Serial0no ip addressshutdown ! interface Serial1ip address 12.1.1.1 255.255.255.0encapsulation frame-relayframe-relay inverse-arp ! router ripversion 2network 172.16.0.0network 1.0.0.0network 12.0.0.0no auto-summary ! ip classless! line con 0password 123login line aux 0 line vty 0 4login li
9、ne vty 5 19login ! end步骤步骤 3 恢复路由器配置恢复路由器配置 RA#erase startup-config RA#reload Proceed with reload? confirm 查看路由器配置 Red-Giant#show running-config Building configuration.Current configuration: ! version 6.14(9coll) ! hostname “Red-Giant“ ! ip subnet-zero ! interface FastEthernet0no ip addressshutdown
10、! interface FastEthernet1no ip addressshutdown ! interface FastEthernet2no ip addressshutdown ! interface FastEthernet3no ip addressshutdown !interface Serial0no ip addressshutdown ! interface Serial1no ip addressshutdown ! ip classless ! line con 0 line aux 0 line vty 0 4login line vty 5 19login !
11、end 先给和 TFTP 相连的服务器配置一个 IP 地址测试连通性 Red-Giant#ping 172.16.2.10Type escape sequence to abort. Sending 5, 100-byte ICMP Echoes to 172.16.2.10, timeout is 2 seconds: ! Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/4 ms 然后进行还原Red-Giant#copy tftp running-configAddress of remote host 255.
12、255.255.255? 172.16.2.10Name of configuration file red-giant-confg? config.textConfigure using config.text from 172.16.2.10? confirmLoading config.text from 172.16.2.10 (via FastEthernet0): !OK - 733/32727 bytes 验证测试:验证路由器上已经更新为新的配置验证测试:验证路由器上已经更新为新的配置Red-Giant#copy tftp running-configAddress of rem
13、ote host 255.255.255.255? 172.16.2.10Name of configuration file red-giant-confg? config.textConfigure using config.text from 172.16.2.10? confirmLoading config.text from 172.16.2.10 (via FastEthernet0): !OK - 733/32727 bytesRA#show running-configBuilding configuration.Current configuration: ! versio
14、n 6.14(9coll) ! hostname “RA“ ! enable password 123 ! ip subnet-zero ! interface Loopback0ip address 1.1.1.1 255.255.255.0 ! interface FastEthernet0ip address 172.16.2.1 255.255.255.0 ! interface FastEthernet1ip address 12.1.1.2 255.255.255.0shutdown ! interface FastEthernet2no ip addressshutdown !
15、interface FastEthernet3no ip addressshutdown ! interface Serial0no ip addressshutdown ! interface Serial1ip address 12.1.1.1 255.255.255.0encapsulation frame-relayframe-relay inverse-arp ! router ripversion 2network 172.16.0.0network 1.0.0.0network 12.0.0.0no auto-summary !ip classless ! line con 0p
16、assword 123login line aux 0 line vty 0 4login line vty 5 19login ! end 参考配置参考配置 Red-Giant#copy tftp running-config Address of remote host 255.255.255.255? 172.16.2.10 Name of configuration file red-giant-confg? config.text Configure using config.text from 172.16.2.10? confirm Loading config.text from 172.16.2.10 (via FastEthernet0): ! OK - 733/32727 bytesRA#show running-config Building configuration.Current configuration: