How to Recover Cisco Router IOS using Rommon Mode in Packet Tracer

Quick Insight

You recover a Cisco router IOS in Packet Tracer by booting into Rommon mode first. Set the config-register to 0x2100 and reload the device to enter the recovery prompt. Inside Rommon, assign an IP, mask, gateway, and the TFTP server address. Then, run the tftpdnld command to pull a clean IOS file from your server. After the transfer, switch the register back to 0x2102 and reset the router. This method brings a dead device back to life using one central backup file.

If the IOS image of your Router is corrupted for some reason, or if you want to install a newer version, you can do so easily with Rommon Mode. This mode can be expressed as a disaster recovery area.

Recovering Router IOS using Rommon Mode in Packet Tracer

How to Recover Cisco IOS with Rommon Mode from TFTP Server

You can also use other ways to back up or bring back your IOS image with the Packet Tracer simulator.

However, if the IOS software is corrupted or missing, you can turn on your device in Rommon monitor and recover the IOS software after setting up the TFTP server information.

What is Rommon Mode?

Rommon Mode or Rommon monitor is a Bootstrap program. Bootstrap starts the Router hardware and then boots the IOS software. This mode is enabled each time the router is restarted or turned off and on again.

If your router is turned on in Rommon, it means that there is a problem with the IOS software. So, we need to restore your robust or new IOS software using the CLI prompt.

On a router that usually works, users cannot see the Rommon monitor. When the IOS image is distorted, the device automatically turns on this mode and can then be manually restarted by the user.

The utility that performs all these operations is called Rommon. It can be compared to the POST system of a computer running at boot.

Rommon is also known as ROM Monitor Mode, Boot Software, Boot Image, and Boot Helper.

How to Use Rommon Mode on Router

In this article, we will restore deleted iOS software from the TFTP Server using ROM Monitor.

Step 1

After opening your Packet Tracer software, create a simple network topology as follows. And add one TFTP server to the workspace.

Adding devices and cabling can sometimes be confusing. If you want to learn how to set up a basic network layout in Packet Tracer from scratch, we have a guide ready. You can check this source to cut down on cabling mistakes.

A Switch and TFTP Server Connected to Cisco Router

Step 2

Configure the TCP/IP settings of the TFTP Server.

TFTP Server TCP/IP Settings

Step 3

In the Packet Tracer, click on TFTP Server, and from the pop-up window, click on the Services tab and then on TFTP. If there are files in the server, delete them to avoid confusion.

Enabling TFTP Service

Step 4

Open the Cisco Router CLI tab and configure the GigabitEthernet 0/0 interface as follows.

Router> en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname R1
R1(config)#
R1(config)#interface gigabitethernet 0/0
R1(config-if)#ip address 192.168.10.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#
%LINK-5-CHANGED: Interface GigabitEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0, changed state to up
R1(config-if)#exit
R1(config)#

Assigning an IP Address to the GigabitEthernet Interface

Step 5

Before uploading the IOS software to the TFTP server, browse the files on the Router with the show flash: command.

Show Flash Command

Step 6

To upload IOS, follow the instructions below. Be sure to include the full name of the IOS software in the Source Filename section.

R1# copy tftp: flash
Source filename []? c1900-universalk9-mz.SPA.151-4.M4.bin
Address or name of remote host []? 192.168.10.100
Destination filename [c1900-universalk9-mz.SPA.151-4.M4.bin]?

Writing c1900-universalk9-mz.SPA.151-4.M4.bin...

Copy IOS Image to TFTP

Step 7

IOS software successfully backed up to the TFTP server.

You have backed up your iOS to TFTP with success. But how do you handle this move in different cases? I suggest checking the guide I made earlier on backing up an IOS image to TFTP. It makes things much simpler, especially in case of flash file system faults.

Upload Complete

Step 8

When you check the TFTP server in the Packet Tracer workspace, you can see the file you copied.

Checking IOS on a TFTP Server

Step 9

After this step, we will explore how to recover IOS through Rommon.

First, to delete the IOS software from the Router, execute the delete flash: command and type in the full name of the file, then press Enter to confirm.

R1# delete flash:
Delete filename []? c1900-universalk9-mz.SPA.151-4.M4.bin
Delete flash:/c1900-universalk9-mz.SPA.151-4.M4.bin? [confirm]

Delete Flash Command

Step 10

After deleting the IOS, use the config-register 0x2100 command to turn on the device in Rommon. Then restart the router with the Reload command.

R1(config)# config-register 0x2100

Using the config-register 0x2100 command

Step 11

As you can see in the image below, the Router is now in ROM Recovery.

Rommon Mode

Step 12

You must configure the Rommon mode of the router. Set the TCP/IP information first, and then type the IP address of the TFTP server on your network.

Finally, type the full name of the file you want to copy from the TFTP server.

rommon 1 > IP_ADDRESS=192.168.10.1
rommon 2 > IP_SUBNET_MASK=255.255.255.0
rommon 3 > DEFAULT_GATEWAY=192.168.10.1
rommon 4 > TFTP_SERVER=192.168.10.100
rommon 5 > TFTP_FILE=c1900-universalk9-mz.SPA.151-4.M4.bin

Configuring Rommon

Step 13

After you set the Common settings, use the tftpdnld command to upload the backed-up IOS software to the Router.

rommon 6 > tftpdnld

IP_ADDRESS: 192.168.10.1
IP_SUBNET_MASK: 255.255.255.0
DEFAULT_GATEWAY: 192.168.10.1
TFTP_SERVER: 192.168.10.100
TFTP_FILE: c1900-universalk9-mz.SPA.151-4.M4.bin
Invoke this command for disaster recovery only.
WARNING: all existing data in all partitions on flash will be lost!

Do you wish to continue? y/n: [n]:

tftpdnld command

Step 14

Press Y (Yes) to confirm.

Confirming the Import of IOS

Step 15

After successfully copying the iOS to the device, you must configure the Router to open it from Flash.

Recovering Router's Image File

Step 16

In standard mode, execute the config-register 0x2102 command and then restart the device with the reset command.

rommon 2 > confreg 0x2102
rommon 3 > reset

confreg-register 0x2102

Step 17

The Cisco Router restarts.

Restarting Cisco Router

Step 18

Bootstrap has successfully installed IOS!

Now, you can check the files with the show flash: command on the router.

c1900 IOS

   Video

To restore the IOS software of a Cisco Router on the network from TFTP, you can watch the video below and also subscribe to our YouTube channel to support us!

Video Thumbnail
Watch on YouTube

FAQ About Cisco Router Rommon Mode

My device suddenly dropped to the Rommon Mode screen while booting normally. Is the IOS really dead, or is there a way out?

Do not panic at all. This mode is usually not a sign of disaster, but rather a life jacket. The router hardware is healthy but it could not load the operating system into memory. The most common reason for this is that the IOS image in Flash memory is deleted or damaged. Sometimes a wrong register setting also traps the device here.
Take a breath right away and lean back. Because this black screen is a transfer station that takes you to the CLI. From here you can easily transfer new software via TFTP. So the IOS is not dead, it is just in deep sleep and waiting for you to wake it up.
In the cases I have observed, the most critical mistake is seeing this screen and resetting the device. Yet what you need to do is enter the IP address and TFTP server info correctly and run the tftpdnld command. In a few minutes, your device gets back its first-day performance.

I keep getting a timeout error when sending files via TFTP. What should I check the connection against?

The root of this error usually lies in two points. Either wrong IP planning has been done or the file name does not match letter by letter.
First, make sure the IP address of the Ethernet interface on the Router and the TFTP server are in the same network block. If the IP_ADDRESS and TFTP_SERVER variables you wrote in the Rommon environment cannot ping each other, the process will not start.
The second big trap is uppercase-lowercase sensitivity. You must write exactly the file name that Cisco wants. Even writing .BIN instead of c1900-universalk9-mz.SPA.151-4.M4.bin causes the process to crash. In simulations like Packet Tracer, these strict rules are exactly the same as real devices.
Let me give one last tip. Defining the router’s gateway as its own IP often works. Giving the same IP to the DEFAULT_GATEWAY variable removes routing problems. Because they are already on the same network as the server and do not need a next hop.

I loaded the IOS but the device is still stuck in this recovery mode. What do I need to do?

Copying the software to Flash memory is only half the battle. The remaining critical move is to tell the device ‘I am healed now, you can boot normally’. You give this instruction with the Configuration Register value. If you do not write confreg 0x2102 and reset in the Rommon command line, the router stubbornly returns to this mode every time.
The 0x2100 value keeps the device in this Bootstrap stage forever. This is a deliberate waiting room. 0x2102 is the universal password that means ‘find the first valid IOS in Flash and load it’. Knowing the difference saves you from hours of headache.
Suppose it did not recover even though you changed the register value. In this case, check once more with the ‘show flash:’ command that the file was really written and its size is correct. Sometimes the file can be transferred damaged during the transfer.

What should I watch out for when doing this on a real Cisco device, as opposed to Packet Tracer?

The copying that takes seconds in the simulation world can take minutes in the real world. Never get impatient and unplug the console cable while connected. If the transfer speed is at a low level like 9600 baud, moving a large IOS image takes quite some time. Interfering with the device while exclamation marks are spinning on the screen can permanently damage the Flash memory.
Another critical difference is the TFTP server choice. There is a ready service inside Packet Tracer. But in the field, you must use reliable software like SolarWinds TFTP Server or Tftpd64.
If the Windows firewall blocks this traffic, the process is cut off halfway. Temporarily disabling the firewall on the server side often saves the day.
Finally, on real hardware, if the console cable breaks, the Rommon session freezes. So make sure the physical connections are solid before starting the process.

I messed up the config register settings. What do values other than 0x2102 do?

Register settings are small switches in the Router’s brain. 0x2102 is the default and safest position. It tells the device ‘Get up, look at Flash and load the system’. 0x2142 is a total reset monster. If it boots with this value, the router ignores the startup configuration (startup-config). This is the secret hero of password recovery jobs.
0x2101 is also an interesting creature. It starts the device in Mini IOS, that is, RxBoot mode. This is used when the main software is broken but you want a more capable interface than Rommon. But in our topic today, the 0x2100 value is chosen on purpose. The aim is to stop the device and allow manual intervention.
Instead of entering these values by heart, it is important to know what you are doing. If you accidentally enter a value like 0x0102, the device may not show a display on the console. That is when things go south.

I cannot load the new IOS because there is no space left in Flash memory. What path can I follow without deleting the old image?

Sadly, you have to be cruel at this point. The Router Flash memory is a limited space. Keeping the old and broken one does not benefit you. Before running the tftpdnld command in the Rommon environment, the smartest move is to free up the current space. The command already warns you by saying ‘WARNING: all existing data in all partitions on flash will be lost!’.
But if you somehow returned to the normal CLI and want to back it up, things change. First clean the area with the delete flash:old_ios.bin command. Then fully reclaim the space taken by the deleted file with the squeeze flash: command. If you do not do these two steps, you will surely face the ‘Not enough space’ error.
On some newer generation devices, loading can also be done via a USB port. But in classic Rommon usage, the cleanest method is to allow Flash to be formatted just before pulling the file from TFTP. Do not forget, the goal is to get the device up. Leave the archiving worry for later.

Conclusion

In this article, we have examined how to quickly restore the IOS problems that occur in the Routers from Rommon mode. In real scenarios, you may need TFTP software, such as SolarWinds.

They'll Thank You for Discovering This Guide!

Ready to do your loved ones a huge favor with just one click? Knowledge grows as it is shared.

4 People Shared Their Experience

  1. Very thanks, this is the useful article.

    1. Thank you for your comment.

  2. Thank you for this good article but I think we must use this command for transfer the iOS from flash to tftp .
    Command is —> Copy flash: tftp:

  3. This so comprehensible. I was so indulged in the information presented on this website. This a lot for the good work.

Share Your Opinion