10-03-2008 12:54 PM - edited 03-06-2019 01:45 AM
This may be a stupid question, but I am confused about something....
If I want to copy a config from a tftp server to a router with the "copy tftp start" command and save the destination file as startup-config, does the router erase the startup config first before importing the command lines?
I created a test file called "test" and there was one command on it: service nagle.
I wanted to see if it would leave the startup config intact and just add the service nagle command, but instead it wiped out the startup config and then added service nagle.
I did a "sh start" and it said "using 17 bytes out of 534,323 (or whatever number) and then "service nagle"...thats it. No startup config.
Of course I did this in a lab! :-)
So, what gives? I thought the "service nagle" command would be added and the startup config left intact. How do I prevent the startup config from getting blown out of the water?
Thanks
VL
Solved! Go to Solution.
10-03-2008 01:19 PM
Hello Victor,
the following config guide could be helpful
it says:
he router does not erase the existing running configuration before adding the commands. If a command in the copied configuration file replaces a command in the existing configuration file, the existing command will be erased. For example, if the copied configuration file contains a different IP address in a particular command than the existing configuration, the IP address in the copied configuration will be used. However, some commands in the existing configuration may not be replaced or negated. In this case, the resulting configuration file will be a mixture of the existing configuration file and the copied configuration file, with the copied configuration file having precedence.
So we have a doc that says that the resulting config should be the merge of old file and new file but this is not the case in your experiment.
May be the merge works when copying to the running config.
I remember a different behaviour depending on the destination file used:
copy tftp run
should merge the two and then you can save the resulting file
copying to the startup-config is a file overwrite/substitution
These two options should provide the flexibility to do what you want.
To protect : backup your config to a TFTP server ...
Hope to help
Giuseppe
10-03-2008 01:07 PM
On second thought, it makes perfect sense that if I save the file to "startup-config" that the one-line file will become the startup config and blow out the rest.
So, is there a way to just add command lines?
10-03-2008 01:19 PM
copy tftp run
copy run start
:)
10-03-2008 01:19 PM
Hello Victor,
the following config guide could be helpful
it says:
he router does not erase the existing running configuration before adding the commands. If a command in the copied configuration file replaces a command in the existing configuration file, the existing command will be erased. For example, if the copied configuration file contains a different IP address in a particular command than the existing configuration, the IP address in the copied configuration will be used. However, some commands in the existing configuration may not be replaced or negated. In this case, the resulting configuration file will be a mixture of the existing configuration file and the copied configuration file, with the copied configuration file having precedence.
So we have a doc that says that the resulting config should be the merge of old file and new file but this is not the case in your experiment.
May be the merge works when copying to the running config.
I remember a different behaviour depending on the destination file used:
copy tftp run
should merge the two and then you can save the resulting file
copying to the startup-config is a file overwrite/substitution
These two options should provide the flexibility to do what you want.
To protect : backup your config to a TFTP server ...
Hope to help
Giuseppe
10-03-2008 02:16 PM
Guiseppe
I was surprised when you said this:"So we have a doc that says that the resulting config should be the merge of old file and new file but this is not the case in your experiment" because clearly Victor's experiment was with startup config and not with running config.
But then you go on to say the correct thing, which is that the behavior is quite different depending on whether it is running config (a merge) or is startup config (an erase and complete replacement).
So Victor, to answer your question:"How do I prevent the startup config from getting blown out of the water?" the answer is that you can not prevent this.
HTH
Rick
10-03-2008 03:02 PM
Jon:
C'mon, mate!! I'm not THAT stupid! :-) I know those commands, but my question was more specific than that.
Giuseppe:
Thanks for the link and the explanation.
Rick:
Thanks for the clarification.
Anyway, I am surprised at myself fo not knowing this. This is basic CCNA-type stuff, to be honest. The problem is that I have never been in a network environment where there actually existed a TFTP server to use to configure devices. It was always something nice to read about -- just never saw it applied, so thats why I am experimenting.
Nonetheless, its basic question and I should be embarrassed and ashamed. If I could, I would flog myself repeatedly with a garden hose. OK, Im kidding... -)
So, to clarify, if I do a "copy tftp run". the existing config will be merged with the applied configs, except in the case in which there is a conflict (one command replacing the other), in which case the copied command would take precedence. AND THE RUNNING CONFIG WILL NOT BE BLOWN AWAY, RIGHT?
If I do a "copy tftp start" the existing config is automatically wiped out (erased) before the new config commands are applied? If so, I am wondering why this client has a procedure where an "erase start" is executed before executing a "copy tftp start" to configure their wireless AP.....? Perhaps just a force of habit...
Thanks
Victor
10-04-2008 02:23 AM
Victor
I know your'e not stupid hence the smily in my post. I was just being a bit literal (and flippant) - no offense intended :-)
If it makes you feel any better, or at least stops you beating yourself up, i didn't know this either ie. i knew copy tftp run was a merge but not what copy tftp start does. And i'm damn sure that i've forgotten some other very basic CCNA stuff along the way.
"AND THE RUNNING CONFIG WILL NOT BE BLOWN AWAY, RIGHT?" - yep, that's how i understand it and have seen it happen. Any lines where the command has been changed/updated will replace the one in the running config otherwise running config stays as is.
Jon
10-04-2008 06:20 AM
Jon:
I was not offened at all. I've known you only to be extremely helpful and a gentleman and I appreciate all the help and guidance you have given me fo so many months that I have been posting questions to this board. I look forward to your responses.
Thanks also for your encouragement. I appreciate it.
Victor
10-03-2008 11:44 PM
Hello Rick,
I realized that I had copied the test explaining the right command thinking it was the other one !
then I thought about my own experience and the way to perform incremental adds to the current config
It was too late to edit my post
Thanks for your attention and guidance
Best Regards
Giuseppe
10-05-2008 12:06 PM
Guiseppe
I was confident that you knew better, and that is why I started by stating that I am surprised at what you said. And you did get it explained right by the end of your post. I also have had the experience of looking at something that I have posted and realizing that it was not really correct. Sometimes we see it soon enough to be within the window to be able to edit and correct it - and sometimes not.
Keep up your good work on the forum. I look forward to many more helpful posts from you.
HTH
Rick
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide