1 .. _bgp-user-guide-rib-config-policies:
3 RIB Policy Configuration
4 ========================
6 The OpenDaylight BGP implementation supports configurable RIB policies that allow the modification of import and export policies.
8 .. note:: Default ODL BGP RIB Config Policy is provided. 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.
10 **URL:** ``/restconf/config/openconfig-routing-policy:routing-policy``
12 **RFC8040 URL:** ``/rests/data/openconfig-routing-policy:routing-policy?content=config``
20 **Content-Type:** ``application/xml``
26 :emphasize-lines: 2,15
28 <routing-policy xmlns="http://openconfig.net/yang/routing-policy">
30 <bgp-defined-sets xmlns="http://openconfig.net/yang/bgp-policy">
31 <cluster-id-sets xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
34 <role-sets xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
37 <originator-id-sets xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
44 <name>default-odl-export-policy</name>
47 <name>to-odl-internal</name>
49 <bgp-actions xmlns="http://openconfig.net/yang/bgp-policy">
54 <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
63 <name>default-odl-import-policy</name>
69 @line 2: BGP defined sets.
71 @line 15: Policy definitions.
75 **Content-Type:** ``application/json``
81 :emphasize-lines: 3,10
87 "cluster-id-sets": "...",
89 "originator-id-sets": "..."
92 "policy-definitions": {
93 "policy-definition": [
95 "name": "default-odl-export-policy",
98 "name": "to-odl-internal",
103 "bgp-conditions": "..."
110 "name": "default-odl-import-policy",
118 @line 3: BGP defined sets.
120 @line 10: Policy definitions.
126 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.
128 **URL:** ``/restconf/config/openconfig-routing-policy:routing-policy/openconfig-routing-policy:policy-definitions/``
130 **RFC8040 URL:** ``/rests/data/openconfig-routing-policy:routing-policy/openconfig-routing-policy:policy-definitions``
138 **Content-Type:** ``application/xml``
144 :emphasize-lines: 2,5,7,10
146 <policy-definition xmlns="http://openconfig.net/yang/routing-policy">
147 <name>odl-policy-example</name>
150 <name>reject-all-incoming-routes</name>
155 <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
156 <match-role-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
158 <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="all"]</role-set>
167 @line 2: The unique policy instance identifier.
169 @line 5: Policy Statement Identifier.
173 @line 10: BGP Conditions.
177 **Content-Type:** ``application/json``
183 :emphasize-lines: 4,8,10,15
186 "policy-definition": [
188 "name": "odl-policy-example",
192 "name": "reject-all-incoming-routes",
199 "openconfig-bgp-policy:bgp-conditions": {
200 "odl-bgp-policy:match-role-set": {
202 "role-set": "/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name=\"all\"]"
214 @line 4: The unique policy instance identifier.
216 @line 8: Policy Statement Identifier.
220 @line 15: BGP Conditions.
224 The new instance presence can be verified via REST:
226 **URL:** ``/restconf/config/openconfig-routing-policy:routing-policy/openconfig-routing-policy:policy-definitions/policy-definition/odl-policy-example``
228 **RFC8040 URL:** ``/rests/data/openconfig-routing-policy:routing-policy/openconfig-routing-policy:policy-definitions/policy-definition=odl-policy-example``
240 :emphasize-lines: 2,5
242 <policy-definition xmlns="http://openconfig.net/yang/routing-policy">
243 <name>odl-policy-example</name>
246 <name>reject-all-incoming-routes</name>
248 <reject-route></reject-route>
251 <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
252 <match-role-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
254 <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="all"]</role-set>
255 <match-set-options>ANY</match-set-options>
264 @line 2: Policy definition Identifier.
266 @line 5: Policy Statement Identifier.
274 :emphasize-lines: 4,8
277 "policy-definition": [
279 "name": "odl-policy-example",
283 "name": "reject-all-incoming-routes",
290 "openconfig-bgp-policy:bgp-conditions": {
291 "odl-bgp-policy:match-role-set": {
293 "role-set": "/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name=\"all\"]"
305 @line 4: Policy definition Identifier.
307 @line 8: Policy Statement Identifier.
311 ODL BGP by default provides support for a group of BGP Actions.
315 Default policy to accept the route.
344 Default policy to reject the route.
373 Action to prepend local AS number to the AS-path
384 <bgp-actions xmlns="http://openconfig.net/yang/bgp-policy">
385 <set-as-path-prepend/>
398 "set-as-path-prepend": {
404 Originator Id prepend
405 '''''''''''''''''''''''''
406 Action to prepend Originator Id. In case there is non Originator Id present, local Originator Id is prepend.
418 <bgp-actions xmlns="http://openconfig.net/yang/bgp-policy">
419 <set-originator-id-prepend xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy"/>
430 "set-originator-id-prepend": {
445 <bgp-actions xmlns="http://openconfig.net/yang/bgp-policy">
446 <set-originator-id-prepend xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
447 <originator-id>192.0.2.1</originator-id>
448 </set-originator-id-prepend>
459 "set-originator-id-prepend": {
460 "originator-id": "192.0.2.1"
467 Action to prepend local Cluster Id to Cluster Id List.
478 <bgp-actions xmlns="http://openconfig.net/yang/bgp-policy">
479 <set-cluster-id-prepend xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy"/>
492 "set-cluster-id-prepend": {
500 Set the origin attribute to the specified value.
511 <bgp-actions xmlns="http://openconfig.net/yang/bgp-policy">
512 <set-route-origin>IGP</set-route-origin>
525 "set-route-origin": "IGP"
532 Set the local pref attribute on the route update.
543 <bgp-actions xmlns="http://openconfig.net/yang/bgp-policy">
544 <set-local-pref>100</set-local-pref>
557 "set-local-pref": 100
564 Set the next-hop attribute in the route update.
577 <bgp-actions xmlns="http://openconfig.net/yang/bgp-policy">
578 <set-next-hop>SELF</set-next-hop>
591 "set-next-hop": "SELF"
607 <bgp-actions xmlns="http://openconfig.net/yang/bgp-policy">
608 <set-next-hop>4.5.6.7</set-next-hop>
621 "set-next-hop": "4.5.6.7"
628 Set the med metric attribute in the route update.
639 <bgp-actions xmlns="http://openconfig.net/yang/bgp-policy">
640 <set-med>15</set-med>
658 Community set prepend
659 '''''''''''''''''''''
660 Action to set the community attributes of the route, along with options to modify how the community is modified.
673 <bgp-actions xmlns="http://openconfig.net/yang/bgp-policy">
676 <as-number>65</as-number>
677 <semantics>10</semantics>
680 <as-number>66</as-number>
681 <semantics>11</semantics>
683 <options>ADD</options>
688 @line 3: Set Community.
716 @line 4: Set Community.
726 :emphasize-lines: 3,5,7
729 <bgp-actions xmlns="http://openconfig.net/yang/bgp-policy">
732 /rpol:routing-policy/rpol:defined-sets/rpol:community-sets/community-set[community-set-name="community-set-name-example"]
734 <options>ADD</options>
739 @line 3: Set Community.
741 @line 5: Community set reference.
743 @line 7: Options are ADD, REMOVE, REPLACE.
749 :emphasize-lines: 4,5,6
755 "community-set-ref": "/rpol:routing-policy/rpol:defined-sets/rpol:community-sets/community-set[community-set-name=\"community-set-name-example\"]",
762 @line 4: Set Community.
764 @line 5: Community set reference.
766 @line 6: Options are ADD, REMOVE, REPLACE.
781 <bgp-defined-sets xmlns="http://openconfig.net/yang/bgp-policy">
784 <community-set-name>community-set-name-test</community-set-name>
786 <as-number>65</as-number>
787 <semantics>10</semantics>
790 <as-number>66</as-number>
791 <semantics>11</semantics>
798 @line 3: Community set.
808 "bgp-defined-sets" : {
811 "community-set-name": "community-set-name-test",
828 @line 4: Set Community.
830 Extended Community set action
831 ''''''''''''''''''''''''''''''
832 Action to set the extended community attributes of the route, along with options to modify how the community is modified.
845 <bgp-actions xmlns="http://openconfig.net/yang/bgp-policy">
847 <ext-community-member>
848 <encapsulation-extended-community>
849 <tunnel-type>vxlan</tunnel-type>
850 </encapsulation-extended-community>
851 </ext-community-member>
852 <ext-community-member>
853 <as-4-route-origin-extended-community>
854 <as-4-specific-common>
855 <as-number>65000</as-number>
856 <local-administrator>123</local-administrator>
857 </as-4-specific-common>
858 </as-4-route-origin-extended-community>
859 </ext-community-member>
860 <options>ADD</options>
865 @line 3: Set Extended Community.
876 "set-ext-community": {
877 "ext-community-member": [
879 "encapsulation-extended-community": {
880 "tunnel-type": "vxlan"
884 "as-4-route-origin-extended-community": {
885 "as-4-specific-common": {
886 "as-number": "65000",
887 "local-administrator": "123"
898 @line 4: Set Extended Community.
908 :emphasize-lines: 3,5,7
911 <bgp-actions xmlns="http://openconfig.net/yang/bgp-policy">
913 <ext-community-set-ref>
914 /rpol:routing-policy/rpol:defined-sets/rpol:ext-community-sets/ext-community-set[ext-community-set-name="ext-community-set-name-example"]
915 </ext-community-set-ref>
916 <options>REMOVE</options>
921 @line 3: Set Extended Community.
923 @line 5: Extended Community set reference.
925 @line 7: Options are ADD, REMOVE, REPLACE.
931 :emphasize-lines: 4,5,6
936 "set-ext-community": {
937 "ext-community-set-ref": "/rpol:routing-policy/rpol:defined-sets/rpol:community-sets/community-set[community-set-name=\"community-set-name-example\"]",
944 @line 4: Set Extended Community.
946 @line 5: Extended Community set reference.
948 @line 6: Options are ADD, REMOVE, REPLACE.
960 :emphasize-lines: 3,5
963 <bgp-defined-sets xmlns="http://openconfig.net/yang/bgp-policy">
966 <ext-community-set-name>ext-community-set-name-test</ext-community-set-name>
967 <ext-community-member>
968 <encapsulation-extended-community>
969 <tunnel-type>vxlan</tunnel-type>
970 </encapsulation-extended-community>
971 </ext-community-member>
972 <ext-community-member>
973 <as-4-route-origin-extended-community>
974 <as-4-specific-common>
975 <as-number>65000</as-number>
976 <local-administrator>123</local-administrator>
977 </as-4-specific-common>
978 </as-4-route-origin-extended-community>
979 </ext-community-member>
981 </ext-community-sets>
985 @line 3: Extendend Community set.
987 @line 5: Extendend Community set name.
993 :emphasize-lines: 4,5
997 "bgp-defined-sets" : {
998 "ext-community-sets": {
999 "ext-community-set": {
1000 "ext-community-set-name": "ext-community-set-name-test",
1001 "ext-community-member": [
1003 "encapsulation-extended-community": {
1004 "tunnel-type": "vxlan"
1006 "as-4-route-origin-extended-community": {
1007 "as-4-specific-common": {
1009 "local-administrator": 123
1020 @line 4: Extendend Community set.
1022 @line 5: Extendend Community set name.
1024 Filter Non transitive attributes
1025 ''''''''''''''''''''''''''''''''
1026 Filters attributes, removing non transitive attributes.
1037 <bgp-actions xmlns="http://openconfig.net/yang/bgp-policy">
1038 <non-transitive-attributes-filter xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy"/>
1044 .. code-block:: json
1051 "non-transitive-attributes-filter": {
1057 Client Attribute Prepend
1058 ''''''''''''''''''''''''
1059 Replace attributes per any VPN Route attributes from client Peer, if present.
1070 <bgp-actions xmlns="http://openconfig.net/yang/bgp-policy">
1071 <client-attribute-prepend xmlns="urn:opendaylight:params:xml:ns:yang:bgp:route:target:constrain"/>
1077 .. code-block:: json
1084 "client-attribute-prepend": {
1092 ODL BGP by default provides support for a group of BGP Conditions.
1094 Match BGP Neighbor Set
1095 ''''''''''''''''''''''
1103 :emphasize-lines: 3,4,5,6
1106 <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
1107 <match-bgp-neighbor-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
1109 <neighbor-set>/rpol:routing-policy/rpol:defined-sets/rpol:neighbor-sets/neighbor-set[neighbor-set-name="bgp-neighbor-set-example"]</neighbor-set>
1110 <match-set-options>INVERT</match-set-options>
1112 </match-bgp-neighbor-set>
1116 @line 3: Match BGP Neighbor Condition set.
1118 @line 4: Match BGP Neighbor from whom we receive the route.
1120 @line 5: Match BGP Neighbor Set reference.
1122 @line 6: Match Set Options (ANY, INVERT)
1126 .. code-block:: json
1128 :emphasize-lines: 4,5,6,7
1132 "bgp-conditions" : {
1133 "match-bgp-neighbor-set": {
1135 "neighbor-set": "/rpol:routing-policy/rpol:defined-sets/rpol:neighbor-sets/neighbor-set[neighbor-set-name=\"bgp-neighbor-set-example\"]",
1136 "match-set-options": "INVERT"
1143 @line 4: Match BGP Neighbor Condition set.
1145 @line 5: Match BGP Neighbor from whom we receive the route.
1147 @line 6: Match BGP Neighbor Set reference.
1149 @line 7: Match Set Options (ANY, INVERT)
1157 :emphasize-lines: 3,4,5,6
1160 <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
1161 <match-bgp-neighbor-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
1163 <neighbor-set>/rpol:routing-policy/rpol:defined-sets/rpol:neighbor-sets/neighbor-set[neighbor-set-name="bgp-neighbor-set-example"]</neighbor-set>
1164 <match-set-options>INVERT</match-set-options>
1166 </match-bgp-neighbor-set>
1170 @line 3: Match BGP Neighbor Condition set.
1172 @line 4: Match BGP Neighbor to whom we send the route.
1174 @line 5: Match BGP Neighbor Set reference.
1176 @line 6: Match Set Options (ANY, INVERT)
1180 .. code-block:: json
1182 :emphasize-lines: 4,5,6,7
1186 "bgp-conditions" : {
1187 "match-bgp-neighbor-set": {
1189 "neighbor-set": "/rpol:routing-policy/rpol:defined-sets/rpol:neighbor-sets/neighbor-set[neighbor-set-name=\"bgp-neighbor-set-example\"]",
1190 "match-set-options": "INVERT"
1197 @line 4: Match BGP Neighbor Condition set.
1199 @line 5: Match BGP Neighbor to whom we receive the route.
1201 @line 6: Match BGP Neighbor Set reference.
1203 @line 7: Match Set Options (ANY, INVERT)
1211 :emphasize-lines: 3,4,5,7,8,9
1214 <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
1215 <match-bgp-neighbor-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
1217 <neighbor-set>/rpol:routing-policy/rpol:defined-sets/rpol:neighbor-sets/neighbor-set[neighbor-set-name="bgp-neighbor-set-example"]</neighbor-set>
1220 <neighbor-set>/rpol:routing-policy/rpol:defined-sets/rpol:neighbor-sets/neighbor-set[neighbor-set-name="bgp-neighbor-set-example"]</neighbor-set>
1221 <match-set-options>INVERT</match-set-options>
1223 </match-bgp-neighbor-set>
1227 @line 3: Match BGP Neighbor Condition set.
1229 @line 4: Match BGP Neighbor from whom we receive the route.
1231 @line 5: Match BGP Neighbor Set reference.
1233 @line 7: Match BGP Neighbor to whom we send the route.
1235 @line 8: Match BGP Neighbor Set reference.
1237 @line 9: Match Set Options (ANY, INVERT)
1241 .. code-block:: json
1243 :emphasize-lines: 4,5,6,8,9,10
1247 "bgp-conditions" : {
1248 "match-bgp-neighbor-set": {
1250 "neighbor-set": "/rpol:routing-policy/rpol:defined-sets/rpol:neighbor-sets/neighbor-set[neighbor-set-name=\"bgp-neighbor-set-example\"]",
1253 "neighbor-set": "/rpol:routing-policy/rpol:defined-sets/rpol:neighbor-sets/neighbor-set[neighbor-set-name=\"bgp-neighbor-set-example\"]",
1254 "match-set-options": "INVERT"
1261 @line 4: Match BGP Neighbor Condition set.
1263 @line 5: Match BGP Neighbor from whom we receive the route.
1265 @line 6: Match BGP Neighbor Set reference.
1267 @line 8: Match BGP Neighbor to whom we send the route.
1269 @line 9: Match BGP Neighbor Set reference.
1271 @line 10: Match Set Options (ANY, INVERT)
1283 :emphasize-lines: 3,5
1288 <neighbor-set-name>bgp-neighbor-set-example</neighbor-set-name>
1290 <address>127.0.0.1</address>
1293 <address>127.0.0.2</address>
1299 @line 3: Originator Id Set.
1301 @line 5: Originator Id Set name.
1305 .. code-block:: json
1307 :emphasize-lines: 4,5
1313 "neighbor-set-name": "bgp-neighbor-set-example",
1316 "address": "127.0.0.1"
1319 "address": "127.0.0.2"
1327 @line 4: Originator Id Set.
1329 @line 5: Originator Id Set name.
1331 Match Originator Id Set
1332 '''''''''''''''''''''''
1340 :emphasize-lines: 3,5,7
1343 <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
1344 <match-originator-id-set-condition xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
1346 /rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/originator-id-sets/originator-id-set[originator-set-name="local-originator-id"]
1347 </originator-id-set>
1348 <match-set-options>INVERT</match-set-options>
1349 </match-originator-id-set-condition>
1353 @line 3: Match Originator Id Condition set.
1355 @line 5: Match Originator Id Set reference.
1357 @line 7: Match Set Options (ANY, INVERT)
1361 .. code-block:: json
1363 :emphasize-lines: 4,5,6
1367 "bgp-conditions" : {
1368 "match-originator-id-set-condition": {
1369 "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\"]",
1370 "match-set-options": "INVERT"
1376 @line 4: Match Originator Id Condition set.
1378 @line 5: Match Originator Id Set reference.
1380 @line 6: Match Set Options (ANY, INVERT)
1392 :emphasize-lines: 3,5
1395 <bgp-defined-sets xmlns="http://openconfig.net/yang/bgp-policy">
1396 <originator-id-sets xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
1398 <originator-id-set-name>local-originator-id</originator-id-set-name>
1400 </originator-id-set>
1401 </originator-id-sets>
1405 @line 3: Originator Id Set.
1407 @line 5: Originator Id Set name.
1411 .. code-block:: json
1413 :emphasize-lines: 4,5
1417 "bgp-defined-sets" : {
1418 "originator-id-sets": {
1419 "originator-id-set": {
1420 "originator-id-set-name": "local-originator-id"
1427 @line 4: Originator Id Set.
1429 @line 5: Originator Id Set name.
1431 Match Cluster Id Set
1432 ''''''''''''''''''''
1440 :emphasize-lines: 3,5
1443 <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
1444 <match-cluster-id-set-condition xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
1446 /rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/cluster-id-sets/cluster-id-set[cluster-set-name="local-cluster-id"]
1448 <match-set-options>INVERT</match-set-options>
1449 </match-cluster-id-set-condition>
1453 @line 3: Match Cluster Id Condition set.
1455 @line 5: Match Cluster Id Set reference.
1459 .. code-block:: json
1461 :emphasize-lines: 4,5
1465 "bgp-conditions" : {
1466 "match-cluster-id-set-condition": {
1467 "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\"]",
1468 "match-set-options": "INVERT"
1474 @line 4: Match Cluster Id Condition set.
1476 @line 5: Match Cluster Id Set reference.
1488 :emphasize-lines: 3,5
1491 <bgp-defined-sets xmlns="http://openconfig.net/yang/bgp-policy">
1492 <cluster-id-sets xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
1494 <cluster-id-set-name>local-cluster-id</cluster-id-set-name>
1501 @line 3: Cluster Id Set.
1503 @line 5: Cluster Id Set name.
1507 .. code-block:: json
1509 :emphasize-lines: 4,5
1513 "bgp-defined-sets" : {
1514 "cluster-id-sets": {
1516 "cluster-id-set-name": "local-cluster-id"
1523 @line 4: Cluster Id Set.
1525 @line 5: Cluster Id Set name.
1536 :emphasize-lines: 3,5,6
1539 <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
1540 <match-role-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
1542 <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="only-ibgp"]</role-set>
1543 <match-set-options>INVERT</match-set-options>
1546 <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="all"]</role-set>
1552 @line 3: Match Role Set.
1554 @line 5: Match Role Set reference.
1556 @line 6: Match Set Options (ANY, INVERT)
1560 .. code-block:: json
1562 :emphasize-lines: 4,6,7
1566 "bgp-conditions" : {
1569 "role-set": "/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name=\"only-ibgp\"]"
1570 "match-set-options": "INVERT"
1573 "role-set": "/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name=\"all\"]"
1580 @line 4: Match Role Set.
1582 @line 6: Match Role Set reference.
1584 @line 7: Match Set Options (ANY, INVERT)
1596 :emphasize-lines: 3,4,10,11
1599 <bgp-defined-sets xmlns="http://openconfig.net/yang/bgp-policy">
1601 <role-set-name>all</role-set-name>
1604 <role>rr-client</role>
1605 <role>internal</role>
1608 <role-set-name>only-ibgp</role-set-name>
1616 @line 4: Role Set name.
1620 @line 11: Role Id Set name.
1624 .. code-block:: json
1626 :emphasize-lines: 4,6,14,15
1630 "bgp-defined-sets" : {
1633 "role-set-name": "all",
1642 "role-set-name": "only-ibgp",
1652 @line 6: Role Set name.
1656 @line 15: Role Id Set name.
1667 :emphasize-lines: 3,5,7
1670 <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
1673 /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"]
1675 <match-set-options>ANY</match-set-options>
1676 </match-as-path-set>
1680 @line 3: Match AS Path Set.
1682 @line 5: AS Path Set reference.
1684 @line 7: Match Set Option(ANY, ALL, INVERT).
1688 .. code-block:: json
1690 :emphasize-lines: 4,6,7
1694 "bgp-conditions" : {
1695 "match-as-path-set": {
1696 "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\"]"
1697 "match-set-options": "INVERT"
1703 @line 4: Match AS Path Set.
1705 @line 6: AS Path Set reference.
1707 @line 7: Match Set Option(ANY, ALL, INVERT).
1719 :emphasize-lines: 4,5,6
1722 <bgp-defined-sets xmlns="http://openconfig.net/yang/bgp-policy">
1725 <as-path-set-name>as-path-set-example</as-path-set-name>
1726 <as-path-set-member>65</as-path-set-member>
1727 <as-path-set-member>64</as-path-set-member>
1728 <as-path-set-member>63</as-path-set-member>
1734 @line 4: AS Path Set.
1736 @line 5: AS Path Set name.
1738 @line 6: AS Path set member
1742 .. code-block:: json
1744 :emphasize-lines: 4,5,6
1748 "bgp-defined-sets" : {
1750 "as-path-set-name": "as-path-set-example",
1751 "as-path-set-member": [
1761 @line 4: AS Path Set.
1763 @line 5: AS Path Set name.
1765 @line 6: AS Path set member
1776 :emphasize-lines: 3,5,7
1779 <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
1780 <match-community-set>
1782 /rpol:routing-policy/rpol:defined-sets/rpol:community-sets/community-set[community-set-name="community-set-name-example"]
1784 <match-set-options>ANY</match-set-options>
1785 </match-community-set>
1789 @line 3: Match Community Set.
1791 @line 5: Match Community Set reference.
1793 @line 7: Match Set Option(ANY, ALL, INVERT).
1797 .. code-block:: json
1799 :emphasize-lines: 4,6,7
1803 "bgp-conditions" : {
1804 "match-community-set": {
1805 "community-set": "/rpol:routing-policy/rpol:bgp-defined-sets/rpol:community-sets/community-set[community-set-name=\"community-set-name-example\"]"
1806 "match-set-options": "ANY"
1812 @line 4: Match Community Set.
1814 @line 6: Match Community Set reference.
1816 @line 7: Match Set Option(ANY, ALL, INVERT).
1828 :emphasize-lines: 4,5,6,10
1831 <bgp-defined-sets xmlns="http://openconfig.net/yang/bgp-policy">
1834 <community-set-name>community-set-name-example</community-set-name>
1836 <as-number>65</as-number>
1837 <semantics>10</semantics>
1840 <as-number>66</as-number>
1841 <semantics>11</semantics>
1848 @line 4: Community Set.
1850 @line 5: Community Set name.
1852 @line 6: Communities.
1854 @line 10: Communities.
1858 .. code-block:: json
1860 :emphasize-lines: 5,6,7,12
1864 "bgp-defined-sets" : {
1867 "community-set-name": "community-set-name-example",
1884 @line 5: Community Set.
1886 @line 6: Community Set name.
1888 @line 7: Communities.
1890 @line 12: Communities.
1892 Match Extended Community Set
1893 ''''''''''''''''''''''''''''
1900 :emphasize-lines: 3,5,7
1903 <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
1904 <match-ext-community-set>
1906 /rpol:routing-policy/rpol:defined-sets/rpol:ext-community-sets/ext-community-set[ext-community-set-name="ext-community-set-name-test"]
1907 </ext-community-set>
1908 <match-set-options>ANY</match-set-options>
1909 </match-ext-community-set>
1913 @line 3: Match Extended Community Set.
1915 @line 5: Match Extended Community Set reference.
1917 @line 7: Match Set Option(ANY, ALL, INVERT).
1921 .. code-block:: json
1923 :emphasize-lines: 4,6,7
1927 "bgp-conditions" : {
1928 "match-ext-community-set": {
1929 "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\"]"
1930 "match-set-options": "ANY"
1936 @line 4: Match Extended Community Set.
1938 @line 6: Match Extended Community Set reference.
1940 @line 7: Match Set Option(ANY, ALL, INVERT).
1952 :emphasize-lines: 4,5,6,11
1955 <bgp-defined-sets xmlns="http://openconfig.net/yang/bgp-policy">
1956 <ext-community-sets>
1958 <ext-community-set-name>ext-community-set-name-test</ext-community-set-name>
1959 <ext-community-member>
1960 <encapsulation-extended-community>
1961 <tunnel-type>vxlan</tunnel-type>
1962 </encapsulation-extended-community>
1963 </ext-community-member>
1964 <ext-community-member>
1965 <as-4-route-origin-extended-community>
1966 <as-4-specific-common>
1967 <as-number>65000</as-number>
1968 <local-administrator>123</local-administrator>
1969 </as-4-specific-common>
1970 </as-4-route-origin-extended-community>
1971 </ext-community-member>
1972 </ext-community-set>
1973 </ext-community-sets>
1977 @line 4: Extended Community Set.
1979 @line 5: Extended Community Set name.
1981 @line 6: Extended Communities.
1983 @line 11: Extended Communities.
1987 .. code-block:: json
1989 :emphasize-lines: 5,6,7,12
1993 "bgp-defined-sets" : {
1994 "ext-community-sets": {
1995 "ext-community-set": {
1996 "ext-community-set-name": "ext-community-set-name-test",
1997 "ext-community-member": [
1999 "encapsulation-extended-community": {
2000 "tunnel-type": "vxlan"
2002 "as-4-route-origin-extended-community": {
2003 "as-4-specific-common": {
2005 "local-administrator": 123
2016 @line 5: Extended Community Set.
2018 @line 6: Extended Community Set name.
2020 @line 7: Extended Communities.
2022 @line 12: Extended Communities.
2035 <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
2036 <afi-safi-in xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-in>
2040 @line 3: Afi Safi match.
2044 .. code-block:: json
2050 "bgp-conditions" : {
2051 "afi-safi-in": "x:IPV4-UNICAST"
2056 @line 4: Afi Safi match.
2058 Match not in Afi Safi
2059 '''''''''''''''''''''
2069 <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
2070 <afi-safi-not-in xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy"
2071 xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-not-in>
2072 <afi-safi-not-in xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy"
2073 xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV6-UNICAST</afi-safi-not-in>
2077 @line 3: Afi Safi not in match.
2081 .. code-block:: json
2087 "bgp-conditions" : {
2088 "afi-safi-not-in": [
2096 @line 4: Afi Safi not in match.
2098 Match As Path Length
2099 ''''''''''''''''''''
2109 <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
2111 <operator xmlns:x="http://openconfig.net/yang/policy-types">x:attribute-eq</operator>
2117 @line 3: As Path Length match.
2121 .. code-block:: json
2127 "bgp-conditions" : {
2129 "operator": "x:attribute-eq",
2136 @line 4: As Path Length match.
2149 <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
2150 <local-pref-eq>100</local-pref-eq>
2154 @line 3: Local Preference match.
2158 .. code-block:: json
2164 "bgp-conditions" : {
2165 "local-pref-eq": 100
2170 @line 4: Local Preference match.
2183 <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
2184 <origin-eq>IGP</origin-eq>
2188 @line 3: Origin match.
2192 .. code-block:: json
2198 "bgp-conditions" : {
2204 @line 4: Origin match.
2217 <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
2218 <med-eq>100</med-eq>
2226 .. code-block:: json
2232 "bgp-conditions" : {
2251 <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
2252 <next-hop-in>192.168.2.2</next-hop-in>
2253 <next-hop-in>42.42.42.42</next-hop-in>
2257 @line 3: Next hop match.
2261 .. code-block:: json
2267 "bgp-conditions" : {
2276 @line 4: Next hop match.
2278 Match VPN Non member
2279 ''''''''''''''''''''
2281 True if Route Targets attributes does not match with any Route Target Contrain advertized per Advertized peer.
2292 <bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
2293 <vpn-non-member xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy"/>
2297 @line 3: VPN Non member match.
2301 .. code-block:: json
2307 "bgp-conditions" : {
2314 @line 4: Next hop match.