[Xorp-hackers] commit/load - rollback

Kristian larsson kristian@juniks.net
Wed, 25 May 2005 23:58:28 +0200


I have a few suggestions for these commands.
when doing a "load", the configuration from the loaded file is commited right
away, I think it would be great to load it into the current "session" first so
that you may have a chance to edit parts of it. So you could load a template,
do some local changes (such as ip address, AS..) and then do the commit.

Then there's the commit command.
First off, juniper has this great command "commit revert <n>" (I think it is),
anyway it commits the configuration and after <n> minutes it reverts back to
the previous. So when commiting and you loose connectivity due to your new
config, the router will revert and after a few minutes you can go back and edit
your config.
If everything works out alright after your first commit you could just do a
regular commit to make the changes permanent.
Secondly, xorp's commit doesn't save the configuration to file. Once again I
would like to look at junipers solution.
At every commit the configuration is saved. The previous config is saved as
config.1 the one before that as .2 and so forth up to a 100 or something like
that.
It is then possible to do a "rollback <n>" to roll back <n> number of
configurations. It would be possible to add timestamps as well, so you could do
rollback time 2004-05-06 14:30 and it would read the config that was current at
that time. Great if you wanna know what has changed over the time.
Perhaps you dig up in that old log of yours that bla bla date something
happened. You do a diff between the current and the rollback conf of that date
and voila you get the changes.

I have written some pathces for this, but as my C++ are not what they should be
it's some pretty ugly code.
you can find the originals, the modified files as well as diffs at
http://www.juniks.net/~ply/xorp/junos-stylish/
Have in mind that these files have not been cleaned up and thus are more of work
in progress (and an example of my lousy C++) than actual patches.

Thoughts?

Regards,
Kristian