Wednesday, June 10, 2009

Recovering a cisco 870 router

So, lets turn the router on. Seeing a whole bunch of interesting stuff, especially:

Booting flash:/c870-advipservicesk9-mz.124-4.T3.bin

and all the different interfaces states. Now it's dropped me to the normal prompt. Of course, I could type en and try to guess the password, but lets not waste our time! So, according to the cisco website:

http://www.cisco.com/en/US/docs/routers/access/800/850/software/configuration/guide/trouble.html#wp1038210

sh version Configuration register is 0x2102

So lets hard reboot it with the power button and keep pressing the "break" key while it's rebooting. I had to try this a few times, as pressing the break key didn't seem to work very well. Other sources mention pressing "ctrl and break" which on a laptop means pressing "ctrl, the Fn key and the break key" which is a little awkward, but eventually I got to:

rommon 1 > confreg 0x2142
You must reset or power cycle for new config to take effect
rommon 2 > reset

Woo-hoo! Now it's resetting and I land at the following prompt:

Would you like to enter the initial configuration dialog? [yes/no]: _

Here I type no, followed by enable and show startup-config to view the original configuration, but the original enable password is encrypted:

enable secret 5 $1$yusS$D4aa0.FehLVWGPzRUZjAB0

but it's pretty much useless to me (you could go to one of the million places out there to decrypt it if you wanted) as I want a fresh start anyway, so I reboot (reload) once more to get back to my prompt:

Would you like to enter the initial configuration dialog? [yes/no]: yes
Would you like to enter basic management setup? [yes/no]: yes
Enter host name [Router]: router01
This is the enable password you get prompted for when typing en:
Enter enable secret: cheese1
Enter enable password: cheese2
Enter virtual terminal password: cheese3
Configure SNMP Network Management? [yes]: no
As the 870 has four switchports (FE0 - 3) and one WAN interface FE4, we can only assign an IP address directly to FE4. We can assign IP addresses to the other switchports, but we'd have to do that through VLAN creation which I'll touch on later.
Enter interface name used to connect to the
management network from the above interface summary: 
FastEthernet4
Use the 100 Base-TX (RJ-45) connector? [yes]: yes
Operate in full-duplex mode? [no]: no
Configure IP on this interface? [yes]: yes
I'm using this IP address as my internal home network has this range and this particular IP address I know is free.
IP address for this interface: 192.168.1.20
Subnet mask for this interface [255.255.255.0] : 255.255.255.0
[0] Go to the IOS command prompt without saving this config.
[1] Return back to the setup without saving this config.
[2] Save this configuration to nvram and exit.

Enter your selection [2]: 2
Building configuration...
Press RETURN to get started!

show version Configuration register is 0x2142
en
conf t
Change back the register or else you'll always be prompted after every reload with the above (mind you, all you'd have to say is no, en and copy startup-config running-config if you have it saved).
config-register 0x2102
end
show version Configuration register is 0x2142 (will be 0x2102 at next reload)
wr mem
copy running-config startup-config
reload

Tada! The router now restarts and loads our config straight away!

No comments:

Post a Comment