TFTPダウンロードによる障害時の回復



●概要

 下記URLを参照してください。
 TFTP ダウンロードによる障害時の回復

 ルータに新しいソフトウェアをロードするには、通常、Cisco IOS ソフトウェアの Command-Line Interface(CLI; コマンドライン インターフェイス)から copy tftp flash 特権 EXEC コマンドを実行します。ただし、ルータが Cisco IOS ソフトウェアをブートできない場合は、ROM モニタ モード中に新しいソフトウェアをロードすることができます。
 ここでは、リモート TFTP サーバからルータのフラッシュ メモリに Cisco IOS ソフトウェア イメージをロードする方法について説明します。 tftpdnld コマンドを実行すると、ルータに新しいソフトウェア イメージをダウンロードする前にフラッシュ メモリ内のすべての既存データが消去されるため、このコマンドは障害回復の場合にだけ使用してください。
 なお、この方法はフラッシュメモリの破損時、IOSイメージのサイズが大きく、別の新しいフラッシュメモリを使用してルータを起動したい場合等に応用できます。

●TFTPダウンロードのコマンド変数

 下記URLを参照してください。
 TFTP ダウンロードによる障害時の回復

 上記を参照して、下記のように設定しました。
rommon 1 > IP_ADDRESS=172.21.1.10
rommon 2 > IP_SUBNET_MASK=255.255.255.0
rommon 3 > DEFAULT_GATEWAY=172.21.1.253
rommon 4 > FE_PORT=fe0
rommon 5 > TFTP_SERVER=1.0.0.15
rommon 6 > TFTP_FILE=c1841-advipservicesk9-mz.151-4.M1.bin
 ただし、フラッシュカードが認識しない場合、IPアドレスを割り当てることができませんので注意してください。

●TFTPダウンロードコマンドの使用
rommon 7 > tftpdnld
          IP_ADDRESS: 172.21.1.10
      IP_SUBNET_MASK: 255.255.255.0
     DEFAULT_GATEWAY: 172.21.1.253
         TFTP_SERVER: 1.0.0.15
           TFTP_FILE: c1841-advipservicesk9-mz.151-4.M1.bin
        TFTP_MACADDR: 00:1e:f7:69:5b:96
        TFTP_VERBOSE: Progress
    TFTP_RETRY_COUNT: 18
        TFTP_TIMEOUT: 7200
       TFTP_CHECKSUM: Yes
             FE_PORT: 0
       FE_SPEED_MODE: Auto Detect
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 c1841-advipservicesk9-mz.151-4.M1.bin from 1.0.0.15 !!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  :
 (途中省略)
  :
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
File reception completed.
Validating checksum.
loading image c1841-advipservicesk9-mz.151-4.M1.bin
program load complete, entry point: 0x8000f000, size: 0x2b81c98
Self decompressing the image : ######################################################################
#####################################################################################################
############################################################################################# [OK]
IOMEM set to: 25
PMem allocated: 299892736 bytes; IOMem allocated: 102760448 bytes
              Restricted Rights Legend
Use, duplication, or disclosure by the Government is
subject to restrictions as set forth in subparagraph
(c) of the Commercial Computer Software - Restricted
Rights clause at FAR sec. 52.227-19 and subparagraph
(c) (1) (ii) of the Rights in Technical Data and Computer
Software clause at DFARS sec. 252.227-7013.
           cisco Systems, Inc.
           170 West Tasman Drive
           San Jose, California 95134-1706
Cisco IOS Software, 1841 Software (C1841-ADVIPSERVICESK9-M), Version 15.1(4)M1, RELEASE SOFTWARE (fc1)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2011 by Cisco Systems, Inc.
Compiled Tue 14-Jun-11 16:51 by prod_rel_team
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.
Installed image archive
Cisco 1841 (revision 7.0) with 292864K/100352K bytes of memory.
Processor board ID FCZ1204911X
2 FastEthernet interfaces
1 Serial(sync/async) interface
1 Virtual Private Network (VPN) Module
DRAM configuration is 64 bits wide with parity disabled.
191K bytes of NVRAM.
125952K bytes of ATA CompactFlash (Read/Write)
Press RETURN to get started!
*Jul 21 06:47:18.247: %VPN_HW-6-INFO_LOC: Crypto engine: onboard 0  State changed to: Initialized
*Jul 21 06:47:18.251: %VPN_HW-6-INFO_LOC: Crypto engine: onboard 0  State changed to: Enabled
*Jul 21 06:47:20.591: %LINK-3-UPDOWN: Interface Serial0/0/0, changed state to down
*Jul 21 06:47:21.779: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to down
*Jul 21 06:47:21.779: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0/0, changed state to down
*Jul 21 06:47:22.183: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to down
*Jul 21 06:47:23.127: %SYS-5-CONFIG_I: Configured from memory by console
*Jul 21 06:47:25.087: %LINK-5-CHANGED: Interface FastEthernet0/1, changed state to administratively down
*Jul 21 06:47:25.087: %LINK-5-CHANGED: Interface Serial0/0/0, changed state to administratively down
*Jul 21 06:47:25.771: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
*Jul 21 06:47:29.119: %SYS-5-RESTART: System restarted --
Cisco IOS Software, 1841 Software (C1841-ADVIPSERVICESK9-M), Version 15.1(4)M1, RELEASE SOFTWARE (fc1)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2011 by Cisco Systems, Inc.
Compiled Tue 14-Jun-11 16:51 by prod_rel_team
*Jul 21 06:47:29.123: %SNMP-5-COLDSTART: SNMP agent on host Router is undergoing a cold start
*Jul 21 06:47:29.471: %CRYPTO-6-ISAKMP_ON_OFF: ISAKMP is OFF
*Jul 21 06:47:29.475: %CRYPTO-6-GDOI_ON_OFF: GDOI is OFF
*Jul 21 06:47:29.475: %CRYPTO-6-ISAKMP_ON_OFF: ISAKMP is OFF
*Jul 21 06:47:29.475: %CRYPTO-6-GDOI_ON_OFF: GDOI is OFF
Router>
 自動的にIOSイメージを読み込んで、起動に成功しました。

●File Name Length (46) too long

 Cisco 2811のコンパクトフラッシュを64MBから128MBに変更し、新たなIOSを上記の方法でインストールしようとしたところ下記のようなエラーが表示されインストールで来ませんでした。
File Name Length (46) too long
 「ファイル名が長すぎる」というのが原因らしいのですが、上記の方法による対処法方法が分かりませんでした。
 コンパクトフラッシュには書き込まない方法で、IOSをTFTPサーバからダウンロードし、ルーターを起動させ、その後copyコマンドによりIOSをコンパクトフラッシュに書き込ませる方法を選択しました。
 コンパクトフラッシュには書き込まないようにIOSをダウンロードし、ルータを起動させるには以下のコマンドを使用します。
rommon 7 > tftpdnld -r
 IOSのダウンロード途中から、起動までの様子は下記のとおりです。

  (途中省略)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
File reception completed.
Validating checksum.

loading image c2800nm-adventerprisek9_ivs_li-mz.151-4.M2.bin
program load complete, entry point: 0x8000f000, size: 0x412a3f8
Self decompressing the image :
########################################################################################################
########################################################################################################
########################################################################################################
########################################################################################################## [OK]

Smart Init is enabled
smart init is sizing iomem
ID MEMORY_REQ TYPE
0003E7 0X00474800 C2811 Mainboard
0X00264050 Onboard VPN
0X000021B8 Onboard USB
0X002C29F0 public buffer pools
0X00211000 public particle pools
-----------------------------------------------
TOTAL: 0X00BAE3F8

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.
Rounded IOMEM up to: 12Mb.
Using 1 percent iomem. [12Mb/768Mb]

Restricted Rights Legend

Use, duplication, or disclosure by the Government is
subject to restrictions as set forth in subparagraph
(c) of the Commercial Computer Software - Restricted
Rights clause at FAR sec. 52.227-19 and subparagraph
(c) (1) (ii) of the Rights in Technical Data and Computer
Software clause at DFARS sec. 252.227-7013.

cisco Systems, Inc.
170 West Tasman Drive
San Jose, California 95134-1706



Cisco IOS Software, 2800 Software (C2800NM-ADVENTERPRISEK9_IVS_LI-M), Version 15.1(4)M2, RELEASE SOFTWARE (fc1)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2011 by Cisco Systems, Inc.
Compiled Mon 26-Sep-11 16:41 by prod_rel_team


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.

Installed image archive
Cisco 2811 (revision 1.0) with 774144K/12288K bytes of memory.
Processor board ID FHK1117F31W
2 FastEthernet interfaces
1 Virtual Private Network (VPN) Module
DRAM configuration is 64 bits wide with parity disabled.
239K bytes of non-volatile configuration memory.
125184K bytes of ATA CompactFlash (Read/Write)
NLS timeout set to 1
Control Relationship ID set to 1

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!By default, the following "voice service voip" !!
!!sub-command is enabled: !!
!! ip address trusted authenticate !!
!! !!
!!The command enables the ip address authentication !!
!!on incoming H.323 or SIP trunk calls for toll fraud !!
!!prevention supports. !!
!! !!
!!Please use "show ip address trusted list" command !!
!!to display a list of valid ip addresses for incoming !!
!!H.323 or SIP trunk calls. !!
!! !!
!!Additional valid ip addresses can be added via the !!
!!following command line: !!
!! voice service voip !!
!! ip address trusted list !!
!! ipv4 <ipv4-address> [<ipv4 network-mask>] !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!


Press RETURN to get started!


*Aug 11 07:47:22.855: %VPN_HW-6-INFO_LOC: Crypto engine: onboard 0 State changed to: Initialized
*Aug 11 07:47:22.867: %VPN_HW-6-INFO_LOC: Crypto engine: onboard 0 State changed to: Enabled
*Aug 11 07:47:25.375: %LINEPROTO-5-UPDOWN: Line protocol on Interface LI-Null0, changed state to up
*Aug 11 07:47:25.375: %LINEPROTO-5-UPDOWN: Line protocol on Interface VoIP-Null0, changed state to up
*Aug 11 07:47:25.375: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
*Aug 11 07:47:25.379: %LINK-3-UPDOWN: Interface FastEthernet0/1, changed state to up
*Aug 11 07:47:26.375: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
*Aug 11 07:47:26.379: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to down
*Aug 11 16:47:28.071: %SYS-6-CLOCKUPDATE: System clock has been updated from 07:47:28 UTC Sat Aug 11 2012 to 16:47:28 JST Sat Aug 11 2012, configured from console by console.
*Aug 11 16:47:28.327: %SYS-5-CONFIG_I: Configured from memory by console
*Aug 11 16:47:30.143: %LINK-5-CHANGED: Interface FastEthernet0/0, changed state to administratively down
*Aug 11 16:47:30.159: %LINK-5-CHANGED: Interface FastEthernet0/1, changed state to administratively down
*Aug 11 16:47:31.179: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to down
*Aug 11 16:47:32.795: %SYS-5-RESTART: System restarted --
Cisco IOS Software, 2800 Software (C2800NM-ADVENTERPRISEK9_IVS_LI-M), Version 15.1(4)M2, RELEASE SOFTWARE (fc1)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2011 by Cisco Systems, Inc.
Compiled Mon 26-Sep-11 16:41 by prod_rel_team
*Aug 11 16:47:32.799: %SNMP-5-COLDSTART: SNMP agent on host cisco2811-1 is undergoing a cold start
*Aug 11 16:47:32.995: %SYS-6-BOOTTIME: Time taken to reboot after reload = 5895 seconds
*Aug 11 16:47:33.223: %CRYPTO-6-ISAKMP_ON_OFF: ISAKMP is OFF
*Aug 11 16:47:33.223: %CRYPTO-6-GDOI_ON_OFF: GDOI is OFF
*Aug 11 16:47:33.223: %CRYPTO-6-ISAKMP_ON_OFF: ISAKMP is OFF
*Aug 11 16:47:33.223: %CRYPTO-6-GDOI_ON_OFF: GDOI is OFF

 起動できたら、TFTPサーバが接続されているネットワークに該当Cisco機器を接続し、IPアドレス等を設定します。
 TFTPサーバにpingし、応答があればIOSをダウンロードすることができます。
 copyコマンドを使用したIOSのアップグレード方法は●IOSのバックアップ・アップグレードを参照してください。
 作業の様子は下記のとおりです。
cisco2811-1#copy tftp flash
Address or name of remote host []? 1.0.0.15
Source filename []? c2800nm-adventerprisek9_ivs_li-mz.151-4.M2.bin
Destination filename [c2800nm-adventerprisek9_ivs_li-mz.151-4.M2.bin]?
Accessing tftp://1.0.0.15/c2800nm-adventerprisek9_ivs_li-mz.151-4.M2.bin...
Erase flash: before copying? [confirm]
Erasing the flash filesystem will remove all files! Continue? [confirm]
Erasing device... eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee ...erased
Erase of flash: complete
Loading c2800nm-adventerprisek9_ivs_li-mz.151-4.M2.bin from 1.0.0.15 (via FastEthernet0/1): !!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[OK - 68330944 bytes]

Verifying checksum... CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC OK (0xF6E4)
68330944 bytes copied in 608.556 secs (112284 bytes/sec)
 コンパクトフラッシュに書き込まれているかどうか確認します。
cisco2811-1#dir flash:
Directory of flash:/

    1  -rw-    68330944                    <no date>  c2800nm-adventerprisek9_ivs_li-mz.151-4.M2.bin

128188412 bytes total (59857404 bytes free)
cisco2811-1#show flash:

CompactFlash directory:
File  Length   Name/status
  1   68330944  c2800nm-adventerprisek9_ivs_li-mz.151-4.M2.bin
[68331008 bytes used, 59857404 available, 128188412 total]
125184K bytes of ATA CompactFlash (Read/Write)
 問題なさそうです。
 では、再起動してみます。

cisco2811-1#reload
Proceed with reload? [confirm]

*Aug 11 17:52:20.087: %SYS-5-RELOAD: Reload requested by console. Reload Reason: Reload Command.

System Bootstrap, Version 12.4(13r)T5, RELEASE SOFTWARE (fc1)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 2007 by cisco Systems, Inc.

Memory Dimms are not of the same type

DIMM0 is a ECC Memory
DIMM1 is a non-ECC Memory

c2811 platform with 786432 Kbytes of main memory
Main memory is configured to 64 bit mode with ECC disabled


Upgrade ROMMON initialized

program load complete, entry point: 0x8000f000, size: 0x412a3f8
Self decompressing the image :
####################################################################################################### > [OK]