HOME > コンテンツリスト > ラボ・シナリオ for CCNA > [ < 前へ 次へ > ]

パスワードリカバリを行う

ネットワーク構成図

  1. 次の設定を行い、コンフィグを保存しなさい。
  2. ホスト名RT-A
    暗号化されない特権パスワードcisco
    暗号化される特権パスワードMicrosoft
    Router# conf t
    Enter configuration commands, one per line.  End with CNTL/Z.
    Router(config)# hostname RT-A
    RT-A(config)# enable password cisco
    RT-A(config)# enable secret Microsoft
    RT-A(config)# ^Z
    RT-A# copy run start
    Destination filename [startup-config]? < Enter >
    Building configuration...
    [OK]
    RT-A#
    
    パスワードは大文字/小文字を区別します。
  3. ルータの電源を [OFF] → [ON] させなさい。
  4. RT-A> en
    Password:  ← 入力しない
    
    ここで、特権パスワードを忘れたことにします。しかし、ルータの設定変更をしたいので特権モードに入りたいとします。
  5. ルータの電源を再度 [OFF] → [ON] し、60秒以内に Break 信号 (Alt+B) を送り、ROM モニターモードで起動させなさい。
  6. System Bootstrap, Version 12.4(13r)T5, RELEASE SOFTWARE (fc1)
    Technical Support: http://www.cisco.com/techsupport
    Copyright (c) 2007 by cisco Systems, Inc.
    PLD version 0x10
    GIO ASIC version 0x127
    c1841 platform with 393216 Kbytes of main memory
    Main memory is configured to 64 bit mode with parity disabled
    
    
    Upgrade ROMMON initialized
    program load complete, entry point: 0x8000f000, size: 0xcb80
    
    monitor: command "boot" aborted due to user interrupt
    rommon 1 >
    
    Break 信号を送るキーは使用しているターミナルソフトによって異なります。Alt+B は Tera Term の場合です。上には「60秒以内」と記載していますが、実際には一番最初の BOOT メッセージが表示されたらすぐに Alt+B を押し、「rommon 1 >」が表示されたら離すといいでしょう。
  7. コンフィグレーションレジスタ値を 0x2142 にし、ルータを再起動させなさい。
  8. rommon 1 > confreg 0x2142
    
    You must reset or power cycle for new config to take effect
    rommon 2 > reset
    
    System Bootstrap, Version 12.4(13r)T5, RELEASE SOFTWARE (fc1)
    Technical Support: http://www.cisco.com/techsupport
    Copyright (c) 2007 by cisco Systems, Inc.
    PLD version 0x10
    GIO ASIC version 0x127
    c1841 platform with 393216 Kbytes of main memory
    Main memory is configured to 64 bit mode with parity disabled
    
    
    Upgrade ROMMON initialized
    program load complete, entry point: 0x8000f000, size: 0xcb80
    program load complete, entry point: 0x8000f000, size: 0xcb80
    
    program load complete, entry point: 0x8000f000, size: 0x2d3b348
    Self decompressing the image : #################################################
    ################################################################################
    ################################################################################
    ######################################################### [OK]
          ・
          ・
          ・
    Would you like to enter the initial configuration dialog? [yes/no]:
    
    ルータは、Flash メモリから IOS をロードして起動していますが、
    Would you like to enter the initial configuration dialog? [yes/no]:
    
    が表示されていますので、ルータ起動時に startup-config を読み込んでいません。

    コンフィグレーションレジスタ値 0x2142 は、パスワードを忘れてルータにログインできなくなった時 (パスワードリカバリ時) に使用する startup-config を読み込まずルータを起動させるモードです。
  9. 特権モードに入りなさい。
  10. Would you like to enter the initial configuration dialog? [yes/no]: n
    
    Router> en
    Router#
    
    特権パスワードを設定している startup-config を読み込んでいないので、特権パスワードは聞かれません。
  11. running-config と startup-config を表示し比較しなさい。
  12. Router# sh run
    Building configuration...
    
    Current configuration : 936 bytes
    !
    version 15.1
    service timestamps debug datetime msec
    service timestamps log datetime msec
    no service password-encryption
    !
    hostname Router
    !
    boot-start-marker
    boot-end-marker
    !
    !
    !
    no aaa new-model
    !
    dot11 syslog
    ip source-route
    !
    !
    !
    !
    !
    ip cef
    no ipv6 cef
    !
    
    Router# sh start
    Using 1076 out of 196600 bytes
    !
    ! Last configuration change at 01:14:34 UTC Sat Aug 17 2013
    version 15.1
    service timestamps debug datetime msec
    service timestamps log datetime msec
    no service password-encryption
    !
    hostname RT-A
    !
    boot-start-marker
    boot-end-marker
    !
    !
    enable secret 4 lvf2OEGyS3nEmKKzJZZV.2HknPH9g0oiktXQJaG7WDo
    enable password cisco
    !
    no aaa new-model
    !
    dot11 syslog
    ip source-route
    !
    !
    !
    !
    !
    ip cef
    no ipv6 cef
    !
    
    running-config は何も設定されていないデフォルトの状態で、startup-config にはホスト名と enable password、enable secret が設定されている状態です。
  13. startup-config を running-config にコピーし、enable secret パスワードとして ccna を設定し、設定内容を保存しなさい。
  14. Router# copy start run
    Destination filename [running-config]? < Enter >
    1076 bytes copied in 0.292 secs (3685 bytes/sec)
    
    RT-A# conf t
    Enter configuration commands, one per line.  End with CNTL/Z.
    RT-A(config)# enable secret ccna
    RT-A(config)# ^Z
    RT-A# copy run start
    Destination filename [startup-config]? < Enter >
    Building configuration...
    [OK]
    RT-A#
    
    今回は enable secret パスワードを忘れて特権モードに入れなかったので、sh start で enable secret パスワードを見ればいいのですが、enable secret パスワードは暗号化されていて何が設定されているかわかりません。そのため、enable secret パスワードを新しく設定し直します。それ以外の設定は引き継ぎたいので一旦 startup-config を running-config にコピーし、その後 enable secret パスワードだけを上書きします。

    ※ パスワードリカバリの時によく忘れるのが、copy start run を事前に行うことです。これを行わず enable secret の設定を行い、copy run start を行うと、ルータに設定していたIPアドレス、ダイナミックルーティングプロトコルなど、全ての設定が消去してしまいます。
    また、今回はやっていませんが、使用する各インターフェイスでの no shoutdown コマンドも必要です。copy start run 後、sh run で、各インターフェイスの設定部分をチェックしてください。
  15. コンフィグレーションレジスタの値を確認しなさい。
  16. Router# sh version
    Cisco IOS Software, 1841 Software (C1841-ADVENTERPRISEK9-M), Version 15.1(4)M6, RELEASE SOFTWARE (fc2)
          ・
          ・
          ・
    125184K bytes of ATA CompactFlash (Read/Write)
    
    Configuration register is 0x2142
    
    コンフィグレーションレジスタの値はまだ startup-config をバイパスする (読み込まない) モード 0x2142 のままです。
  17. コンフィグレーションレジスタ値を 0x2102 に戻し、ルータを再起動させなさい。
  18. RT-A# conf t
    Enter configuration commands, one per line.  End with CNTL/Z.
    RT-A(config)# config-register 0x2102
    RT-A(config)# ^Z
    RT-A# reload
    
    System configuration has been modified. Save? [yes/no]: no
    Proceed with reload? [confirm] < Enter >
    
    System Bootstrap, Version 12.4(13r)T5, RELEASE SOFTWARE (fc1)
    Technical Support: http://www.cisco.com/techsupport
    Copyright (c) 2007 by cisco Systems, Inc.
    PLD version 0x10
    GIO ASIC version 0x127
    c1841 platform with 393216 Kbytes of main memory
    Main memory is configured to 64 bit mode with parity disabled
    
    
    Upgrade ROMMON initialized
    program load complete, entry point: 0x8000f000, size: 0xcb80
    program load complete, entry point: 0x8000f000, size: 0xcb80
    
    program load complete, entry point: 0x8000f000, size: 0x2d3b348
    Self decompressing the image : #################################################
    ################################################################################
    ################################################################################
    ######################################################### [OK]
          ・
          ・
          ・
    Press RETURN to get started! < Enter >
    
    
    RT-A> en
    Password: ccna    ← 変更後の ccna を入力する (実際には表示されない)
    RT-A#
    
    これで新しい特権パスワード ccna を使ってルータの設定変更ができるようになります。