Locked out of your Cisco? Break in!

Posted on in Networking

Blue CrowbarI recently had the pleasure of working on a client's Cisco 2600 series router that had not been used in quite some time. Access lists on the vty lines and a misconfigured con line meant I was locked out. In a situation like this, the only way to gain access to the router is by forcing it to boot without reading the startup configuration.

The first thing to do is plug a console cable in and launch your favorite terminal application (I use ZTerm for this). Power cycle the router and send a break within the first few seconds. At this time you, should see a rommon prompt like the one displayed below.

monitor: command "boot" aborted due to user interrupt
rommon 1 >

The confreg command will allow you to change the boot characteristics of the router. This is where we'll tell the router to ignore the system configuration.
<!--more-->

rommon 1 > confreg
           Configuration Summary
   (Virtual Configuration Register: 0x2102)
enabled are:
load rom after netboot fails
console baud: 9600
boot: image specified by the boot system commands
      or default to: cisco2-C2600

do you wish to change the configuration? y/n  [n]:  y
enable  "diagnostic mode"? y/n  [n]: 
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]: y
change console baud rate? y/n  [n]:
change the boot characteristics? y/n  [n]: 

           Configuration Summary
   (Virtual Configuration Register: 0x2142)
enabled are:
load rom after netboot fails
ignore system config info
console baud: 9600
boot: image specified by the boot system commands
      or default to: cisco2-C2600

do you wish to change the configuration? y/n  [n]:


You must reset or power cycle for new config to take effect
rommon 2 >

Now you just need to issue the reset command and you'll be presented with an initial configuration dialog once the reboot is complete.

IMPORTANT! Once you're done, change your configuration register so that the router will load your configuration on boot.

Slaptijack's Koding Kraken