XpressLearn Home

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...
Using the diff utility built into IOS

Have you ever logged into a router and issued a show running-config to view it’s configuration only to see toward the top of the file, that the last configuration time and the last saved time don’t match? What does this mean? Well it means that someone got in a hurry and didn’t write their modified configuration to memory, therefore causing it to be lost the after the next reboot. I wouldn’t be satisfied with just saving the running-config to startup-config without knowing what had been changed. It may be that someone was careless and any change made shouldn’t be carried over at reboot. There is an easy way to check this with newer IOS releases ( 12.3(4)T it was introduced and then integrated into 12.2(25)S ) using the built in diff tool in IOS.

Now if your not familiar with diff, it is a very popular utility in the Unix world used to compare two files and display only the differences. Versions of this utility have been ported to just about every OS imaginable. However, sometimes these utilities are not available when we need them. In order to view the differences of the startup and running configurations before this was available in IOS, you would have to get both configurations off the Cisco device an onto a machine with diff installed. The two configurations would need to be in separate text files and then the utility run against them. Look how easy Cisco has made it now with the following command:

show archive config differences system:/running-config nvram:/startup-config

Here is a sample output :

Router#$show archive config differences system:/running-config nvram:/startup-config
Contextual Config Diffs:
+service timestamps debug datetime msec
+service timestamps log datetime msec
-service timestamps debug uptime
-service timestamps log uptime

Router#

In the previous example, it shows the logging statements (using uptime) were replaced with logging statements that have the date and time in the log entry.

Author Info:

 
Scott is the Founder, Administrator, Architect, Chief Editor and Shameless Hack who wrote and runs Xpresslearn.
 

Scott has been working in the networking field for 13 years and has experience in all the areas: Lan, Wan, Security, Optimization, High Availability, Wireless, and others.

When he is not working on further development of Xpresslearn, Scott loves spending time with his family and has such hobbies as Camping, Fishing, Cars, and Woodworking.

Related Posts:


Leave a Reply