1 module frr-bgp-route-map {
3 namespace "http://frrouting.org/yang/bgp-route-map";
4 prefix frr-bgp-route-map;
6 import ietf-inet-types {
10 import frr-route-map {
18 import frr-bgp-filter {
22 import ietf-routing-types {
29 "FRR Users List: <mailto:frog@lists.frrouting.org>
30 FRR Development List: <mailto:dev@lists.frrouting.org>";
32 "This module defines bgp route map settings";
39 identity match-alias {
40 base frr-route-map:rmap-match-type;
42 "Match BGP community alias name";
45 identity match-local-preference {
46 base frr-route-map:rmap-match-type;
48 "Match local-preference of routes";
51 identity match-script {
52 base frr-route-map:rmap-match-type;
54 "Match script of routes";
57 identity match-origin {
58 base frr-route-map:rmap-match-type;
60 "Match BGP route origin code";
64 base frr-route-map:rmap-match-type;
66 "Control rpki specific settings";
69 identity probability {
70 base frr-route-map:rmap-match-type;
72 "Match portion of routes defined by percentage value";
76 base frr-route-map:rmap-match-type;
78 "Match source vrf of routes";
82 base frr-route-map:rmap-match-type;
87 identity mac-address-list {
88 base frr-route-map:rmap-match-type;
90 "Match MAC address access-list";
93 identity ip-route-source {
94 base frr-route-map:rmap-match-type;
96 "Match advertising source address of route";
99 identity ip-route-source-prefix-list {
100 base frr-route-map:rmap-match-type;
102 "Match advertising source address of route";
105 identity evpn-route-type {
106 base frr-route-map:rmap-match-type;
108 "Match EVPN route type";
111 identity evpn-default-route {
112 base frr-route-map:rmap-match-type;
114 "Match EVPN default Type-5 route";
118 base frr-route-map:rmap-match-type;
124 base frr-route-map:rmap-match-type;
126 "Match EVPN route distinguisher";
129 identity match-community {
130 base frr-route-map:rmap-match-type;
132 "Match BGP community list";
135 identity match-large-community {
136 base frr-route-map:rmap-match-type;
138 "Match BGP large-community list";
141 identity match-extcommunity {
142 base frr-route-map:rmap-match-type;
144 "Match BGP extcommunity list";
147 identity as-path-list {
148 base frr-route-map:rmap-match-type;
150 "Match BGP AS path list";
153 identity ipv4-nexthop {
154 base frr-route-map:rmap-match-type;
156 "Match IPv4 next hop address";
159 identity ipv6-nexthop {
160 base frr-route-map:rmap-match-type;
162 "Match IPv6 next hop address";
166 base frr-route-map:rmap-set-type;
168 "Set BGP administrative distance to use";
171 identity set-extcommunity-none {
172 base frr-route-map:rmap-set-type;
174 "Set BGP extended community attribute";
177 identity set-extcommunity-rt {
178 base frr-route-map:rmap-set-type;
180 "Set BGP extended community attribute";
183 identity set-extcommunity-soo {
184 base frr-route-map:rmap-set-type;
186 "Set BGP extended community attribute";
189 identity set-extcommunity-lb {
190 base frr-route-map:rmap-set-type;
192 "Set BGP extended community attribute";
195 identity set-ipv4-nexthop {
196 base frr-route-map:rmap-set-type;
198 "Set the IPv4 next-hop to peer-address/unchanged";
201 identity ipv4-vpn-address {
202 base frr-route-map:rmap-set-type;
204 "Set IPv4 VPN next-hop address";
207 identity ipv6-nexthop-global {
208 base frr-route-map:rmap-set-type;
210 "Set IPv6 next-hop global address";
213 identity ipv6-prefer-global {
214 base frr-route-map:rmap-set-type;
216 "Set IPv6 next-hop to prefer global address";
219 identity ipv6-peer-address {
220 base frr-route-map:rmap-set-type;
222 "Set IPv6 next-hop peer address";
225 identity ipv6-vpn-address {
226 base frr-route-map:rmap-set-type;
228 "Set IPv6 VPN next-hop address";
231 identity label-index {
232 base frr-route-map:rmap-set-type;
234 "Set the label index to associate with the prefixs";
237 identity set-local-preference {
238 base frr-route-map:rmap-set-type;
240 "Set the BGP local preference path attribute";
243 identity set-origin {
244 base frr-route-map:rmap-set-type;
246 "Set BGP route origin code";
250 base frr-route-map:rmap-set-type;
252 "Set the BGP weight attribute";
255 identity originator-id {
256 base frr-route-map:rmap-set-type;
258 "Set the BGP originator ID attribute";
262 base frr-route-map:rmap-set-type;
264 "Export route to non-main kernel table";
267 identity atomic-aggregate {
268 base frr-route-map:rmap-set-type;
270 "Set BGP atomic-aggregate attribute";
273 identity as-path-prepend {
274 base frr-route-map:rmap-set-type;
276 "Set the BGP AS-path attribute";
279 identity as-path-exclude {
280 base frr-route-map:rmap-set-type;
282 "Set the BGP AS-path attribute";
285 identity set-community {
286 base frr-route-map:rmap-set-type;
288 "Set the BGP community attribute";
291 identity set-large-community {
292 base frr-route-map:rmap-set-type;
294 "Set the BGP large-community attribute";
297 identity aggregator {
298 base frr-route-map:rmap-set-type;
300 "Set the BGP aggregator attribute";
303 identity comm-list-delete {
304 base frr-route-map:rmap-set-type;
306 "Set BGP community list (for deletion)";
309 identity large-comm-list-delete {
310 base frr-route-map:rmap-set-type;
312 "Set BGP large community list (for deletion)";
315 identity set-evpn-gateway-ip-ipv4 {
316 base frr-route-map:rmap-set-type;
318 "Set EVPN gateway IP overlay index IPv4";
321 identity set-evpn-gateway-ip-ipv6 {
322 base frr-route-map:rmap-set-type;
324 "Set EVPN gateway IP overlay index IPv6";
327 grouping extcommunity-non-transitive-types {
328 leaf two-octet-as-specific {
331 "Non-Transitive Two-Octet AS-Specific Extended Community";
335 typedef extcommunity-lb-type {
337 enum "explicit-bandwidth" {
340 "Bandwidth value in Mbps";
342 enum "cumulative-bandwidth" {
345 "Cumulative bandwidth of all multipaths (outbound-only)";
347 enum "computed-bandwidth" {
350 "Internally computed bandwidth based on number of multipaths (outbound-only)";
354 "ext-community link bandwidth types.";
357 augment "/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:match-condition/frr-route-map:rmap-match-condition/frr-route-map:match-condition" {
358 case local-preference {
359 when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:match-condition/frr-route-map:condition, 'frr-bgp-route-map:match-local-preference')";
360 leaf local-preference {
362 range "0..4294967295";
368 when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:match-condition/frr-route-map:condition, 'frr-bgp-route-map:match-alias')";
375 when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:match-condition/frr-route-map:condition, 'frr-bgp-route-map:match-script')";
382 when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:match-condition/frr-route-map:condition, 'frr-bgp-route-map:match-origin')";
405 when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:match-condition/frr-route-map:condition, 'frr-bgp-route-map:rpki')";
428 when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:match-condition/frr-route-map:condition, 'frr-bgp-route-map:probability')";
437 when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:match-condition/frr-route-map:condition, 'frr-bgp-route-map:source-vrf')";
444 when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:match-condition/frr-route-map:condition, 'frr-bgp-route-map:peer')";
448 case peer-ipv4-address {
450 "IP address of peer";
451 leaf peer-ipv4-address {
452 type inet:ipv4-address;
456 case peer-interface {
458 "Interface name of peer";
459 leaf peer-interface {
464 case peer-ipv6-address {
466 "IPv6 address of peer";
467 leaf peer-ipv6-address {
468 type inet:ipv6-address;
474 "Static or Redistributed routes";
482 case access-list-name {
483 when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:match-condition/frr-route-map:condition, 'frr-bgp-route-map:mac-address-list') or "
484 + "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:match-condition/frr-route-map:condition, 'frr-bgp-route-map:as-path-list') or "
485 + "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:match-condition/frr-route-map:condition, 'frr-bgp-route-map:ip-route-source') or "
486 + "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:match-condition/frr-route-map:condition, 'frr-bgp-route-map:ip-route-source-prefix-list')";
490 type filter:access-list-name;
494 case evpn-default-route {
495 when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:match-condition/frr-route-map:condition, 'frr-bgp-route-map:evpn-default-route')";
497 "Match default EVPN type-5 route";
498 leaf evpn-default-route {
504 when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:match-condition/frr-route-map:condition, 'frr-bgp-route-map:evpn-vni')";
514 case evpn-route-type {
515 when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:match-condition/frr-route-map:condition, 'frr-bgp-route-map:evpn-route-type')";
517 "Match eVPN route-type";
518 leaf evpn-route-type {
540 when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:match-condition/frr-route-map:condition, 'frr-bgp-route-map:evpn-rd')";
542 "Match eVPN route-distinguisher";
543 leaf route-distinguisher {
544 type rt-types:route-distinguisher;
548 case comm-list-name {
549 when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:match-condition/frr-route-map:condition, 'frr-bgp-route-map:match-community') or "
550 + "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:match-condition/frr-route-map:condition, 'frr-bgp-route-map:match-large-community') or "
551 + "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:match-condition/frr-route-map:condition, 'frr-bgp-route-map:match-extcommunity')";
552 container comm-list {
553 leaf comm-list-name {
554 type bgp-filter:bgp-list-name;
557 leaf comm-list-name-exact-match {
560 "Do exact matching of communities";
566 when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:match-condition/frr-route-map:condition, 'frr-bgp-route-map:ipv4-nexthop')";
568 type inet:ipv4-address;
575 when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:match-condition/frr-route-map:condition, 'frr-bgp-route-map:ipv6-nexthop')";
577 type inet:ipv6-address;
584 augment "/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:set-action/frr-route-map:rmap-set-action/frr-route-map:set-action" {
586 when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:set-action/frr-route-map:action, 'frr-bgp-route-map:distance')";
594 case extcommunity-none {
595 when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:set-action/frr-route-map:action, 'frr-bgp-route-map:set-extcommunity-none')";
597 "Value of the BGP extended community attribute";
598 leaf extcommunity-none {
600 description "No extended community attribute";
604 case extcommunity-rt {
605 when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:set-action/frr-route-map:action, 'frr-bgp-route-map:set-extcommunity-rt')";
607 "Value of the ext-community";
608 leaf extcommunity-rt {
611 "Set BGP ext-community route-target attribute";
615 case extcommunity-soo {
616 when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:set-action/frr-route-map:action, 'frr-bgp-route-map:set-extcommunity-soo')";
618 "Value of the ext-community";
619 leaf extcommunity-soo {
622 "Set BGP ext-community site-of-origin attribute";
626 case extcommunity-lb {
627 when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:set-action/frr-route-map:action, 'frr-bgp-route-map:set-extcommunity-lb')";
628 container extcommunity-lb {
630 "Value of the ext-community.";
632 type frr-bgp-route-map:extcommunity-lb-type;
636 when "../lb-type = 'explicit-bandwidth'";
641 "Bandwidth value in Mbps";
643 uses extcommunity-non-transitive-types;
648 when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:set-action/frr-route-map:action, 'frr-bgp-route-map:ipv4-vpn-address')";
650 "Set the IPv4 address";
652 type inet:ipv4-address;
657 when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:set-action/frr-route-map:action, 'frr-bgp-route-map:set-ipv4-nexthop')";
664 when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:set-action/frr-route-map:action, 'frr-bgp-route-map:ipv6-nexthop-global') or "
665 + "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:set-action/frr-route-map:action, 'frr-bgp-route-map:ipv6-vpn-address')";
667 "Set the IPv6 address";
669 type inet:ipv6-address;
674 when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:set-action/frr-route-map:action, 'frr-bgp-route-map:ipv6-prefer-global') or "
675 + "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:set-action/frr-route-map:action, 'frr-bgp-route-map:ipv6-peer-address')";
682 when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:set-action/frr-route-map:action, 'frr-bgp-route-map:label-index')";
691 when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:set-action/frr-route-map:action, 'frr-bgp-route-map:set-local-preference')";
698 when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:set-action/frr-route-map:action, 'frr-bgp-route-map:weight')";
701 range "0..4294967295";
707 when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:set-action/frr-route-map:action, 'frr-bgp-route-map:set-origin')";
730 when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:set-action/frr-route-map:action, 'frr-bgp-route-map:originator-id')";
732 type inet:ipv4-address;
737 when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:set-action/frr-route-map:action, 'frr-bgp-route-map:table')";
740 range "1..4294967295";
745 case atomic-aggregate {
746 when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:set-action/frr-route-map:action, 'frr-bgp-route-map:atomic-aggregate')";
747 leaf atomic-aggregate {
752 case as-path-prepend {
753 when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:set-action/frr-route-map:action, 'frr-bgp-route-map:as-path-prepend')";
754 choice as-path-prepend {
756 "Value of the BGP AS-path attribute";
759 "Prepend the mentioned AS-path";
760 leaf prepend-as-path {
767 "Prepend the last ASN in the AS-path";
777 case as-path-exclude {
778 when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:set-action/frr-route-map:action, 'frr-bgp-route-map:as-path-exclude')";
779 leaf exclude-as-path {
782 "Exclude the mentioned AS-path";
787 when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:set-action/frr-route-map:action, 'frr-bgp-route-map:set-community')";
790 "Value of the BGP community attribute";
793 "No community attribute";
794 leaf community-none {
799 case community-string {
802 leaf community-string {
809 case large-community {
810 when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:set-action/frr-route-map:action, 'frr-bgp-route-map:set-large-community')";
811 choice large-community {
813 "Value of the BGP large-community attribute";
816 "No large-community attribute";
817 leaf large-community-none {
822 case large-community-string {
824 "Large-Community string";
825 leaf large-community-string {
833 when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:set-action/frr-route-map:action, 'frr-bgp-route-map:aggregator')";
834 container aggregator {
835 leaf aggregator-asn {
837 range "1..4294967295";
840 "ASN of the aggregator";
843 leaf aggregator-address {
844 when "../aggregator-asn > 0 or "
845 + "../aggregator-asn <= 4294967295";
846 type inet:ipv4-address;
848 "IPv4 address of the aggregator";
853 case comm-list-name {
854 when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:set-action/frr-route-map:action, 'frr-bgp-route-map:comm-list-delete') or "
855 + "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:set-action/frr-route-map:action, 'frr-bgp-route-map:large-comm-list-delete')";
856 leaf comm-list-name {
857 type bgp-filter:bgp-list-name;
860 case evpn-gateway-ip-ipv4 {
862 "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:set-action/frr-route-map:action,
863 'frr-bgp-route-map:set-evpn-gateway-ip-ipv4')";
865 "Set EVPN gateway IP overlay index IPv4";
866 leaf evpn-gateway-ip-ipv4 {
867 type inet:ipv4-address;
870 case evpn-gateway-ip-ipv6 {
872 "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:set-action/frr-route-map:action,
873 'frr-bgp-route-map:set-evpn-gateway-ip-ipv6')";
875 "Set EVPN gateway IP overlay index IPv6";
876 leaf evpn-gateway-ip-ipv6 {
877 type inet:ipv6-address;