cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
587
Views
0
Helpful
2
Replies

Deterministic output for IOS configuration?

matthewkielec
Level 1
Level 1

I'm trying to build a script to differentiate changes to the configuration of the Cisco IOS routers and switches within our infrastructure. Basically it performs a diff between the running and startup configs as well as past configs. One issue I'm seeing is that sometimes the output between the show running-config and show startup-config lists items on the same system in a different order. For example if two ntp servers are listed in the configuration, they aren't always listed in the same order. In one instance the running config lists them as A then B where the startup config lists them as B then A. We've also seen this with other lines in the configuration file. This makes it more difficult for us to highlight actual configuration changes in our script.

Is the configuration file generated in a deterministic nature?

If so then how might we have re-ordered values in the configuration file?

2 Replies 2

Marvin Rhoads
Hall of Fame
Hall of Fame

I've seen the parser do this sometimes too - not sure why.

I've not seen most commercial and open source programs for configuration management (e.g., LMS, SolarWinds NCM, Kiwi Cattools and RANCID) have a problem recognizing that all the same configuraiton lines were present. Have you thought about using one of them?

Thanks Marvin. I looked at the source code to RANCID and they apparently have the same issue. Their solution (see rancid.in's WriteTerm method) is to "fix" specific lines in the configuration file which they have seen reported in a non-deterministic order by pruning them out and sorting them before storing in the "RANCID" version of the configuration file. I guess that works, would be nice if Cisco could fix this to avoid work around scripts.

Review Cisco Networking for a $25 gift card