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 as-path-replace {
286 base frr-route-map:rmap-set-type;
288 "Replace ASNs to local AS number";
291 identity set-community {
292 base frr-route-map:rmap-set-type;
294 "Set the BGP community attribute";
297 identity set-large-community {
298 base frr-route-map:rmap-set-type;
300 "Set the BGP large-community attribute";
303 identity aggregator {
304 base frr-route-map:rmap-set-type;
306 "Set the BGP aggregator attribute";
309 identity comm-list-delete {
310 base frr-route-map:rmap-set-type;
312 "Set BGP community list (for deletion)";
315 identity large-comm-list-delete {
316 base frr-route-map:rmap-set-type;
318 "Set BGP large community list (for deletion)";
321 identity set-evpn-gateway-ip-ipv4 {
322 base frr-route-map:rmap-set-type;
324 "Set EVPN gateway IP overlay index IPv4";
327 identity set-evpn-gateway-ip-ipv6 {
328 base frr-route-map:rmap-set-type;
330 "Set EVPN gateway IP overlay index IPv6";
333 identity set-l3vpn-nexthop-encapsulation {
334 base frr-route-map:rmap-set-type;
336 "Accept L3VPN traffic over other than LSP encapsulation";
339 grouping extcommunity-non-transitive-types {
340 leaf two-octet-as-specific {
343 "Non-Transitive Two-Octet AS-Specific Extended Community";
347 typedef extcommunity-lb-type {
349 enum "explicit-bandwidth" {
352 "Bandwidth value in Mbps";
354 enum "cumulative-bandwidth" {
357 "Cumulative bandwidth of all multipaths (outbound-only)";
359 enum "computed-bandwidth" {
362 "Internally computed bandwidth based on number of multipaths (outbound-only)";
366 "ext-community link bandwidth types.";
369 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" {
370 case local-preference {
371 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')";
372 leaf local-preference {
374 range "0..4294967295";
380 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')";
387 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')";
394 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')";
417 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')";
440 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')";
449 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')";
456 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')";
460 case peer-ipv4-address {
462 "IP address of peer";
463 leaf peer-ipv4-address {
464 type inet:ipv4-address;
468 case peer-interface {
470 "Interface name of peer";
471 leaf peer-interface {
476 case peer-ipv6-address {
478 "IPv6 address of peer";
479 leaf peer-ipv6-address {
480 type inet:ipv6-address;
486 "Static or Redistributed routes";
494 case access-list-name {
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:mac-address-list') or "
496 + "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 "
497 + "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 "
498 + "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')";
502 type filter:access-list-name;
506 case evpn-default-route {
507 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')";
509 "Match default EVPN type-5 route";
510 leaf evpn-default-route {
516 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')";
526 case evpn-route-type {
527 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')";
529 "Match eVPN route-type";
530 leaf evpn-route-type {
550 "Ethernet Auto-Discovery route";
555 "Ethernet Segment route";
562 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')";
564 "Match eVPN route-distinguisher";
565 leaf route-distinguisher {
566 type rt-types:route-distinguisher;
570 case comm-list-name {
571 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 "
572 + "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 "
573 + "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')";
574 container comm-list {
575 leaf comm-list-name {
576 type bgp-filter:bgp-list-name;
579 leaf comm-list-name-exact-match {
582 "Do exact matching of communities";
588 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')";
590 type inet:ipv4-address;
597 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')";
599 type inet:ipv6-address;
606 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" {
608 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')";
616 case extcommunity-none {
617 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')";
619 "Value of the BGP extended community attribute";
620 leaf extcommunity-none {
622 description "No extended community attribute";
626 case extcommunity-rt {
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-rt')";
629 "Value of the ext-community";
630 leaf extcommunity-rt {
633 "Set BGP ext-community route-target attribute";
637 case extcommunity-soo {
638 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')";
640 "Value of the ext-community";
641 leaf extcommunity-soo {
644 "Set BGP ext-community site-of-origin attribute";
648 case extcommunity-lb {
649 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')";
650 container extcommunity-lb {
652 "Value of the ext-community.";
654 type frr-bgp-route-map:extcommunity-lb-type;
658 when "../lb-type = 'explicit-bandwidth'";
663 "Bandwidth value in Mbps";
665 uses extcommunity-non-transitive-types;
670 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')";
672 "Set the IPv4 address";
674 type inet:ipv4-address;
679 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')";
686 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 "
687 + "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')";
689 "Set the IPv6 address";
691 type inet:ipv6-address;
696 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 "
697 + "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')";
704 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')";
713 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')";
720 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')";
723 range "0..4294967295";
729 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')";
752 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')";
754 type inet:ipv4-address;
759 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')";
762 range "1..4294967295";
767 case atomic-aggregate {
768 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')";
769 leaf atomic-aggregate {
774 case as-path-prepend {
775 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')";
776 choice as-path-prepend {
778 "Value of the BGP AS-path attribute";
781 "Prepend the mentioned AS-path";
782 leaf prepend-as-path {
789 "Prepend the last ASN in the AS-path";
799 case as-path-exclude {
800 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')";
801 leaf exclude-as-path {
804 "Exclude the mentioned AS-path";
808 case as-path-replace {
809 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-replace')";
810 leaf replace-as-path {
813 "Replace ASNs to local AS number";
818 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')";
821 "Value of the BGP community attribute";
824 "No community attribute";
825 leaf community-none {
830 case community-string {
833 leaf community-string {
840 case large-community {
841 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')";
842 choice large-community {
844 "Value of the BGP large-community attribute";
847 "No large-community attribute";
848 leaf large-community-none {
853 case large-community-string {
855 "Large-Community string";
856 leaf large-community-string {
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:aggregator')";
865 container aggregator {
866 leaf aggregator-asn {
868 range "1..4294967295";
871 "ASN of the aggregator";
874 leaf aggregator-address {
875 when "../aggregator-asn > 0 or "
876 + "../aggregator-asn <= 4294967295";
877 type inet:ipv4-address;
879 "IPv4 address of the aggregator";
884 case comm-list-name {
885 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 "
886 + "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')";
887 leaf comm-list-name {
888 type bgp-filter:bgp-list-name;
891 case evpn-gateway-ip-ipv4 {
893 "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,
894 'frr-bgp-route-map:set-evpn-gateway-ip-ipv4')";
896 "Set EVPN gateway IP overlay index IPv4";
897 leaf evpn-gateway-ip-ipv4 {
898 type inet:ipv4-address;
901 case evpn-gateway-ip-ipv6 {
903 "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,
904 'frr-bgp-route-map:set-evpn-gateway-ip-ipv6')";
906 "Set EVPN gateway IP overlay index IPv6";
907 leaf evpn-gateway-ip-ipv6 {
908 type inet:ipv6-address;
911 case l3vpn-nexthop-encapsulation {
913 "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,
914 'frr-bgp-route-map:set-l3vpn-nexthop-encapsulation')";
916 "Accept L3VPN traffic over other than LSP encapsulation";
917 leaf l3vpn-nexthop-encapsulation {