We will describe about the configuration files and IOS images. We will locate those images of the operating system and explain the role of the configuration register to change the boot sequence.
Router Power-On Boot Sequence
In troubleshooting your router’s operations, it is critical to understand the sequence of events that take place during the router’s bootup. Initially, the router will perform a series of self-tests (POST) to check the hardware and verify the present components. After that, instructions in the bootstrap code will tell the router where and how to load the image of the operating system. Configuration files will be found and loaded after that and the router will offer a prompt for configuration and management across the consoled ports and other lines of access into the router if configured. The important thing to understand here is the fallback options that are available in finding and loading the IOS software and the configuration files. Components like the configuration register and the boot system commands will be critical in customizing this process, allowing you to find the order of the options and the fallback options.
Router Internal Components
The router booting process takes its components from internal locations of the router. Some of those locations are listed here:
- NVRAM (Configuration Register)
Some of them are the typical interfaces to communicate with the rest of the world and the processor which powers the rest of the components. The specific locations are the read-only memory, which contains the power- on self test that runs as a first step in your booting process but also contains the RAM monitor mode or shell, which provides a command-line interface for data recovery and an image corruption recovery, and also a mini version of IOS, which will run if the image and flash fails.
However, it all starts with the configuration register. This is as 16-bit file that defines and assigns the steps of the process in which order they occur. This component is stored in the non-volatile random access memory or in VRAM. The contents of this memory will not be lost after power off and reboot of the router, and it contains not the configuration register, but also your configuration files. In this case, the startup configuration files, which are available after each router bootup. The configuration router by default tells the router to obtain the image of the operating system from flash, so that is where this image resides. In some the router models, this flash is almost a file system, so it can be used to store other file types like digital certificates or even management applications like the Security Device Manager. Once a router boots, the image will be loaded in RAM, random access memory, which is lost after a power off or reboot of the router, but it will contain all the dynamic information necessary for the router to operate. That includes not only the image of IOS, but also the running configuration file, and other dynamic information used by, for example, routing protocols and other components of the router.
Of special importance in the booting process is the read-only memory component. Not only does it contain the microcode used to test the basic functionality of the router hardware and determine which components are present, it also contains a bootstrap code, which directs the router initially with instructions during initialization. This is one component that will read the configuration register to determine how to boot the image of IOS. Finally, the ROM monitor mode is a key shell or a low-level operating system that allows users to enter a command-line interface used for testing, troubleshooting, and things like password recovery.
Finding the Cisco IOS Image
The router’s operating system is the brains of its operations. A configuration register value will tell the router via the bootstrap code where to check and find the image of the operating system. Different values will mean different things and this is something you can manipulate and change to customize the order of operations and the order of initialization. The default location is flash memory, but you could give the configuration register certain values to make them look for boot system command, which really represent the power of customization to let the administrator decide where to obtain the operating system.
Options are TFTP servers, flash memory, or different files in flash memory if many exist or even a mini version located in ROM. If none of those options exist or are configured, and the flash memory does not contain an image of the operating system, the process will go on attempting to boot from a network server. It will try to find TFTP servers with a specific naming convention for the file system to look for. If that fails, the process will go on trying to load the boot helper image, which is the IOS subset located in ROM.
If there is nothing there either or it is corrupted, then the router will fall back into ROM monitor mode (ROMMON). Even from there, you will have the option as an administrator to use all the options available including loading from the network to actually find the operating system manually and allow the router to boot up.
Loading the Cisco IOS Image from Flash
It is important to understand that different models and router families within the Cisco product line could add minor variations of the previous process. If the router follows the default process and finds the IOS image in flash, it will try to load it into random access memory. You may find routers that do not have RAM to hold the whole image of the operating system. If that is the case, certain models are able to run the image directly from flash.
Others will be able to use compressed versions of the operating system and so that means it will take a little longer in decompressing the image while the image is being loaded into RAM. Typically, images that are run directly from flash are not compressed. The image file name will tell you whether the image is compressed or not.
Loading the Configuration
After the image of the operating system is loaded into RAM, the process goes on trying to load the configuration files. This component will have similar options in terms of where to find and how to load the configuration file in memory. The default location is NVRAM, but if the NVRAM is empty at the moment of bootup, then the router will enter the autoinstall process, which will try to download a configuration file from a TFTP server automatically. It will first try to obtain an IP address via several bootstrapping protocols like SLARP or even BOOTP. If that process fails, then the router will go into the setup utility, which allows the administrator to provide basic configuration by following a wizard-like questionnaire.
In any case, it is important to remember the differences between the configuration files in RAM and in NVRAM. RAM contains the current active configuration and it is populated and changed every time you type in commands or configure the router from a central management tool. Active configurations are not saved automatically, and so they are not available if the router boots up at that point.
Safe configurations are stored in NVRAM and the saving process is manual. You need to use the copy running config start config command or the various versions of it like writemem. Only then will the configuration be available after the next bootup. These are the commands to display each one of the locations.
Current configuration : 980 bytes
Using 1082 out of 57336 bytes!
Determining the Current Configuration Register Value
As you can tell, by the descriptions of the booting process in this lesson, the configuration register is a key component and the one that will drive the location and loading of images of the operating system. You can review and list the current value of the configuration register by using the show version command. Look at the last line, that is the value of the configuration register. It is a 16-bit hexadecimal value where each bit has a special meaning in router operations.
Cisco IOS Software, 2600 Software (C2691-ADVENTERPRISEK9-M), Version 12.4(25d), RELEASE SOFTWARE (fc1)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2010 by Cisco Systems, Inc.
Compiled Wed 18-Aug-10 05:35 by prod_rel_team
ROM: ROMMON Emulation Microcode
ROM: 2600 Software (C2691-ADVENTERPRISEK9-M), Version 12.4(25d), RELEASE SOFTWARE (fc1)
RouterA uptime is 2 minutes
System returned to ROM by unknown reload cause - suspect boot_data[BOOT_COUNT] 0x0, BOOT_COUNT 0, BOOTDATA 19
System image file is "tftp://255.255.255.255/unknown"
This product contains cryptographic features and is subject to United
States and local country laws governing import, export, transfer and
use. Delivery of Cisco cryptographic products does not imply
third-party authority to import, export, distribute or use encryption.
Importers, exporters, distributors and users are responsible for
compliance with U.S. and local country laws. By using this product you
agree to comply with applicable laws and regulations. If you are unable
to comply with U.S. and local laws, return this product immediately.
A summary of U.S. laws governing Cisco cryptographic products may be found at:
If you require further assistance please contact us by sending email to
Cisco 2691 (R7000) processor (revision 0.1) with 187392K/9216K bytes of memory.
Processor board ID XXXXXXXXXXX
R7000 CPU at 160MHz, Implementation 39, Rev 2.1, 256KB L2, 512KB L3 Cache
2 FastEthernet interfaces
1 Serial(sync/async) interface
DRAM configuration is 64 bits wide with parity enabled.
55K bytes of NVRAM.
16384K bytes of ATA System CompactFlash (Read/Write)
Configuration register is 0x2102
Configuration Register Values
The configuration register then is a 16-bit word, where each bit has a special meaning. You can use some of the bits to load the router without reading the startup configuration. This is typically done in password recovery or you can simply change the physical settings of the console port with some of the bits. The four leased significant bits rule the booting process; they are called the boot field. Different values will result in different order of steps in the booting process, and eventually different locations of the IOS image. For example, a value of 0 in the 4 bits will mean that the router will use a ROM monitor mode to bootup.
Remember, the ROM monitor mode is typically used for password recovery and other methods of troubleshooting. If the 4 bits have a value of 1, then the router automatically boots from the subset image in ROM. Any value between 2 and F will examine NVRAM for the boot system commands. You can then issue multiple boot system commands and the order of them will be important. They will define how you want to find and load the image of the operating system and which ones are fallback options in case the fist option fails. The example here will try to load the image from two different files in flash and if those fail, then it will try loading it from a TFTP server.
<0x0-0xFFFF> Config register number
Router(config)#boot system flash:c2800nm-advipservicesk9-mz.124-20T1.bin
Router(config)#boot system flash:c2800nm-ipbase-mz.123-8.T11.bin
Router(config)#boot system tftp://10.1.1.1/c2800nm-advipservicesk9-mz.124-20T1.bin
show version Command
If you change the value of the configuration register, you will need to restart the router. When you change it, if you issue the show version command, you will see the current value and then the value that will be set after the next reload. It is very important to understand that even though the last 4 bits of the configuration register rule the booting process, the other bits have special meaning as well. In hexadecimal values, the last four bits are represented by the last digit of the hexadecimal number, so be sure not to change the other bits and the other digits of the hexadecimal number if you do not want to create inconsistencies and eventually prevent the router from booting.
show flash Command
If you use the boot system commands to customize the order of the fallback options to load IOS or to define specific image files in flash, then be sure to configure the right name for the image file. You can verify this by using the show flash command and looking at the image files and the current options in the output.
-#- --length-- -----date/time------ path
1 74786164 Sep 14 2011 01:02:56 +02:00 c2900-universalk9-mz.SPA.151-4.M1.bin
2 2903 Sep 14 2011 01:11:22 +02:00 cpconfig-29xx.cfg
3 2941440 Sep 14 2011 01:11:38 +02:00 cpexpress.tar
4 1038 Sep 14 2011 01:11:46 +02:00 home.shtml
5 115712 Sep 14 2011 01:12:02 +02:00 home.tar
6 1697952 Sep 14 2011 01:12:44 +02:00 securedesktop-ios-22.214.171.124-k9.pkg
7 415956 Sep 14 2011 01:13:20 +02:00 sslclient-win-126.96.36.199.pkg
176508928 bytes available (79978496 bytes used)