Just a quick post to show how one can compared what is in the startup-configuration
compared to the running-configuration or to compare to different configurations
stored on flash on Cisco devices.

The device boots up with the startup-configuration. Then we add some commands to
the running-configuration but we do not save them.

R1(config)#int f0/0
R1(config-if)#ip add 192.168.0.1 255.255.255.0
R1(config-if)#no shut
R1(config-if)#description link to Datacenter
R1(config-if)#ip route 192.168.2.0 255.255.255.0 192.168.0.2

Then the show archive command is used to show what’s different between the two versions.

R1#show archive config differences
Contextual Config Diffs:
interface FastEthernet0/0
 +no ip address
 +shutdown
interface FastEthernet0/0
 -description link to Datacenter
 -ip address 192.168.0.1 255.255.255.0
-ip route 192.168.2.0 255.255.255.0 192.168.0.2

Commands with a + sign in front of it are present in the startup-configuration but
not in the running-configuration. If there is a – sign then they are present in the
running-configuration but not in startup-configuration.

It is also possible to compare a file stored in NVRAM to the running-configuration.

R1#dir flash:
Directory of flash:/

    1  -rw-         967                      config.old

16777212 bytes total (16776180 bytes free)

R1(config)#int f0/1
R1(config-if)#ip add 10.0.0.1 255.255.255.0
R1(config-if)#no shut
R1(config-if)#description to Firewall
R1#show archive config differences system:running-config flash:config.old
Contextual Config Diffs:
interface FastEthernet0/1
 +no ip address
 +shutdown
interface FastEthernet0/1
 -description to Firewall
 -ip address 10.0.0.1 255.255.255.0

Just a little tool that may be helpful to see what is different between versions. It
could be used for such things as editing an ACL by uploading a file to the device.
Then do a diff between the files to see what is changing in the ACL.

Cisco diff – compare configurations
Tagged on:                 

6 thoughts on “Cisco diff – compare configurations

  • February 2, 2014 at 10:25 pm
    Permalink

    Hi Daniel, I am sure you know this already. There is another command that will give a clean list of commands — as they should be applied to rollback: This allows for a straight-forward cut-(edit)-and-paste.

    show archive config INCREMENTAL-DIFFS flash:config.old

    Love your blog.

    Reply
    • February 6, 2014 at 11:25 pm
      Permalink

      Thanks for the kind words Mark and thanks for contributing in the comments!

      I’m thinking if I know any else of these things that could help my readers out.

      Reply
  • February 19, 2014 at 10:46 am
    Permalink

    Hi Daniel,
    Very good post indeed, I discovered a useful new thing. Keep on

    Mohamed Nidhal beyrem Jaziri
    CCIE # 38232
    Tunisia

    Reply
  • June 10, 2015 at 10:18 pm
    Permalink

    HI ,

    My GSR router has installed image : IOS ™ GS Software (C12KPRP-K4P-M), Version 12.0(32)SY12, RELEASE SOFTWARE (fc1) . It doesn’t support sh archive config diff. How to compare the difference between running-config and startup-config ?

    Thanks

    lily

    Reply
  • January 11, 2018 at 8:46 am
    Permalink

    Also in ASA ‘ sh archive…’ command doesn’t exist. How to compare configs then?

    Reply
    • November 12, 2021 at 8:00 am
      Permalink

      sh run | incl checksum:
      sh start | incl checksum:

      and compare the output

      Reply

Leave a Reply

Your email address will not be published. Required fields are marked *