Cisco 删除IOS后恢复、重灌ios

Flash 被清空,只能进入rommon 模式,唯一办法重灌IOS镜像文件,所需IOS文件可以到cisco官方网站和www.net130.com下载:
    软件准备:
* 先找到与机型相配的IOS文件(注意机子的内存大小选择大小相配的文件);
* 去下个Cisco TFTP Server;
   硬件准备:
* 除了要一根控制线外,还要一根交叉线来连接Router和你的控制电脑(注意Cisco Router一般规定了灌IOS必须用interface ethernet0/0,即第一个以太网端口);
   注意事项:
* 你要灌的IOS文件要放到Cisco TFTP Server的根目录下,Cisco TFTP Server才会自动找到你所需要加载的IOS镜像文件;

通过concle口登录路由器,设置tftp的环境

rommon 1 >IP_ADDRESS=192.168.1.2                 //默认为路由器第一个以太网接口的ip

rommon 2 >IP_SUBNET_MASK=255.255.255.0    //设置路由器以太网接口的子网掩码

rommon 3 >DEFAULT_GATEWAY=192.168.1.1    //设置网关,否则tftp无法成功

rommon 4 >TFTP_SERVER=192.168.1.104           //设置笔记本ip,即为tftp server的ip

rommon 5 >TFTP_FILE=c2600-i-mz.123-6c.bin     //设置路由器要下载的ios文件名

rommon 6 > set                               //设置tftp完环境后,可以用set命令再检查一下,也可以略过

PS1=rommon ! >

RET_2_RTS=

IP_ADDRESS=192.168.1.2

IP_SUBNET_MASK=255.255.255.0

DEFAULT_GATEWAY=192.168.1.1

TFTP_SERVER=192.168.1.104

TFTP_FILE=c2600-i-mz.123-6c.bin

rommon 7 > tftpdnld                      //核对无误后,开始tftp


          IP_ADDRESS: 192.168.1.2
      IP_SUBNET_MASK: 255.255.255.0
     DEFAULT_GATEWAY: 192.168.1.1
         TFTP_SERVER: 192.168.1.104
           TFTP_FILE:c2600-i-mz.123-6c.bin

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

Receiving c2600-c-mz.121-9.bin from 192.168.1.104

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
File reception completed.
Copying file c2600-c-mz.121-9.bin to flash.
Erasing flash at 0x607c0000
program flash location 0x60120000

rommon 8 > confreg                   //下载ios完毕后,还需设置寄存器的值

      Configuration Summary
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      //要选择“y”
enable "diagnostic mode"? y/n [n]: n
enable "use net in IP bcast address"? y/n [n]: n
disable "load rom after netboot fails"? y/n [n]: n
enable "use all zero broadcast"? y/n [n]: n
enable "break/abort has effect"? y/n [n]: n
enable "ignore system config info"? y/n [n]: n
change console baud rate? y/n [n]: n
change the boot characteristics? y/n [n]: y      //要选择“y”
enter to boot:
0 = ROM Monitor
1 = the boot helper image
2-15 = boot system
    [2]:2                           //要选择“2”

    Configuration Summary
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]:n

rommon 8 > reset                       //重启路由器

重启后,恢复正常

 

如果不能确定ios版本,可在路由器重启之前,按ctrl+break进入rommon后,输入reset命令,可以看到当前路由器需要ios的版本文件


本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/yangfree990/archive/2010/06/10/5661937.aspx

posted @ 2010-07-27 09:22  骚包猪  阅读(2207)  评论(1编辑  收藏  举报