Guest

Cisco IOS Software Releases 12.3 T

Contextual Configuration Diff Utility

Table Of Contents

Contextual Configuration Diff Utility

Contents

Prerequisites for Contextual Configuration Diff Utility

Restrictions for Contextual Configuration Diff Utility

Information About Contextual Configuration Diff Utility

Benefits of the Contextual Configuration Diff Utility

Contextual Configuration Diff Utility Output Format

How to Use the Contextual Configuration Diff Utility

Using the Contextual Configuration Diff Utility

Configuration Examples for the Contextual Configuration Diff Utility

Diff Operation: Example

Incremental Diff Operation: Example

Additional References

Related Documents

Standards

MIBs

RFCs

Technical Assistance

Command Reference

show archive config differences

show archive config incremental-diffs

Feature Information for Contextual Configuration Diff Utility


Contextual Configuration Diff Utility


First Published: November 2003
Last Updated: August 2007 (for Release 12.2SX)

  

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 in This Module

Your Cisco IOS software release may not support all of the features documented in this module. To reach links to specific feature documentation in this module and to see a list of the releases in which each feature is supported, use the "Feature Information for Contextual Configuration Diff Utility" section.

Finding Support Information for Platforms and Cisco IOS Software Images

Use Cisco Feature Navigator to find information about platform support and software image support. Cisco Feature Navigator enables you to determine which Cisco IOS and Catalyst OS software images support a specific software release, feature set, or platform. To access Cisco Feature Navigator, go to http://www.cisco.com/go/fn. An account on Cisco.com is not required.

Contents

Prerequisites for Contextual Configuration Diff Utility

Restrictions for Contextual Configuration Diff Utility

Information About Contextual Configuration Diff Utility

How to Use the Contextual Configuration Diff Utility

Configuration Examples for the Contextual Configuration Diff Utility

Additional References

Command Reference

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

Before using the Contextual Configuration Diff Utility feature, you should understand the following concepts:

Benefits of the Contextual Configuration Diff Utility

Contextual Configuration Diff Utility Output Format

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 ip access-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 (show archive config differences command). 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 (show archive config incremental-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

This section contains the following procedure:

Using the Contextual Configuration Diff Utility (required)

Using the Contextual Configuration Diff Utility

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

SUMMARY STEPS

1. enable

2. show archive config differences [file1 [file2]]
or
show archive config incremental-diffs [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 

show archive config differences [file1 [file2]]

or

show archive config incremental-diffs file

Example:

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

or

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

This section contains the following configuration examples:

Diff Operation: Example

Incremental Diff Operation: Example

Diff Operation: Example

In this example, a diff operation is performed on the running and startup configuration files. Table 1 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 show archive config differences command. This sample output displays the results of the diff operation performed on the configuration files in Table 1.

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. Table 2 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 show archive config incremental-diffs command. This sample output displays the results of the incremental diff operation performed on the configuration files in Table 2.

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" chapter in the Cisco IOS Configuration Fundamentals and Network Management Configuration Guide, Release 12.2

Commands for managing configuration files

The Cisco IOS Configuration Fundamentals Command Reference appropriate to your software release version.


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 Technical Support & Documentation website contains thousands of pages of searchable technical content, including links to products, technologies, solutions, technical tips, and tools. Registered Cisco.com users can log in from this page to access even more content.

http://www.cisco.com/techsupport  


Command Reference

This section documents modified commands only.

show archive config differences

show archive config incremental-diffs

show archive config differences

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, use the show archive config differences command in user EXEC or privileged EXEC mode.

show archive config differences [file1 [file2]]

Syntax Description

file1

(Optional) The filename of the first configuration file.

file2

(Optional) The filename of the second configuration file.


Command Default

If the file1 and file2 arguments are not specified, the first configuration file is assumed to be the running configuration file and the second to be the startup configuration file.

If only the file1 argument is specified, the second configuration file is assumed to be the running configuration file.

Command Modes

User EXEC
Privileged EXEC

Command History

Release
Modification

12.3(4)T

This command was introduced.

12.2(25)S

This command was integrated into Cisco IOS Release 12.2 S.

12.2(27)SBC

This command was integrated into Cisco IOS Release 12.2 SB.

12.2(33)SRA

This command was integrated into Cisco IOS Release 12.2 SR.

12.2(33)SXH

This command was integrated into Cisco IOS Release 12.2 SX.


Usage Guidelines

Interpreting the output of the show archive config differences command is dependent on the order in which the two files are configured. 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.

Examples

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

Table 3 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 show archive config differences command. This sample output displays the results of the diff operation performed on the configuration files in Table 3.

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

Related Commands

Command
Description

more nvram:startup-config

Displays the startup configuration file contained in NVRAM or specified by the CONFIG_FILE environment variable.

more system:running-config

Displays the contents of the currently running configuration file.

show archive config incremental-diffs

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.


show archive config incremental-diffs

To perform a line-by-line comparison of a specified configuration file to the running configuration file and generate a list of the configuration lines that do not appear in the running configuration file, use the show archive config incremental-diffs command in user EXEC or privileged EXEC mode.

show archive config incremental-diffs file

Syntax Description

file

The filename of the configuration file to be compared to the running configuration file.


Command Modes

User EXEC
Privileged EXEC

Command History

Release
Modification

12.3(4)T

This command was introduced.

12.2(25)S

This command was integrated into Cisco IOS Release 12.2 S.

12.2(27)SBC

This command was integrated into Cisco IOS Release 12.2 SB.

12.2(33)SRA

This command was integrated into Cisco IOS Release 12.2 SR.

12.2(33)SXH

This command was integrated into Cisco IOS Release 12.2 SX.


Usage Guidelines

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.

Examples

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

Table 4 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 show archive config incremental-diffs command. This sample output displays the results of the incremental diff operation performed on the configuration files in Table 4.

Router# show archive config incremental-diffs nvram: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

Related Commands

Command
Description

more nvram:startup-config

Displays the startup configuration file contained in NVRAM or specified by the CONFIG_FILE environment variable.

more system:running-config

Displays the contents of the currently running configuration file.

show archive config differences

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


Feature Information for Contextual Configuration Diff Utility

Table 5 lists the release history for this feature.

Not all commands may be available in your Cisco IOS software release. For release information about a specific command, see the command reference documentation.

Cisco IOS software images are specific to a Cisco IOS software release, a feature set, and a platform. Use Cisco Feature Navigator to find information about platform support and Cisco IOS software image support. Access Cisco Feature Navigator at http://www.cisco.com/go/cfn. An account on Cisco.com is not required.


Note Table 5 lists only the Cisco IOS software release that introduced support for a given feature in a given Cisco IOS software release. Unless noted otherwise, subsequent releases of that Cisco IOS software release also support that feature.


Table 5 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

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(25)S, support was added for a Cisco IOS 12.2S release.

In 12.2(27)SBC, support was added in a Cisco IOS 12.2SB release.

In 12.2(33)SRA, support was added in a Cisco IOS 12.2SR release.
In 12.2(33)SXH, support was added in a Cisco IOS 12.2SX release.

The following sections provide information about this feature:

Benefits of the Contextual Configuration Diff Utility

Contextual Configuration Diff Utility Output Format

Using the Contextual Configuration Diff Utility

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