Cisco IOS でコンフィグを世代管理する

従来からある Cisco IOS でもコンフィグを世代管理することは可能です。 コンフィグの世代管理を行う場合、コンフィグ保存専用のディレクトリを作成した方が管理が簡単なので、予めディレクトリを作成しておきます。

Switch# mkdir archive
Create directory filename [archive]?
Created dir flash:archive

後は世代管理を行う為の設定を行います。

archive
!
path flash:/archive/
maximum 10
write-memory

設定は各々、以下の意味を持ちます。

項目 意味
path flash:/archive/ 世代管理されたコンフィグを保存するディレクトリを指定
maximum 10 管理する世代数を指定
write-memory コンフィグを保存する度に、自動的に指定したディレクトリへコンフィグをバックアップする

コンフィグの差分 (Diff) を取得するには以下のコマンドを実行します。 下記では startup-configrunning-config の差分を取得します。

show archive config differences

下記のようにパスを指定すれば、特定のコンフィグ同士を比較することも可能です。

show archive config differences [A] [B]

保存済みのコンフィグへ戻したい場合は以下のコマンドを実行します。

config replace flash:/config1.txt

実行例は以下の通りです。

Switch# config replace flash:/config1.txt
This will apply all necessary additions and deletions
to replace the current running configuration with the
contents of the specified configuration file, which is
assumed to be a complete configuration, not a partial
configuration. Enter Y if you are sure you want to proceed. ? [no]: Y

Oct  9 23:38:11: Rollback:Acquired Configuration lock.
Total number of passes: 0
Rollback Done

コメント

タイトルとURLをコピーしました