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 {
538 "Ethernet Auto-Discovery route";
543 "Ethernet Segment route";
550 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')";
552 "Match eVPN route-distinguisher";
553 leaf route-distinguisher {
554 type rt-types:route-distinguisher;
558 case comm-list-name {
559 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 "
560 + "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 "
561 + "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')";
562 container comm-list {
563 leaf comm-list-name {
564 type bgp-filter:bgp-list-name;
567 leaf comm-list-name-exact-match {
570 "Do exact matching of communities";
576 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')";
578 type inet:ipv4-address;
585 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')";
587 type inet:ipv6-address;
594 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" {
596 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')";
604 case extcommunity-none {
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-none')";
607 "Value of the BGP extended community attribute";
608 leaf extcommunity-none {
610 description "No extended community attribute";
614 case extcommunity-rt {
615 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')";
617 "Value of the ext-community";
618 leaf extcommunity-rt {
621 "Set BGP ext-community route-target attribute";
625 case extcommunity-soo {
626 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')";
628 "Value of the ext-community";
629 leaf extcommunity-soo {
632 "Set BGP ext-community site-of-origin attribute";
636 case extcommunity-lb {
637 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')";
638 container extcommunity-lb {
640 "Value of the ext-community.";
642 type frr-bgp-route-map:extcommunity-lb-type;
646 when "../lb-type = 'explicit-bandwidth'";
651 "Bandwidth value in Mbps";
653 uses extcommunity-non-transitive-types;
658 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')";
660 "Set the IPv4 address";
662 type inet:ipv4-address;
667 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')";
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-nexthop-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-vpn-address')";
677 "Set the IPv6 address";
679 type inet:ipv6-address;
684 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 "
685 + "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')";
692 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')";
701 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')";
708 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')";
711 range "0..4294967295";
717 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')";
740 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')";
742 type inet:ipv4-address;
747 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')";
750 range "1..4294967295";
755 case atomic-aggregate {
756 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')";
757 leaf atomic-aggregate {
762 case as-path-prepend {
763 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')";
764 choice as-path-prepend {
766 "Value of the BGP AS-path attribute";
769 "Prepend the mentioned AS-path";
770 leaf prepend-as-path {
777 "Prepend the last ASN in the AS-path";
787 case as-path-exclude {
788 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')";
789 leaf exclude-as-path {
792 "Exclude the mentioned AS-path";
797 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')";
800 "Value of the BGP community attribute";
803 "No community attribute";
804 leaf community-none {
809 case community-string {
812 leaf community-string {
819 case large-community {
820 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')";
821 choice large-community {
823 "Value of the BGP large-community attribute";
826 "No large-community attribute";
827 leaf large-community-none {
832 case large-community-string {
834 "Large-Community string";
835 leaf large-community-string {
843 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')";
844 container aggregator {
845 leaf aggregator-asn {
847 range "1..4294967295";
850 "ASN of the aggregator";
853 leaf aggregator-address {
854 when "../aggregator-asn > 0 or "
855 + "../aggregator-asn <= 4294967295";
856 type inet:ipv4-address;
858 "IPv4 address of the aggregator";
863 case comm-list-name {
864 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 "
865 + "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')";
866 leaf comm-list-name {
867 type bgp-filter:bgp-list-name;
870 case evpn-gateway-ip-ipv4 {
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-ipv4')";
875 "Set EVPN gateway IP overlay index IPv4";
876 leaf evpn-gateway-ip-ipv4 {
877 type inet:ipv4-address;
880 case evpn-gateway-ip-ipv6 {
882 "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,
883 'frr-bgp-route-map:set-evpn-gateway-ip-ipv6')";
885 "Set EVPN gateway IP overlay index IPv6";
886 leaf evpn-gateway-ip-ipv6 {
887 type inet:ipv6-address;