LoginSignup
11
10

More than 5 years have passed since last update.

Cisco IOS/IOS-XE/NX-OSでコンフィグのDiffを取る

Last updated at Posted at 2017-06-12

きっかけ

ビルの全館停電対応で、ルータやスイッチの電源を切る前に running-config が保存されているか調べる必要が生じたことによります。構成管理しろという話ですね。

わざわざターミナルエミュレータでログ取ってローカルの diff にかけるのも面倒だと思って調べたら、ビルトインのコマンドで実行できることがわかりました。

動作確認した環境

  • Cisco ISR 2900 w/ IOS 15.0
  • Cisco ASR 1000 w/ IOS-XE 03.15 (IOS 15.5(2)S)
  • Cisco Nexus 7000 w/ NX-OS 6.2

多分 IOS 12.x 世代でも動きます。

実際

IOS/IOS-XE

基本形はこちら。

# show archive config differences <ORIGINAL> <MODIFIED>

今回は startup-configrunning-config を比較するのでこうします。この例では no ip domain lookup が追加されたことがわかります。

# show archive config differences nvram:startup-config system:running-config
!Contextual Config Diffs:
+no ip domain lookup

比較元・比較先には IOS/IOS-XE がファイルシステムとして認識できるものが設定できます。

# show archive config differences ?
  archive:  [file1 path]
  cns:      [file1 path]
  flash0:   [file1 path]
  flash1:   [file1 path]
  flash:    [file1 path]
  ftp:      [file1 path]
  http:     [file1 path]
  https:    [file1 path]
  null:     [file1 path]
  nvram:    [file1 path]
  rcp:      [file1 path]
  scp:      [file1 path]
  system:   [file1 path]
  tar:      [file1 path]
  tftp:     [file1 path]
  tmpsys:   [file1 path]
  xmodem:   [file1 path]
  ymodem:   [file1 path]
  |         Output modifiers
  <cr>

NX-OS

NX-OS ではもっと簡単です。

# show running-config diff
11
10
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
11
10