Cisco IOS Backup and Restore Process Step By Step Guide

This tutorial explains Cisco IOS backup, restore and upgrade process step by step with packet tracer lab example. Learn how to take the backup of IOS from Cisco device to TFTP server, how to restore the IOS in ROMMON mode through TFTP protocol and how to upgrade a running IOS in detail.

Any supporting file transfer protocol (such as FTP, TFTP and RCP) can be used for backup process. In this tutorial I will use TFTP Protocol.

TFTP Protocol
  • TFTP is the most lightweight authentication less protocol.
  • It does not implement any security measurements such as login or access control mechanism.
  • TFTP can only read and write files from TFTP server. It cannot list, delete or rename files or directories.
  • TFTP is originally designed for LAN ( Local Area Network). It is virtually unused on Internet.
  • It is used for initial stages of any network booting approach such as PXE, BSDP, BOOTP.
  • It is also used for firmware images and configuration file transfer to network appliances like router, switch, IP phone, firewall etc.
  • TFTP use UDP as transport protocol.
  • Transfer request is always initiated on port 69.

This tutorial is last part of our article “Cisco Internetworking Operating System (IOS) Explained with Examples”. Other parts of this article are available here.

Cisco IOS Naming Convention Explained with Examples

This tutorial is first part of this article. In this part, I explained naming convention used in Cisco IOS. Cisco IOS name contains a lot of information about IOS such as features, type, version, platform, compression and location.

Cisco IOS Mode Explained with Examples

This tutorial is second part of this article. In this part, I explained Cisco IOS mode in detail with example. Different modes are used for different purpose. This tutorial will help you in choosing correct mode for assigned task.

Cisco IOS Context Sensitive Help Features Explained

This tutorial is third part of this article. In this part, I explained How to get help in Cisco IOS in detail with examples. Knowing how get help will make your job easier as Cisco IOS includes thousands of commands with numbers of switches and parameters.

Packet Tracer Lab Setup for Practice

Open Packet Tracer and click End devices. From End devices drag and drop Server and PC-PT in workspace.

IOS Backup and Restore Process Practice Topology

Click Router. From available Routers drag and drop a 1841 series router in workspace.

IOS Backup and Restore Process Practice Topology

Click Connections. Connect Server's FastEthernet 0 with Router's FastEthernet0/0 via cross cable and Router's console with PC-PT's RS232 via console cable.

IOS Backup and Restore Process Practice Topology

Configure Router's interface FastEthernet0/0 with IP address (In real life we never use /8 subnet for end to end connection, but in lab environment we can go with it to the process simple.)

IOS Backup and Restore Process Practice Topology

Configure IP address on Server

IOS Backup and Restore Process Practice Topology

Sever has multiple IOS images for practice. By default TFTP service is running on Server. To verify it click on Config menu tab and expend the Services left menu item.

IOS Backup and Restore Process Practice Topology

If you find it difficult to replicate this practice lab in your packet tracer, download this pre-created practice lab and load it in packet tracer.

Packet Tracer Practice Lab

Taking backup of IOS from Cisco devices

By now I assume that you have this topology in packet tracer.

Click PC-PT and click Desktop menu and click Terminal and accept default Settings. Now we are connected with Router.

IOS Backup and Restore Process Practice Topology

Run show flash command from privilege exec mode and note down the name of IOS file.

show flash

copy flash tftp command is used to copy IOS from Flash to TFTP server. It takes three parameters.

Source filename :- Name of IOS file that need to be copied.

Address or name of remote host :- IP address of TFTP Server. ( To use name we need to configure DNS service on router. )

Destination filename :- Name of file used at destination to store the source file.

copy flash tftp

We have successfully taken the backup of IOS on TFTP Server. In next step we would delete the current IOS.

Next command will delete IOS from flash. If you are following this practice on real device skip this stage, unless you are doing it under the supervision of an expert. If you are following this practice on packet tracer, go ahead.

From privileged mode use delete command to delete IOS file from flash.

Router#delete:[IOS File Name]

Press Enter when asked to confirm the delete operation.

ios command delete flash ios

During the boot process router copy and decompress the IOS file in RAM. Router will work as it is until we reload it. Enter reload command in privileged mode to reload the router.

cisco ios reload command

As expected Router entered in ROMMON mode. ROMMON mode is used for disaster recovery.

How to restore IOS from ROMMON mode

ROMMON Mode allows us to restore IOS from TFTP Server in Flash. We can use this feature to install new IOS or upload another copy of IOS in Flash.

ROMMON mode has only couple of commands to work with. You can list all available commands by entering ? [Question mark key] .

rommon mode list all command

tftpdnld command is used to download the IOS from TFTP Server.

tftpdnld command help

tftpdnld command needs following variable to be set, before it can download the file.

  • IP_ADDRESS :- Temporary IP address assigned to the router.
  • IP_SUBNET_MASK :- Must match with the subnet of TFTP Server.
  • DEFAULT_GATEWAY :- For this process it would be IP Address of TFTP Server.
  • TFTP_SERVER :- IP address of TFTP Server.
  • TFTP_FILE :- Exact name of IOS file. Name is case sensitive.
  • TFTP_CHECKSUM :- This prevents checksum errors with earlier version of boot ROMs.

Set above variables and enter tftpdnld command. Command will list all variables for your confirmation. If any variable need to be correct type N and reset that variable before executing this command again. If all variables are correct, type Y to confirm the download operation.

tftpdnld  download ios confirmation

Before you confirm the downloading process make sure:-

  • TFTP Server is running.
  • IOS file is located in the root directory of TFTP Server.
  • IOS file being downloaded is compatible with hardware.
  • Use first built in interface of router to connect with TFTP Server. Command will not work with modular card interface.
  • Server and device are connected with supporting cable. If directly connected use cross cable. If connected via switch use straight through cable.
  • All variable commands are case sensitive and must be entered in upper case.
  • Entered IOS file name must match exactly with the file name stored in TFTP Server.
  • IP_ADDRESS is a temporary address of router. It must be different from DEFAULT_GATEWAY. You can pick any unused IP address for router, from the subnet of DEFAULT_GATEWAY.
  • For this process DEFAULT_GATEWAY and TFTP_SERVER are the same. Use TFTP Server's IP address for both.

In few minutes IOS would be download in flash. Once this process is completed use reset command to reload the system.

reset command

We have successfully restored the IOS. Router does not store any running configuration automatically. Running configuration is remain in RAM. When we reload the system any running configuration stored in RAM get erased Unless we saved it manually. In above example we did not store running configuration so we need to configure it again for next practice. Assign IP address to router's FastEthernet 0/0. If you have downloaded pre-configured topology from our site reopen it for next practice.

How to upgrade Cisco IOS

Cisco continuously updates IOS to meet new requirements. With updating existing one, Cisco also release features specific IOS. Whether you are upgrading existing one or installing new Cisco IOS, method is same.

Connect device with TFTP Server. I already explained this process earlier in this article. By now I assume that your device has proper connectivity with TFTP Server and TFTP Server contains the IOS, which you are looking for.

Following command is used to download new IOS from TFTP Server in Flash memory.

Router#copy tftp flash

This command requires three parameters.

Address or name of remote host :- IP Address of TFTP Server.

Source filename :- Exact file name of IOS stored in TFTP Server.

Destination filename :- Name of IOS file that you want use in flash.

In following example we would download another IOS.

copy tftp flash

Use show flash command to list all files stored in flash.

show flash

We have successfully downloaded another IOS. Now you can safely delete the old IOS or can keep both. If you delete old IOS, new IOS will be load automatically during the next boot process.

Couples of old series routers do not have sufficient memory for another IOS. In such a case you could delete current IOS from flash before downloading another IOS. As I have already mentioned earlier in this article, during the boot process router copy and decompressed ( if file is compressed) the IOS in RAM. So you are safe until router is running.

If you keep both IOS, you need to adjust the config register value. Router uses config register value to select the boot option.


ComputerNetworkingNotes CCNA Study Guide Cisco IOS Backup and Restore Process Step By Step Guide