The students in our labs oftenly delete not just startup configuration but the whole IOS of a router. Then the IOS of the router have to be recovered. There is one way using the COM port, but it takes time (tens of minutes). The second way is to use an another router with the same IOS as the TFTP server.
TOPOLOGY:
R1———Fa0/0———R2
R1 will serve as the tftp server, R2 we have to recover. Routers are connected back-to-back using the cross cable.
As the first step we configure IP adressing information of the R1 fa 0/0 interface:
R1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#int Fa 0/0
R1(config-if)#ip ad 1.1.1.1 255.255.255.0
R1(config-if)#no shut
Then we configure the R1 router to server as tftp server offering own IOS from the flash storage:
R1(config)#tftp-server flash:c2600-jk9o3s-mz.122-29.bin
Router R2 is in ROM monitor mode, becasue it is missing IOS in flash, the booting was not sucessfull. We print variable setting using command set
rommon 1 > set
PS1=rommon ! >
TFTP_FILE=c2600-jk9o3s-mz.122-29.bin
BOOT=
IP_ADDRESS=10.10.104.10
IP_SUBNET_MASK=255.255.255.0
DEFAULT_GATEWAY=10.10.104.4
TFTP_SERVER=10.10.104.4
?=1
RET_2_RTS=
BSI=0
RET_2_RCALTS=
and we see that we have to change them to reflect our topology (we have to change the IP address, mask, address of the tftp server, name of the file that will be downloaded):
rommon 9 > IP_ADDRESS=1.1.1.2
rommon 10 > IP_SUBNET=255.255.255.0
rommon 12 > TFTP_SERVER=1.1.1.1
Check:
rommon 13 > set
PS1=rommon ! >
TFTP_FILE=c2600-jk9o3s-mz.122-29.bin
BOOT=
IP_SUBNET_MASK=255.255.255.0
DEFAULT_GATEWAY=10.10.104.4
RET_2_RTS=
BSI=0
RET_2_RCALTS=
_2_RCALTS=
?=0
IP_ADDRESS=1.1.1.2
IP_SUBNET=255.255.255.0
TFTP_SERVER=1.1.1.1
when look OK we may start the download using tftpdnld command
tftpdnldIP_ADDRESS: 1.1.1.2
IP_SUBNET_MASK: 255.255.255.0
DEFAULT_GATEWAY: 10.10.104.4
TFTP_SERVER: 1.1.1.1
TFTP_FILE: c2600-jk9o3s-mz.122-29.bin
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
.
Receiving c2600-jk9o3s-mz.122-29.bin from 1.1.1.1 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
etc
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!
File reception completed.
Copying file c2600-jk9o3s-mz.122-29.bin to flash.
Erasing flash at 0x60fc0000
program flash location 0x60c60000
rommon 15 >
when the download finished reload the router
rommon 15 > reset
That's all.