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 grouping extcommunity-non-transitive-types {
334 leaf two-octet-as-specific {
337 "Non-Transitive Two-Octet AS-Specific Extended Community";
341 typedef extcommunity-lb-type {
343 enum "explicit-bandwidth" {
346 "Bandwidth value in Mbps";
348 enum "cumulative-bandwidth" {
351 "Cumulative bandwidth of all multipaths (outbound-only)";
353 enum "computed-bandwidth" {
356 "Internally computed bandwidth based on number of multipaths (outbound-only)";
360 "ext-community link bandwidth types.";
363 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" {
364 case local-preference {
365 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')";
366 leaf local-preference {
368 range "0..4294967295";
374 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')";
381 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')";
388 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')";
411 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')";
434 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')";
443 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')";
450 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')";
454 case peer-ipv4-address {
456 "IP address of peer";
457 leaf peer-ipv4-address {
458 type inet:ipv4-address;
462 case peer-interface {
464 "Interface name of peer";
465 leaf peer-interface {
470 case peer-ipv6-address {
472 "IPv6 address of peer";
473 leaf peer-ipv6-address {
474 type inet:ipv6-address;
480 "Static or Redistributed routes";
488 case access-list-name {
489 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 "
490 + "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 "
491 + "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 "
492 + "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')";
496 type filter:access-list-name;
500 case evpn-default-route {
501 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')";
503 "Match default EVPN type-5 route";
504 leaf evpn-default-route {
510 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')";
520 case evpn-route-type {
521 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')";
523 "Match eVPN route-type";
524 leaf evpn-route-type {
544 "Ethernet Auto-Discovery route";
549 "Ethernet Segment route";
556 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')";
558 "Match eVPN route-distinguisher";
559 leaf route-distinguisher {
560 type rt-types:route-distinguisher;
564 case comm-list-name {
565 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 "
566 + "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 "
567 + "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')";
568 container comm-list {
569 leaf comm-list-name {
570 type bgp-filter:bgp-list-name;
573 leaf comm-list-name-exact-match {
576 "Do exact matching of communities";
582 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')";
584 type inet:ipv4-address;
591 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')";
593 type inet:ipv6-address;
600 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" {
602 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')";
610 case extcommunity-none {
611 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')";
613 "Value of the BGP extended community attribute";
614 leaf extcommunity-none {
616 description "No extended community attribute";
620 case extcommunity-rt {
621 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')";
623 "Value of the ext-community";
624 leaf extcommunity-rt {
627 "Set BGP ext-community route-target attribute";
631 case extcommunity-soo {
632 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')";
634 "Value of the ext-community";
635 leaf extcommunity-soo {
638 "Set BGP ext-community site-of-origin attribute";
642 case extcommunity-lb {
643 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')";
644 container extcommunity-lb {
646 "Value of the ext-community.";
648 type frr-bgp-route-map:extcommunity-lb-type;
652 when "../lb-type = 'explicit-bandwidth'";
657 "Bandwidth value in Mbps";
659 uses extcommunity-non-transitive-types;
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:ipv4-vpn-address')";
666 "Set the IPv4 address";
668 type inet:ipv4-address;
673 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')";
680 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 "
681 + "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')";
683 "Set the IPv6 address";
685 type inet:ipv6-address;
690 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 "
691 + "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')";
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:label-index')";
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-local-preference')";
714 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')";
717 range "0..4294967295";
723 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')";
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:originator-id')";
748 type inet:ipv4-address;
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:table')";
756 range "1..4294967295";
761 case atomic-aggregate {
762 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')";
763 leaf atomic-aggregate {
768 case as-path-prepend {
769 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')";
770 choice as-path-prepend {
772 "Value of the BGP AS-path attribute";
775 "Prepend the mentioned AS-path";
776 leaf prepend-as-path {
783 "Prepend the last ASN in the AS-path";
793 case as-path-exclude {
794 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')";
795 leaf exclude-as-path {
798 "Exclude the mentioned AS-path";
802 case as-path-replace {
803 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')";
804 leaf replace-as-path {
807 "Replace ASNs to local AS number";
812 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')";
815 "Value of the BGP community attribute";
818 "No community attribute";
819 leaf community-none {
824 case community-string {
827 leaf community-string {
834 case large-community {
835 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')";
836 choice large-community {
838 "Value of the BGP large-community attribute";
841 "No large-community attribute";
842 leaf large-community-none {
847 case large-community-string {
849 "Large-Community string";
850 leaf large-community-string {
858 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')";
859 container aggregator {
860 leaf aggregator-asn {
862 range "1..4294967295";
865 "ASN of the aggregator";
868 leaf aggregator-address {
869 when "../aggregator-asn > 0 or "
870 + "../aggregator-asn <= 4294967295";
871 type inet:ipv4-address;
873 "IPv4 address of the aggregator";
878 case comm-list-name {
879 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 "
880 + "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')";
881 leaf comm-list-name {
882 type bgp-filter:bgp-list-name;
885 case evpn-gateway-ip-ipv4 {
887 "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,
888 'frr-bgp-route-map:set-evpn-gateway-ip-ipv4')";
890 "Set EVPN gateway IP overlay index IPv4";
891 leaf evpn-gateway-ip-ipv4 {
892 type inet:ipv4-address;
895 case evpn-gateway-ip-ipv6 {
897 "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,
898 'frr-bgp-route-map:set-evpn-gateway-ip-ipv6')";
900 "Set EVPN gateway IP overlay index IPv6";
901 leaf evpn-gateway-ip-ipv6 {
902 type inet:ipv6-address;