networking-forum.com
Community BlogCommunity Wiki * Register  * Search  * Login
View unanswered postsView active topics

All times are UTC - 6 hours [ DST ]



Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Fri Sep 23, 2011 4:14 am 
Offline
Senior Member
Senior Member
User avatar

Joined: Thu Sep 17, 2009 3:06 pm
Posts: 272
I made a following configuration to my router:

Code:
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:


Top
 Profile  
 
PostPosted: Sat Sep 24, 2011 8:43 am 
Offline
Member
Member

Joined: Sun Jun 26, 2011 6:22 pm
Posts: 108
Location: Quebec, Canada
Certs: CCNP, CCNA Security, CCNA, JNCIS-ENT
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.


Top
 Profile  
 
PostPosted: Sat Sep 24, 2011 8:28 pm 
Offline
Senior Member
Senior Member
User avatar

Joined: Thu Sep 17, 2009 3:06 pm
Posts: 272
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:
root> show configuration interfaces fxp2
apply-groups MASTER;
unit 0 {
    apply-groups MASTER2;
}

root>


..the description will be server:

Code:
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:
root> show configuration interfaces fxp2   
apply-groups MASTER2;
unit 0 {
    apply-groups MASTER;
}

root>


..the description will be switch:

Code:
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:


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group