Restoring a Cisco router config using a config file
Solution 1
You'll miss some things by doing it this way. The best option is to copy the config to a tftp server and restore it from there if necessary
copy running-config tftp:
to restore
configure replace tftp://servername/config
Solution 2
The correct way to restore a config file from backup is to:
copy tftp://path/to/config startup-config
reload
If you copy into the running-config, you'll actually merge with the running config. You'll pick up some elements that you don't want.
Some newer routers have a command to replace the running-config wholesale with an external config, but the exact command escapes me at the moment.
Related videos on Youtube
Tor Haugen
Updated on September 17, 2022Comments
-
Tor Haugen over 1 year
I'm working with a Cisco router over telnet (actually PuTTY), and I'm a newbie to ios.
I'm slowly getting the hang of it, but have a very basic question:
I have issued a show running-config command and saved the result to a text file. Can I later restore the router config by pasting this file into telnet? Will it simply accept the whole config and return to its present state?
Sorry, I know it's a really stupid question :-)
-
Tor Haugen over 13 yearsWhat will I miss? Will it not work at all?
-
Jason Berg over 13 yearsIt will probably work...but certain things don't come over on the show run...for instance, if an interface is shutdown by default, you issue a "no shutdown" command to enable it. That command doesn't show up in a show run, so when you paste your config, you miss that.
-
Phil Hollenback over 13 yearsThis is where I insert the mandatory recommendation that you look into using a tool like RANCID to manage your router config instead of dealing with it manually.
-
Jeshizaemon over 13 years+1 for tftp. Another advantage of tftp is that you can backup ANY file on your router. There are lots of tftp servers and they really do work (it seems weird that they are so easy, almost too easy, to set up). I use the solarwinds free tftp, but I can't recommend them since they will try to sell you everything under the sun if you download on of their free tools. (>ω<;