Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

Mapping OpenConfig Routing Policy Commands to Junos Configuration

Note:

See OpenConfig Data Model Version topic to understand the data models supported version and its Junos OS release for Juniper Networks EX2300, EX3400, EX4300, EX4600, and EX9200 switches, MX Series, PTX Series, and QFX Series.

Table 1 to Table 3 show the mapping of OpenConfig routing policy commands to the relevant configuration in Junos.

Table 1: Defined Set Configuration

Command Name

OpenConfig Command Path

Junos Configuration

Prefix Set

/routing-policy/defined-sets/prefix-set

set policy-options prefix-list name

Neighbor Set

/routing-policy/defined-sets/neighbor-set

set policy-options neighbor-list name

Tag Set

/routing-policy/defined-sets/tag-set

set policy-options tag-list name tag-set value

Table 2: BGP Defined Set Configuration

Command Name

OpenConfig Command Path

Junos Configuration

Community Set

/routing-policy/defined-sets/bgp-defined-sets/community-set

set policy-options community name members value

AS Path Set

/routing-policy/defined-sets/bgp-defined-sets/as-path-set

Not supported

Ext Community Set

/routing-policy/defined-sets/bgp-defined-sets/ext-community-set

set policy-options community name members value

Table 3: Policy Definition Configuration

Command Name

OpenConfig Command Path

Junos Configuration

Command path prefix:

/routing-policy/policy-definition/statements/statement

Call Policy

/conditions/call-policy

set policy-options policy-statement name from policy value

Prefix Set

/conditions/match-prefix-set/prefix-set

set policy-options policy-statement name from prefix-list name

set policy-options policy-statement name from route-filter address prefix-length-range range

Match Set Options

conditions {
   match-prefix-set {
      config {
         match-set-options <>
         }
      }
   }
}
policy-options {
   policy-statement <> {
       term <> {
          from {
            route-filter-list <> invert; 
          }
       }
   } 
}

Possible OpenConfig values for match-set-options are any and invert. If you configure any, there is no Junos OS translation because this is the Junos OS default behavior. If you configure invert, the Junos OS mapping configuration is shown above, ending with route-filter-list <> invert-match.

Neighbor Set

/conditions/match-neighbor-set/neighbor-set

set policy-options policy-statement name from neighbor address

Match Neighbor Set

/conditions/match-neighbor-set/match-set-options

Not supported

Tag Set

/conditions/match-tag-set/tag-set

set policy-options policy-statement name from tag tag

Match Tag Set

/conditions/match-tag-set/match-set-options

Not supported

Install Protocol EQ

/conditions/install-protocol-eq

set policy-options policy-statement name from protocol protocol

IGP Conditions

/conditions/igp-conditions

Not supported

BGP Match Community Set

/conditions/bgp-conditions/match-community-set/community-set

set policy-options policy-statement name from community name

BGP Match Ext Community Set

/conditions/bgp-conditions/match-ext-community-set

set policy-options policy-statement name from community name

BGP Match Ext Community Set Options

/conditions/bgp-conditions/match-ext-community-set/match-set-options

Not supported

BGP Match AS Path Set

/conditions/bgp-conditions/match-as-path-set

Not supported

BGP MED EQ

/conditions/bgp-conditions/med-eq

set policy-options policy-statement name from metric metric

BGP Origin EQ

/conditions/bgp-conditions/origin-eq

set policy-options policy-statement name from origin (egp | igp | incomplete)

BGP Next Hop

/conditions/bgp-conditions/next-hop-in

set policy-options policy-statement name from next-hop address

BGP Local Preference EQ

/conditions/bgp-conditions/local-pref-eq

set policy-options policy-statement name from local-preference preference

BGP Community Count

/conditions/bgp-conditions/community-count

set policy-options policy-statement name from community-count count (equal | orhigher |orlower)

BGP AS Path Length

/conditions/bgp-conditions/as-path-length

Not supported

Accept-Route

/actions/config/accept-route

set policy-options policy-statement example-accept then accept

Reject-Route

/actions/config/reject-route

set policy-options policy-statement example-reject then reject

Set Tag

actions {
    set-tag {
         inline {
         config {
            tag <>;
         }
         }
    }
}
policy-options {
   policy-statement <> {
       term <> {
          then {
              tag  <> ;
                          }
          }
       }
   } 
}

IGP Actions

/actions/igp-actions/set-tag

set policy-options policy-statement name then tag tag

BGP Actions Set AS Path Prepend

/actions/bgp-actions/set-as-path-prepend

Not supported

BGP Actions Set Community

/actions/bgp-actions/set-community

set policy-options policy-statement name then community (set | replace | add) name

BGP Actions Set Ext Community

/actions/bgp-actions/set-ext-community

set policy-options policy-statement name then community (set | replace | add) name

BGP Actions Set Route Origin

/actions/bgp-actions/set-route-origin

set policy-options policy-statement name then origin (egp |igp | incomplete)

BGP Actions Set Local Preferences

/actions/bgp-actions/set-local-pref

set policy-options policy-statement name then local-preference preference

BGP Actions Set Next Hop

/actions/bgp-actions/set-next-hop

set policy-options policy-statement name then next-hop address

BGP Actions Set Med

/actions/bgp-actions/set-med

set policy-options policy-statement name then metric metric

BGP Actions As-Path-Prepend

/actions/bgp-actions/config/set-as-path-prepend/asn

set policy-options policy-statement name then as-path-prepend as-path