RIB Policy Configuration¶
The OpenDaylight BGP implementation supports configurable RIB policies that allow the modification of import and export policies.
Note
Default ODL BGP RIB Config Policy is provided. Default policy is compliant with default behaviour from RFC8212. Any config policy to be used by Protocol must be configured and present before than Protocol configuration is added. If policy is reconfigured, protocol must be re configured again.
URL: /rests/data/openconfig-routing-policy:routing-policy?content=config
Method: GET
Content-Type: application/xml
Request Body:
1<routing-policy xmlns="http://openconfig.net/yang/routing-policy">
2 <defined-sets>
3 <bgp-defined-sets xmlns="http://openconfig.net/yang/bgp-policy">
4 <cluster-id-sets xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
5 ...
6 </cluster-id-sets>
7 <role-sets xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
8 ...
9 </role-sets>
10 <originator-id-sets xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
11 ...
12 </originator-id-sets>
13 </bgp-defined-sets>
14 </defined-sets>
15 <policy-definitions>
16 <policy-definition>
17 <name>default-odl-export-policy</name>
18 <statements>
19 <statement>
20 <name>to-odl-internal</name>
21 <actions>
22 <bgp-actions xmlns="http://openconfig.net/yang/bgp-policy">
23 ...
24 </bgp-actions>
25 </actions>
26 <conditions>
27 <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
28 ...
29 </bgp-conditions>
30 </conditions>
31 </statement>
32 ...
33 </statements>
34 </policy-definition>
35 <policy-definition>
36 <name>default-odl-import-policy</name>
37 ...
38 </policy-definition>
39 </policy-definitions>
40</routing-policy>
@line 2: BGP defined sets.
@line 15: Policy definitions.
Content-Type: application/json
Request Body:
1{
2 "routing-policy": {
3 "defined-sets": {
4 "bgp-defined-sets": {
5 "cluster-id-sets": "...",
6 "role-sets": "...",
7 "originator-id-sets": "..."
8 }
9 },
10 "policy-definitions": {
11 "policy-definition": [
12 {
13 "name": "default-odl-export-policy",
14 "statements": {
15 "statement": {
16 "name": "to-odl-internal",
17 "actions": {
18 "bgp-actions": "..."
19 },
20 "conditions": {
21 "bgp-conditions": "..."
22 }
23 },
24 "#text": "..."
25 }
26 },
27 {
28 "name": "default-odl-import-policy",
29 "#text": "..."
30 }
31 ]
32 }
33 }
34}
@line 3: BGP defined sets.
@line 10: Policy definitions.
Policy Configuration¶
Conditions may include multiple match or comparison operations; similarly, actions may consist of a multitude of changes to route attributes or a final disposition regarding the acceptance or rejection of the route.
URL: /rests/data/openconfig-routing-policy:routing-policy/openconfig-routing-policy:policy-definitions
Method: POST
Content-Type: application/xml
Request Body:
1<policy-definition xmlns="http://openconfig.net/yang/routing-policy">
2 <name>odl-policy-example</name>
3 <statements>
4 <statement>
5 <name>reject-all-incoming-routes</name>
6 <actions>
7 <reject-route/>
8 </actions>
9 <conditions>
10 <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
11 <match-role-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
12 <from-role>
13 <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="all"]</role-set>
14 </from-role>
15 </match-role-set>
16 </bgp-conditions>
17 </conditions>
18 </statement>
19 </statements>
20</policy-definition>
@line 2: The unique policy instance identifier.
@line 5: Policy Statement Identifier.
@line 7: Actions.
@line 10: BGP Conditions.
Content-Type: application/json
Request Body:
1{
2 "policy-definition": [
3 {
4 "name": "odl-policy-example",
5 "statements": {
6 "statement": [
7 {
8 "name": "reject-all-incoming-routes",
9 "actions": {
10 "reject-route": [
11 null
12 ]
13 },
14 "conditions": {
15 "openconfig-bgp-policy:bgp-conditions": {
16 "odl-bgp-policy:match-role-set": {
17 "from-role": {
18 "role-set": "/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name=\"all\"]"
19 }
20 }
21 }
22 }
23 }
24 ]
25 }
26 }
27 ]
28}
@line 4: The unique policy instance identifier.
@line 8: Policy Statement Identifier.
@line 10: Actions.
@line 15: BGP Conditions.
The new instance presence can be verified via REST:
URL: /rests/data/openconfig-routing-policy:routing-policy/openconfig-routing-policy:policy-definitions/policy-definition=odl-policy-example
Method: GET
Response Body:
1<policy-definition xmlns="http://openconfig.net/yang/routing-policy">
2 <name>odl-policy-example</name>
3 <statements>
4 <statement>
5 <name>reject-all-incoming-routes</name>
6 <actions>
7 <reject-route></reject-route>
8 </actions>
9 <conditions>
10 <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
11 <match-role-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
12 <from-role>
13 <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="all"]</role-set>
14 <match-set-options>ANY</match-set-options>
15 </from-role>
16 </match-role-set>
17 </bgp-conditions>
18 </conditions>
19 </statement>
20 </statements>
21</policy-definition>
@line 2: Policy definition Identifier.
@line 5: Policy Statement Identifier.
Response Body:
1{
2 "policy-definition": [
3 {
4 "name": "odl-policy-example",
5 "statements": {
6 "statement": [
7 {
8 "name": "reject-all-incoming-routes",
9 "actions": {
10 "reject-route": [
11 null
12 ]
13 },
14 "conditions": {
15 "openconfig-bgp-policy:bgp-conditions": {
16 "odl-bgp-policy:match-role-set": {
17 "from-role": {
18 "role-set": "/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name=\"all\"]"
19 }
20 }
21 }
22 }
23 }
24 ]
25 }
26 }
27 ]
28}
@line 4: Policy definition Identifier.
@line 8: Policy Statement Identifier.
Actions¶
ODL BGP by default provides support for a group of BGP Actions.
Accept¶
Default policy to accept the route.
1<actions>
2 <accept-route/>
3</actions>
1{
2 "actions": {
3 "accept-route": {
4 }
5 }
6}
Reject¶
Default policy to reject the route.
1<actions>
2 <reject-route/>
3</actions>
1{
2 "actions": {
3 "reject-route" : {
4 }
5 }
6}
As-path prepend¶
Action to prepend local AS number to the AS-path
1<actions>
2 <bgp-actions xmlns="http://openconfig.net/yang/bgp-policy">
3 <set-as-path-prepend/>
4 </bgp-actions>
5</actions>
1{
2 "actions": {
3 "bgp-actions" : {
4 "set-as-path-prepend": {
5 }
6 }
7 }
8}
Originator Id prepend¶
Action to prepend Originator Id. In case there is non Originator Id present, local Originator Id is prepend.
Local
1<bgp-actions xmlns="http://openconfig.net/yang/bgp-policy">
2 <set-originator-id-prepend xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy"/>
3</bgp-actions>
1{
2 "bgp-actions" : {
3 "set-originator-id-prepend": {
4 }
5 }
6}
By value
1<bgp-actions xmlns="http://openconfig.net/yang/bgp-policy">
2 <set-originator-id-prepend xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
3 <originator-id>192.0.2.1</originator-id>
4 </set-originator-id-prepend>
5</bgp-actions>
1{
2 "bgp-actions" : {
3 "set-originator-id-prepend": {
4 "originator-id": "192.0.2.1"
5 }
6 }
7}
Cluster Id prepend¶
Action to prepend local Cluster Id to Cluster Id List.
1<actions>
2 <bgp-actions xmlns="http://openconfig.net/yang/bgp-policy">
3 <set-cluster-id-prepend xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy"/>
4 </bgp-actions>
5</actions>
1{
2 "actions": {
3 "bgp-actions" : {
4 "set-cluster-id-prepend": {
5 }
6 }
7 }
8}
Set Route Origin¶
Set the origin attribute to the specified value.
1<actions>
2 <bgp-actions xmlns="http://openconfig.net/yang/bgp-policy">
3 <set-route-origin>IGP</set-route-origin>
4 </bgp-actions>
5</actions>
1{
2 "actions": {
3 "bgp-actions" : {
4 "set-route-origin": "IGP"
5 }
6 }
7}
Set Local Preference¶
Set the local pref attribute on the route update.
1<actions>
2 <bgp-actions xmlns="http://openconfig.net/yang/bgp-policy">
3 <set-local-pref>100</set-local-pref>
4 </bgp-actions>
5</actions>
1{
2 "actions": {
3 "bgp-actions" : {
4 "set-local-pref": 100
5 }
6 }
7}
Set NextHop¶
Set the next-hop attribute in the route update.
Local
1<actions>
2 <bgp-actions xmlns="http://openconfig.net/yang/bgp-policy">
3 <set-next-hop>SELF</set-next-hop>
4 </bgp-actions>
5</actions>
1{
2 "actions": {
3 "bgp-actions" : {
4 "set-next-hop": "SELF"
5 }
6 }
7}
By value
1<actions>
2 <bgp-actions xmlns="http://openconfig.net/yang/bgp-policy">
3 <set-next-hop>4.5.6.7</set-next-hop>
4 </bgp-actions>
5</actions>
1{
2 "actions": {
3 "bgp-actions" : {
4 "set-next-hop": "4.5.6.7"
5 }
6 }
7}
Set MED¶
Set the med metric attribute in the route update.
1<actions>
2 <bgp-actions xmlns="http://openconfig.net/yang/bgp-policy">
3 <set-med>15</set-med>
4 </bgp-actions>
5</actions>
1{
2 "actions": {
3 "bgp-actions" : {
4 "set-med": 15
5 }
6 }
7}
Community set prepend¶
Action to set the community attributes of the route, along with options to modify how the community is modified.
Inline
1<actions>
2 <bgp-actions xmlns="http://openconfig.net/yang/bgp-policy">
3 <set-community>
4 <communities>
5 <as-number>65</as-number>
6 <semantics>10</semantics>
7 </communities>
8 <communities>
9 <as-number>66</as-number>
10 <semantics>11</semantics>
11 </communities>
12 <options>ADD</options>
13 </set-community>
14 </bgp-actions>
15</actions>
@line 3: Set Community.
1{
2 "actions": {
3 "bgp-actions" : {
4 "set-community": {
5 "communities": [
6 {
7 "as-number": 65,
8 "semantics": 10
9 },
10 {
11 "as-number": 66,
12 "semantics": 11
13 }
14 ],
15 "options": "ADD"
16 }
17 }
18 }
19}
@line 4: Set Community.
By reference
1<actions>
2 <bgp-actions xmlns="http://openconfig.net/yang/bgp-policy">
3 <set-community>
4 <community-set-ref>
5 /rpol:routing-policy/rpol:defined-sets/rpol:community-sets/community-set[community-set-name="community-set-name-example"]
6 </community-set-ref>
7 <options>ADD</options>
8 </set-community>
9 </bgp-actions>
10</actions>
@line 3: Set Community.
@line 5: Community set reference.
@line 7: Options are ADD, REMOVE, REPLACE.
1{
2 "actions": {
3 "bgp-actions" : {
4 "set-community": {
5 "community-set-ref": "/rpol:routing-policy/rpol:defined-sets/rpol:community-sets/community-set[community-set-name=\"community-set-name-example\"]",
6 "options": "ADD"
7 }
8 }
9 }
10}
@line 4: Set Community.
@line 5: Community set reference.
@line 6: Options are ADD, REMOVE, REPLACE.
Defined set
1<defined-sets>
2 <bgp-defined-sets xmlns="http://openconfig.net/yang/bgp-policy">
3 <community-sets>
4 <community-set>
5 <community-set-name>community-set-name-test</community-set-name>
6 <communities>
7 <as-number>65</as-number>
8 <semantics>10</semantics>
9 </communities>
10 <communities>
11 <as-number>66</as-number>
12 <semantics>11</semantics>
13 </communities>
14 </community-set>
15 </community-sets>
16 </bgp-defined-sets>
17</defined-sets>
@line 3: Community set.
1{
2 "defined-sets": {
3 "bgp-defined-sets" : {
4 "community-sets": {
5 "community-set": {
6 "community-set-name": "community-set-name-test",
7 "communities": [
8 {
9 "as-number": 65,
10 "semantics": 10
11 },
12 {
13 "as-number": 66,
14 "semantics": 11
15 }
16 ]
17 }
18 }
19 }
20 }
21}
@line 4: Set Community.
Extended Community set action¶
Action to set the extended community attributes of the route, along with options to modify how the community is modified.
Inline
1<actions>
2 <bgp-actions xmlns="http://openconfig.net/yang/bgp-policy">
3 <set-ext-community>
4 <ext-community-member>
5 <encapsulation-extended-community>
6 <tunnel-type>vxlan</tunnel-type>
7 </encapsulation-extended-community>
8 </ext-community-member>
9 <ext-community-member>
10 <as-4-route-origin-extended-community>
11 <as-4-specific-common>
12 <as-number>65000</as-number>
13 <local-administrator>123</local-administrator>
14 </as-4-specific-common>
15 </as-4-route-origin-extended-community>
16 </ext-community-member>
17 <options>ADD</options>
18 </set-ext-community>
19 </bgp-actions>
20</actions>
@line 3: Set Extended Community.
1{
2 "actions": {
3 "bgp-actions": {
4 "set-ext-community": {
5 "ext-community-member": [
6 {
7 "encapsulation-extended-community": {
8 "tunnel-type": "vxlan"
9 }
10 },
11 {
12 "as-4-route-origin-extended-community": {
13 "as-4-specific-common": {
14 "as-number": "65000",
15 "local-administrator": "123"
16 }
17 }
18 }
19 ],
20 "options": "ADD"
21 }
22 }
23 }
24}
@line 4: Set Extended Community.
By reference
1<actions>
2 <bgp-actions xmlns="http://openconfig.net/yang/bgp-policy">
3 <set-ext-community>
4 <ext-community-set-ref>
5 /rpol:routing-policy/rpol:defined-sets/rpol:ext-community-sets/ext-community-set[ext-community-set-name="ext-community-set-name-example"]
6 </ext-community-set-ref>
7 <options>REMOVE</options>
8 </set-ext-community>
9 </bgp-actions>
10</actions>
@line 3: Set Extended Community.
@line 5: Extended Community set reference.
@line 7: Options are ADD, REMOVE, REPLACE.
1{
2 "actions": {
3 "bgp-actions" : {
4 "set-ext-community": {
5 "ext-community-set-ref": "/rpol:routing-policy/rpol:defined-sets/rpol:community-sets/community-set[community-set-name=\"community-set-name-example\"]",
6 "options": "REMOVE"
7 }
8 }
9 }
10}
@line 4: Set Extended Community.
@line 5: Extended Community set reference.
@line 6: Options are ADD, REMOVE, REPLACE.
Defined set
1<defined-sets>
2 <bgp-defined-sets xmlns="http://openconfig.net/yang/bgp-policy">
3 <ext-community-sets>
4 <ext-community-set>
5 <ext-community-set-name>ext-community-set-name-test</ext-community-set-name>
6 <ext-community-member>
7 <encapsulation-extended-community>
8 <tunnel-type>vxlan</tunnel-type>
9 </encapsulation-extended-community>
10 </ext-community-member>
11 <ext-community-member>
12 <as-4-route-origin-extended-community>
13 <as-4-specific-common>
14 <as-number>65000</as-number>
15 <local-administrator>123</local-administrator>
16 </as-4-specific-common>
17 </as-4-route-origin-extended-community>
18 </ext-community-member>
19 </ext-community-set>
20 </ext-community-sets>
21 </bgp-defined-sets>
22</defined-sets>
@line 3: Extendend Community set.
@line 5: Extendend Community set name.
1{
2 "defined-sets": {
3 "bgp-defined-sets" : {
4 "ext-community-sets": {
5 "ext-community-set": {
6 "ext-community-set-name": "ext-community-set-name-test",
7 "ext-community-member": [
8 {
9 "encapsulation-extended-community": {
10 "tunnel-type": "vxlan"
11 },
12 "as-4-route-origin-extended-community": {
13 "as-4-specific-common": {
14 "as-number": 65000,
15 "local-administrator": 123
16 }
17 }
18 }
19 ]
20 }
21 }
22 }
23 }
24}
@line 4: Extendend Community set.
@line 5: Extendend Community set name.
Filter Non transitive attributes¶
Filters attributes, removing non transitive attributes.
1<actions>
2 <bgp-actions xmlns="http://openconfig.net/yang/bgp-policy">
3 <non-transitive-attributes-filter xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy"/>
4 </bgp-actions>
5</actions>
1{
2 "actions": {
3 "bgp-actions" : {
4 "non-transitive-attributes-filter": {
5 }
6 }
7 }
8}
Client Attribute Prepend¶
Replace attributes per any VPN Route attributes from client Peer, if present.
1<actions>
2 <bgp-actions xmlns="http://openconfig.net/yang/bgp-policy">
3 <client-attribute-prepend xmlns="urn:opendaylight:params:xml:ns:yang:bgp:route:target:constrain"/>
4 </bgp-actions>
5</actions>
1{
2 "actions": {
3 "bgp-actions" : {
4 "client-attribute-prepend": {
5 }
6 }
7 }
8}
Conditions¶
ODL BGP by default provides support for a group of BGP Conditions.
Match BGP Neighbor Set¶
1<conditions>
2 <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
3 <match-bgp-neighbor-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
4 <from-neighbor>
5 <neighbor-set>/rpol:routing-policy/rpol:defined-sets/rpol:neighbor-sets/neighbor-set[neighbor-set-name="bgp-neighbor-set-example"]</neighbor-set>
6 <match-set-options>INVERT</match-set-options>
7 </from-neighbor>
8 </match-bgp-neighbor-set>
9 </bgp-conditions>
10</conditions>
@line 3: Match BGP Neighbor Condition set.
@line 4: Match BGP Neighbor from whom we receive the route.
@line 5: Match BGP Neighbor Set reference.
@line 6: Match Set Options (ANY, INVERT)
1{
2 "conditions": {
3 "bgp-conditions" : {
4 "match-bgp-neighbor-set": {
5 "from-neighbor": {
6 "neighbor-set": "/rpol:routing-policy/rpol:defined-sets/rpol:neighbor-sets/neighbor-set[neighbor-set-name=\"bgp-neighbor-set-example\"]",
7 "match-set-options": "INVERT"
8 }
9 }
10 }
11 }
12}
@line 4: Match BGP Neighbor Condition set.
@line 5: Match BGP Neighbor from whom we receive the route.
@line 6: Match BGP Neighbor Set reference.
@line 7: Match Set Options (ANY, INVERT)
1<conditions> 2 <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy"> 3 <match-bgp-neighbor-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy"> 4 <to-neighbor> 5 <neighbor-set>/rpol:routing-policy/rpol:defined-sets/rpol:neighbor-sets/neighbor-set[neighbor-set-name="bgp-neighbor-set-example"]</neighbor-set> 6 <match-set-options>INVERT</match-set-options> 7 </to-neighbor> 8 </match-bgp-neighbor-set> 9 </bgp-conditions> 10</conditions>
@line 3: Match BGP Neighbor Condition set.
@line 4: Match BGP Neighbor to whom we send the route.
@line 5: Match BGP Neighbor Set reference.
@line 6: Match Set Options (ANY, INVERT)
1{
2 "conditions": {
3 "bgp-conditions" : {
4 "match-bgp-neighbor-set": {
5 "to-neighbor": {
6 "neighbor-set": "/rpol:routing-policy/rpol:defined-sets/rpol:neighbor-sets/neighbor-set[neighbor-set-name=\"bgp-neighbor-set-example\"]",
7 "match-set-options": "INVERT"
8 }
9 }
10 }
11 }
12}
@line 4: Match BGP Neighbor Condition set.
@line 5: Match BGP Neighbor to whom we receive the route.
@line 6: Match BGP Neighbor Set reference.
@line 7: Match Set Options (ANY, INVERT)
1<conditions>
2 <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
3 <match-bgp-neighbor-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
4 <from-neighbor>
5 <neighbor-set>/rpol:routing-policy/rpol:defined-sets/rpol:neighbor-sets/neighbor-set[neighbor-set-name="bgp-neighbor-set-example"]</neighbor-set>
6 </from-neighbor>
7 <to-neighbor>
8 <neighbor-set>/rpol:routing-policy/rpol:defined-sets/rpol:neighbor-sets/neighbor-set[neighbor-set-name="bgp-neighbor-set-example"]</neighbor-set>
9 <match-set-options>INVERT</match-set-options>
10 </to-neighbor>
11 </match-bgp-neighbor-set>
12 </bgp-conditions>
13</conditions>
@line 3: Match BGP Neighbor Condition set.
@line 4: Match BGP Neighbor from whom we receive the route.
@line 5: Match BGP Neighbor Set reference.
@line 7: Match BGP Neighbor to whom we send the route.
@line 8: Match BGP Neighbor Set reference.
@line 9: Match Set Options (ANY, INVERT)
1{
2 "conditions": {
3 "bgp-conditions" : {
4 "match-bgp-neighbor-set": {
5 "from-neighbor": {
6 "neighbor-set": "/rpol:routing-policy/rpol:defined-sets/rpol:neighbor-sets/neighbor-set[neighbor-set-name=\"bgp-neighbor-set-example\"]",
7 },
8 "to-neighbor": {
9 "neighbor-set": "/rpol:routing-policy/rpol:defined-sets/rpol:neighbor-sets/neighbor-set[neighbor-set-name=\"bgp-neighbor-set-example\"]",
10 "match-set-options": "INVERT"
11 }
12 }
13 }
14 }
15}
@line 4: Match BGP Neighbor Condition set.
@line 5: Match BGP Neighbor from whom we receive the route.
@line 6: Match BGP Neighbor Set reference.
@line 8: Match BGP Neighbor to whom we send the route.
@line 9: Match BGP Neighbor Set reference.
@line 10: Match Set Options (ANY, INVERT)
Defined set
1<defined-sets>
2 <neighbor-sets>
3 <neighbor-set>
4 <neighbor-set-name>bgp-neighbor-set-example</neighbor-set-name>
5 <neighbor>
6 <address>127.0.0.1</address>
7 </neighbor>
8 <neighbor>
9 <address>127.0.0.2</address>
10 </neighbor>
11 </neighbor-set>
12 </neighbor-sets>
13</defined-sets>
@line 3: Originator Id Set.
@line 5: Originator Id Set name.
1{
2 "defined-sets": {
3 "neighbor-sets": {
4 "neighbor-set": {
5 "neighbor-set-name": "bgp-neighbor-set-example",
6 "neighbor": [
7 {
8 "address": "127.0.0.1"
9 },
10 {
11 "address": "127.0.0.2"
12 }
13 ]
14 }
15 }
16 }
17}
@line 4: Originator Id Set.
@line 5: Originator Id Set name.
Match Originator Id Set¶
1<conditions>
2 <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
3 <match-originator-id-set-condition xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
4 <originator-id-set>
5 /rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/originator-id-sets/originator-id-set[originator-set-name="local-originator-id"]
6 </originator-id-set>
7 <match-set-options>INVERT</match-set-options>
8 </match-originator-id-set-condition>
9 </bgp-conditions>
10</conditions>
@line 3: Match Originator Id Condition set.
@line 5: Match Originator Id Set reference.
@line 7: Match Set Options (ANY, INVERT)
1{
2 "conditions": {
3 "bgp-conditions" : {
4 "match-originator-id-set-condition": {
5 "originator-id-set": "/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/originator-id-sets/originator-id-set[originator-set-name=\"local-originator-id\"]",
6 "match-set-options": "INVERT"
7 }
8 }
9 }
10}
@line 4: Match Originator Id Condition set.
@line 5: Match Originator Id Set reference.
@line 6: Match Set Options (ANY, INVERT)
Defined set
1<defined-sets>
2 <bgp-defined-sets xmlns="http://openconfig.net/yang/bgp-policy">
3 <originator-id-sets xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
4 <originator-id-set>
5 <originator-id-set-name>local-originator-id</originator-id-set-name>
6 <local/>
7 </originator-id-set>
8 </originator-id-sets>
9 </bgp-defined-sets>
10</defined-sets>
@line 3: Originator Id Set.
@line 5: Originator Id Set name.
1{
2 "defined-sets": {
3 "bgp-defined-sets" : {
4 "originator-id-sets": {
5 "originator-id-set": {
6 "originator-id-set-name": "local-originator-id"
7 }
8 }
9 }
10 }
11}
@line 4: Originator Id Set.
@line 5: Originator Id Set name.
Match Cluster Id Set¶
1<conditions>
2 <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
3 <match-cluster-id-set-condition xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
4 <cluster-id-set>
5 /rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/cluster-id-sets/cluster-id-set[cluster-set-name="local-cluster-id"]
6 </cluster-id-set>
7 <match-set-options>INVERT</match-set-options>
8 </match-cluster-id-set-condition>
9 </bgp-conditions>
10</conditions>
@line 3: Match Cluster Id Condition set.
@line 5: Match Cluster Id Set reference.
1{
2 "conditions": {
3 "bgp-conditions" : {
4 "match-cluster-id-set-condition": {
5 "cluster-id-set": "/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/cluster-id-sets/cluster-id-set[cluster-set-name=\"local-cluster-id\"]",
6 "match-set-options": "INVERT"
7 }
8 }
9 }
10}
@line 4: Match Cluster Id Condition set.
@line 5: Match Cluster Id Set reference.
Defined set
1<defined-sets>
2 <bgp-defined-sets xmlns="http://openconfig.net/yang/bgp-policy">
3 <cluster-id-sets xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
4 <cluster-id-set>
5 <cluster-id-set-name>local-cluster-id</cluster-id-set-name>
6 <local/>
7 </cluster-id-set>
8 </cluster-id-sets>
9 </bgp-defined-sets>
10</defined-sets>
@line 3: Cluster Id Set.
@line 5: Cluster Id Set name.
1{
2 "defined-sets": {
3 "bgp-defined-sets" : {
4 "cluster-id-sets": {
5 "cluster-id-set": {
6 "cluster-id-set-name": "local-cluster-id"
7 }
8 }
9 }
10 }
11}
@line 4: Cluster Id Set.
@line 5: Cluster Id Set name.
Match Peer Role Set¶
1<conditions>
2 <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
3 <match-role-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
4 <from-role>
5 <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="only-ibgp"]</role-set>
6 <match-set-options>INVERT</match-set-options>
7 </from-role>
8 <to-role>
9 <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="all"]</role-set>
10 <to-role>
11 </match-role-set>
12 </bgp-conditions>
13</conditions>
@line 3: Match Role Set.
@line 5: Match Role Set reference.
@line 6: Match Set Options (ANY, INVERT)
1{
2 "conditions": {
3 "bgp-conditions" : {
4 "match-role-set": {
5 "from-role": {
6 "role-set": "/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name=\"only-ibgp\"]"
7 "match-set-options": "INVERT"
8 },
9 "to-role": {
10 "role-set": "/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name=\"all\"]"
11 }
12 }
13 }
14 }
15}
@line 4: Match Role Set.
@line 6: Match Role Set reference.
@line 7: Match Set Options (ANY, INVERT)
Defined set
1<defined-sets>
2 <bgp-defined-sets xmlns="http://openconfig.net/yang/bgp-policy">
3 <role-set>
4 <role-set-name>all</role-set-name>
5 <role>ebgp</role>
6 <role>ibgp</role>
7 <role>rr-client</role>
8 <role>internal</role>
9 </role-set>
10 <role-set>
11 <role-set-name>only-ibgp</role-set-name>
12 <role>ibgp</role>
13 </role-set>
14 </bgp-defined-sets>
15</defined-sets>
@line 3: Role Set.
@line 4: Role Set name.
@line 10: Role Set.
@line 11: Role Id Set name.
1{
2 "defined-sets": {
3 "bgp-defined-sets" : {
4 "role-set": [
5 {
6 "role-set-name": "all",
7 "role": [
8 "ebgp",
9 "ibgp",
10 "rr-client",
11 "internal"
12 ]
13 },
14 {
15 "role-set-name": "only-ibgp",
16 "role": "ibgp"
17 }
18 ]
19 }
20 }
21}
@line 4: Role Set.
@line 6: Role Set name.
@line 14: Role Set.
@line 15: Role Id Set name.
Match AS Path Set¶
1<conditions>
2 <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
3 <match-as-path-set>
4 <as-path-set>
5 /rpol:routing-policy/rpol:defined-sets/bgp-pol:bgp-defined-sets/bgp-pol:as-path-sets/bgp-pol:as-path-set/[as-path-set-name="as-path-set-example"]
6 </as-path-set>
7 <match-set-options>ANY</match-set-options>
8 </match-as-path-set>
9 </bgp-conditions>
10</conditions>
@line 3: Match AS Path Set.
@line 5: AS Path Set reference.
@line 7: Match Set Option(ANY, ALL, INVERT).
1{
2 "conditions": {
3 "bgp-conditions" : {
4 "match-as-path-set": {
5 "as-path-set": "/rpol:routing-policy/bgp-pol:bgp-defined-sets/bgp-pol:as-path-sets/bgp-pol:as-path-set/[as-path-set-name=\"as-path-set-example\"]"
6 "match-set-options": "INVERT"
7 }
8 }
9 }
10}
@line 4: Match AS Path Set.
@line 6: AS Path Set reference.
@line 7: Match Set Option(ANY, ALL, INVERT).
Defined set
1<defined-sets>
2 <bgp-defined-sets xmlns="http://openconfig.net/yang/bgp-policy">
3 <as-path-sets>
4 <as-path-set>
5 <as-path-set-name>as-path-set-example</as-path-set-name>
6 <as-path-set-member>65</as-path-set-member>
7 <as-path-set-member>64</as-path-set-member>
8 <as-path-set-member>63</as-path-set-member>
9 </as-path-set>
10 </as-path-sets>
11 </bgp-defined-sets>
12</defined-sets>
@line 4: AS Path Set.
@line 5: AS Path Set name.
@line 6: AS Path set member
1{
2 "defined-sets": {
3 "bgp-defined-sets" : {
4 "as-path-sets": {
5 "as-path-set-name": "as-path-set-example",
6 "as-path-set-member": [
7 65,
8 64,
9 63
10 ]
11 }
12 }
13 }
14}
@line 4: AS Path Set.
@line 5: AS Path Set name.
@line 6: AS Path set member
Match Community Set¶
1<conditions>
2 <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
3 <match-community-set>
4 <community-set>
5 /rpol:routing-policy/rpol:defined-sets/rpol:community-sets/community-set[community-set-name="community-set-name-example"]
6 </community-set>
7 <match-set-options>ANY</match-set-options>
8 </match-community-set>
9 </bgp-conditions>
10</conditions>
@line 3: Match Community Set.
@line 5: Match Community Set reference.
@line 7: Match Set Option(ANY, ALL, INVERT).
1{
2 "conditions": {
3 "bgp-conditions" : {
4 "match-community-set": {
5 "community-set": "/rpol:routing-policy/rpol:bgp-defined-sets/rpol:community-sets/community-set[community-set-name=\"community-set-name-example\"]"
6 "match-set-options": "ANY"
7 }
8 }
9 }
10}
@line 4: Match Community Set.
@line 6: Match Community Set reference.
@line 7: Match Set Option(ANY, ALL, INVERT).
Defined set
1<defined-sets>
2 <bgp-defined-sets xmlns="http://openconfig.net/yang/bgp-policy">
3 <community-sets>
4 <community-set>
5 <community-set-name>community-set-name-example</community-set-name>
6 <communities>
7 <as-number>65</as-number>
8 <semantics>10</semantics>
9 </communities>
10 <communities>
11 <as-number>66</as-number>
12 <semantics>11</semantics>
13 </communities>
14 </community-set>
15 </community-sets>
16 </bgp-defined-sets>
17</defined-sets>
@line 4: Community Set.
@line 5: Community Set name.
@line 6: Communities.
@line 10: Communities.
1{
2 "defined-sets": {
3 "bgp-defined-sets" : {
4 "community-sets": {
5 "community-set": {
6 "community-set-name": "community-set-name-example",
7 "communities": [
8 {
9 "as-number": "65",
10 "semantics": "10"
11 },
12 {
13 "as-number": "66",
14 "semantics": "11"
15 }
16 ]
17 }
18 }
19 }
20 }
21}
@line 5: Community Set.
@line 6: Community Set name.
@line 7: Communities.
@line 12: Communities.
Match Extended Community Set¶
1<conditions>
2 <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
3 <match-ext-community-set>
4 <ext-community-set>
5 /rpol:routing-policy/rpol:defined-sets/rpol:ext-community-sets/ext-community-set[ext-community-set-name="ext-community-set-name-test"]
6 </ext-community-set>
7 <match-set-options>ANY</match-set-options>
8 </match-ext-community-set>
9 </bgp-conditions>
10</conditions>
@line 3: Match Extended Community Set.
@line 5: Match Extended Community Set reference.
@line 7: Match Set Option(ANY, ALL, INVERT).
1{
2 "conditions": {
3 "bgp-conditions" : {
4 "match-ext-community-set": {
5 "ext-community-set": "/rpol:routing-policy/rpol:bgp-defined-sets/rpol:ext-community-sets/ext-community-set[ext-community-set-name=\"ext-community-set-name-test\"]"
6 "match-set-options": "ANY"
7 }
8 }
9 }
10}
@line 4: Match Extended Community Set.
@line 6: Match Extended Community Set reference.
@line 7: Match Set Option(ANY, ALL, INVERT).
Defined set
1<defined-sets>
2 <bgp-defined-sets xmlns="http://openconfig.net/yang/bgp-policy">
3 <ext-community-sets>
4 <ext-community-set>
5 <ext-community-set-name>ext-community-set-name-test</ext-community-set-name>
6 <ext-community-member>
7 <encapsulation-extended-community>
8 <tunnel-type>vxlan</tunnel-type>
9 </encapsulation-extended-community>
10 </ext-community-member>
11 <ext-community-member>
12 <as-4-route-origin-extended-community>
13 <as-4-specific-common>
14 <as-number>65000</as-number>
15 <local-administrator>123</local-administrator>
16 </as-4-specific-common>
17 </as-4-route-origin-extended-community>
18 </ext-community-member>
19 </ext-community-set>
20 </ext-community-sets>
21 </bgp-defined-sets>
22</defined-sets>
@line 4: Extended Community Set.
@line 5: Extended Community Set name.
@line 6: Extended Communities.
@line 11: Extended Communities.
1{
2 "defined-sets": {
3 "bgp-defined-sets" : {
4 "ext-community-sets": {
5 "ext-community-set": {
6 "ext-community-set-name": "ext-community-set-name-test",
7 "ext-community-member": [
8 {
9 "encapsulation-extended-community": {
10 "tunnel-type": "vxlan"
11 },
12 "as-4-route-origin-extended-community": {
13 "as-4-specific-common": {
14 "as-number": 65000,
15 "local-administrator": 123
16 }
17 }
18 }
19 ]
20 }
21 }
22 }
23 }
24}
@line 5: Extended Community Set.
@line 6: Extended Community Set name.
@line 7: Extended Communities.
@line 12: Extended Communities.
Match in Afi Safi¶
1<conditions>
2 <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
3 <afi-safi-in xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-in>
4 </bgp-conditions>
5</conditions>
@line 3: Afi Safi match.
1{
2 "conditions": {
3 "bgp-conditions" : {
4 "afi-safi-in": "x:IPV4-UNICAST"
5 }
6 }
7}
@line 4: Afi Safi match.
Match not in Afi Safi¶
1<conditions>
2 <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
3 <afi-safi-not-in xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy"
4 xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-not-in>
5 <afi-safi-not-in xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy"
6 xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV6-UNICAST</afi-safi-not-in>
7 </bgp-conditions>
8</conditions>
@line 3: Afi Safi not in match.
1{
2 "conditions": {
3 "bgp-conditions" : {
4 "afi-safi-not-in": [
5 "x:IPV4-UNICAST",
6 "x:IPV6-UNICAST"
7 ]
8 }
9 }
10}
@line 4: Afi Safi not in match.
Match As Path Length¶
1<conditions>
2 <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
3 <as-path-length>
4 <operator xmlns:x="http://openconfig.net/yang/policy-types">x:attribute-eq</operator>
5 <value>2</value>
6 </as-path-length>
7 </bgp-conditions>
8</conditions>
@line 3: As Path Length match.
1{
2 "conditions": {
3 "bgp-conditions" : {
4 "as-path-length": {
5 "operator": "x:attribute-eq",
6 "value": 2
7 }
8 }
9 }
10}
@line 4: As Path Length match.
Match Local Pref¶
1<conditions>
2 <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
3 <local-pref-eq>100</local-pref-eq>
4 </bgp-conditions>
5</conditions>
@line 3: Local Preference match.
1{
2 "conditions": {
3 "bgp-conditions" : {
4 "local-pref-eq": 100
5 }
6 }
7}
@line 4: Local Preference match.
Match Origin¶
1<conditions>
2 <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
3 <origin-eq>IGP</origin-eq>
4 </bgp-conditions>
5</conditions>
@line 3: Origin match.
1{
2 "conditions": {
3 "bgp-conditions" : {
4 "origin-eq": "IGP"
5 }
6 }
7}
@line 4: Origin match.
Match MED¶
1<conditions>
2 <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
3 <med-eq>100</med-eq>
4 </bgp-conditions>
5</conditions>
@line 3: MED match.
1{
2 "conditions": {
3 "bgp-conditions" : {
4 "med-eq": 100
5 }
6 }
7}
@line 4: MED match.
Match Next Hop¶
1<conditions>
2 <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
3 <next-hop-in>192.168.2.2</next-hop-in>
4 <next-hop-in>42.42.42.42</next-hop-in>
5 </bgp-conditions>
6</conditions>
@line 3: Next hop match.
1{
2 "conditions": {
3 "bgp-conditions" : {
4 "next-hop-in": [
5 "192.168.2.2",
6 "42.42.42.42"
7 ]
8 }
9 }
10}
@line 4: Next hop match.
Match VPN Non member¶
True if Route Targets attributes does not match with any Route Target Contrain advertized per Advertized peer.
1<conditions>
2 <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
3 <vpn-non-member xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy"/>
4 </bgp-conditions>
5</conditions>
@line 3: VPN Non member match.
1{
2 "conditions": {
3 "bgp-conditions" : {
4 "vpn-non-member": {
5 }
6 }
7 }
8}
@line 4: Next hop match.