Sie sind auf Seite 1von 18

One of the most important task in Network Operation is Taking

Configuration backup once the device is configured properly. Besides


sometimes it becomes necessary to restore the backup file to the
devices also. So in this post the chef will share some recipe to take
device backup and also restore the device backup in the device.

Before starting the lab lets understand few things related with the
backup or downloading the Configuration file.

In Cisco Devices there are 2 types of configuration file.

1. Running-Config: This is the configuration file administrator is


currently working on.This file is located in RAM.
2. Startup-Config: this is the configuration file saved by the
Administrator which means this is the saved copy of a Running-
Configuration file. Startup-Config file is located at the NVRAM.
In cisco devices, an Administrator can take backup any of the file or
both file. It depends on Administrator’s choice and situation during
work

For example we are going to make some major configuration changes


in a device. So we must take configuration backup. If any complex
issues arises immediately or after some while we will be able to roll
back to previous working condition. In this case, we have to restore
the backup file in the devices.

Backup can be taken using lots of way, the common method is using
TFTP,FTP and SCP etc. But TFTP is being used most of the cases
because of it’s simplicity. In this LAB we will perform our tasks using
TFTP only.

TFTP stands for Trivial File Transfer Protocol. It uses UDP port 69. This
software is being used widely for transferring IOS images,
Configuration files, License , Software/tools etc. from Host to Device
and vice versa.

TFTP has 2 parts: TFTP client and TFTP server.


TFTP server : This is the HOST where the TFTP tool is running.
Usually the Admin’s Console(PC/LAPTOP) becomes the TFTP server as
the TFTP software is installed there.

TFTP client: usually the Networking Devices are the TFTP client. They
are the one who will be connected to the TFTP server.

You can download TFTP software from internet. Chef’s favorite one is
tftpd.32. You can download the software from the link below :

http://tftpd32.jounin.net/

its simple and small sized software. You don’t need to install it. Just
download and use directly.

In our LAB we will do the following


tasks
 

1. Configure some basic configuration in our Router


2. Save the configuration file.
3. Take backup of both startup and running configuration file
4. We will restore the backup and verify
5. Besides, we will take the router to factory default mode, then
restore backup and make it functional.
 

This lab can be done using Cisco Packet Tracer, GNS3  and also in
Real devices. Here the Chef will show his recipe using GNS3.
 

Device Interface IP Address Subnetmask


Router Fa0/0 192.168.1.254 255.255.255.0
PC LAN 192.168.1.7 255.255.255.0
 

1. Basic Configuration:

Configuration of Router :

Router(config)#hostname R1

R1(config)#username chef privilege 15 password nchef123


R1(config)#enable password nchefbd

R1(config)#

R1(config)#interface fa0/0

R1(config-if)#ip address 192.168.1.254 255.255.255.0

R1(config-if)#Description “Connected to Host-1 LAN interface”

R1(config-if)#no shutdown

R1(config-if)#

R1(config-if)#exit

R1(config)#exit

Configuration of PC-LAN interface:


 

Connectivity test: connectivity was checked using ping command from


Router to PC and vice versa .
 

2. Saving the Configuration File:

At this moment we have a Running Configuration file which is stored in


RAM. To generate the Startup Config file in NVRAM we have to save
the Running Config file .

R1#copy running-config startup-config

Destination filename [startup-config]?

Building configuration…

[OK]

 
Now startup configuration file is also generated.

3. Take backup of Both Running and Startup Configuration


files:

First open tftp software. Here chef has tftpd32 which is free to

download and use.

1. This is the location of your software. If you download anything


from devices will be stored in this location. Click on Browse to
set another location otherwise skip it.
2. This is the interface IP address of our Host(PC). If you don’t see
your IP address then Drop down the menu a select your IP
address.
 

Connectivity are checked earlier and found ok. If you don’t find
connectivity by using PING command then try again after disabling the
windows firewall or your OS’s firewall. Windows firewall usually blocks
the icmp packets.
You have to apply the command in privilege mode.the command
syntax are following:

Router# Copy Source Location   Destination Location

For example,

Router# copy startup-config tftp:

Copy = Syntax

Startup-config = source location

TFTP: destination location

In words its like “ Copy the Startup-config file in TFTP sever.

So commands for taking Running-Config and Startup-Config will be like


:

Router R1

R1#copy running-config tftp:

Address or name of remote host []? 192.168.1.7


Destination filename [r1-confg]? R1-running-Config_4-8-2017

!!

1303 bytes copied in 8.136 secs (160 bytes/sec)

R1#copy startup-config tftp:

Address or name of remote host []? 192.168.1.7

Destination filename [r1-confg]? R1-Startu-Config_4-8-2017

!!

1303 bytes copied in 0.144 secs (9049 bytes/sec)

R1#

Now open the TFTP folder to check the Configuration backup file.

Open the files by Microsoft Word or Wordpad to see the configuration


files.
For example: select a file > right click on mouse> select OPEN WITH>
select MS word or Wordpad

4. Now restoring the Backups:

Router# copy tftp: running-config


Then provide the TFTP server address & startup configuration file
name. Set the destination is Startup-config end press enter.

Command is Copy TFTP: Startup-Config

2. remote Host Address: this is the TFTP server address.


3. Source File name : write the name of the Saved File. Simply copy
the name from the file. Else type it
4. Destination Name: We want it to be saved as Running-config
which is default. As we want to save it with default name which
is router showing [running-config] so just press enter.
The overall work process is given below:

Router R1

R1#copy tftp: startup-config

Address or name of remote host []? 192.168.1.7

Source filename []? R1-Startu-Config_4-8-2017


Destination filename [startup-config]?

Accessing tftp://192.168.1.7/R1-Startu-Config_4-8-2017…

Loading R1-Startu-Config_4-8-2017 from 192.168.1.7 (via FastEthernet0/0): !

[OK – 1303 bytes]

[OK]

1303 bytes copied in 1.848 secs (705 bytes/sec)

R1#

*Mar  1 01:16:54.843: %SYS-5-CONFIG_NV_I: Nonvolatile storage configured from


tftp://192.168.1.7/R1-Startu-Config_4-8-2017 by console

R1#copy tftp: running-config

Address or name of remote host [192.168.1.7]? 192.168.1.7

Source filename [R1-Startu-Config_4-8-2017]? R1-running-Config_4-8-2017

Destination filename [running-config]?

Accessing tftp://192.168.1.7/R1-running-Config_4-8-2017…

Loading R1-running-Config_4-8-2017 from 192.168.1.7 (via FastEthernet0/0): !

[OK – 1303 bytes]

1303 bytes copied in 7.988 secs (163 bytes/sec)

R1#

5. Erase the Backup Files and Restore from factory Default


Mode:
 

R1#erase startup-config

Erasing the nvram filesystem will remove all configuration files! Continue? [confirm]

[OK]

Erase of nvram: complete

Now reload the router to make it Factory Default:

R1#reload

System configuration has been modified. Save? [yes/no]: no

Proceed with reload? [confirm]

Please provide no when router asks to save the configuration file.


Because Router understands that when it reboots all the unsaved
changes will be lost. And in this LAB we want router to lost all
unsaved changes.

Now we don’t have any configuration in our router. But to upload the
backups router must be reachable to TFTP server.

So, lets configure one interface with the IP address so that router can
communicate with TFTP server. After that router will be able to take
backups from TFTP server.

Router#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.

Router(config)#interface fa0/0

Router(config-if)#ip address 192.168.1.254 255.255.255.0

Router(config-if)#no shutdown

Router(config-if)#exit

Router(config)#

Lets check connectivity between TFTP server(Our PC) and Client


(router R1)

Router#ping 192.168.1.7

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 192.168.1.7, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 32/37/48 ms

Taking Backup from TFTP Server:

Router#copy tftp: startup-config

Address or name of remote host []? 192.168.1.7

Source filename []? R1-Startu-Config_4-8-2017


Destination filename [startup-config]?

Accessing tftp://192.168.1.7/R1-Startu-Config_4-8-2017…

Loading R1-Startu-Config_4-8-2017 from 192.168.1.7 (via FastEthernet0/0): !

[OK – 1303 bytes]

[OK]

1303 bytes copied in 3.576 secs (364 bytes/sec)

Router#

Now router has a Startup Configuration file but Router Hostname is


still showing Router. Because we have imported the startup-config file
and we are viewing the running-config when we operate the device.

So imply copy the Startup configuration in Running Configuration file.

Router#copy startup-config running-config

Destination filename [running-config]?

1303 bytes copied in 4.824 secs (270 bytes/sec)

R1#

Did u notice that after copying startup to running config the hostname
changed to the R1 ? SO our work is done.

Important Note: when we takes a device to factory default mode then


all Physical Interface shutdowns. After roll back the last configuration
file still the interfaces will be down. We have to manually
activate/enable the interfaces using the no shutdown command.
 

Now what happen when we roll back the running configuration file ?

Lets erase the config, reload the router and configure the ip address
only. The upload the Running-Config file in the Router.

Router#copy tftp: running-config

Address or name of remote host []? 192.168.1.7

Source filename []? R1-running-Config_4-8-2017

Destination filename [running-config]?

Accessing tftp://192.168.1.7/R1-running-Config_4-8-2017…

Loading R1-running-Config_4-8-2017 from 192.168.1.7 (via FastEthernet0/0): !

[OK – 1303 bytes]

1303 bytes copied in 6.156 secs (212 bytes/sec)

R1#

Now we have directly load the Running-config file in router’s RAM. Now
enable the required interfaces using no shutdown command as
mentioned above.

But LAB is not finished yet. We have not saved the configuration yet.
Now if the  router reboots our configuration will be lost. So we must
save the configuration.

R1#copy running-config startup-config


Destination filename [startup-config]?

Building configuration…

[OK]

there is also cisco reference please check:

http://www.cisco.com/c/en/us/support/docs/ios-nx-os-software/ios-
software-releases-122-mainline/46741-backup-config.html

If you find this post helpful then please do not hesitate to rate this
post.

 (1 votes, average: 5.00 out of 5)

Also read the following Posts :

Basic Configurations 1

Basic Configurations 2

Interface Configuration

Introduction to Cisco Packet Tracer

Telnet

SSH
Password Recovery

Configuration Save,Reload and Erase

Das könnte Ihnen auch gefallen