1

Just wondering what is the best way to give configurations a version. To elaborate - I want to have different versions of configuration files and query the running-config for the currently running configuration version. Is there a MIB OID that I can set to specify the current running configuration version and then poll later? Can I put it right in the configuration file itself?

Context here is upgrade management.

Thanks!

EDIT: To clarify (I didn't even understand what I wrote the first time), all I'm really looking for is an easy way to add version meta-data to a config file.

Ideally, what I'd like to do is have a line in the config file like this:

! configuration_version 1.10

The problem with this is that when you copy the configuration file to running, you lose comments, so the only alternative I can find is to put the config_version attribute in one of the banners, like the motd or the login banner. This works but its a hack and it's a pain in the butt to parse the banner message out of the running-config since there is no "show banner" command in the cli.

ac84
  • 91
  • 1
  • 5

4 Answers4

1

what I have seen done is to add the version to the description of a loopback, say

int lo100 description Ver1.51

another thing is to tag the snmp location line like ::ver1.51

hope that helps, give me some votes if so Im a newbie!

0

We do this job by programming. We connect through SSH V2 protocol to cisco router and send the necessary commands to get the running-configuration and we save it to a file.

When we update our configurations to the last version, we connect to the router and request the running-config, if the configurations are not the same we parse changes in access-list and all that stuff and send by ssh the commands to keep that router updated to the latest version.

For IOS upgrades, we use tftp commands as well.

EDIT:

You can add comments to a configuration file describing the commands you have entered. Precede a comment with an exclamation point (!).

Example from cisco:

Router# configure terminal
Router(config)# !The following command provides the router host name.
Router(config)# hostname new_name
new_name(config)# end
Community
  • 1
  • 1
Carlos Landeras
  • 11,025
  • 11
  • 56
  • 82
  • Hi, thanks for the response. Actually I'm more interested in how you manage the versions of the files. I wrote a python script to do all this programmatically, the trouble I'm having is a simple way of telling whether or not to upgrade at all. I.e. I want to put a line in the running-configuration like "configuration-version 1.0.0". Then I can parse this out and determine if I actually need to upgrade or not without pulling down the whole configuration and doing a diff or anything like that. Currently the only place I can find to put a version number is in one of the banners-motd,login etc – ac84 Nov 22 '12 at 22:01
  • You can use a comment using an exclamation point (!). See answer – Carlos Landeras Nov 22 '12 at 22:42
  • But the comment does not exist in RAM or in the running-config. You can put them in the startup-config but when you copy replace startup to running you lose the comments because the switch/router doesn't care about them – ac84 Nov 23 '12 at 01:06
0

You could make a copy of the config and place it in flash or nvram naming it something like hostname-config-version.number. Then you could alter your script to look in flash or nvram for the file name rather than looking through the config.

0

You can also use configuration rollback to manage multiple versions of configs e.g.:

Router#conf t
Router(config)#archive
Router(config-archive)#path ?
flash: Write archive on flash: file system
ftp: Write archive on ftp: file system
http: Write archive on http: file system
https: Write archive on https: file system
pram: Write archive on pram: file system
rcp: Write archive on rcp: file system
scp: Write archive on scp: file system
tftp: Write archive on tftp: file system

Router(config-archive)#path flash:
Router(config-archive)#end
Router#

show archive can then list the saved configurations and configure revert can be used to go back to an old version.

However take care about storing all config on the router; not the best idea as disks can go bad.

Goblinhack
  • 2,859
  • 1
  • 26
  • 26