03-08-2022 11:56 AM
hi,
is there a way not to apply commands I aneter from conf te all at once but after I exit config mode or something?
br
Solved! Go to Solution.
03-09-2022 04:37 AM - last edited on 03-14-2022 10:10 AM by Translator
well, looks like I found solution ... configure what is needed for config archive and then
conf te revert timer 2
exit config mode without changing anything
copy flash:commands.txt running
new commands are in running
and if you do not configure confirm in 2 minutes ... config will revert
faster then reload :-))
03-08-2022 11:58 AM
Not sure we understasnd the requirement, can you please explain more with some examples, so we can suggest better ?
03-08-2022 12:45 PM - last edited on 03-14-2022 11:03 AM by Translator
As a general principle for IOS, config commands are implemented when you press Enter. So in general it is not possible to apply commands all at once. If we look for exceptions there are several to consider:
- in some (recent) versions of IOS in some config modes commands are not applied immediately but are held until you exit that config mode and then the group of commands is applied. (but I believe you are looking for something that would work with commands in multiple parts of the config so this is not so very useful)
- one alternative might be to type the
config
commands into a text file and then to use a
copy
command to copy all of the commands into running config which would result in applying all together. (but perhaps part of what you are looking for is the syntax checker to verify that what you have typed is correct and to catch any typo you might make, if so this is not so very useful)
- another alternative would be to get a router (similar model and version of code as the router you want to configure) in a test environment. Do config t, and enter all of the commands that you need (which will be applied on the test router) and then use the
show history
command (making sure that its buffer is large enough to hold all the commands) to get all the commands that you can then copy into the live router and effectively apply all at once.
03-08-2022 01:06 PM - last edited on 03-14-2022 10:02 AM by Translator
ok,
copy flash:cmd.txt
running looks promising. Is there a way to use config revert in this scenario? I saw I can use revert in 3 minutes if I use conf te mode .... but how to do it if I copy commands from text to running config? schedule reload i one way but I'd like to see if I can use revert method
thanks
03-08-2022 02:15 PM - last edited on 03-14-2022 10:04 AM by Translator
What I've done, in situations like you describe, is create a text file with the commands I need to apply at one time; store file on a tftp (or ftp, etc.) server (usually my PC). Copy the text file to a file, on the device, into its flash.
(e.g. copy tftp:file flash:file)
Schedule a reload in about 3 minutes, from now. Copy flash's text file to running config. (e.g. copy flash:file running-config) After pressing return, wait for about 15 seconds, before trying to issues any additional commands, to determine if you can still reach the device. After the 15 second "pause", try to enter commands, assuming all else looks good, cancel reload; save running config to start up config.
I recall, some devices, if so configured, support archival and rollback commands, but don't recall they (i.e. a rollback) can be easily be invoked against some timed wait.
03-09-2022 12:35 AM
Thanks for the clarification that what you are especially interested in is having several interface commands that you want to apply together. Like @Joseph W. Doherty I have successfully used the approach of putting the commands into a text file and then copy the text file to running config. You could certainly use the approach of create text file on tftp/ftp server, copy file from server to flash, and copy file from flash to running, but I would be inclined to simplify and just copy from server to running.
And like Joseph I have successfully used the scheduled reload as a way to recover if the config changes did not work. (and cancel the scheduled reload if they did work) One thing to consider is how much time to provide in the scheduled reload. If you would know pretty quickly whether the changes worked or not then 3 minutes would be fine. But if, for example, you are changing addressing because you are changing what that interface connects to, then you need to allow enough time for those changes to be completed. Remember in this case if you need to revert the config changes you might also need someone to revert the connection change.
03-09-2022 04:37 AM - last edited on 03-14-2022 10:10 AM by Translator
well, looks like I found solution ... configure what is needed for config archive and then
conf te revert timer 2
exit config mode without changing anything
copy flash:commands.txt running
new commands are in running
and if you do not configure confirm in 2 minutes ... config will revert
faster then reload :-))
03-09-2022 07:52 AM - edited 03-09-2022 07:53 AM
Cool!!!
As noted earlier, recalled archive feature had a "rollback" capability, but didn't know it had/has a timer option for the "rollback" (i.e. revert).
Yup, would expect it to be faster than a reload, less disruptive too.
All that noted, in the past, when the archive feature was first provided, I found it just a little bit "funky". Possibly current versions are now "solid". Even so, might still be good idea to schedule a reload, just with a much longer timer, say, perhaps, 10 minutes. If all goes well, cancel revert and reload. If all doesn't go well, and revert doesn't restore access, you still have a last chance for the reload to recover.
Using both revert and reload is a belt and suspenders approach, but having supported remote sites where it might take lots of hours to get someone (technical) on-site, and you really, really, don't want to drop the site, going the little bit of extra effort might be worthwhile.
PS:
If you can, mark your approach as solved, so others, facing a similar issue, can, more quickly, find a possible solution for them too.
03-09-2022 08:03 AM
Thanks for the update. Glad to know that you have found a solution for this.
03-09-2022 07:41 AM
". . . but I would be inclined to simplify and just copy from server to running."
Yup that might be just fine too!
In my cases I was using a "server" that would also be disrupted by the interface being changed; i.e. the reason for copying to device's local flash.
03-08-2022 01:02 PM
I need to enter several commands to router interface ... interface that is my only way to connect to router. So I want to be sure that router gets both of them and apply. Problem is if I lose connection to router after command1. So is there a way to say ... ok here are two commands and apply them at the end of config session and not before :-))
03-09-2022 04:41 AM
If you think due to some reason you lossing connection due to misconfiguration, then you can setup a time to reload the Router to get back to network with old known good config below guide help to setup one :
https://www.ciscozine.com/how-to-schedule-a-reload/
Once you config done, you can cancel reload and write the config.
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