As
Halo told, it's possible with
configure replace. For example I configured few settings under global and interface configuration mode:
Code:
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#no logging console
Router(config)#int fa0/0
Router(config-if)#descr test
Router(config-if)#ip addr 10.10.10.1 255.255.255.252
Router(config-if)#exit
Router(config)#hostname R1
R1(config)#end
R1#
..copied
running-config to
startup-config:
Code:
R1#copy running-config startup-config
Destination filename [startup-config]?
Building configuration...
[OK]
R1#
..then deleted
startup-config:
Code:
Router#delete nvram:startup-config
Delete filename [startup-config]?
Delete nvram:startup-config? [confirm]
[OK]
Router#
..and finally replaced the
running-config with empty
startup-config:
Code:
Router#conf replace nvram:startup-config
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
Overwriting with a file sized 50% or less than running config's. Proceed? [no]:
Rollback:Acquired Configuration lock.y
The rollback configlet from the last pass is listed below:
********
!List of Commands:
default service timestamps debug uptime
default service timestamps log uptime
default service password-encryption
no hostname Router
no boot-start-marker
no boot-end-marker
default ip cef
interface FastEthernet0/0
no duplex auto
no speed auto
interface FastEthernet1/0
no duplex auto
no speed auto
interface FastEthernet2/0
no duplex auto
no speed auto
interface FastEthernet3/0
no duplex auto
no speed auto
default ip http server
default ip forward-protocol nd
line vty 0 4
default login
end
********
Rollback aborted after 5 passes
Router#
However, for example on
Cisco 7200(Version 15.0(1)M) replacing the
running-config with blank
startup-config doesn't work:
Code:
R1#configure replace nvram:startup-config
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
%The input file is not a valid config file.
R1#
In lab environment it's good to have some sort of archived configuration template and once work is done one can reload the default configuration with it:
Code:
R1#show archive
The maximum archive configurations allowed is 14.
There are currently 1 archive configurations saved.
The next archive file will be named disk0:/conf-1
Archive # Name
1 disk0:/conf-0 <- Most Recent
2
3
4
5
6
7
8
9
10
11
12
13
14
R1#conf replace disk0:/conf-0
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
% Warning: use /31 mask on non point-to-point interface cautiously
Total number of passes: 1
Rollback Done
Router#