I guess every engineer knows that heart-stopping moment when you change something on a remote router and the telnet session you are using stops responding. You hit a few keys in the folorn hope that it is a bit of network congestion before resigning yourself to the fact that you’ve just been a complete idiot and removed the IP address you were telnetting in through.
Juniper built JunOS from the ground up with features to counter things like this. In JunOS, when you go into editing mode, a copy of the current configuration is taken and becomes what is called the “candidate configuration”. It is this that gets edited, and when you are happy with your changes, you issue the “commit” command. The candidate configuration becomes the current configuration, and the old current configuration is stored as a “rollback configuration”. Of course if you’ve made a mistake, it is at this point that your telnet session goes dead.
If you use the “commit confirmed” command, however, the router implements the configuration and waits for a second “commit” command. If it doesn’t get one within a set period, it assumes you have lost connectivity and rolls the configuration back to the previously working config. A nice feature.
Now IOS doesn’t do this, unfortunately. What you can do, however, if you are making what might be a risky change, is to use the “reload in ” command. Here’s what you do:
- Enter privileged exec mode
- Issue the command “reload in 10” to give yourself 10 minutes
- Make your changes in configuration mode
- If you didn’t cut yourself off, you’re ok. Cancel the reload using “cancel reload”
- Write your config to flash
If you prefer, you can reload at a specific time – “reload at 19:00” will reload the router at 7pm. It is probably wise to check that your clock is right before you do this though.
And finally, a “show reload” will tell you if there are any outstanding reloads pending.
This parameter on the end of the reload command seems to have been around for a few years (at least since 12.1 mainline), but I’ve never seen anyone else using it.