1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

ネットワーク実機学習記録4.設定の保存と初期化

Posted at

概要

練習3、4.png
前回のRAMに保持された設定をNVRAMに保存する。
その後初期化を行い設定が消えたことを確認する。

設定操作ログ

Switch#copy running-config startup-config
Destination filename [startup-config]? 
Building configuration...
[OK]
Switch#
Switch#
Switch#show startup-config 
Using 1169 out of 32768 bytes
!
version 12.1
no service pad
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname Switch
!
!
ip subnet-zero
!
!
spanning-tree mode pvst
no spanning-tree optimize bpdu transmission
spanning-tree extend system-id
!
!
!
!
interface FastEthernet0/1
!
interface FastEthernet0/2
!
interface FastEthernet0/3
!
interface FastEthernet0/4
!
interface FastEthernet0/5
!
interface FastEthernet0/6
!
interface FastEthernet0/7
!
interface FastEthernet0/8
!
interface FastEthernet0/9
!
interface FastEthernet0/10
!
interface FastEthernet0/11
!
interface FastEthernet0/12
!
interface FastEthernet0/13
!
interface FastEthernet0/14
!
interface FastEthernet0/15
!
interface FastEthernet0/16
!
interface FastEthernet0/17
!
interface FastEthernet0/18
!
interface FastEthernet0/19
!
interface FastEthernet0/20
!
interface FastEthernet0/21
!
interface FastEthernet0/22
!
interface FastEthernet0/23
!
interface FastEthernet0/24
!
interface GigabitEthernet0/1
!
interface GigabitEthernet0/2
!
interface Vlan1
 ip address 10.0.0.1 255.0.0.0
 no ip route-cache
!
ip http server
!
line con 0
line vty 5 15
!
!
end

Switch#
Switch#
Switch#erase startup-config 
Erasing the nvram filesystem will remove all configuration files! Continue? [confirm]
[OK]
Erase of nvram: complete
Switch#
00:08:57: %SYS-7-NV_BLOCK_INIT: Initalized the geometry of nvram
Switch#
Switch#
Switch#reload
Proceed with reload? [confirm]

00:09:16: %SYS-5-RELOAD: Reload requested by console. Reload Reason: Reload Command.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Press RETURN to get started!
Switch>
Switch>en
Switch#
Switch#
Switch#show startup-config
startup-config is not present
Switch#
Switch#
Switch#exi

設定の保存

Switch#copy running-config startup-config
Destination filename [startup-config]? 
Building configuration...
[OK]
Switch#
Switch#
Switch#show startup-config
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
interface Vlan1
 ip address 10.0.0.1 255.0.0.0
 no ip route-cache
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!
end

copy runnig-config startup-configコマンド後Destination filename [startup-config]? でstartup-configへの保存かどうかの確認が出るのでエンターを押すと、running-configで設定した内容がstartup-configに保存されます。
show startup-configでstartup-configのデータを確認すると、前回設定したvlan1のipアドレスが保存されていることが確認できます。

補足:ルーター、スイッチが動作中に設定されたデータはRAMによるrunning-configに保持されます。
よって、電源オフ後も設定を保持するためにはNVRAMによるstartup-configに、running-configの設定をコピーして保存しておく必要があります。

設定の初期化

Switch#erase startup-config 
Erasing the nvram filesystem will remove all configuration files! Continue? [confirm]
[OK]
Erase of nvram: complete
Switch#
00:08:57: %SYS-7-NV_BLOCK_INIT: Initalized the geometry of nvram
Switch#
Switch#
Switch#reload
Proceed with reload? [confirm]

00:09:16: %SYS-5-RELOAD: Reload requested by console. Reload Reason: Reload Command.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Press RETURN to get started!
Switch>
Switch>en
Switch#
Switch#
Switch#show startup-config
startup-config is not present

erase startup-configコマンド後Erasing the nvram filesystem will remove all configuration files! Continue? [confirm]で続行の確認が出るのでエンターを押すと、消去が行われます。
その後reloadコマンドで再起動をすると消去が反映されます。
show startup-configコマンドでstartup-configの情報を確認すると、
startup-config is not presentと表示され、保存された設定がなくなったことが確認できます。

参考

ICND1:第5章

1
0
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
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?