LoginSignup
20
3

【チートシート】シスコ製ネットワーク機器の初期化方法まとめ - IOS XE 編

Last updated at Posted at 2023-12-17

:christmas_tree: はじめに

この記事はシスコの有志による Cisco Systems Japan Advent Calendar 2023 の 18 日目として投稿しています。

📅 これまでのカレンダーの一覧(クリックして開きます)

:dart: この記事の対象者

  • write erase で消えない 設定値のために検証が詰んだひと (CCIE ラボ勉強中の自分)
  • 訳の分からない振る舞い を前にして 初期化に一縷の望みをかける ひと (CCIE ラボ勉強中の自分)
  • コンフィグはあってるはずなのに思い通りに動かなくて 全てを吹き飛ばしたい ひと (CCIE ラボ本番中の自分)
  • 出処不明の機材を使い始めるひと (eBay,ヤフオクで検証機材を落札した自分)
  • 誰かに機材を譲るひと (手数料キャンペーン中にヤフオクへ不用品を出品する自分)

完全に俺得な記事になってしまった...

:gift: この記事はなに?

Cisco IOS XE というネットワーク OS が動作している様々なネットワーク機器の初期化方法を整理しました。

というのも、一般的に write erasevlan.dat を消す ことが知られていますが、実はそれだけでは一部の設定が残ったりするんですね。

ヤフオクで買った機材で show run とか dir とかして 🫣🤭😱😇 するのも楽しいですが この記事がエンジニア各位のお役に立てますことを祈っています。

おねがい
執筆者は記事公開日 (2023/12/18) 前日に出来る限りの努力と熱量をもって、この記事を書きました。しかし、この記事は網羅性に乏しく、間違いが含まれているかもしれません。
もし、この記事に追記したい情報があれば、どうか 編集リクエスト を送ってください。

:boom: 初期化方法

この記事で扱う初期化方法
この記事では「ネットワーク OS 上でコマンドを実行して初期化する」方法に注目します。
これ以外にも「ハードウェアボタン」や「bootloader 上のコマンド」などの方法がありますが、この記事では扱いません。
なぜなら、macOS 環境に住まう私は 10 年以上のキャリアを経ても「キーボードを全力でガチャガチャしたら、偶に ROMMON に落ちる、こともある」くらいの認識しかないからです。

ルータ (Cisco IOS XE - Autonomous Mode)

ベストプラクティス

Router#factory-reset all
The factory reset operation is irreversible for all operations. Are you sure? [confirm]

再起動して ROMMON (bootloader) のプロンプトで止まったら、boot コマンドを入力します。

rommon 1 > boot bootflash:packages.conf

IOS XE が起動したら ROMMON に関する最低限の設定を入力することを忘れないでください。

Router#conf t
Router(config)#boot system flash bootflash:packages.conf
Router(config)#config-register 0x2102
Router(config)#end
Router#wr

write erase はよく知られた伝統的な IOS コマンドです。確かに startup-config(起動時に読み込まれるコンフィグ)を削除してくれますが、それだけです。例えばユーザが作成したファイル bootflash:hoge.log は削除されません :no_good:

factory-reset は IOS XE 16.6.1 (リリース日: 2017/07/31) からルータに導入された 初期化のためのコマンド です。このコマンドを使うことで、ROMMON のパラメータや bootflash 上のファイルなど、隈なく全てを削除できます。つまり、ユーザが作成したファイル bootflash:hoge.log も削除されます :ok_woman:

factory-reset all を実行して初期化後、機器は自動的に再起動します。しかし ROMMON (bootloader) で止まってしまうため、IOS XE は自動的に起動しません。IOS XE を起動するためにはコンソール経由で boot を入力してください。

Current image running: Boot ROM1

Last reset cause: LocalSoft
C1111-8P platform with 4194304 Kbytes of main memory

rommon 1 > boot bootflash:packages.conf

factory-reset all は ROMMON (bootloader) の変数も全て初期化します。そのため、起動するイメージの設定が無くなったり、コンフィグレーション レジスタが 0x8000 になったりしていることに注意してください。これが、先ほどのように電源投入時に IOS XE イメージを自動的に起動されず、ROMMON のプロンプトで止まってしまう理由です。

以下は ROMMON に関する一般的な設定例と、その確認方法です。

Router#conf t
Router(config)#boot system flash bootflash:packages.conf
Router(config)#config-register 0x2102
Router(config)#end
Router#wr
Building configuration...
[OK]
Router#show boot
BOOT variable = bootflash:packages.conf,1;
CONFIG_FILE variable does not exist
BOOTLDR variable does not exist
Configuration register is 0x8000 (will be 0x2102 at next reload)

Standby not ready to show bootvar

なお、よりセキュアな初期化のために削除回数や対象を拡張した factory-reset all secure {3-pass | 7-pass} コマンドもあります。必要に応じてオプションを選択してください。詳しくはドキュメントを参照してください。

実行例

C1111-4PLTELA (17.09.04a) のログ(クリックして開きます)
項目 結果
所要時間 :rocket: 数分
startup config 削除される
ユーザが作成したファイル 削除される
IOS XE イメージ 削除されない
コンフィグレーションレジスタ 0x8000
ブートイメージ 未定義になる
Router#factory-reset all
The factory reset operation is irreversible for all operations. Are you sure? [confirm]

This operation may take 20 minutes or more. Please do not power cycle.

in the reset_all_loop 2 3 6 7-10
/bootflash failed to mount
Dec 17 08:38:48.702: Factory reset operation completed.

Both copies of Nvram are corrupted.

Warning: monitor Nvram area is corrupt ... using default values
Confreg is corrupted, using default 8000
Key Sectors:(Primary, GOOD), (Backup, GOOD), (Revocation, GOOD)
Size of Primary = 1664 Backup = 1664 Revocation = 348
RSA Self Test Passed

Expected hash:
DDAF35A193617ABACC417349AE204131
12E6FA4E89A97EA20A9EEEE64B55D39A
2192992A274FC1A836BA3C23A3FEEBBD
454D4423643CE80E2A9AC94FA54CA49F

Obtained hash:
DDAF35A193617ABACC417349AE204131
12E6FA4E89A97EA20A9EEEE64B55D39A
2192992A274FC1A836BA3C23A3FEEBBD
454D4423643CE80E2A9AC94FA54CA49F
Sha512 Self Test Passed
Rom image verified correctly


System Bootstrap, Version 17.5(1r), RELEASE SOFTWARE
Copyright (c) 1994-2021  by cisco Systems, Inc.


Current image running: Boot ROM0

Last reset cause: LocalSoft
C1111-4PLTELA platform with 4194304 Kbytes of main memory

rommon 1 > boot bootflash:packages.conf
Located packages.conf
#

Performing Integrity Check ...
ISR4221/K9 (17.09.04a) のログ(クリックして開きます)
項目 結果
所要時間 :rocket: 数分
startup config 削除される
ユーザが作成したファイル 削除される
IOS XE イメージ 削除されない
コンフィグレーションレジスタ 0x8000
ブートイメージ 未定義になる
Router#factory-reset all
The factory reset operation is irreversible for all operations. Are you sure? [confirm]

This operation may take 20 minutes or more. Please do not power cycle.

Dec 17 10:48:09.334: %PMAN-5-EXITACTION: R0/0: pvp: Process manager is exiting: process exit with reload chassis code


in the reset_all_loop 2 3 6 7-10
/bootflash failed to mount
Dec 17 10:49:21.076: Factory reset operation completed.

Initializing Hardware ...

Checking for PCIe device presence...done

Both copies of Nvram are corrupted.

Warning: monitor Nvram area is corrupt ... using default values
Confreg is corrupted, using default 8000
System integrity status: 0x300600
	Upgrade Boot CPLD corrupt
Key Sectors:(Primary, GOOD), (Backup, GOOD), (Revocation, GOOD)
Size of Primary = 2288 Backup = 2288 Revocation = 288
RSA Self Test Passed

Expected hash:
DDAF35A193617ABACC417349AE204131
12E6FA4E89A97EA20A9EEEE64B55D39A
2192992A274FC1A836BA3C23A3FEEBBD
454D4423643CE80E2A9AC94FA54CA49F

Obtained hash:
DDAF35A193617ABACC417349AE204131
12E6FA4E89A97EA20A9EEEE64B55D39A
2192992A274FC1A836BA3C23A3FEEBBD
454D4423643CE80E2A9AC94FA54CA49F
Sha512 Self Test Passed
Rom image verified correctly


System Bootstrap, Version 16.12(2r), RELEASE SOFTWARE
Copyright (c) 1994-2019  by cisco Systems, Inc.


Current image running: Boot ROM0

Last reset cause: LocalSoft
ISR4221/K9 platform with 4194304 Kbytes of main memory

rommon 1 > boot bootflash:packages.conf
Located packages.conf
#
C8200-1N-4T (17.09.04a) のログ(クリックして開きます)
項目 結果
所要時間 :rocket: 数分
startup config 削除される
ユーザが作成したファイル 削除される
IOS XE イメージ 削除されない
コンフィグレーションレジスタ 0x8000
ブートイメージ 未定義になる
Router#factory-reset all
The factory reset operation is irreversible for all operations. Are you sure? [confirm]

This operation may take 20 minutes or more. Please do not power cycle.


*Dec 17 14:20:10.597: %SYS-5-RELOAD: Reload requested by Exec. Reload Reason: Factory Reset.
Dec 17 14:20:16.550: %PMAN-5-EXITACTION: R0/0: pvp: Process manager is exiting: process exit with reload chassis code


Dec 17 14:20:21.216: Factory reset secure operation. Please do not power cycle.
in the reset_all_loop 2 3 6 7-10
/bootflash failed to mount
Dec 17 14:20:35.896: Factory reset operation completed.

Initializing Hardware ...
U
Checking for PCIe device presence...done

Both copies of Nvram are corrupted.

Warning: monitor Nvram area is corrupt ... using default values
Confreg is corrupted, using default 8000
System integrity status: 0x610



Key Sectors:(Primary, GOOD), (Backup, GOOD), (Revocation, GOOD)
Size of Primary = 1417 Backup = 1417 Revocation = 1008
RSA Self Test Passed

Expected hash:
DDAF35A193617ABACC417349AE204131
12E6FA4E89A97EA20A9EEEE64B55D39A
2192992A274FC1A836BA3C23A3FEEBBD
454D4423643CE80E2A9AC94FA54CA49F

Obtained hash:
DDAF35A193617ABACC417349AE204131
12E6FA4E89A97EA20A9EEEE64B55D39A
2192992A274FC1A836BA3C23A3FEEBBD
454D4423643CE80E2A9AC94FA54CA49F
Sha512 Self Test Passed
Rom image verified correctly


System Bootstrap, Version 17.6(6r), RELEASE SOFTWARE
Copyright (c) 1994-2022 by cisco Systems, Inc.


Current image running   : Boot ROM0

Last reset cause        : LocalSoft
C8200-1N-4T platform with 8388608 Kbytes of main memory

rommon 1 > boot bootflash:packages.conf
boot: reading file packages.conf
#
boot: validating package signature (SHA-1 hash):
 expected   : 4047ED64:C2039888:B9990551:3C0B7E10:7B437A9F
 calculated : 4047ED64:C2039888:B9990551:3C0B7E10:7B437A9F
boot: parsed image from conf file: c8000be-rpboot.17.09.04a.SPA.pkg
################################

ルータ (Cisco IOS XE - Controller Mode / XE SD-WAN)

アンチパターン

Router#write erase
This command is not supported in Controller mode.

ベストプラクティス

  1. Cisco IOS XE Autonomous Mode へ切り替えて初期化する
  2. コンフィグ 及び 利用していないソフトウェアイメージだけが削除されることに留意の上、コマンドを実行する
Router#pnpa service discovery stop
Router#request platform software sdwan software reset

「シスコのルータ、なのに write erase をサポートしていないと言う」 完全にパニックですね?わたしも絶望しました。このとき、ルータは SD-WAN 用のソフトウェア (Cisco IOS XE Controller Mode もしくは XE SD-WAN) が動作しているはずです。

一般的な IOS XE に切り替えるためには 2 つのドキュメントを参照してください:

スイッチ (Cisco IOS XE)

アンチパターン

Switch#write erase
Switch#delete vlan.dat

ベストプラクティス
IOS XE イメージファイルが保存された TFTP サーバもしくは USB メモリを準備した上でコマンドを実行

Switch#factory-reset switch all all
The factory reset operation is irreversible for all operations. Are you sure? [confirm]
 The following will be deleted as a part of factory reset:
 1: Crash info and logs
 2: User data, startup and running configuration
 3: All IOS images, including the current boot image
 4: User added rommon variables
 5: OBFL logs
 6: Data on Field Replaceable Units(USB/SSD/SATA)
 The system will reload to perform factory reset.
 It will take some time to complete and bring it to rommon.
 You will need to load IOS image using USB/TFTP from rommon after
 this operation is completed.
 DO NOT UNPLUG THE POWER OR INTERRUPT THE OPERATION
 Are you sure you want to continue? [confirm]

ここでもルータと同じく factory-reset を使いますが、ルータとスイッチでは振る舞いが違うことに注意してください

:warning: スイッチの場合は IOS XE が再起動不能になります。しかし、これは期待される動作です

スイッチで factory-reset all を実行すると、実行中の IOS XE イメージを含むあらゆるファイルが削除されます。そのため、当然 IOS XE が起動しません。スイッチは ROMMON (bootloader) で止まってしまい、スイッチ単体では IOS XE を起動する術はありません。この振る舞いは実行時の警告文にも記されています。

なお、ルータで factory-reset all を実行したときには、実行中の IOS XE イメージに限ってバックアップが作成されるため、このような事象は起こりません。

👀 `factory-reset all` を実行して再起不能になってしまったスイッチのログ(クリックして開きます)
Initializing Hardware...
NOTICE: Please reset the device for the new MAC_ADDR value to take effect.

System Bootstrap, Version 17.9.1r [FC11], RELEASE SOFTWARE (P)
Compiled Thu 01/05/2023 16:43:42 by rel

Current ROMMON image : Primary
C9200-24P platform with 4194304 Kbytes of main memory

WARNING: Bootable URL's in BOOT variable not found or exhausted.
         Please check the ROMMON configuration or boot command usage.
switch: dir flash:

Attributes        Size         Name
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
drwxr-xr-x        4096   .prst_sync
-rw-r--r--        4020   lateshutdown.log
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

そのため、実務では以下 2 つの選択に迫られます。

  1. (推奨) factory-reset all を使った後に IOS XE イメージを新しく導入する
    • 例: スイッチに接続した USB メモリへ IOS XE イメージをコピーしておき、初期化後、ROMMON で USB メモリから直接 IOS XE を起動する
    • 参照: IOS/IOS-XE: ROMMON からの復旧方法
  2. 対象が限定的であることに留意しながら初期化する
    • スタートアップコンフィグを初期化する factory-reset config
    • ブート変数を初期化を初期化する factory-reset boot-vars
    • Plug and Play を行える状態に初期化する pnp service reset

実行例

C9200L-48P-4X (17.09.04a) / `factory-reset all` のログ(クリックして開きます)
項目 結果
所要時間 :rocket: 数分
startup config 削除される
ユーザが作成したファイル 削除される
IOS XE イメージ 削除される
コンフィグレーションレジスタ N/A 1
ブートイメージ 未定義になる
Switch#factory-reset switch all all
The factory reset operation is irreversible for all operations. Are you sure? [confirm]
 The following will be deleted as a part of factory reset:
 1: Crash info and logs
 2: User data, startup and running configuration
 3: All IOS images, including the current boot image
 4: User added rommon variables
 5: OBFL logs
 6: Data on Field Replaceable Units(USB/SSD/SATA)
 The system will reload to perform factory reset.
 It will take some time to complete and bring it to rommon.
 You will need to load IOS image using USB/TFTP from rommon after
 this operation is completed.
 DO NOT UNPLUG THE POWER OR INTERRUPT THE OPERATION
 Are you sure you want to continue? [confirm]
 Protection key not found
Switch#
Chassis 1 reloading, reason - Factory Reset
Dec 17 09:39:28.063: %PMAN-5-EXITACTION: C0/0: pvp: Process manager is exiting: reload cc action requested
Dec 17 09:39:29.095: %PMAN-5-EXITACTION: F0/0: pvp: Process manager is exiting: reload fp action requested
Dec 17 09:39:31.431: %PMAN-5-EXITACTION: R0/0: pvp: Process manager is exiting: rp processes exit with reload switch code


Enabling factory reset for this reload cycle
 Switch booted with flash:packages.conf
 Switch booted via packages.conf
% FACTORYRESET - Started Cleaning Up...

% FACTORYRESET - Unmounting sd1
% FACTORYRESET - Cleaning Up sd1 [0]
% FACTORYRESET - erase In progress.. please wait for completion...
% FACTORYRESET - write zero...
% FACTORYRESET - finish erase

% FACTORYRESET - Making File System sd1 [0]
mke2fs 1.43-WIP (18-May-2015)
Discarding device blocks: done
Creating filesystem with 204800 4k blocks and 51296 inodes
Filesystem UUID: 9542ff2c-051b-48ed-b1ad-0f3cc5b0354c
Superblock backups stored on blocks:
	32768, 98304, 163840

Allocating group tables: done
Writing inode tables: done
Writing superblocks and filesystem accounting information: done
% FACTORYRESET - Mounting Back sd1 [0]
% FACTORYRESET - Factory Reset Done for sd1

% FACTORYRESET - Unmounting sd3
% FACTORYRESET - Cleaning Up sd3 [0]
% FACTORYRESET - erase In progress.. please wait for completion...
% FACTORYRESET - write zero...
% FACTORYRESET - finish erase

% FACTORYRESET - Making File System sd3 [0]
mke2fs 1.43-WIP (18-May-2015)
Discarding device blocks: done
Creating filesystem with 485376 4k blocks and 121440 inodes
Filesystem UUID: b1f377a4-1219-428c-a5ed-989b9f99c863
Superblock backups stored on blocks:
	32768, 98304, 163840, 229376, 294912

Allocating group tables: done
Writing inode tables: done
Writing superblocks and filesystem accounting information: done
% FACTORYRESET - Mounting Back sd3 [0]
% FACTORYRESET - Factory Reset Done for sd3

% FACTORYRESET - Unmounting sd6
% FACTORYRESET - Cleaning Up sd6 [0]
% FACTORYRESET - erase In progress.. please wait for completion...
% FACTORYRESET - write zero...
% FACTORYRESET - finish erase

% FACTORYRESET - Making File System sd6 [0]
mke2fs 1.43-WIP (18-May-2015)
Discarding device blocks: done
Creating filesystem with 131072 1k blocks and 32768 inodes
Filesystem UUID: 0b320ab9-d999-4574-846c-17c32ef56969
Superblock backups stored on blocks:
	8193, 24577, 40961, 57345, 73729

Allocating group tables: done
Writing inode tables: done
Writing superblocks and filesystem accounting information: done
% FACTORYRESET - Mounting Back sd6 [0]
% FACTORYRESET - Factory Reset Done for sd6
% FACTORYRESET - Lic Clean UP
% FACTORYRESET - Lic Clean Successful...
% FACTORYRESET - Clean Up Successful...
% FACTORYRESET - Check for usbflash/sdflash devices...
ReloadReason=Factory Reset
Factory reset successful. Rebooting...

Initializing Hardware...
NOTICE: Please reset the device for the new MAC_ADDR value to take effect.

System Bootstrap, Version 17.9.1r [FC13], RELEASE SOFTWARE (P)
Compiled Thu 06/08/2023 20:25:39 by rel

Current ROMMON image : Primary
C9200L-48P-4X platform with 2097152 Kbytes of main memory

WARNING: Bootable URL's in BOOT variable not found or exhausted.
         Please check the ROMMON configuration or boot command usage.
switch: dir flash:

Attributes        Size         Name
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
drwxr-xr-x        4096   .prst_sync
-rw-r--r--        3983   lateshutdown.log
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

完全に中身が空っぽになったので、TFTP でブートしました...😭

C9200L-48P-4X (17.09.04a) / `factory-reset boot-vars`, `factory-reset config` のログ(クリックして開きます)
項目 結果
所要時間 :rocket: 数分
startup config 削除される
ユーザが作成したファイル 削除されない
IOS XE イメージ 削除されない
コンフィグレーションレジスタ N/A 1
ブートイメージ 未定義になる
Switch#factory-reset switch all boot-vars
The factory reset operation is irreversible for erasing user added boot variables. Are you sure? [confirm]
Please reload the switch(s) to check boot variables in rommon
*Dec 17 09:30:15.371: NGWC_FACTORYRESET: Switch 1, cmd: reset bootvar success
Switch#factory-reset switch all config
The factory reset operation is irreversible for erasing configuration. Are you sure? [confirm]
 As part of this operation Config and FIPS Key (if detected) will be removed.
 Make sure to configure it back to enable FIPS mode.
 Are you sure you want to continue? [confirm]
*Dec 17 09:30:28.590: NGWC_FACTORYRESET: Switch 1, cmd: clear config success
*Dec 17 09:30:28.826: %SYS-7-NV_BLOCK_INIT: Initialized the geometry of nvram
Switch#reload
WARNING:
Boot variable either does not exist or buffer is too small
This may impact autoboot of the router. Proceed with caution
Do you wish to proceed with reload anyway[confirm]
Reload command is being issued on Active unit, this will reload the whole stack
Proceed with reload? [confirm]

*Dec 17 09:30:35.734: %IOSXE_RP_CFG_NOT-3-BOOT_VAR_NOT_SET: Either the boot variable does not exist or the buffer is too small.Keep it blank.
*Dec 17 09:30:37.341: %SYS-5-RELOAD: Reload requested by console. Reload Reason: Reload Command.
Chassis 1 reloading, reason - Reload command
Dec 17 09:30:43.953: %PMAN-5-EXITACTION: C0/0: pvp: Process manager is exiting: reload cc action requested
Dec 17 09:30:44.994: %PMAN-5-EXITACTION: F0/0: pvp: Process manager is exiting: reload fp action requested
Dec 17 09:30:47.175: %PMAN-5-EXITACTION: R0/0: pvp: Process manager is exiting: process exit with reload stack code



Initializing Hardware...
NOTICE: Please reset the device for the new MAC_ADDR value to take effect.

System Bootstrap, Version 17.9.1r [FC13], RELEASE SOFTWARE (P)
Compiled Thu 06/08/2023 20:25:39 by rel

Current ROMMON image : Primary
C9200L-48P-4X platform with 2097152 Kbytes of main memory

WARNING: Bootable URL's in BOOT variable not found or exhausted.
         Please check the ROMMON configuration or boot command usage.
switch: boot flash:packages.conf
boot: attempting to boot from [flash:packages.conf]
boot: reading file packages.conf

##############

無線 LAN コントローラ (Cisco Catalyst 9800 シリーズ ワイヤレス コントローラ)

ベストプラクティス

WLC#factory-reset all
The factory reset operation is irreversible for all operations. Are you sure? [confirm]
 The following will be deleted as a part of factory reset:
 1: All writable file systems and personal data
 2: OBFL logs
 3: Licenses
 4: Userdata and Startup config
 5: Rommon variables
 6: User Credentials
 The system will reload to perform factory reset.
 This operation can take anywhere between 30 minutes to 3 hours
 DO NOT UNPLUG THE POWER OR INTERRUPT THE OPERATION
 Are you sure you want to continue? [confirm]
 Factory reset will take a backup of the boot image if the system is currently booted from an image stored locally. If the current boot image is a remote image or stored on a usb/nim-ssd, please take a backup of the image before executing this command.
 Are you sure you want to continue? [confirm]

では無線 LAN コントローラで実行するfactory-reset はどう振る舞うのでしょうか?

答えは 「ルータともスイッチとも違う」 です :crying_cat_face:

factory-reset all を実行すると(ルータと同じように)実行中の IOS XE イメージがバックアップされます。そのため、スイッチのように IOS XE イメージを準備する必要はありません。

しかしルータと違うのは、ROMMON (bootloader) の変数を全て初期化しているものの コンフィグレーション レジスタは維持されている 点です。そのため、factory-reset all を実行して初期化後、機器は自動的に再起動しますが、ROMMON では止まらずに自動的に IOS XE のイメージが選択されて起動します。

以上を踏まえると、一番初期化しやすいプラットフォームと言えるかもしれません。

ただし、なぜか所要時間が非常に長い ことには注意が必要です。実機で何度も確認しましたが、数分程度で完了するルータやスイッチと異なり、無線 LAN コントローラでは常に 30 分程度必要になりました。

実行例

C9800-L-C-K9 (17.09.04a) のログ(クリックして開きます)
項目 結果
所要時間 :timer: 30 分以上
startup config 削除される
ユーザが作成したファイル 削除される
IOS XE イメージ 削除されない
コンフィグレーションレジスタ 維持される (0x2102)
ブートイメージ 未定義になる
WLC#factory-reset all
The factory reset operation is irreversible for all operations. Are you sure? [confirm]
 The following will be deleted as a part of factory reset:
 1: All writable file systems and personal data
 2: OBFL logs
 3: Licenses
 4: Userdata and Startup config
 5: Rommon variables
 6: User Credentials
 The system will reload to perform factory reset.
 This operation can take anywhere between 30 minutes to 3 hours
 DO NOT UNPLUG THE POWER OR INTERRUPT THE OPERATION
 Are you sure you want to continue? [confirm]
 Factory reset will take a backup of the boot image if the system is currently booted from an image stored locally. If the current boot image is a remote image or stored on a usb/nim-ssd, please take a backup of the image before executing this command.
 Are you sure you want to continue? [confirm]

Chassis 1 reloading, reason - Reload command
Jan  6 05:34:25.556: %PMAN-5-EXITACTION: C0/0: pvp: Process manager is exiting:
Jan  6 05:34:26.049: %PMAN-5-EXITACTION: F0/0: pvp: Process manager is exiting:
Jan  6 05:34:27.098: %PMAN-5-EXITACTION: R0/0: pvp: Process manager is exiting: process exit with reload chassis code


Enabling factory reset for this reload cycle

*Jan 06 05:34:30.194: %IOSXEBOOT-4-FACTORY_RESET: (rp/0): Taking a backup of bootflash:packages.conf. It will be restored to bootflash: after factory reset is complete

*Jan 06 05:34:33.173: %IOSXEBOOT-4-FACTORY_RESET: (rp/0): Erasing file system

*Jan 06 05:34:35.927: %IOSXEBOOT-4-FACTORY_RESET: (rp/0): Erasing file system

*Jan 06 05:34:38.901: %IOSXEBOOT-4-FACTORY_RESET: (rp/0): Erasing file system
 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

*Jan 06 05:46:50.870: %IOSXEBOOT-4-FACTORY_RESET: (rp/0): Erasing file system
 .

*Jan 06 05:46:53.027: %IOSXEBOOT-4-FACTORY_RESET: (rp/0): Erasing file system
 .

*Jan 06 05:46:55.143: %IOSXEBOOT-4-FACTORY_RESET: (rp/0): Erasing file system
 .

*Jan 06 05:46:57.259: %IOSXEBOOT-4-FACTORY_RESET: (rp/0): Erasing file system
 .

*Jan 06 05:46:59.370: %IOSXEBOOT-4-FACTORY_RESET: (rp/0): Erasing file system
 . . . . . . . . . . . . . . . . . . . . . . .

*Jan 06 05:47:45.576: %IOSXEBOOT-4-FACTORY_RESET: (rp/0): Erasing file system
 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

*Jan 06 06:00:28.108: %IOSXEBOOT-4-FACTORY_RESET: (rp/0): Factory reset successfull. Continuing with reboot...


Initializing Hardware ...

System Bootstrap, Version 16.12(3r), RELEASE SOFTWARE
Copyright (c) 1994-2019  by cisco Systems, Inc.

Current image running: Boot ROM1
Last reset cause: LocalSoft

The values of MSR  0x198h = 00001400 and MSR 0x199h = 00001400 for KATAR
C9800-L-X-K9 platform with 16777216 Kbytes of main memory

no valid BOOT image found
Final autoboot attempt from default boot device...
File size is 0x4e36e418
Located C9800-L-mono-universalk9_wlc.17.09.04a.SPA.pkg
Image size 1312220184 inode num 12, bks cnt 320367 blk size 8*512
#####################################
WLC#show ver | i Last reload reason|Configuration register
Last reload reason: factory-reset
Configuration register is 0x2102

WLC#show boot
BOOT variable does not exist
CONFIG_FILE variable does not exist
BOOTLDR variable does not exist
Configuration register is 0x2102

Standby not ready to show bootvar

:bookmark: まとめ

「初期化方法をまとめます」を主題に掲げましたが、実際のところ、この記事で紹介したかったのは 基本的な機能で、全く同じコマンドなのに、プラットフォームごとに全く振る舞いが違うこともあるよ! ということでした。

そのため、factory-reset all コマンドを例にとって、プラットフォームごとの振る舞いを実機で検証して整理しました。

世界中のラボから大量の実機を用意し、わざわざ最新の Suggested Release バージョンの IOS XE にアップデートして、にも関わらず factory-reset all で全てを吹き飛ばす作業を何度も繰り返して得られた結果を簡単にまとめると以下のとおりです:

factory-reset all の結果 ルータ スイッチ 無線 LAN コントローラ
所要時間 5 分以内 5 分以内 40 分程度
コンフィグレーションレジスタ 0x8000 N/A1 0x2102
IOS XE イメージも削除されるか? 削除されない 削除される 削除されない
初期化後 IOS XE は起動するか? 自動起動しない 起動できない 自動起動する

どうしてこんなことになっちゃったんでしょうね :santa:

このところシスコはスイッチに留まらず、ルータや無線 LAN 製品も Cisco Catalyst シリーズのブランドに統一しています。

そして Cisco IOS XE が様々なプラットフォームで共通するネットワーク OS として実行されています。

プラットフォーム間のコマンド体系が共通化されることで、エンジニアの学習コストが下がることに期待できますが、まだまだ マニアックな 面白いところはたくさんありそうですね!

:wave: 最後に

わたしが所属しているチームでは、この記事のように シスコ製品のベストプラクティスを整理して日々お客様に提供しています。

役立つ情報を Youtube チャンネルに公開していますので、ぜひご覧ください!

わたしはいま 「サーバールームの音」プレイリスト が公開されていることに気づいて、たいへんクレイジーなチャンネルだな(褒め言葉)と認識を新たにしました。

:bow: 免責事項

本サイトおよび対応するコメントにおいて表明される意見は、投稿者本人の個人的意見であり、私の所属する組織の意見ではありません。本サイトの内容は、情報の提供のみを目的として掲載されており、私の所属する組織や他の関係者による推奨や表明を目的としたものではありません。各利用者は、本Webサイトへの掲載により、投稿、リンクその他の方法でアップロードした全ての情報の内容に対して全責任を負い、本Webサイトの利用に関するあらゆる責任から私の所属する組織を免責することに同意したものとします。

  1. Cisco Catalyst 9000 シリーズスイッチではコンフィグレーションレジスタの取り扱いが従来と異なります。ミスリードを誘う恐れがあるため評価しません。 2 3

20
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
20
3