replacing IOS on a Cisco 1720 series router
February 18, 2005
One of our students here at school accidently blew out IOS on of our lab 1721’s, and would only boot into rommon mode. So the professor handed to me and said “hey can you fix this?” not one to turn down a challange i said sure. After digging around i found out tha t you can push an image to a router via the console cable using xmodem via hyperterminal. Well i tried that and it didnt work too well, the connection kept dying. So i dug around and found out about a command in rommon mode called tftpdnld. This basically grabs IOS image via a tftp server and writes it to flash. I also found out that you can setup a router as a tftp server. I checked to see if ours supported it and it did. So here is what i did to get everything setup
you have 2 routers
routerA the good working router
routerB no IOS
now router A has no config on it, because they usually get wiped out after a lab. So when i booted it up i said no to using the auto config utility.
after i get to the prompt i setup the ethernet interface
ip address 192.168.1.1 2552.55.255.0
no shut
exit
next i need to configure the tftp server, the command is tftp-server and doing ? after the command will give you a list of all the options for it. Here we will do
tftp-server flash:
this will make it so that it will allow any tftp requests to grab this file. You can get the name of the image by doing show flash
now the router acting as the tftp server is ready to go, what we need to do next is set up the broken router.
Because the IOS image got wiped out the broken router will only boot into rommon mode and the prompt will look something like this
rommon 1>
here is the help output from tftpdnld
usage: tftpdnld [-ur]
Use this command for disaster recovery only to recover an image via TFTP.
Monitor variables are used to set up parameters for the transfer.
(Syntax: “VARIABLE_NAME=value” and use “set” to show current variables.)
“ctrl-c” or “break” stops the transfer before flash erase begins.
The following variables are REQUIRED to be set for tftpdnld:
IP_ADDRESS: The IP address for this unit
IP_SUBNET_MASK: The subnet mask for this unit
DEFAULT_GATEWAY: The default gateway for this unit
TFTP_SERVER: The IP address of the server to fetch from
TFTP_FILE: The filename to fetch
The following variables are OPTIONAL:
TFTP_VERBOSE: Print setting. 0=quiet, 1=progress(default), 2=verbose
TFTP_RETRY_COUNT: Retry count for ARP and TFTP (default=7)
TFTP_TIMEOUT: Overall timeout of operation in seconds (default=7200)
TFTP_CHECKSUM: Perform checksum test on image, 0=no, 1=yes (default=1)
Command line options:
-r: do not write flash, load to DRAM only and launch image
-u: upgrade the rommon, system will reboot once upgrade is complete
to see what variables you have set while in rommon mode do set and it will show you.
we need to setup the defaults and here is what i put in
IP_ADDRESS=192.168.1.2
IP_SUBNET_MASK=255.255.255.0
DEFAULT_GATEWAY=192.168.1.2
TFTP_SERVER=192.168.1.1 #ip of the fa interface on the good router
TFTP_FILE=
I also added these as well
TFTP_VERBOSE=1
TFTP_CHECKSUM=0
reason why i set the checksun to 0 is there is a bug where the checksum will fail on a perfectly good image, here is the bug report
http://www.cisco.com/pcgi-bin/Support/Bugtool/onebug.pl?bugid=CSCdk81077 (need CCO login)
once you have those set just run tftpdnld and you should see this
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
just hit y
now you should see the image download from the good router and then it will write it to flash. once that is complete just type in reset and the router should reboot backup into IOS.

