Packet Tracer においても、Catalyst2950スイッチがありますが、ここで解説しているパスワードリカバリーの方法を試すことができません。実機においては、以下の手順でパスワードリカバリーするものと参考にしていただければと思います。

パスワードリカバリー(スイッチ)

Catalyst2950スイッチのパスワードリカバリー方法です。基本的に、Catalyst2900XLスイッチと同じです。

 Catalystスイッチを譲り受けたり、オークションで落札して手に入れたとしてもパスワードがかかったままでは、設定の変更ができません。パスワードリカバリーは、ぜひマスターしておきたいものです。

手順

1.スイッチの電源を切り、スイッチの前面部分にある「MODE」ボタンを押したまま、スイッチの電源を入れます。

すると以下のように表示されます。

flash_init
load_helper
dir flash:

Router>enable
C2950 Boot Loader (CALHOUN-HBOOT-M) Version 12.0(5)WC(1), RELEASE SOFTWARE (fc1)
Compiled Tue 27-Mar-01 23:28 by devgoyal
WS-C2950-24 starting…
Base ethernet MAC Address: 00:06:2a:fb:9f:80
Xmodem file system is available.

The system has been interrupted prior to initializing the
flash filesystem. The following commands will initialize
the flash filesystem, and finish loading the operating
system software:

flash_init
load_helper
boot

switch:

2.次のコマンドを入力してファイルシステムを初期化し、ヘルプをロードします。

flash_init
load_helper
dir flash:

switch: flash_init
Initializing Flash…
flashfs[0]: 163 files, 3 directories
flashfs[0]: 0 orphaned files, 0 orphaned directories
flashfs[0]: Total bytes: 7741440
flashfs[0]: Bytes used: 2969088
flashfs[0]: Bytes available: 4772352
flashfs[0]: flashfs fsck took 6 seconds.
…done initializing flash.
Boot Sector Filesystem (bs:) installed, fsid: 3
Parameter Block Filesystem (pb:) installed, fsid: 4
switch: load_helper
switch: dir flash:
Directory of flash:/

2 drwx 10240 <date> html
5 -rwx 1068 <date> config.text
6 -rwx 1680957 <date> c2950-c3h2s-mz.120-5.WC2.bin
167 -rwx 107 <date> info.ver
168 -rwx 288 <date> env_vars

4772352 bytes available (2969088 bytes used)

 上の出力で、黄色く網掛けになっている「config.txt」がスイッチの設定ファイルです。この中にパスワードが設定されています。

3.設定ファイルをリネームします。

rename flash:config.text flash:config.old

switch: rename flash:config.text flash:config.old

4.システムをブートします。

「boot」コマンドを実行します。

switch: boot
Loading “flash:c2950-c3h2s-mz.120-5.WC2.bin”…########################
#######################################################
################################################

File “flash:c2950-c3h2s-mz.120-5.WC2.bin” uncompressed and installed, entry point: 0x80010000
executing…

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 Internetwork Operating System Software
IOS ™ C2950 Software (C2950-C3H2S-M), Version 12.0(5)WC2, RELEASE SOFTWARE (fc1)
Copyright (c) 1986-2001 by cisco Systems, Inc.
Compiled Tue 23-Oct-01 12:26 by devgoyal
Image text-base: 0x80010000, data-base: 0x8031E000

Initializing flashfs…
flashfs[1]: 163 files, 3 directories
flashfs[1]: 0 orphaned files, 0 orphaned directories
flashfs[1]: Total bytes: 7741440
flashfs[1]: Bytes used: 2969088
flashfs[1]: Bytes available: 4772352
flashfs[1]: flashfs fsck took 6 seconds.
flashfs[1]: Initialization complete.
Done initializing flashfs.
C2950 POST: System Board Test : Passed
C2950 POST: Ethernet Controller Test : Passed
C2950 POST: MII TEST : Passed

cisco WS-C2950-24 (RC32300) processor (revision B0) with 22249K bytes of memory.
Processor board ID FAB0523Q25B
Last reset from system-reset

Processor is running Enterprise Edition Software
Cluster command switch capable
Cluster member switch capable
24 FastEthernet/IEEE 802.3 interface(s)

32K bytes of flash-simulated non-volatile configuration memory.
Base ethernet MAC Address: 00:06:2A:FB:9F:80
Motherboard assembly number: 73-5781-08
Motherboard serial number: FAB0523A2PW
Model revision number: B0
Model number: WS-C2950-24
System serial number: FAB0523Q25B
C2950 INIT: Complete

00:00:17: %SYS-5-RESTART: System restarted —
Cisco Internetwork Operating System Software
IOS ™ C2950 Software (C2950-C3H2S-M), Version 12.0(5)WC2, RELEASE SOFTWARE (fc1)
Copyright (c) 1986-2001 by cisco Systems, Inc.
Compiled Tue 23-Oct-01 12:26 by devgoyal

— System Configuration Dialog —

At any point you may enter a question mark ‘?’ for help.
Use ctrl-c to abort configuration dialog at any prompt.
Default settings are in square brackets ‘[]’.

Continue with configuration dialog? [yes/no]: no
Press RETURN to get started.

「startup-config」がない状態で起動するので、セットアップモードが起動しますが、「no」で抜けます。

5.設定ファイルを元の名前に戻します。

copy flash:config.old flash:config.text

Switch>enable
Switch#copy flash:config.old flash:config.text
Destination filename [config.text]?
C
1068 bytes copied in 0.40 secs

6.パスワード関係一式を新しいパスワードに変更します。

ここでは、コンソールパスワードと特権モードのパスワードを変更します。

Switch#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#enable password cisco
Switch(config)#enable secret cisco
The enable secret you have chosen is the same as your enable password.
This is not recommended. Re-enter the enable secret.

Switch(config)#line console 0
Switch(config-line)#password cisco
Switch(config-line)#login
Switch(config-line)#exit
Switch(config)#exit
Switch#

7.設定を保存します。

Switch#copy running-config startup-config

Switch#copy running-config startup-config
Destination filename [startup-config]?
Building configuration…
[OK]

8.再起動します。

Switch#reload

Switch#reload