Cisco IOS XE 設定の保存方法
IOS XE は hostname などの設定変更が running-config に即時反映されますが、running-config はあくまでメモリ上の設定であり、再起動すると失われます。
再起動後も設定を保持するには、running-config を startup-config にコピー(保存)する必要があります。
Cisco IOS XE 設定保存
copy running-config startup-config実行すると保存先ファイル名の確認プロンプトが表示されます。Enter を押すとデフォルトの startup-config に保存されます。
設定保存の実行例
設定保存 実行例
IOS-XE#copy running-config startup-config
Destination filename [startup-config]?
Building configuration...
[OK]
IOS-XE#write memory コマンドについて
write memory(略して wr)でも同様に startup-config への保存が可能です。copy running-config startup-config と同じ動作をする短縮コマンドとして提供されています。
write memory コマンド
write memorywrite memory 実行例
IOS-XE#write memory
Building configuration...
[OK]
IOS-XE#running-config と startup-config の確認方法
保存前後の設定は、それぞれ show running-config と show startup-config で個別に確認できます。
running-config / startup-config 確認コマンド
show running-config
show startup-configshow running-config は現在動作中のメモリ上の設定、show startup-config は保存済みの起動時設定を表示します。保存前は両者の内容が異なりますが、copy running-config startup-config(または write memory)を実行すると一致します。
running-config / startup-config 確認 実行例
IOS-XE#show running-config | include hostname
hostname IOS-XE
IOS-XE#
IOS-XE#show startup-config | include hostname
hostname Router
IOS-XE#copy running-config startup-config
Destination filename [startup-config]?
Building configuration...
[OK]
IOS-XE#
IOS-XE#show running-config | include hostname
hostname IOS-XE
IOS-XE#show startup-config | include hostname
hostname IOS-XE
IOS-XE#保存前は startup-config に古いホスト名(Router)が残っていますが、保存後は running-config と同じ IOS-XE に更新されていることがわかります。