On a Cisco Device, the Configuration Register (often referred to and listed in the configuration as ‘confreg’) is a value which tells the device which software to load and run.
We can check with the ‘show version’ command what the device is currently set to. See the example output below:
SWITCH# show version
< TRUNCATED >
Configuration register is 0x2102
As we can see right at the bottom on Line 5, the Configuration Register value is set to 0x2102. But what exactly does this mean?
Common Confreg Values
Let’s take a look at some of the most common Confreg values:
Value | Effect |
---|---|
0x2102 | A normal boot. This is the default for a Cisco Device from the factory. It means that the device should load the normal IOS file. The Configuration is booted from the NVRAM (Startup Config). |
0x2142 | The Device will boot into ROMMON Mode. It will ignore the contents of the NVRAM (the usual Startup Configuration). |
0xF | This means the NVRAM will be interrogated for any boot commands |
0x0 | Booting manually is required |
ROMMON Mode
If the device cannot find a working system image to boot, it will enter into ROMMON (short for ROM Monitor) mode. Think of this as a sort of base, barebones, pre-loaded firmware on the device that allows extremely basic diagnostic and configuration commands. If you are familiar with a PC, think of the BIOS – its like that. Note that you can only access ROMMON mode while you are consoled in to the device, this won’t work remotely!
ROMMON is essentially a last resort state where we can still have some form of software control over the device in order to bring it to a working, production-ready state. It is also handy when used to recover the password for a Router or Switch.
We can manually initiate a boot into ROMMON mode by interrupting the standard boot sequence. On some Devices, you can hold a physical button on the Switch during boot/power on for it to boot into ROMMON mode.
Changing the Confreg Value
If you want to change the Confreg value on your device, you can do so in any mode, within the IOS or in ROMMON mode itself.
Lets see how its done in each.
Changing the Confreg Value in IOS
To change it within IOS, enter global configuration mode and enter the following command, dont forget the ‘0x’!
SWITCH(config)# config-register [INSERT VALUE HERE]
If we execute the ‘show version’ command, we can see the old value, and confirm what the new value will be once we reload the Device:
SWITCH# show version
< TRUNCATED >
Configuration register is [OLD VALUE] (will be [NEW VALUE] at next reload)
Changing the Confreg Value in ROMMON
This is as simple as the below, again, dont forget the ‘0x’!
rommon > confreg [VALUE]
Reboot and thats it!
There is more to ROMMON, but I hope this covers the basics.