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 as-path-prepend {
280 base frr-route-map:rmap-set-type;
282 "Set the BGP AS-path attribute";
285 identity as-path-exclude {
286 base frr-route-map:rmap-set-type;
288 "Set the BGP AS-path attribute";
291 identity as-path-replace {
292 base frr-route-map:rmap-set-type;
294 "Replace ASNs to local AS number";
297 identity set-community {
298 base frr-route-map:rmap-set-type;
300 "Set the BGP community attribute";
303 identity set-large-community {
304 base frr-route-map:rmap-set-type;
306 "Set the BGP large-community attribute";
309 identity aggregator {
310 base frr-route-map:rmap-set-type;
312 "Set the BGP aggregator attribute";
315 identity comm-list-delete {
316 base frr-route-map:rmap-set-type;
318 "Set BGP community list (for deletion)";
321 identity large-comm-list-delete {
322 base frr-route-map:rmap-set-type;
324 "Set BGP large community list (for deletion)";
327 identity set-evpn-gateway-ip-ipv4 {
328 base frr-route-map:rmap-set-type;
330 "Set EVPN gateway IP overlay index IPv4";
333 identity set-evpn-gateway-ip-ipv6 {
334 base frr-route-map:rmap-set-type;
336 "Set EVPN gateway IP overlay index IPv6";
339 identity set-l3vpn-nexthop-encapsulation {
340 base frr-route-map:rmap-set-type;
342 "Accept L3VPN traffic over other than LSP encapsulation";
345 grouping extcommunity-non-transitive-types {
346 leaf two-octet-as-specific {
349 "Non-Transitive Two-Octet AS-Specific Extended Community";
353 typedef extcommunity-lb-type {
355 enum "explicit-bandwidth" {
358 "Bandwidth value in Mbps";
360 enum "cumulative-bandwidth" {
363 "Cumulative bandwidth of all multipaths (outbound-only)";
365 enum "computed-bandwidth" {
368 "Internally computed bandwidth based on number of multipaths (outbound-only)";
372 "ext-community link bandwidth types.";
375 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" {
376 case local-preference {
377 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')";
378 leaf local-preference {
380 range "0..4294967295";
386 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')";
393 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')";
400 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')";
423 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')";
445 case rpki-extcommunity {
446 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')";
447 leaf rpki-extcommunity {
469 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')";
478 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')";
485 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')";
489 case peer-ipv4-address {
491 "IP address of peer";
492 leaf peer-ipv4-address {
493 type inet:ipv4-address;
497 case peer-interface {
499 "Interface name of peer";
500 leaf peer-interface {
505 case peer-ipv6-address {
507 "IPv6 address of peer";
508 leaf peer-ipv6-address {
509 type inet:ipv6-address;
515 "Static or Redistributed routes";
523 case access-list-name {
524 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 "
525 + "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 "
526 + "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 "
527 + "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')";
531 type filter:access-list-name;
535 case evpn-default-route {
536 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')";
538 "Match default EVPN type-5 route";
539 leaf evpn-default-route {
545 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')";
555 case evpn-route-type {
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-route-type')";
558 "Match eVPN route-type";
559 leaf evpn-route-type {
579 "Ethernet Auto-Discovery route";
584 "Ethernet Segment route";
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:evpn-rd')";
593 "Match eVPN route-distinguisher";
594 leaf route-distinguisher {
595 type rt-types:route-distinguisher;
599 case comm-list-name {
600 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 "
601 + "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 "
602 + "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')";
603 container comm-list {
604 leaf comm-list-name {
605 type bgp-filter:bgp-list-name;
608 leaf comm-list-name-exact-match {
611 "Do exact matching of communities";
617 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')";
619 type inet:ipv4-address;
626 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')";
628 type inet:ipv6-address;
635 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" {
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:distance')";
645 case extcommunity-none {
646 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')";
648 "Value of the BGP extended community attribute";
649 leaf extcommunity-none {
651 description "No extended community attribute";
655 case extcommunity-rt {
656 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')";
658 "Value of the ext-community";
659 leaf extcommunity-rt {
662 "Set BGP ext-community route-target attribute";
666 case extcommunity-soo {
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-extcommunity-soo')";
669 "Value of the ext-community";
670 leaf extcommunity-soo {
673 "Set BGP ext-community site-of-origin attribute";
677 case extcommunity-lb {
678 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')";
679 container extcommunity-lb {
681 "Value of the ext-community.";
683 type frr-bgp-route-map:extcommunity-lb-type;
687 when "../lb-type = 'explicit-bandwidth'";
692 "Bandwidth value in Mbps";
694 uses extcommunity-non-transitive-types;
699 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')";
701 "Set the IPv4 address";
703 type inet:ipv4-address;
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:set-ipv4-nexthop')";
715 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 "
716 + "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')";
718 "Set the IPv6 address";
720 type inet:ipv6-address;
725 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 "
726 + "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')";
733 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')";
742 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')";
749 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')";
752 range "0..4294967295";
758 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')";
781 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')";
783 type inet:ipv4-address;
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:table')";
791 range "1..4294967295";
796 case atomic-aggregate {
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:atomic-aggregate')";
798 leaf atomic-aggregate {
803 case as-path-prepend {
804 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')";
805 choice as-path-prepend {
807 "Value of the BGP AS-path attribute";
810 "Prepend the mentioned AS-path";
811 leaf prepend-as-path {
818 "Prepend the last ASN in the AS-path";
828 case as-path-exclude {
829 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')";
830 leaf exclude-as-path {
833 "Exclude the mentioned AS-path";
837 case as-path-replace {
838 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')";
839 leaf replace-as-path {
842 "Replace ASNs to local AS number";
847 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')";
850 "Value of the BGP community attribute";
853 "No community attribute";
854 leaf community-none {
859 case community-string {
862 leaf community-string {
869 case large-community {
870 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')";
871 choice large-community {
873 "Value of the BGP large-community attribute";
876 "No large-community attribute";
877 leaf large-community-none {
882 case large-community-string {
884 "Large-Community string";
885 leaf large-community-string {
893 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')";
894 container aggregator {
895 leaf aggregator-asn {
897 range "1..4294967295";
900 "ASN of the aggregator";
903 leaf aggregator-address {
904 when "../aggregator-asn > 0 or "
905 + "../aggregator-asn <= 4294967295";
906 type inet:ipv4-address;
908 "IPv4 address of the aggregator";
913 case comm-list-name {
914 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 "
915 + "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')";
916 leaf comm-list-name {
917 type bgp-filter:bgp-list-name;
920 case evpn-gateway-ip-ipv4 {
922 "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,
923 'frr-bgp-route-map:set-evpn-gateway-ip-ipv4')";
925 "Set EVPN gateway IP overlay index IPv4";
926 leaf evpn-gateway-ip-ipv4 {
927 type inet:ipv4-address;
930 case evpn-gateway-ip-ipv6 {
932 "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,
933 'frr-bgp-route-map:set-evpn-gateway-ip-ipv6')";
935 "Set EVPN gateway IP overlay index IPv6";
936 leaf evpn-gateway-ip-ipv6 {
937 type inet:ipv6-address;
940 case l3vpn-nexthop-encapsulation {
942 "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,
943 'frr-bgp-route-map:set-l3vpn-nexthop-encapsulation')";
945 "Accept L3VPN traffic over other than LSP encapsulation";
946 leaf l3vpn-nexthop-encapsulation {