Junos
Reply
Regular Visitor
nigelwensley
Posts: 5
Registered: ‎09-27-2011
0
Accepted Solution

Use Groups to add OSPF/IS-IS interfaces?

Does anyone know how to use groups to bulk apply interfaces to OSPF or IS-IS? I have tried with no success. The following configuration for example does not work.

groups {
ospf-interfaces {
protocols {
ospf {
area <*> {
interface <ge-0/0/0.*>;
}
}
}
}
isis-interfaces {
protocols {
isis {
interface <ge-0/0/0.*>;
}
}
}

protocols {
ospf {
apply-groups ospf-interfaces;
}
isis {
apply-groups isis-interfaces;
}

r1# run show isis interface

r1# run show ospf interface

Trusted Expert
Trusted Expert
jtb
Posts: 314
Registered: ‎08-26-2009
0

Re: Use Groups to add OSPF/IS-IS interfaces?

hi,

 

http://www.juniper.net/techpubs/en_US/junos9.6/information-products/topic-collections/swconfig-cli/u... says:

 

You can also use wildcards in a configuration group to allow configuration data to be inherited by any object that matches a wildcard expression

 

So, you can use wildcards to match any existing object, not to add objects matching wildcard.

 

As you noticed,  your config will not work:

admin@gw# show groups isis-interfaces 
protocols {
    isis {
        interface <fe-0/1/*.*> {
            passive;
        }
    }
}

admin@gw# show protocols isis 
apply-groups isis-interfaces;

[edit]
admin@gw# 
admin@gw# show protocols isis | display inheritance 

[edit]

 

The same group applied to modified isis configuration, changes configuration of matching interfaces:

admin@gw# show protocols isis                          
apply-groups isis-interfaces;
interface fe-0/1/2.123;
interface fe-0/1/3.456;
interface fe-1/0/0.789;

[edit]

admin@gw# show protocols isis | display inheritance    
interface fe-0/1/2.123 {
    ##
    ## 'passive' was inherited from group 'isis-interfaces'
    ##
    passive;
}
interface fe-0/1/3.456 {
    ##
    ## 'passive' was inherited from group 'isis-interfaces'
    ##
    passive;
}
interface fe-1/0/0.789;

[edit]

 

It's possible to use group to add interfaces to isis protocol, but we can't use wildcards in interface names:

admin@gw# show groups isis-add-interfaces                         
protocols {
    isis {
        interface fe-0/1/2.222;
        interface fe-0/1/3.333;
    }
}

[edit]

admin@gw# show protocols isis                          
apply-groups isis-add-interfaces;

[edit]
admin@gw# show protocols isis | display inheritance    
##
## 'fe-0/1/2.222' was inherited from group 'isis-add-interfaces'
##
interface fe-0/1/2.222;
##
## 'fe-0/1/3.333' was inherited from group 'isis-add-interfaces'
##
interface fe-0/1/3.333;

[edit]
admin@gw# 

 

Anyway, I see no gain here and prefer to add the interfaces explicitly under protocol isis and have full control.

It's also possible to add  'interface all' under isis and use group to add  'family iso' only to interfaces matching wildcard. 

jtb

Regular Visitor
nigelwensley
Posts: 5
Registered: ‎09-27-2011
0

Re: Use Groups to add OSPF/IS-IS interfaces?

Thank you jtb, as you say there is no gain from configuring IS-IS this way. It is useful to create a group to add "family iso" and "family mpls" to selected interfaces using wildcards, then configure IS-IS for interface all. 

 

I was really hoping it was possible more for OSPF, as configuring "interface all" is not desirable there, and adding interfaces one by one is tiresome.

Recognized Expert
erdems
Posts: 191
Registered: ‎12-30-2008
0

Re: Use Groups to add OSPF/IS-IS interfaces?

Hey Nigel,

 

 Have you considered using commit scripts?

 

 You can build a simple script that would automatically add every interface with family iso configured also as protocols isis interface xxx (and more, if you like).

 

 The logic will basically be that if you have family iso configured for an interface, it is a core-facing interface and therefore should have other functionality enabled like MPLS or a specific firewall filter/CoS implementation.

 

 I personally prefer scripts over groups for automation for they avoid the need of "|display inheritance" after a show command.

 

Cheers,

____________________________________________
If you think your question's answered, please
mark the respective post as "Accepted Solution".

Kudos are an excellent way of showing appreciation, too.
Copyright© 1999-2013 Juniper Networks, Inc. All rights reserved.