Backing up Cisco IOS Router image - GeeksforGeeks

03 Mar, 2022
As a network administrator, you should always have a backup for worse conditions. One of the common worse conditions that can occur is the IOS image of a device deleted. This condition gets worse if there is no backup of the IOS image present. 
So to ignore conditions like these, a backup should be a must and here we will take a Cisco IOS image backup on the TFTP server. 
Trivial File Transfer Protocol (TFTP) – TFTP is a simple file transfer protocol that 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 are 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. The router has IP address 10.1.1.1/24 and the TFTP server has IP address 10.1.1.2/24. 
Note – Before taking IOS backup, make sure the Tftp server and router are able to ping each other. 
 
As shown in the figure, we see an 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 the IOS image file. here, it is named 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 routerIOS.  
 
As shown in the above figure, the file has been copied to the 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 the TFTP server we will use the command:  
rommon 1>tftpdnld
 
Now, as soon as we type this command, we see 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 that we want to give 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 the router’s interface, therefore, we can give the TFTP server’s IP address which has been 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 routerios.bin.  
After we have entered these commands, we will again enter the command tftpdnld. 
 
After that, it will ask us to continue to 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.  
Pushpender007
marcosarcticseal
Computer Networks
Misc
Misc
Misc
Computer Networks
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Advanced Encryption Standard (AES)
Intrusion Detection System (IDS)
Introduction and IPv4 Datagram Header
Secure Socket Layer (SSL)
Cryptography and its Types
Top 10 algorithms in Interview Questions
vector::push_back() and vector::pop_back() in C++ STL
Overview of Data Structures | Set 1 (Linear Data Structures)
How to write Regular Expressions?
Minimax Algorithm in Game Theory | Set 3 (Tic-Tac-Toe AI - Finding optimal move)