Junos OS

last person joined: 21 hours ago 

Ask questions and share experiences about Junos OS.
  • 1.  help me to understand "show configuration | rollback 1"

    Posted 02-18-2013 05:39

    hello, im new to JUNOS, have simple questions.

     

    "interfaces ge-2/1/1 unit 764]"

    i change the interface description from "test1" to "test2" and made a commit.

     

    and when i'm looking at this command: show | compare rollback 1 

    i got this result:

     

    [edit interfaces ge-2/1/1 unit 764]
    -    description "test1";
    +    description "test2"

      I think that the minus - plus signs ordered should've been vice versa...?

    it says that in rollback 1 there was no "TEST1" description, and sign plus says that rollback 1 file have "test2" description.

     



  • 2.  RE: help me to understand "show configuration | rollback 1"

    Posted 02-18-2013 08:44

    The result is correct. You are comparing your current (post commit) config to the rollback 1 config. The current config had the test1 description removed (hence the "-") and the test2 description added to it (hence the "+") 

     

    The compare is being shown relative to the current config, not relative to the rollback 1.



  • 3.  RE: help me to understand "show configuration | rollback 1"

    Posted 02-18-2013 14:00

    thanks for input...

     

    but why the command "show | compare" before the commit shows exatcly the same...


    if we seek your explanation then "show | compare" should have dispayed the "minus-plus" vice versa? cause we looking into active and candidate configuration.. and active configuration still didn't have the test2 description commited...



  • 4.  RE: help me to understand "show configuration | rollback 1"

    Posted 02-18-2013 15:13

    "# show | compare" before the commit should show the same as "> show configuration | compare rollback 1" after the commit.


    Why? "# show | compare" compares the candidate configuration with the currently active configuration.

     

    "> show configuration | compare rollback 1" compares the currently active configuration with the last active configuration.

     

    During a commit:

     

    - The candidate becomes the currently active

    - The currently active becomes the last active

     

    So it's the same stuff.



  • 5.  RE: help me to understand "show configuration | rollback 1"

    Posted 02-21-2013 15:07

     

    Somewhat confusing explanation since you are comparing commands from inside and outside of config mode.  "show | compare" or "show | compare rollback #" are used from config mode.  "show configuration | compare rollback #" is used when not in config mode.

     

    "show | compare" is the same thing as "show | compare rollback 0".  0 is the currently active configuration.  1 is the configuration that was active before 0, 2 is the one active before 1, and so on up to the commit history limit.

     

     

     

    So, why would 0 and 1 show the same when comparing inside config mode?  One simple reason is because the last commit was a confirmed commit.

    set interfaces ge-0/0/0 description "test 0/0/0"

    commit confirmed

    commit

     

    That makes rollback 0 and rollback 1 the exact same so any compare you do will be the same.  If someone does a "commit full" without any changes in order to poke all the system daemons you'll see the same thing.

     

    Another possible reason is because you are doing the show | compare from inside interfaces.  The compare shows what is different from your current configuration level and below, not the entire configuration.  If you want to compare against the entire configuration you need to be at the top level of the configuration.

     

    For example, here are two updates to two different configuration areas.

    [edit]
    cmyers@lab-mx960-1.re0# set interfaces ge-0/0/0 description "test 0" 
    
    [edit]
    cmyers@lab-mx960-1.re0# commit 
    commit complete
    
    [edit]
    cmyers@lab-mx960-1.re0# set routing-options options syslog upto debug 
    
    [edit]
    cmyers@lab-mx960-1.re0# commit 
    commit complete
    

     

    Now, I want to go in and change the description for ge-0/0/0.

    [edit]
    cmyers@lab-mx960-1.re0# edit interfaces 
    
    [edit interfaces]
    cmyers@lab-mx960-1.re0# set ge-0/0/0 description "test 2" 
    
    [edit interfaces]
    cmyers@lab-mx960-1.re0# show | compare 
    [edit interfaces ge-0/0/0]
    -  description "test 0";
    +  description "test 2";
    

     

    That's what you expect.  But what about comparing against rollback 1?

    [edit interfaces]
    cmyers@lab-mx960-1.re0# show | compare rollback 1 
    [edit interfaces ge-0/0/0]
    -  description "test 0";
    +  description "test 2";
    

     

    Because we are in the interfaces stanza, compare will only show me the differences inside the interfaces stanza, nowhere else.  To be safe and see all differences you need to be at the top of the configuration hierarchy.

    [edit interfaces]
    cmyers@lab-mx960-1.re0# top 
    
    [edit]
    cmyers@lab-mx960-1.re0# 

     

    Now, let's do the show | compare again to see how it compares to the current active config.

    [edit]
    cmyers@lab-mx960-1.re0# show | compare 
    [edit interfaces ge-0/0/0]
    -   description "test 0";
    +   description "test 2";
    

     

     OK, that's what we expect.  Now what about the config before that?

    [edit]
    cmyers@lab-mx960-1.re0# show | compare rollback 1 
    [edit interfaces ge-0/0/0]
    -   description "test 0";
    +   description "test 2";
    [edit routing-options options syslog]
    -    upto info;
    +    upto debug;
    

     

    Ah-ha!  Now we can see the other change back in rollback 1.

     

    -Chad

     



  • 6.  RE: help me to understand "show configuration | rollback 1"

    Posted 03-17-2013 02:36

    Future, what will happen to the active/running configuration now if I enter commit. What will this candidate configuration I am working on do to the currently running configuration. If you simply entered configuration (no prompts for uncommitted changes) and ran the the command, it would show nothing. When you start making changes, if you are only adding you will see +ve only. If you are removing parts of the configuration, those will show up with the -ve.

     

    command: show | compare  ("show'" the active configuration and "compare" it with the the candidate configuration)

    the -ve in this case means what will be removed from the active configuration and the +ve means what will be added to the active configuration, if you committed the current candidate configuration.

    In other words, show me what changes I will make to the active configuratin, because when you entered configutation mode, you were presented with a candidate copy which was populated with the active configuration. 

    Past- what happened a while ago. Show me what did I remove from the active/running configuration (-ve) and what did I add (+ve) when committed last (rollback 1) If you were to load rollback 1, then show | compare, the signs would switch, because rollback 1 (-ve) will become the current candidate configuration and the -ve, what was removed, would become positive and the +ve what was added will become -ve, what will be reoved if the commit was entered.

    slightly different take 

    command: show | compare rollback 1 ("show" what was removed from the active configuration and "cmpare" what was in the candidate configuration that was added +ve when you committed that configuration)