All Juniper related discussions.
User avatar
m4rtin
Senior Member
Posts:
409
Joined:
Thu Sep 17, 2009 3:06 pm

hierarchy of apply-groups

Fri Sep 23, 2011 4:14 am

I made a following configuration to my router:

Code: Select all
root> show configuration             
## Last commit: 1970-02-03 13:23:03 UTC by root
groups {
    TEST2 {
        interfaces {
            <*> {
                unit <*> {
                    description switch;
                }
            }
        }
    }
    MASTER {
        interfaces {
            fxp2 {
                unit 0 {
                    apply-groups TEST2;
                }
            }
        }
    }
    MASTER2 {
        interfaces {
            fxp2 { 
                unit 0 {
                    description server;
                }
            }
        }
    }
}
system {
    root-authentication {
        encrypted-password "$1$/sxRObYO$2UuOcI0DFC9zDmCjMjzdK/"; ## SECRET-DATA
    }
    syslog {
        user * {
            any emergency;
        }
        file messages {
            any notice;
            authorization info;
        }
        file interactive-commands {
            interactive-commands any;
        }
    }               
}
interfaces {
    fxp2 {
        apply-groups MASTER;
        unit 0 {
            apply-groups MASTER2;
        }
    }
}

root>


As you can see, fxp2.0 gets it's description from group MASTER, which gets it's configuration from group TEST2 so finally the fxp2 unit 0 description would be switch. However, there is a duplicate apply-group MASTER2, which configures interface fxp2 unit 0 description to server. Is there some sort of rule, which of those groups will apply description to fxp2.0? In other words both MASTER2 and TEST2 try to set description to fxp2.0, but which one will win and why? :roll:

Mendlar
Member
Posts:
118
Joined:
Sun Jun 26, 2011 6:22 pm
Certs:
CCNP, CCDA, CCNA Security, CCNA, JNCIS-ENT

Re: hierarchy of apply-groups

Sat Sep 24, 2011 8:43 am

Both try to set the description, but only one is parsed last. Your MASTER2 apply-groups directive will be applied last since it is the farthest in the stanza.

You can confirm it using "show | display commit-scripts view" in configuration mode. It'll show you the XML output of the script and there should be something like "<description junos:group="MASTER2" junos:changed="changed">server</description>" under your fxp2 interface configuration.

User avatar
m4rtin
Senior Member
Posts:
409
Joined:
Thu Sep 17, 2009 3:06 pm

Re: hierarchy of apply-groups

Sat Sep 24, 2011 8:28 pm

Mendlar wrote:Both try to set the description, but only one is parsed last. Your MASTER2 apply-groups directive will be applied last since it is the farthest in the stanza.

You can confirm it using "show | display commit-scripts view" in configuration mode. It'll show you the XML output of the script and there should be something like "<description junos:group="MASTER2" junos:changed="changed">server</description>" under your fxp2 interface configuration.


Mendlar,
I see. So am I correct that in case MASTER2 is after the MASTER apply-group in configuration:

Code: Select all
root> show configuration interfaces fxp2
apply-groups MASTER;
unit 0 {
    apply-groups MASTER2;
}

root>


..the description will be server:

Code: Select all
root> show interfaces descriptions         
Interface       Admin Link Description
fxp2.0          up    up   server

root>



..and in case MASTER is after the MASTER2 apply-group in configuration:

Code: Select all
root> show configuration interfaces fxp2   
apply-groups MASTER2;
unit 0 {
    apply-groups MASTER;
}

root>


..the description will be switch:

Code: Select all
root> show interfaces descriptions         
Interface       Admin Link Description
fxp2.0          up    up   switch

root>



In addition to this, is the configuration, which is used by the JUNOS for processes configurations, actually the one in show configuration | display commit-scripts view output? :roll:

'

Return to Juniper Networking

Who is online

Users browsing this forum: No registered users and 9 guests