In the Cisco ROMMON status, restore the IOS

Source: Internet
Author: User

This article describes in detail how to restore the IOS of a Cisco router in the ROMMON state and how to use TFTP to restore IOS; use Xmodem to restore IOS.

It is a common task for a new user to accidentally delete or upgrade IOS, and enter the ROMMONROMMON status after restarting, the former may be larger. Both of them can enable the router to enter the ROMMON status, and cannot perform normal routing forwarding functions and software configuration. In this mode, most of the commands in the original IOS cannot be used. What should we do? According to the documents on the Cisco website, I have translated two common methods: 1. Use TFTP to restore IOS; 2. Use Xmodem to restore IOS. The commands of different routers are somewhat different. Here we take the 2600 and 3600 series routes as an example, but the idea should be similar. The two methods are described separately below:

Before resuming a vroflash, You can first check the Flash file on the vro and run the command dir flash:; note that the flash file is followed by the colon :), after the command is executed, the existing IOS size and file name of flash are displayed, as shown in the following figure: 1. rommon 1> dir flash:

File size Checksum File name
2179331 bytes (0x214103) 0x7b95 c1600-nsy-mz_112-15a_p
If both the File name and File size meet your requirements and are correct, you do not need to upgrade them. This may be because of a problem with your config-register settings. Normally, config-register should be 0x2102. Note that the value of the last bits in 0x2102 is 2 and the value of the last BITs between 2 and F is normal. Note that the config-register value controls the vro startup! If the last numeric value is not in this range, you can use the confreg command to change its value. For the meaning of each 16-bit of config-register, let's take a look at cisco's technical materials. If either of File name or File size is incorrect
The following upgrade steps:

I. use TFTP to restore IOS

Connect the Ethernet port of your router to a PC with the TFTP Server software, and start the TFTP Server software on the PC, put the new IOS file in the root directory of the TFTP server Directory. For example, your TFTP Server software is installed in the Cisco TFTP Server directory on the machine, put the new IOS file in the Cisco TFTP Server Directory. Connect the debugging machine to the router using the control line. Must be connected to the first Ethernet port)
The next step is to perform operations on the vro. First, set the environment variables in the ROMMON status on the vro. Note that all environment variables are case sensitive and must be noted! This is often the reason for errors. The specific settings are as follows:
Open the Super Terminal tool of the machine and connect to the ROUTER. The window appears.
The command line prompt is: ROMMON 1> where "1" indicates the number of lines in the command line ). Enter the following command at the prompt:
ROMMON 1> IP_ADDRESS = the IP address of the ROUTER must be in the same network segment as the machine where the TFTP software is located)
ROMMON 2> IP_SUBNET_MASK = subnet mask of the ROUTER
ROMMON 3> DEFAUT_GATEWAY = the default gateway address can be none, or it can be a TFTP server)
ROMMON 4> TFTP_SERVER = TFTP Server IP Address
ROMMON 5> TFTP_FILE = the IOS file name only provides the file name, no path required)
ROMMON 6> tftpdnld press ENTER

Note: The preceding commands must be in upper case, while the last tftpdnld command must be in lower case. After setting, run the sync command to save the environment variable to NVRAM and run the set command to check the setting.
After the tftpdnld command is executed, you only need to select as prompted to complete file transmission. After the file is transferred, it will automatically return to the command line and enter reset to restart the ROUTER. After the restart, it will return to the familiar IOS mode and even the previously configured information will not be lost.

The following is an example:
Example
Rommon 16> IP_ADDRESS = 172.16.0.1
Rommon 17> IP_SUBNET_MASK = 255.255.255.0
Rommon 18> DEFAULT_GATEWAY = 172.16.0.2
Rommon 19> TFTP_SERVER = 172.16.0.2
Rommon 20> TFTP_FILE = c2600-is-mz.113-2.0.3.Q
Rommon 21> tftpdnld
IP_ADDRESS: 172.16.0.1
IP_SUBNET_MASK: 255.255.255.0
DEFAULT_GATEWAY: 172.16.0.2
TFTP_SERVER: 172.16.0.2
TFTP_FILE: c2600-is-mz.113-2.0.3.Q
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]: y
Starting ing c2600-is-mz.113-2.0.3.Q from 172.16.0.2 !!!!!.!!!!!!!!!!!!!!!!!!!.!!
File completion tion completed.
Copying file c2600-is-mz.113-2.0.3.Q to flash.
Erasing flash at 0x607c0000
Program flash location 0x60440000
Rommon 22>
 
2. Use Xmodem to restore IOS

The main difference between Xmodem and TFTP is that the transmission channels are different. The IOS transmission of TFTP must go through the ethernet cable, while the Xmodem is transmitted through the control line, therefore, using Xmodem to restore IOS eliminates the need to connect a PC to a vro network or set IP addresses, saving a lot of trouble. However, Xmodem is transmitted through the control line console. Generally, the baud rate of the control line connected to the cisco router is 9600, that is, 9.6 k/s, it takes a long time to transmit a file that is several Mb in size, and you need to wait patiently. Waiting is always worrying. I am a person who does not like waiting. Fortunately, you can change the baud rate on the vro. The maximum is 115200, that is, 115.2 K/S. Although the difference is far from that of 100 M/s fast Ethernet, but it is much faster than the snail bait speed of 9.6 kbit/S, so you can use the confreg command to modify the default baud rate first, as shown below:

Rommon 2> confreg
Configuration Summary
Enabled are:
Load rom after netboot fails
Console BAO: 9600
Boot: image specified by the boot system commands
Or default to: cisco2-C3600
Do you wish to change the configuration? Y/n [n]: y
Enable "diagnostic mode "? Y/n [n]:! --- Pressing "Enter" accepts
! --- Default (value between the brackets)
Enable "use net in IP bcast address "? Y/n [n]:
Disable "load rom after netboot fails "? Y/n [n]:
Enable "use all zero broadcast "? Y/n [n]:
Enable "break/abort has effect "? Y/n [n]:
Enable "ignore system config info "? Y/n [n]:
Change console baud rate? Y/n [n]: y
Enter rate: 0 = 9600, 1 = 4800, 2 = 1200, 3 = 2400
4 = 19200, 5 = 38400, 6 = 57600, 7 = 115200 [7]: 7
Change the boot characteristics? Y/n [n]:
Configuration Summary
Enabled are:
Load rom after netboot fails
Console BAO: 115200
Boot: image specified by the boot system commands
Or default to: cisco2-C3600
Do you wish to change the configuration? Y/n [n]:
You must reset or power cycle for new config to take effect

After modification, You need to restart the configuration to make the configuration take effect. Note that the connection baud rate of the Super Terminal on your debugging machine must also be changed to 115200, otherwise, you may see a bunch of garbled characters # ^ $ & % × ^.
Next, we use the xmodem command. The xmodem usage is as follows:
Rommon 1> xmodem [-cyrx] <destination filename>
Option
Function
-C
Use CRC-16 check during transmission. The default is 8-bit CRC.
-Y
Ymodem-batch Protocol use CRC-16 error check
-R
Transfer the software to DRAM. The default value is Flash.
Note: not recommended! After restarting, DRAM files will be lost, and you need to restore IOS again.
-X
Upload the software to DRAM, but do not execute it unless you use the launch command.
Note: not recommended! Same as-r
-F
Erase all files in Flash
This option is specified by vrouters of the 1600 series. It is the default option on other platforms.
Examples:
Rommon 1> xmodem-cf c1600-nsy-mz_112-15a_P
Rommon 1> xmodem-y c2500-js-mz_120-14
Let's try step by step:

1. to execute the xmodem command: rommon 1> xmodem c1600-nsy-mz_112-15a_P
C1600-nsy-mz_112-15a_P is the name of the file we plan to save in the router, you can start the name you want, but it is best to press the name of the original file.

2. Wait for the ROMmon prompt, similar to the following:
Ready to receive file c1600-nsy-mz_112-15a_P...

3. OK. You can transfer the file. On the Super Terminal page, right-click and choose send file. In the displayed dialog box, select the new IOS version you want to transfer to the vro, select the Xmodem protocol. Then click send.

4. The next step is the file transfer interface. Please wait ......

5. When Download Complete is displayed! Information, it is almost everything, but as a column check is still necessary, use the command: dir flash: to see if the file has passed correctly.
Rommon 1> dir flash:
File size Checksum File name
2179331 bytes (0x214103) 0x7b95 c1600-nsy-mz_112-15a_p

6. Haha, at the end: Use the reset or bootflash: [filename] command, as shown below:
Rommon 1> reset or rommon 1> boot flash: c1600-nsy-mz_112-15a_P
Restart the router. OK? If you have already entered the normal interface, congratulations, And the IOS is restored successfully. You can check some of them: show version, show flash, etc. But don't forget, you just changed the default control line baud rate 9600 to 115200. Now you have to change it back and run the command: config t; config-register 0x2102; end.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.