Contextual Configuration Diff Utility

Last Updated: November 29, 2011

The Contextual Configuration Diff Utility feature provides the ability to perform a line-by-line comparison of any two configuration files (accessible through the Cisco IOS Integrated File System [IFS]) and generate a list of the differences between them. The generated output includes information regarding configuration lines that have been added, modified, or deleted, and the configuration modes within which a changed configuration line exists.

Finding Feature Information

Your software release may not support all the features documented in this module. For the latest feature information and caveats, see the release notes for your platform and software release. To find information about the features documented in this module, and to see a list of the releases in which each feature is supported, see the Feature Information Table at the end of this document.

Use Cisco Feature Navigator to find information about platform support and Cisco software image support. To access Cisco Feature Navigator, go to www.cisco.com/go/cfn. An account on Cisco.com is not required.

Prerequisites for Contextual Configuration Diff Utility

The format of the configuration files used for the Contextual Configuration Diff Utility feature must comply with standard Cisco IOS configuration file indentation rules as follows:

  • Start all commands on a new line with no indentation, unless the command is within a configuration submode.
  • Indent commands within a first-level configuration submode one space.
  • Indent commands within a second-level configuration submode two spaces.
  • Indent commands within subsequent submodes accordingly.

The router must have a contiguous block of memory larger than the combined size of the two configuration files being compared.

Restrictions for Contextual Configuration Diff Utility

If the router does not have a contiguous block of memory larger than the combined size of the two configuration files being compared, the diff operation fails.

Information About Contextual Configuration Diff Utility

Benefits of the Contextual Configuration Diff Utility

The Contextual Configuration Diff Utility feature provides the ability to perform a line-by-line comparison of any two configuration files (accessible through the Cisco IOS File System [IFS]) and generate a list of the differences between them. The generated output includes information regarding the following items:

  • Configuration lines that have been added, modified, or deleted.
  • Configuration modes within which a changed configuration line exists.
  • Location changes of configuration lines that are order-sensitive. For example, the ipaccess-list and community-lists commands are order-sensitive commands dependent on where they are listed within a configuration file in relation to other Cisco IOS commands of similar type.

Contextual Configuration Diff Utility Output Format

Diff Operation

The Contextual Configuration Diff Utility feature uses the filenames of two configuration files as input. A diff operation is performed on the specified files and a list of differences between the two files is generated as output. Interpreting the output is dependent on the order in which the two files are configured (showarchiveconfigdifferencescommand). In this section, we assume that the filename of the file entered first is file1 and the filename of the file entered second is file2. Each entry in the generated output list is prefixed with a unique text symbol to indicate the type of difference found. The text symbols and their meanings are as follows:

  • A minus symbol (-) indicates that the configuration line exists in file1 but not in file2.
  • A plus symbol (+) indicates that the configuration line exists in file2 but not in file1.
  • An exclamation point (!) with descriptive comments is used to identify order-sensitive configuration lines whose location is different in file1 than in file2.

Incremental Diff Operation

Some applications require that the generated output of a diff operation contain configuration lines that are unmodified (in other words, without the minus and plus symbols). For these applications, an incremental diff operation can be performed, which compares a specified configuration file to the running configuration file (showarchiveconfigincremental-diffs command).

When an incremental diff operation is performed, a list of the configuration lines that do not appear in the running configuration file (in other words, configuration lines that only appear in the specified file that is being compared to the running configuration file) is generated as output. An exclamation point (!) with descriptive comments is used to identify order-sensitive configuration lines whose location is different in the specified configuration file than in the running configuration file.

How to Use the Contextual Configuration Diff Utility

Using the Contextual Configuration Diff Utility

This task describes how to use the Contextual Configuration Diff Utility feature.

SUMMARY STEPS

1.    enable

2.   Do one of the following:

  • show archive config differenc es [file1 [file2]]
  • or
  • show archive config incremental- diff s file

3.    exit


DETAILED STEPS
  Command or Action Purpose
Step 1
enable


Example:

Router> enable

 

Enables privileged EXEC mode.

  • Enter your password if prompted.
 
Step 2
Do one of the following:
  • show archive config differenc es [file1 [file2]]
  • or
  • show archive config incremental- diff s file


Example:

Router# show archive config differences running-config startup-config



Example:



Example:

Router# show archive config incremental-diffs nvram:startup-config

 

Performs a line-by-line comparison of any two configuration files (accessible through the IFS) and generates a list of the differences between them.

or

Performs a line-by-line comparison of a specified configuration file to the running configuration file and generates a list of the configuration lines that do not appear in the running configuration file.

 
Step 3
exit


Example:

Router# exit

 

Exits to user EXEC mode.

 

Configuration Examples for the Contextual Configuration Diff Utility

Diff Operation Example

In this example, a diff operation is performed on the running and startup configuration files. The table below shows the configuration files used for this example.

Table 1 Configuration Files Used for the Diff Operation Example

Running Configuration File

Startup Configuration File

no ip subnet-zero
ip cef
interface Ethernet1/0
 ip address 10.7.7.7 255.0.0.0
 no ip route-cache
 no ip mroute-cache
 duplex half
no ip classless
snmp-server community public RO
ip subnet-zero
ip cef
ip name-server 10.4.4.4
voice dnis-map 1
 dnis 111
interface Ethernet1/0
 no ip address
 no ip route-cache
 no ip mroute-cache
 shutdown
 duplex half
ip default-gateway 10.5.5.5
ip classless
access-list 110 deny   ip any host 10.1.1.1
access-list 110 deny   ip any host 10.1.1.2
access-list 110 deny   ip any host 10.1.1.3
snmp-server community private RW

The following is sample output from the showarchiveconfigdifferencescommand. This sample output displays the results of the diff operation performed on the configuration files in the table below.

Router# show archive config differences running-config startup-config
+ip subnet-zero
+ip name-server 10.4.4.4
+voice dnis-map 1 
 +dnis 111
interface Ethernet1/0
 +no ip address
 +shutdown
+ip default-gateway 10.5.5.5
+ip classless
+access-list 110 deny ip any host 10.1.1.1
+access-list 110 deny ip any host 10.1.1.2
+access-list 110 deny ip any host 10.1.1.3
+snmp-server community private RW
-no ip subnet-zero
interface Ethernet1/0
 -ip address 10.7.7.7 255.0.0.0
-no ip classless
-snmp-server community public RO

Incremental Diff Operation Example

In this example, an incremental diff operation is performed on the startup and running configuration files. The table below shows the configuration files used for this example.

Table 2 Configuration Files Used for the Incremental Diff Operation Example

Startup Configuration File

Running Configuration File

ip subnet-zero
ip cef
ip name-server 10.4.4.4
voice dnis-map 1
 dnis 111
interface Ethernet1/0
 no ip address
 no ip route-cache
 no ip mroute-cache
 shutdown
 duplex half
ip default-gateway 10.5.5.5
ip classless
access-list 110 deny   ip any host 10.1.1.1
access-list 110 deny   ip any host 10.1.1.2
access-list 110 deny   ip any host 10.1.1.3
snmp-server community private RW
no ip subnet-zero
ip cef
interface Ethernet1/0
 ip address 10.7.7.7 255.0.0.0
 no ip route-cache
 no ip mroute-cache
 duplex half
no ip classless
snmp-server community public RO

The following is sample output from the showarchiveconfigincremental-diffscommand. This sample output displays the results of the incremental diff operation performed on the configuration files in the table below.

Router# show archive config incremental-diffs startup-config
ip subnet-zero
ip name-server 10.4.4.4
voice dnis-map 1 
 dnis 111
interface Ethernet1/0
 no ip address
 shutdown
ip default-gateway 10.5.5.5
ip classless
 access-list 110 deny   ip any host 10.1.1.1
 access-list 110 deny   ip any host 10.1.1.2
 access-list 110 deny   ip any host 10.1.1.3
snmp-server community private RW

Additional References

This section provides references related to the Contextual Configuration Diff Utility feature.

Related Documents

Related Topic

Document Title

Information about managing configuration files

Managing Configuration Files

Commands for managing configuration files

The Cisco IOS Configuration Fundamentals Command Reference

Standards

Standards

Title

No new or modified standards are supported by this feature, and support for existing standards has not been modified by this feature.

--

MIBs

MIBs

MIBs Link

No new or modified MIBs are supported by this feature, and support for existing MIBs has not been modified by this feature.

To locate and download MIBs for selected platforms, Cisco IOS releases, and feature sets, use Cisco MIB Locator found at the following URL:

http://www.cisco.com/go/mibs

RFCs

RFCs

Title

No new or modified RFCs are supported by this feature, and support for existing RFCs has not been modified by this feature.

--

Technical Assistance

Description

Link

The Cisco Support website provides extensive online resources, including documentation and tools for troubleshooting and resolving technical issues with Cisco products and technologies.

To receive security and technical information about your products, you can subscribe to various services, such as the Product Alert Tool (accessed from Field Notices), the Cisco Technical Services Newsletter, and Really Simple Syndication (RSS) Feeds.

Access to most tools on the Cisco Support website requires a Cisco.com user ID and password.

http://www.cisco.com/techsupport

Feature Information for Contextual Configuration Diff Utility

The following table provides release information about the feature or features described in this module. This table lists only the software release that introduced support for a given feature in a given software release train. Unless noted otherwise, subsequent releases of that software release train also support that feature.

Use Cisco Feature Navigator to find information about platform support and Cisco software image support. To access Cisco Feature Navigator, go to www.cisco.com/go/cfn. An account on Cisco.com is not required.

Table 3 Feature Information for Contextual Configuration Diff Utility

Feature Name

Releases

Feature Information

Contextual Configuration Diff Utility

12.3(4)T 12.2(25)S 12.2(27)SBC 12.2(33)SRA 12.2(33)SXH 12.2(33)SB

The Contextual Configuration Diff Utility feature provides the ability to perform a line-by-line comparison of any two configuration files and generate a list of the differences between them. The generated output includes information regarding configuration lines that have been added, modified, or deleted, and the configuration modes within which a changed configuration line exists.

In 12.3(4)T, this feature was introduced.

In 12.2(33)SB, this feature was implemented on the Cisco 10000 series.

The following sections provide information about this feature:

The following commands were modified by this feature: show archive config differences, show archive config incremental-diffs.

Cisco and the Cisco logo are trademarks or registered trademarks of Cisco and/or its affiliates in the U.S. and other countries. To view a list of Cisco trademarks, go to this URL: www.cisco.com/go/trademarks. Third-party trademarks mentioned are the property of their respective owners. The use of the word partner does not imply a partnership relationship between Cisco and any other company. (1110R)

Any Internet Protocol (IP) addresses and phone numbers used in this document are not intended to be actual addresses and phone numbers. Any examples, command display output, network topology diagrams, and other figures included in the document are shown for illustrative purposes only. Any use of actual IP addresses or phone numbers in illustrative content is unintentional and coincidental.

© 2011 Cisco Systems, Inc. All rights reserved.