|
Table Of Contents
Disaster Recovery with TFTP Download
TFTP Download Command Variables
Using the TFTP Download Command
Changing the Configuration Register Manually
Changing the Configuration Register Using Prompts
ROM Monitor
The ROM monitor firmware runs when the router is powered up or reset. The firmware helps to initialize the processor hardware and boot the operating system software. You can use the ROM monitor to perform certain configuration tasks, such as recovering a lost password or downloading software over the console port. If there is no Cisco IOS software image loaded on the router, the ROM monitor runs the router.
This appendix contains the following sections:
•Disaster Recovery with TFTP Download
Entering the ROM Monitor
To use the ROM monitor, you must be using a terminal or PC that is connected to the router over the console port.
Perform these steps to configure the router to boot up in ROM monitor mode the next time it is rebooted.
Command PurposeStep 1
enable
Enters privileged EXEC mode.
Enter your password if prompted.
Step 2
configure terminal
Enters global configuration mode.
Step 3
config-reg 0x0
Resets the configuration register.
Step 4
exit
Exits global configuration mode.
Step 5
reload
Reboots the router with the new configuration register value. The router remains in ROM monitor and does not boot the Cisco IOS software.
As long as the configuration value is 0x0, you must manually boot the operating system from the console. See the boot command in the "Command Descriptions" section in this appendix.
After the router reboots, it is in ROM monitor mode. The number in the prompt increments with each new line.
Note In ROM monitor mode, only the Fast Ethernet LAN interface FE0 is enabled and is available for communication, while the other three Fast Ethernet LAN interfaces (FE1, FE2, and FE3) are disabled. After the IOS software boots up, all of the four Fast Ethernet LAN interfaces are enabled. This feature is available if the ROM monitor version that is installed on your router is 12.3(8r)YI6 or later.
Timesaver Break (system interrupt) is always enabled for 60 seconds after the router reboots, regardless of whether it is set to on or off in the configuration register. During this 60-second window, you can break to the ROM monitor prompt by pressing the Break key.
ROM Monitor Commands
Enter ? or help at the ROM monitor prompt to display a list of available commands and options, as follows:
rommon 1 > ?
alias set and display aliases commandboot boot up an external processbreak set/show/clear the breakpointconfreg configuration register utilitycont continue executing a downloaded imagecontext display the context of a loaded imagecookie display contents of cookie PROM in hexcopy Copy a file-copy [-b <buffer_size>] <src_file> <dst_file>delete Delete file(s)-delete <filenames ...>dir List files in directories-dir <directory>dis display instruction streamdnld serial download a program moduleformat Format a filesystem-format <filessystem>frame print out a selected stack framefsck Check filesystem consistency-fsck <filesystem>help monitor builtin command helphistory monitor command historymeminfo main memory informationmkdir Create dir(s)-mkdir <dirnames ...>more Concatenate (type) file(s)-cat <filenames ...>rename Rename a file-rename <old_name> <new_name>repeat repeat a monitor commandreset system resetrmdir Remove a directoryset display the monitor variablesstack produce a stack tracesync write monitor environment to NVRAMsysret print out info from last system returntftpdnld tftp image downloadunalias unset an aliasunset unset a monitor variablexmodem x/ymodem image downloadCommands are case sensitive. You can halt any command by pressing the Break key on a terminal. If you are using a PC, most terminal emulation programs halt a command when you press the Ctrl and the Break keys at the same time. If you are using another type of terminal emulator or terminal emulation software, see the documentation for that product for information on how to send a Break command.
Command Descriptions
Table C-1 describes the most commonly used ROM monitor commands.
Table C-1 Commonly Used ROM Monitor Commands
Command Descriptionhelp or ?
Displays a summary of all available ROM monitor commands.
-?
Displays information about command syntax; for example:
rommon 16 > dis -?usage : dis [addr] [length]The output for this command is slightly different for the xmodem download command:
rommon 11 > xmodem -?xmodem: illegal option -- ?usage: xmodem [-cyrxu] <destination filename>-c CRC-16-y ymodem-batch protocol-r copy image to dram for launch-x do not launch on download completion-u upgrade ROMMON, System will reboot after upgradereset or i
Resets and initializes the router, similar to a power up.
dir device:
Lists the files on the named device; for example, flash memory files:
rommon 4 > dir flash:Directory of flash:/2 -rwx 10283208 <date> c870-advsecurityk9-mz9064448 bytes available (10289152 bytes used) boot commandsFor more information about the ROM monitor boot commands, see the Cisco IOS Configuration Fundamentals and Network Management Guide.
b
Boots the first image in flash memory.
b flash: [filename]
Attempts to boot the image directly from the first partition of flash memory. If you do not enter a filename, this command will boot this first image in flash memory.
Disaster Recovery with TFTP Download
The standard way to load new software on your router is to use the copy tftp flash privileged EXEC command from the Cisco IOS software command-line interface (CLI). However, if the router is unable to boot Cisco IOS software, you can load new software while in ROM monitor mode.
This section describes how to load a Cisco IOS software image from a remote TFTP server to the router flash memory. Use the tftpdnld command only for disaster recovery, because it erases all existing data in flash memory before downloading a new software image to the router.
TFTP Download Command Variables
This section describes the system variables that can be set in ROM monitor mode and that are used during the TFTP download process. There are both required variables and optional variables.
Note The commands described in this section are case sensitive and must be entered exactly as shown.
Required Variables
These variables must be set with these commands before you use the tftpdnld command:
Optional Variables
These variables can be set with these commands before using the tftpdnld command:
Using the TFTP Download Command
Perform these steps in ROM monitor mode to download a file through TFTP.
Step 1 Use the appropriate commands to enter all the required variables and any optional variables described in preceding sections.
Step 2 Enter the tftpdnld command as follows:
rommon 1 > tftpdnld -r
Note The -r variable is optional. Entering this variable downloads and boots the new software but does not save the software to flash memory. You can then use the image that is in flash memory the next time you enter the reload command.
You will see output similar to the following:
IP_ADDRESS: 10.3.6.7IP_SUBNET_MASK: 255.255.0.0DEFAULT_GATEWAY: 10.3.0.1TFTP_SERVER: 192.168.254.254TFTP_FILE: c870-advsecurityk9-mzDo you wish to continue? y/n: [n]:Step 3 If you are sure that you want to continue, enter y in response to the question in the output:
Do you wish to continue? y/n: [n]:yThe router begins to download the new file.
If you mistakenly entered yes, you can enter Ctrl-C or Break to stop the transfer before the flash memory is erased.
Configuration Register
The virtual configuration register is in nonvolatile RAM (NVRAM) and has the same functionality as other Cisco routers. You can view or modify the virtual configuration register from either the ROM monitor or the operating system software. Within the ROM monitor, you can change the configuration register by entering the register value in hexadecimal format, or by allowing the ROM monitor to prompt you for the setting of each bit.
Changing the Configuration Register Manually
To change the virtual configuration register from the ROM monitor manually, enter the confreg command followed by the new value of the register in hexadecimal format, as shown in the following example:
rommon 1 > confreg 0x2101You must reset or power cycle for new config to take effectrommon 2 >The value is always interpreted as hexadecimal. The new virtual configuration register value is written into NVRAM but does not take effect until you reset or reboot the router.
Changing the Configuration Register Using Prompts
Entering the confreg command without an argument displays the contents of the virtual configuration register and a prompt to alter the contents by describing the meaning of each bit.
In either case, the new virtual configuration register value is written into NVRAM but does not take effect until you reset or reboot the router.
The following display shows an example of entering the confreg command:
rommon 7> confregConfiguration Summaryenabled are:console baud: 9600boot: the ROM Monitordo you wish to change the configuration? y/n [n]: yenable "diagnostic mode"? y/n [n]: yenable "use net in IP bcast address"? y/n [n]:enable "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]: yenter rate: 0 = 9600, 1 = 4800, 2 = 1200, 3 = 2400 [0]: 0change the boot characteristics? y/n [n]: yenter to boot:0 = ROM Monitor1 = the boot helper image2-15 = boot system[0]: 0Configuration Summaryenabled are:diagnostic modeconsole baud: 9600boot: the ROM Monitordo you wish to change the configuration? y/n [n]:You must reset or power cycle for new config to take effectConsole Download
You can use console download, a ROM monitor function, to download either a software image or a configuration file over the router console port. After download, the file is either saved to the mini-flash memory module or to main memory for execution (image files only).
Use console download when you do not have access to a TFTP server.
Note If you want to download a software image or a configuration file to the router over the console port, you must use the ROM monitor dnld command.
Note If you are using a PC to download a Cisco IOS image over the router console port at 115,200 bps, ensure that the PC serial port is using a 16550 universal asynchronous transmitter/receiver (UART). If the PC serial port is not using a 16550 UART, we recommend using a speed of 38,400 bps or less when downloading a Cisco IOS image over the console port.
Command Description
The following are the syntax and descriptions for the xmodem console download command:
xmodem [-cyrx] destination_file_name
Follow these steps to run Xmodem:
Step 1 Move the image file to the local drive where Xmodem will execute.
Step 2 Enter the xmodem command.
Error Reporting
Because the ROM monitor console download uses the console to perform the data transfer, when an error occurs during a data transfer, error messages are only displayed on the console once the data transfer is terminated.
If you have changed the baud rate from the default rate, the error message is followed by a message telling you to restore the terminal to the baud rate specified in the configuration register.
Debug Commands
Most ROM monitor debugging commands are functional only when Cisco IOS software has crashed or is halted. If you enter a debugging command and Cisco IOS crash information is not available, you see the following error message:
"xxx: kernel context state is invalid, can not proceed."The following are ROM monitor debugging commands:
•stack or k—Produces a stack trace; for example:
rommon 6> stackStack trace:PC = 0x801111b0Frame 00: FP = 0x80005ea8 PC = 0x801111b0Frame 01: FP = 0x80005eb4 PC = 0x80113694Frame 02: FP = 0x80005f74 PC = 0x8010eb44Frame 03: FP = 0x80005f9c PC = 0x80008118Frame 04: FP = 0x80005fac PC = 0x80008064Frame 05: FP = 0x80005fc4 PC = 0xfff03d70•context—Displays processor context; for example:
rommon 7> contextCPU context of the most recent exception:PC = 0x801111b0 MSR = 0x00009032 CR = 0x53000035 LR = 0x80113694CTR = 0x801065e4 XER = 0xa0006d36 DAR = 0xffffffff DSISR = 0xffffffffDEC = 0xffffffff TBU = 0xffffffff TBL = 0xffffffff IMMR = 0xffffffffR0 = 0x00000000 R1 = 0x80005ea8 R2 = 0xffffffff R3 = 0x00000000R4 = 0x8fab0d76 R5 = 0x80657d00 R6 = 0x80570000 R7 = 0x80570000R8 = 0x00000000 R9 = 0x80570000 R10 = 0x0000954c R11 = 0x00000000R12 = 0x00000080 R13 = 0xffffffff R14 = 0xffffffff R15 = 0xffffffffR16 = 0xffffffff R17 = 0xffffffff R18 = 0xffffffff R19 = 0xffffffffR20 = 0xffffffff R21 = 0xffffffff R22 = 0xffffffff R23 = 0xffffffffR24 = 0xffffffff R25 = 0xffffffff R26 = 0xffffffff R27 = 0xffffffffR28 = 0xffffffff R29 = 0xffffffff R30 = 0xffffffff R31 = 0xffffffff•frame—Displays an individual stack frame.
•sysret—Displays return information from the last booted system image. This information includes the reason for terminating the image, a stack dump of up to eight frames, and, if an exception is involved, the address where the exception occurred; for example:
rommon 8> sysretSystem Return Info:count: 19, reason: user breakpc:0x801111b0, error address: 0x801111b0Stack Trace:FP: 0x80005ea8, PC: 0x801111b0FP: 0x80005eb4, PC: 0x80113694FP: 0x80005f74, PC: 0x8010eb44FP: 0x80005f9c, PC: 0x80008118FP: 0x80005fac, PC: 0x80008064FP: 0x80005fc4, PC: 0xfff03d70FP: 0x80005ffc, PC: 0x00000000FP: 0x00000000, PC: 0x00000000•meminfo—Displays size in bytes, starting address, available range of main memory, the starting point and size of packet memory, and size of NVRAM; for example:
rommon 9> meminfoMain memory size: 40 MB.Available main memory starts at 0x10000, size 40896KBIO (packet) memory size: 5 percent of main memory.NVRAM size: 32KBExiting the ROM Monitor
You must set the configuration register to a value from 0x2 to 0xF for the router to boot a Cisco IOS image from flash memory upon startup or reloading.
The following example shows how to reset the configuration register and cause the router to boot a Cisco IOS image stored in flash memory:
rommon 1 > confreg 0x2101You must reset or power cycle for new config to take effect:
rommon 2 > bootThe router will boot the Cisco IOS image in flash memory. The configuration register will change to 0x2101 the next time the router is reset or power cycled.