ヤフオクで落札した Cisco Catalyst スイッチにパスワードがかかったままだったので初期化した

Pocket

先日来から実機検証していて特定のプラットフォーム依存ぽい例を検証するために Catalyst 2950 をヤフオクで落札しました。
いつものようにコンソールケーブルつないでスイッチの起動してログイン、 en, sh ver あたり入力できたら評価しておわりと思っていたんですが、今回は勝手が違いました。

Switch>en
Password:
Password:
Password:
% Bad secrets

イネーブルシークレットが設定されている。。。。(しかもどっかのコンフィグが残ったままと思しきホスト名)
見なかったことにしてさっそくコンフィグの初期化に取り掛かります。
まずはモードボタンを押し続けると。

C2950 Boot Loader (C2950-HBOOT-M) Version 12.1(11r)EA1, RELEASE SOFTWARE (fc1)
Compiled Mon 22-Jul-02 17:18 by antonino
WS-C2950SX-24 starting...
Base ethernet MAC Address: 00:19:2f:fc:ac:c0
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: flash_init
Initializing Flash...
flashfs[0]: 4 files, 1 directories
flashfs[0]: 0 orphaned files, 0 orphaned directories
flashfs[0]: Total bytes: 7741440
flashfs[0]: Bytes used: 3140608
flashfs[0]: Bytes available: 4600832
flashfs[0]: flashfs fsck took 5 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    -rwx  3132298   <date>               c2950-i6q4l2-mz.121-22.EA13.bin
3    -rwx  77        <date>               private-config.text
5    -rwx  5002      <date>               config.text
6    -rwx  1048      <date>               multiple-fs

4600832 bytes available (3140608 bytes used)

Ciscoデバイスの管理 – Catalystスイッチ – パスワードリカバリー

switch: rename flash: config.text flash:config.text.old
Unknown cmd: rme
switch: rename flash: config.text flash
Unknown cmd: rename
switch: config
Unknown cmd: config
switch: rename flash: config.text flash: config.text.old
usage: rename <old_name> <new_name>
switch: rename flash:config.text flash:config.text.old

switch: boot
Loading "flash:/c2950-i6q4l2-mz.121-22.EA13.bin"...#############################
#########################################################

(snip)

POST: System Board Test : Passed
POST: Ethernet Controller Test : Passed
ASIC Initialization Passed

POST: FRONT-END LOOPBACK TEST : Passedcisco WS-C2950SX-24 (RC32300) processor (revision M0) with 20957K bytes of memory.
Processor board ID FOC1037Z1E9
Last reset from system-reset
Running Standard Image
24 FastEthernet/IEEE 802.3 interface(s)
2 Gigabit Ethernet/IEEE 802.3 interface(s)

32K bytes of flash-simulated non-volatile configuration memory.
Base ethernet MAC Address: 00:19:2F:FC:AC:C0
Motherboard assembly number: 73-8135-08
Power supply part number: 34-0965-01
Motherboard serial number: FOC10341U7G
Power supply serial number: DTH10274Z6H
Model revision number: M0
Motherboard revision number: A0
Model number: WS-C2950SX-24
System serial number: FOC1037Z1E9

         --- System Configuration Dialog ---

Would you like to enter the initial configuration dialog? [yes/no]:
00:00:13: %SPANTREE-5-EXTENDED_SYSID: Extended SysId enabled for type vlan
00:00:17: %SYS-5-RESTART: System restarted --
Cisco Internetwork Operating System Software
IOS (tm) C2950 Software (C2950-I6Q4L2-M), Version 12.1(22)EA13, RELEASE SOFTWARE (fc2)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2009 by cisco Systems, Inc.
Compiled Fri 27-Feb-09 22:20 by amvarma
00:00:17: %SNMP-5-COLDSTART: SNMP agent on host Switch is undergoing a cold start
% Please answer 'yes' or 'no'.
Would you like to enter the initial configuration dialog? [yes/no]: no



Press RETURN to get started!


00:00:40: %LINK-5-CHANGED: Interface Vlan1, changed state to administratively down

起動した・・・

Switch>en
Switch#rename flash:config.text.old flash:config.text
Destination filename [config.text]?
Switch#copy flash:config.text system:running-config
Destination filename [running-config]?
5002 bytes copied in 2.752 secs (1818 bytes/sec)
Switch#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#no enable secret

Switch(config)#^Z
Switch#
*Mar  1 00:11:41.065: %SYS-5-CONFIG_I: Configured from console by console
Switch(config)#no enable password

ブート時のメッセージを見てみる。

00:00:13: %SPANTREE-5-EXTENDED_SYSID: Extended SysId enabled for type vlan
*Mar  1 00:00:18.055: %SYS-5-CONFIG_I: Configured from memory by console
*Mar  1 00:00:18.244: %SYS-5-RESTART: System restarted --
Cisco Internetwork Operating System Software
IOS (tm) C2950 Software (C2950-I6Q4L2-M), Version 12.1(22)EA13, RELEASE SOFTWARE
 (fc2)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2009 by cisco Systems, Inc.
Compiled Fri 27-Feb-09 22:20 by amvarma
*Mar  1 00:00:18.244: %SNMP-5-COLDSTART: SNMP agent on host Switch is undergoin
g a cold start Switch Switch Configuration Script V.4.0.0 / Switch_SX-TC-24.cfg
Switch>

Catalystスイッチ – boot system flashコマンド

Switch#show boot
BOOT path-list:
Config file:          flash:/config.text
Private Config file:  flash:/private-config.text
Enable Break:         no
Manual Boot:          no
HELPER path-list:
NVRAM/Config file
      buffer size:    32768
Timeout for Config
          Download:    0 seconds
Config Download
       via DHCP:       disabled (next boot: disabled)

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

今回は設定ファイルは消して工場出荷時に戻したかったので

erase startup-config
reload

です。

[confirm]
[OK]
Erase of nvram: complete
Switch#reloa
*Mar  1 00:01:41.537: %SYS-7-NV_BLOCK_INIT: Initalized the geometry of nvramd
Proceed with reload? [confirm]

*Mar  1 00:01:50.221: %SYS-5-RELOAD: Reload requested by console. Reload Reason: Reload Command.

本当にありがとうございました。

Sponsored Link

Leave a Reply

Your email address will not be published. Required fields are marked *