[j-nsp] Configuration Groups question...

Chris Spears cspears at eng.oar.net
Fri Apr 18 15:10:03 EDT 2008


If you want to use your description field to elicit a particular 
configuration, you need to write a commit script that can discern this. 
  You can match on text in the description and do an emit-change to 
create additional config parameters.

see 
http://www.juniper.net/techpubs/software/junos/junos90/swconfig-automation/commit-scripts1.html

As it's configured, this will add the firewall filter to each unit on 
each interface, as well as the description "<.*Transit>".  You do have 
limited regexp in [apply-]groups (and apply-path), but they're not 
conditional on previous matches.  Do a "show | display inheritance"..

Chris


Stefan Fouant wrote:
> Does anyone know if I can use Regular Expressions to match on a
> particular field in order to determine if I want to have the
> apply-group settings apply to a particular object?  For example, if I
> had several interfaces in my system which had "Transit" in their
> description, could I do match on this in order to apply my settings?
> 
> The reason I'd like to do this is so I can apply the config-group at
> the root or interfaces level of the configuration hierarchy and have
> it apply to those interfaces which match a certain description, as
> opposed to having to go into each Transit interface and manually set
> the appropriate apply-group, as in the following:
> 
> groups {
>     Management {
>         interfaces {
>             <*> {
>                 description <.*Transit>;
>                 unit <*> {
>                     family inet {
>                         filter {
>                             output transit-out-filter;
>                         }
>                     }
>                 }
>             }
>         }
>     }
> }
> interfaces {
>     apply-groups Management;
>     fe-0/0/0 {
>         description "Type:Transit|Ctype:FE";
>         unit 0 {
>             family inet {
>                 address 11.11.11.1/32;
>             }
>         }
>     }
> }
> 
> I tried this on a lab router and it crashed the box!  :)  Anyone else
> have luck doing something along these lines?  Thanks in advance,
> 
> Stefan Fouant
> _______________________________________________
> juniper-nsp mailing list juniper-nsp at puck.nether.net
> https://puck.nether.net/mailman/listinfo/juniper-nsp



More information about the juniper-nsp mailing list