Computer Network | Backing up Cisco IOS router image



As a network administrator, you should always have a backup for worse conditions. One of the common worse condition that can occur is IOS image of a device deleted.This condition gets more worse if there is no backup of IOS image present.

So to ignore conditions like these, backup should be must and here we will take a Cisco IOS image backup on TFTP server.

Trivial File Transfer Protocol (TFTP) –
TFTP is a simple file transfer protocol which is either used to put or get a file from a remote host. It uses UDP port number 69.
But TFTP is used where no authentication and control is required. Also, it takes less overhead. While on the other hand, it is less interactive than FTP. Therefore, according to the need, FTP or TFTP is used.

Configuration –



Here is a simple topology in which there is a router (for which we will take IOS backup) and a TFTP server. Router has IP address 10.1.1.1/24 and TFTP server has IP address 10.1.1.2/24.

Note –
Before taking IOS backup, make sure Tftp server and router is able to ping each other.

As shown in the figure, we see a IOS image file in flash (.bin file) by command:

router#show flash

Now, we will copy this file to our Tftp server by command:

router#copy flash: tftp:
Source filename[]? c1841-advipservicesk9-mz.124-15.T1.bin
Address or name of remote host []? 10.1.1.2
Destination filename [c1841-advipservicesk9-mz.124-15.T1.bin]? routerios 

Now, as we can see in the above image it is asking for source filename, Address of remote host and destination filename.

  • Source filename – It is the name of IOS image file.here, it is named as c1841-advipservicesk9-mz.124-15.T1.bin (shown in flash).
  • Address or name of remote host – It is the IP address of the TFTP server.In our scenario, it is 10.1.1.2.
  • Destination filename – It is the name of the destination file that will be put in the TFTP server.Here,we have named it as routerios.

As shown in the above figure, the file has been as copied to tftp server.
Now, we will delete the IOS image from the router:

router(config)#delete flash:

Note –
Now, as the file is deleted still the router is running because the IOS has already been loaded into RAM. Therefore, when we will reload the router, it will enter ROMMON mode.



Therefore,now to copy the IOS file from tftp server we will use the command:

rommon 1>tftpdnld

Now, as soon as we type this command, we see that the parameters which we have to enter next.

ROMMON 2>IP_ADDRESS=10.1.1.1
ROMMON 3>IP_SUBNET_MASK=255.255.255.0
ROMMON 4>DEFAULT_GATEWAY=10.1.1.2
ROMMON 5>TFTP_SERVER=10.1.1.2
ROMMON 6>TFTP_FILE=routerios
  • IP_ADDRESS – It is the IP address we want to give to our router’s interface fa0/0 but remember this IP address should be of the same subnet. Here, we have provided 10.1.1.1 on the router’s interface.
  • IP_SUBNET_MASK – This is the subnet mask which we want to give it to the router’s interface IP address which is 255.255.255.0 in our scenario.
  • DEFAULT_GATEWAY – Here, we have to give the default gateway for that router’s interface IP address.
    Here, notice that our TFTP server is directly connected to router’s interface therefore we can give TFTP server’s IP address which have given as 10.1.1.2 but if there is any router in between TFTP server and router then we have to give the default gateway IP address of the router.
  • TFTP_server – This command requires the IP address of the TFTP server which is 10.1.1.2 in our scenario.
  • TFTP_FILE – It is the name of the file which we have saved on the TFTP server. In our scenario, we have given the name as routerios.bin.

After we have entered these commands, we will again enter the command tftpdnld.

After that it will ask us to continue say yes (as shown in the figure) if we have entered the right parameters otherwise enter no and again specify the correct parameters.

ROMMON 7>reset

After that just enter command reset to reload the router.



My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.




Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.