Don’t Cut Your Own Legs Off – IOS and JunOS

1 02 2007

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:

  1. Enter privileged exec mode
  2. Issue the command “reload in 10” to give yourself 10 minutes
  3. Make your changes in configuration mode
  4. If you didn’t cut yourself off, you’re ok. Cancel the reload using “cancel reload”
  5. 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.




One response

21 12 2008

Excellent advice and I do agree, JUNOS has a better method for rolling back. I would like to point out that in step number 4 the command is “reload cancel” not “cancel reload” but I’m sure anyone trying this found that out.

Great blog. I’ll be back often.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: