Friday, September 23, 2011

Router Recovery

This update is intended to show how to recover a router after it has choked on a software image and is now stuck in an rommon state.

• Enabling tftp service on your server/laptop
Sometimes you need to start (or maybe even kill) the tftp service on your laptop and the commands below will do the trick:

sudo launchctl load -F /System/Library/LaunchDaemons/tftp.plist
sudo launchctl unload /System/Library/LaunchDaemons/tftp.plist

• Download fresh image
Once the tftp service is enabled you need to go get yourself an image from cisco.com. Be warned, the image you want may not be the image your router can run. The reason the router choked on the image may have to do with the amount of available memory so be sure to look at the requirements before you pull one off the cisco shelf.

• Placing of image
Maybe not needed but I'll mention it anyway. Images (and anything you want to push or pull via tftp) go into the /private/tftpboot directory. You'll need to move the file after download with something like this:

system:Downloads user$ mv c2600-io3-mz.122-26c.bin /private/tftpboot/

- After this you'll need to change the permissions on the file so it can be accessed:

cd /private/tftpboot/
system:tftpboot user$ sudo chmod 777 c2600-io3-mz.122-26c.bin

• Router configuration

- All you need to do is enter a static IP (example uses 192.168.1.10) on your system and connect an ethernet cable to the router and issue the commands listed below (giving the router a 192.168.1.5 address):

rommon 1 > IP_ADDRESS=192.168.1.5
rommon 2 > IP_SUBNET_MASK=255.255.255.0
rommon 3 > DEFAULT_GATEWAY=192.168.1.1
rommon 4 > TFTP_SERVER=192.168.1.10
rommon 5 > TFTP_FILE=c2600-io3-mz.122-26c.bin
rommon 6 > tftpdnld

IP_ADDRESS: 192.168.1.5
IP_SUBNET_MASK: 255.255.255.0
DEFAULT_GATEWAY: 192.168.1.1
TFTP_SERVER: 192.168.1.10
TFTP_FILE: c2600-io3-mz.122-26c.bin

- Now the router wants to make sure you know your about the summon the RMA demons if this dosn't go well. They scare you with this message:

Invoke this command for disaster recovery only.
WARNING: all existing data in all partitions on flash will be lost!
Do you wish to continue? y/n: [n]: y

- Now the routers receives the image from your system via tftp:
.
Receiving c2600-io3-mz.122-26c.bin from 192.168.1.10 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! (lots of these)

- All good and now for some cleanup:

File reception completed.
Copying file c2600-io3-mz.122-26c.bin to flash.
Erasing flash at 0x60fc0000
program flash location 0x60580000

All you need to do now is reload and say a small prayer.
rommon 7 > reload

As always,good luck!