candy 发表于 2018-7-10 11:59:39

利用Cisco USB 进行IOS升级与故障恢复

  在项目实施和故障排除过程中,经常会遇到路由器IOS BUG无法正常启动,CF卡故障,个别无良网管操作造成配置丢失flash被写入莫名其妙的东西。利用好设备自带的USB能帮助我们快速进行此类故障恢复。
  第一种情况
  在设备良好运行的情况下,如果你有新增一批同型号交换机,或者路由器,那用usb进行IOS的升级同步是非常好用的。
  准备一个u盘,移动硬盘也行,试验设备CISCO 1841
  将USB设备插入
  console显示出检测到usb设备
  *Aug 24 06:17:43.655: %USB_HOST_STACK-6-USB_DEVICE_CONNECTED: A Full speed USB device has been inserted in port 0.
  *Aug 24 06:17:44.299: %USBFLASH-5-CHANGE: usbflash0 has been inserted!
  A#format ?
  flash:      Filesystem to be formatted
  ---------显示出usb设备情况,因为我插的是移动硬盘分了3个区,所以显示如下
  usbflash0:    Filesystem to be formatted
  usbflash0:0:Filesystem to be formatted
  usbflash0:1:Filesystem to be formatted
  IOS放在移动硬盘的第一个盘中,所以
  A#dir usbflash0:
  Directory of usbflash0:/
  1drw-         0   Aug 9 2007 20:57:48 +00:00System Volume Information
  266drw-         0Aug 11 2010 17:45:34 +00:00gG
  1051-rw-    14452703Aug 13 2010 16:04:34 +00:00VanDyke.SecureCRT.v6.5.3.zip
  1052-rw-    44880216Aug 24 2010 05:53:06 +00:00c1841-adventerprisek9-mz.151-2.T1.bin
  1053drw-         0May 12 2010 22:15:16 +00:00$RECYCLE.BIN
  21465661440 bytes total (19124568064 bytes free)
  从移动硬盘中COPY IOS
  A#copy usbflash0: fl
  A#copy usbflash0: flash:
  Source filename []? c1841-adventerprisek9-mz.151-2.T1.bin
  Destination filename ?
  Copy in progress...CCCCCCCCCCCCCCCCCCCCCCCCC省略
  CCCCCCCCCCCCCCCC
  44880216 bytes copied in 121.780 secs (368535 bytes/sec)
  检查一下看FLASH
  A#dir
  Directory of flash:/
  1-rw-    44880216Aug 24 2010 06:24:08 +00:00c1841-adventerprisek9-mz.151-2.T1.bin
  64000000 bytes total (19116032 bytes free)
  A#
  第二种情况,设备无法正常开机,进入rommon模式需要手动引导载入IOS,这种情况下usb的优势就体现出来,大家再也不用xmodem(为了提高速度还要改波特率)或者接反线折腾半天了,直接可以从usb启动,启动完再把ios拷贝进设备。
  我们来看,设备开机就进入rommon
  rommon 2 > dev      ----------看有无支持usb
  Devices in device table:

  >  flash:external compact flash
  bootflash:boot flash
  usbflash0:usbflash0
  eprom:eprom
  让设备从usb载入IOS启动
  rommon 3 > boot usbflash0:c1841-adventerprisek9-mz.151-2.T1.bin

  program load complete, entry point: 0x8000f000,>
  program load complete, entry point: 0x8000f000,>
  program load complete, entry point: 0x8000f000,>  Self decompressing the image : ##############################################################################################################################################################################################################################################################
  Smart Init is enabled
  smart init is sizing iomem

  >  0X003AA110 public buffer pools
  0X00211000 public particle pools
  0X00020000 Crypto module pools
  0X000021B8 Onboard USB
  If any of the above Memory Requirements are
  "UNKNOWN", you may be using an unsupported
  configuration or there is a software problem and
  system operation may be compromised.
  Allocating additional 13997571 bytes to IO Memory.
  PMem allocated: 245366784 bytes; IOMem allocated: 23068672 bytes
  %C3600-3-SLOTS: Number of slots in chassis is undefined.
  This product contains cryptographic features and is subject to United
  States and local country laws governing import, export, transfer and
  use. Delivery of Cisco cryptographic products does not imply
  third-party authority to import, export, distribute or use encryption.
  Importers, exporters, distributors and users are responsible for
  compliance with U.S. and local country laws. By using this product you
  agree to comply with applicable laws and regulations. If you are unable
  to comply with U.S. and local laws, return this product immediately.
  A summary of U.S. laws governing Cisco cryptographic products may be found at:
  http://www.cisco.com/wwl/export/crypto/tool/stqrg.html
  If you require further assistance please contact us by sending email to
  export@cisco.com.
  ------------------------------------------------------------------------------------------------
  检测到USB并开始从USB载入IOS
  --------------------------------------------------------------------------------------------------
  %***_HW-6-INFO_LOC: Crypto engine: onboard 0State changed to: Initialized
  %***_HW-6-INFO_LOC: Crypto engine: onboard 0State changed to: Enabled Installed image archive
  %USB_HOST_STACK-6-USB_DEVICE_CONNECTED: A Full speed USB device has been inserted in port 0.
  %USBFLASH-5-CHANGE: usbflash0 has been inserted!
  %SYS-6-BOOT_MESSAGES: Messages above this line are from the boot loader.

  program load complete, entry point: 0x8000f000,>  如果遇到CF卡损坏而且暂时没有CF可供使用时,大家可以弄个u盘直接插在设备上面
  在设备里面配置
  boot system usbflash0:xxxxxx.bin
  当然在这样的话你的usb得一直插着,如果之后使用CF卡,记得把上面的命令拿掉。
页: [1]
查看完整版本: 利用Cisco USB 进行IOS升级与故障恢复