Routeadmin

lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor

Overwrite running config rather than merge By David Bombal

Saturday, March 06, 2010 9:51:22 PM


To replace the current running configuration with a saved Cisco IOS configuration file, use the configure replace command in privileged EXEC mode.

         Router#configure replace flash:test.cfg


This command will replace (NOTE: not merge) the running config with the config in file test.cfg. This command was introduced in 12.3(7)T


Here is an example of the effect:

         Router#sh ip int brief
          Interface               IP-Address      OK?     Method     Status     Protocol
          FastEthernet0/0    10.10.10.3      YES     manual      up           up

          FastEthernet0/1    10.1.1.1           YES    manual      up           up

          Serial0/3/0             unassigned      YES    unset        administratively down down

         Router#configure replace flash:test.cfg
          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
          Total number of passes: 1
         Rollback Done

          r1#
          Dec 18 00:44:05.927: Rollback:Acquired Configuration lock.
          Dec 18 00:44:07.703: %PARSER-3-CONFIGNOTLOCKED: Unlock requested by process '3'.
          Configuration not locked.
          Dec 18 00:44:08.819: %LINK-5-CHANGED: Interface FastEthernet0/1, changed state to administratively down

         r1#sh ip int brief
          Interface               IP-Address      OK?     Method     Status     Protocol
          FastEthernet0/0    10.10.10.3      YES     manual      up           up

          FastEthernet0/1    10.1.1.1           YES    manual      administratively down down

          Serial0/3/0             unassigned      YES    unset        administratively down down


NOTE the following:
          1) Router name has changed
          2) FastEthernet 0/1 no longer has an IP address
          3) FastEthernet 0/1 is shutdown

This is great as rather than just MERGING a config, the command REPLACES the config. You can replace the running-config from many places:

          r1#configure replace ?
          archive: URL of config file that will replace running-config
          cns: URL of config file that will replace running-config
          flash: URL of config file that will replace running-config
          ftp: URL of config file that will replace running-config
          http: URL of config file that will replace running-config
          https: URL of config file that will replace running-config
          null: URL of config file that will replace running-config
          nvram: URL of config file that will replace running-config
          pram: URL of config file that will replace running-config
          rcp: URL of config file that will replace running-config
          scp: URL of config file that will replace running-config
          system: URL of config file that will replace running-config
          tftp: URL of config file that will replace running-config
          xmodem: URL of config file that will replace running-config
          ymodem: URL of config file that will replace running-config

         
You could thus have a backup config in flash or on a TFTP server and restore immediately to running config.

Comments are closed on this post.