2

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
  • 449
  • 4
  • 6
  • 14

2 Answers2

5

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

Jason Berg
  • 19,084
  • 6
  • 40
  • 55
  • What will I miss? Will it not work at all? – Tor Haugen Jan 21 '11 at 01:10
  • 3
    It 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. – Jason Berg Jan 21 '11 at 02:30
  • 1
    This is where I insert the mandatory recommendation that you look into using a tool like [RANCID](http://www.shrubbery.net/rancid/) to manage your router config instead of dealing with it manually. – Phil Hollenback Jan 21 '11 at 06:19
  • 2
    This will *merge* your current config that you're trying to get rid of and the config you're loading. – MikeyB Jan 24 '11 at 16:10
  • +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. (>ω<; – Jeshizaemon Jan 25 '11 at 17:12
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.

MikeyB
  • 39,291
  • 10
  • 105
  • 189