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 rpki-extcommunity {
70 base frr-route-map:rmap-match-type;
72 "Control rpki specific settings derived from extended community";
75 identity probability {
76 base frr-route-map:rmap-match-type;
78 "Match portion of routes defined by percentage value";
82 base frr-route-map:rmap-match-type;
84 "Match source vrf of routes";
88 base frr-route-map:rmap-match-type;
93 identity mac-address-list {
94 base frr-route-map:rmap-match-type;
96 "Match MAC address access-list";
99 identity ip-route-source {
100 base frr-route-map:rmap-match-type;
102 "Match advertising source address of route";
105 identity ip-route-source-prefix-list {
106 base frr-route-map:rmap-match-type;
108 "Match advertising source address of route";
111 identity evpn-route-type {
112 base frr-route-map:rmap-match-type;
114 "Match EVPN route type";
117 identity evpn-default-route {
118 base frr-route-map:rmap-match-type;
120 "Match EVPN default Type-5 route";
124 base frr-route-map:rmap-match-type;
130 base frr-route-map:rmap-match-type;
132 "Match EVPN route distinguisher";
135 identity match-community {
136 base frr-route-map:rmap-match-type;
138 "Match BGP community list";
141 identity match-large-community {
142 base frr-route-map:rmap-match-type;
144 "Match BGP large-community list";
147 identity match-extcommunity {
148 base frr-route-map:rmap-match-type;
150 "Match BGP extcommunity list";
153 identity as-path-list {
154 base frr-route-map:rmap-match-type;
156 "Match BGP AS path list";
159 identity ipv4-nexthop {
160 base frr-route-map:rmap-match-type;
162 "Match IPv4 next hop address";
165 identity ipv6-nexthop {
166 base frr-route-map:rmap-match-type;
168 "Match IPv6 next hop address";
172 base frr-route-map:rmap-set-type;
174 "Set BGP administrative distance to use";
177 identity set-extcommunity-none {
178 base frr-route-map:rmap-set-type;
180 "Set BGP extended community attribute";
183 identity set-extcommunity-rt {
184 base frr-route-map:rmap-set-type;
186 "Set BGP extended community attribute";
189 identity set-extcommunity-soo {
190 base frr-route-map:rmap-set-type;
192 "Set BGP extended community attribute";
195 identity set-extcommunity-lb {
196 base frr-route-map:rmap-set-type;
198 "Set BGP extended community attribute";
201 identity set-ipv4-nexthop {
202 base frr-route-map:rmap-set-type;
204 "Set the IPv4 next-hop to peer-address/unchanged";
207 identity ipv4-vpn-address {
208 base frr-route-map:rmap-set-type;
210 "Set IPv4 VPN next-hop address";
213 identity ipv6-nexthop-global {
214 base frr-route-map:rmap-set-type;
216 "Set IPv6 next-hop global address";
219 identity ipv6-prefer-global {
220 base frr-route-map:rmap-set-type;
222 "Set IPv6 next-hop to prefer global address";
225 identity ipv6-peer-address {
226 base frr-route-map:rmap-set-type;
228 "Set IPv6 next-hop peer address";
231 identity ipv6-vpn-address {
232 base frr-route-map:rmap-set-type;
234 "Set IPv6 VPN next-hop address";
237 identity label-index {
238 base frr-route-map:rmap-set-type;
240 "Set the label index to associate with the prefixs";
243 identity set-local-preference {
244 base frr-route-map:rmap-set-type;
246 "Set the BGP local preference path attribute";
249 identity set-origin {
250 base frr-route-map:rmap-set-type;
252 "Set BGP route origin code";
256 base frr-route-map:rmap-set-type;
258 "Set the BGP weight attribute";
261 identity originator-id {
262 base frr-route-map:rmap-set-type;
264 "Set the BGP originator ID attribute";
268 base frr-route-map:rmap-set-type;
270 "Export route to non-main kernel table";
273 identity atomic-aggregate {
274 base frr-route-map:rmap-set-type;
276 "Set BGP atomic-aggregate attribute";
279 identity aigp-metric {
280 base frr-route-map:rmap-set-type;
282 "Set BGP AIGP attribute (AIGP TLV Metric)";
285 identity as-path-prepend {
286 base frr-route-map:rmap-set-type;
288 "Set the BGP AS-path attribute";
291 identity as-path-exclude {
292 base frr-route-map:rmap-set-type;
294 "Set the BGP AS-path attribute";
297 identity as-path-replace {
298 base frr-route-map:rmap-set-type;
300 "Replace ASNs to local AS number";
303 identity set-community {
304 base frr-route-map:rmap-set-type;
306 "Set the BGP community attribute";
309 identity set-large-community {
310 base frr-route-map:rmap-set-type;
312 "Set the BGP large-community attribute";
315 identity aggregator {
316 base frr-route-map:rmap-set-type;
318 "Set the BGP aggregator attribute";
321 identity comm-list-delete {
322 base frr-route-map:rmap-set-type;
324 "Set BGP community list (for deletion)";
327 identity large-comm-list-delete {
328 base frr-route-map:rmap-set-type;
330 "Set BGP large community list (for deletion)";
333 identity set-evpn-gateway-ip-ipv4 {
334 base frr-route-map:rmap-set-type;
336 "Set EVPN gateway IP overlay index IPv4";
339 identity set-evpn-gateway-ip-ipv6 {
340 base frr-route-map:rmap-set-type;
342 "Set EVPN gateway IP overlay index IPv6";
345 identity set-l3vpn-nexthop-encapsulation {
346 base frr-route-map:rmap-set-type;
348 "Accept L3VPN traffic over other than LSP encapsulation";
351 grouping extcommunity-non-transitive-types {
352 leaf two-octet-as-specific {
355 "Non-Transitive Two-Octet AS-Specific Extended Community";
359 typedef extcommunity-lb-type {
361 enum "explicit-bandwidth" {
364 "Bandwidth value in Mbps";
366 enum "cumulative-bandwidth" {
369 "Cumulative bandwidth of all multipaths (outbound-only)";
371 enum "computed-bandwidth" {
374 "Internally computed bandwidth based on number of multipaths (outbound-only)";
378 "ext-community link bandwidth types.";
381 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" {
382 case local-preference {
383 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')";
384 leaf local-preference {
386 range "0..4294967295";
392 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')";
399 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')";
406 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')";
429 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')";
451 case rpki-extcommunity {
452 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-extcommunity')";
453 leaf rpki-extcommunity {
475 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')";
484 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')";
491 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')";
495 case peer-ipv4-address {
497 "IP address of peer";
498 leaf peer-ipv4-address {
499 type inet:ipv4-address;
503 case peer-interface {
505 "Interface name of peer";
506 leaf peer-interface {
511 case peer-ipv6-address {
513 "IPv6 address of peer";
514 leaf peer-ipv6-address {
515 type inet:ipv6-address;
521 "Static or Redistributed routes";
529 case access-list-name {
530 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 "
531 + "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 "
532 + "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 "
533 + "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')";
537 type filter:access-list-name;
541 case evpn-default-route {
542 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')";
544 "Match default EVPN type-5 route";
545 leaf evpn-default-route {
551 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')";
561 case evpn-route-type {
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-route-type')";
564 "Match eVPN route-type";
565 leaf evpn-route-type {
585 "Ethernet Auto-Discovery route";
590 "Ethernet Segment route";
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:evpn-rd')";
599 "Match eVPN route-distinguisher";
600 leaf route-distinguisher {
601 type rt-types:route-distinguisher;
605 case comm-list-name {
606 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 "
607 + "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 "
608 + "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')";
609 container comm-list {
610 leaf comm-list-name {
611 type bgp-filter:bgp-list-name;
614 leaf comm-list-name-exact-match {
617 "Do exact matching of communities";
623 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')";
625 type inet:ipv4-address;
632 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')";
634 type inet:ipv6-address;
641 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" {
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:distance')";
651 case extcommunity-none {
652 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')";
654 "Value of the BGP extended community attribute";
655 leaf extcommunity-none {
657 description "No extended community attribute";
661 case extcommunity-rt {
662 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')";
664 "Value of the ext-community";
665 leaf extcommunity-rt {
668 "Set BGP ext-community route-target attribute";
672 case extcommunity-soo {
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-extcommunity-soo')";
675 "Value of the ext-community";
676 leaf extcommunity-soo {
679 "Set BGP ext-community site-of-origin attribute";
683 case extcommunity-lb {
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:set-extcommunity-lb')";
685 container extcommunity-lb {
687 "Value of the ext-community.";
689 type frr-bgp-route-map:extcommunity-lb-type;
693 when "../lb-type = 'explicit-bandwidth'";
698 "Bandwidth value in Mbps";
700 uses extcommunity-non-transitive-types;
705 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')";
707 "Set the IPv4 address";
709 type inet:ipv4-address;
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:set-ipv4-nexthop')";
721 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 "
722 + "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')";
724 "Set the IPv6 address";
726 type inet:ipv6-address;
731 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 "
732 + "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')";
739 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')";
748 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')";
755 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')";
758 range "0..4294967295";
764 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')";
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:originator-id')";
789 type inet:ipv4-address;
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:table')";
797 range "1..4294967295";
802 case atomic-aggregate {
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:atomic-aggregate')";
804 leaf atomic-aggregate {
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:aigp-metric')";
814 "Set BGP AIGP attribute (AIGP Metric TLV)";
818 case as-path-prepend {
819 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')";
820 choice as-path-prepend {
822 "Value of the BGP AS-path attribute";
825 "Prepend the mentioned AS-path";
826 leaf prepend-as-path {
833 "Prepend the last ASN in the AS-path";
843 case as-path-exclude {
844 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')";
845 leaf exclude-as-path {
848 "Exclude the mentioned AS-path";
852 case as-path-replace {
853 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')";
854 leaf replace-as-path {
857 "Replace ASNs to local AS number";
862 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')";
865 "Value of the BGP community attribute";
868 "No community attribute";
869 leaf community-none {
874 case community-string {
877 leaf community-string {
884 case large-community {
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:set-large-community')";
886 choice large-community {
888 "Value of the BGP large-community attribute";
891 "No large-community attribute";
892 leaf large-community-none {
897 case large-community-string {
899 "Large-Community string";
900 leaf large-community-string {
908 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')";
909 container aggregator {
910 leaf aggregator-asn {
912 range "1..4294967295";
915 "ASN of the aggregator";
918 leaf aggregator-address {
919 when "../aggregator-asn > 0 or "
920 + "../aggregator-asn <= 4294967295";
921 type inet:ipv4-address;
923 "IPv4 address of the aggregator";
928 case comm-list-name {
929 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 "
930 + "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')";
931 leaf comm-list-name {
932 type bgp-filter:bgp-list-name;
935 case evpn-gateway-ip-ipv4 {
937 "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,
938 'frr-bgp-route-map:set-evpn-gateway-ip-ipv4')";
940 "Set EVPN gateway IP overlay index IPv4";
941 leaf evpn-gateway-ip-ipv4 {
942 type inet:ipv4-address;
945 case evpn-gateway-ip-ipv6 {
947 "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,
948 'frr-bgp-route-map:set-evpn-gateway-ip-ipv6')";
950 "Set EVPN gateway IP overlay index IPv6";
951 leaf evpn-gateway-ip-ipv6 {
952 type inet:ipv6-address;
955 case l3vpn-nexthop-encapsulation {
957 "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,
958 'frr-bgp-route-map:set-l3vpn-nexthop-encapsulation')";
960 "Accept L3VPN traffic over other than LSP encapsulation";
961 leaf l3vpn-nexthop-encapsulation {