]> git.proxmox.com Git - mirror_frr.git/blob - yang/frr-bgp-route-map.yang
bgpd: Do not allow setting `set distance` via route-maps to zero
[mirror_frr.git] / yang / frr-bgp-route-map.yang
1 module frr-bgp-route-map {
2 yang-version 1.1;
3 namespace "http://frrouting.org/yang/bgp-route-map";
4 prefix frr-bgp-route-map;
5
6 import ietf-inet-types {
7 prefix inet;
8 }
9
10 import frr-route-map {
11 prefix frr-route-map;
12 }
13
14 import frr-filter {
15 prefix filter;
16 }
17
18 import frr-bgp-filter {
19 prefix bgp-filter;
20 }
21
22 import ietf-routing-types {
23 prefix rt-types;
24 }
25
26 organization
27 "Free Range Routing";
28 contact
29 "FRR Users List: <mailto:frog@lists.frrouting.org>
30 FRR Development List: <mailto:dev@lists.frrouting.org>";
31 description
32 "This module defines bgp route map settings";
33
34 revision 2020-01-02 {
35 description
36 "Initial revision";
37 }
38
39 identity match-alias {
40 base frr-route-map:rmap-match-type;
41 description
42 "Match BGP community alias name";
43 }
44
45 identity match-local-preference {
46 base frr-route-map:rmap-match-type;
47 description
48 "Match local-preference of routes";
49 }
50
51 identity match-script {
52 base frr-route-map:rmap-match-type;
53 description
54 "Match script of routes";
55 }
56
57 identity match-origin {
58 base frr-route-map:rmap-match-type;
59 description
60 "Match BGP route origin code";
61 }
62
63 identity rpki {
64 base frr-route-map:rmap-match-type;
65 description
66 "Control rpki specific settings";
67 }
68
69 identity rpki-extcommunity {
70 base frr-route-map:rmap-match-type;
71 description
72 "Control rpki specific settings derived from extended community";
73 }
74
75 identity probability {
76 base frr-route-map:rmap-match-type;
77 description
78 "Match portion of routes defined by percentage value";
79 }
80
81 identity source-vrf {
82 base frr-route-map:rmap-match-type;
83 description
84 "Match source vrf of routes";
85 }
86
87 identity peer {
88 base frr-route-map:rmap-match-type;
89 description
90 "Match peer address";
91 }
92
93 identity mac-address-list {
94 base frr-route-map:rmap-match-type;
95 description
96 "Match MAC address access-list";
97 }
98
99 identity ip-route-source {
100 base frr-route-map:rmap-match-type;
101 description
102 "Match advertising source address of route";
103 }
104
105 identity ip-route-source-prefix-list {
106 base frr-route-map:rmap-match-type;
107 description
108 "Match advertising source address of route";
109 }
110
111 identity evpn-route-type {
112 base frr-route-map:rmap-match-type;
113 description
114 "Match EVPN route type";
115 }
116
117 identity evpn-default-route {
118 base frr-route-map:rmap-match-type;
119 description
120 "Match EVPN default Type-5 route";
121 }
122
123 identity evpn-vni {
124 base frr-route-map:rmap-match-type;
125 description
126 "Match EVPN VNI";
127 }
128
129 identity evpn-rd {
130 base frr-route-map:rmap-match-type;
131 description
132 "Match EVPN route distinguisher";
133 }
134
135 identity match-community {
136 base frr-route-map:rmap-match-type;
137 description
138 "Match BGP community list";
139 }
140
141 identity match-large-community {
142 base frr-route-map:rmap-match-type;
143 description
144 "Match BGP large-community list";
145 }
146
147 identity match-extcommunity {
148 base frr-route-map:rmap-match-type;
149 description
150 "Match BGP extcommunity list";
151 }
152
153 identity as-path-list {
154 base frr-route-map:rmap-match-type;
155 description
156 "Match BGP AS path list";
157 }
158
159 identity ipv4-nexthop {
160 base frr-route-map:rmap-match-type;
161 description
162 "Match IPv4 next hop address";
163 }
164
165 identity ipv6-nexthop {
166 base frr-route-map:rmap-match-type;
167 description
168 "Match IPv6 next hop address";
169 }
170
171 identity distance {
172 base frr-route-map:rmap-set-type;
173 description
174 "Set BGP administrative distance to use";
175 }
176
177 identity set-extcommunity-none {
178 base frr-route-map:rmap-set-type;
179 description
180 "Set BGP extended community attribute";
181 }
182
183 identity set-extcommunity-rt {
184 base frr-route-map:rmap-set-type;
185 description
186 "Set BGP extended community attribute";
187 }
188
189 identity set-extcommunity-soo {
190 base frr-route-map:rmap-set-type;
191 description
192 "Set BGP extended community attribute";
193 }
194
195 identity set-extcommunity-lb {
196 base frr-route-map:rmap-set-type;
197 description
198 "Set BGP extended community attribute";
199 }
200
201 identity set-ipv4-nexthop {
202 base frr-route-map:rmap-set-type;
203 description
204 "Set the IPv4 next-hop to peer-address/unchanged";
205 }
206
207 identity ipv4-vpn-address {
208 base frr-route-map:rmap-set-type;
209 description
210 "Set IPv4 VPN next-hop address";
211 }
212
213 identity ipv6-nexthop-global {
214 base frr-route-map:rmap-set-type;
215 description
216 "Set IPv6 next-hop global address";
217 }
218
219 identity ipv6-prefer-global {
220 base frr-route-map:rmap-set-type;
221 description
222 "Set IPv6 next-hop to prefer global address";
223 }
224
225 identity ipv6-peer-address {
226 base frr-route-map:rmap-set-type;
227 description
228 "Set IPv6 next-hop peer address";
229 }
230
231 identity ipv6-vpn-address {
232 base frr-route-map:rmap-set-type;
233 description
234 "Set IPv6 VPN next-hop address";
235 }
236
237 identity label-index {
238 base frr-route-map:rmap-set-type;
239 description
240 "Set the label index to associate with the prefixs";
241 }
242
243 identity set-local-preference {
244 base frr-route-map:rmap-set-type;
245 description
246 "Set the BGP local preference path attribute";
247 }
248
249 identity set-origin {
250 base frr-route-map:rmap-set-type;
251 description
252 "Set BGP route origin code";
253 }
254
255 identity weight {
256 base frr-route-map:rmap-set-type;
257 description
258 "Set the BGP weight attribute";
259 }
260
261 identity originator-id {
262 base frr-route-map:rmap-set-type;
263 description
264 "Set the BGP originator ID attribute";
265 }
266
267 identity table {
268 base frr-route-map:rmap-set-type;
269 description
270 "Export route to non-main kernel table";
271 }
272
273 identity atomic-aggregate {
274 base frr-route-map:rmap-set-type;
275 description
276 "Set BGP atomic-aggregate attribute";
277 }
278
279 identity aigp-metric {
280 base frr-route-map:rmap-set-type;
281 description
282 "Set BGP AIGP attribute (AIGP TLV Metric)";
283 }
284
285 identity as-path-prepend {
286 base frr-route-map:rmap-set-type;
287 description
288 "Set the BGP AS-path attribute";
289 }
290
291 identity as-path-exclude {
292 base frr-route-map:rmap-set-type;
293 description
294 "Set the BGP AS-path attribute";
295 }
296
297 identity as-path-replace {
298 base frr-route-map:rmap-set-type;
299 description
300 "Replace ASNs to local AS number";
301 }
302
303 identity set-community {
304 base frr-route-map:rmap-set-type;
305 description
306 "Set the BGP community attribute";
307 }
308
309 identity set-large-community {
310 base frr-route-map:rmap-set-type;
311 description
312 "Set the BGP large-community attribute";
313 }
314
315 identity aggregator {
316 base frr-route-map:rmap-set-type;
317 description
318 "Set the BGP aggregator attribute";
319 }
320
321 identity comm-list-delete {
322 base frr-route-map:rmap-set-type;
323 description
324 "Set BGP community list (for deletion)";
325 }
326
327 identity large-comm-list-delete {
328 base frr-route-map:rmap-set-type;
329 description
330 "Set BGP large community list (for deletion)";
331 }
332
333 identity set-evpn-gateway-ip-ipv4 {
334 base frr-route-map:rmap-set-type;
335 description
336 "Set EVPN gateway IP overlay index IPv4";
337 }
338
339 identity set-evpn-gateway-ip-ipv6 {
340 base frr-route-map:rmap-set-type;
341 description
342 "Set EVPN gateway IP overlay index IPv6";
343 }
344
345 identity set-l3vpn-nexthop-encapsulation {
346 base frr-route-map:rmap-set-type;
347 description
348 "Accept L3VPN traffic over other than LSP encapsulation";
349 }
350
351 grouping extcommunity-non-transitive-types {
352 leaf two-octet-as-specific {
353 type boolean;
354 description
355 "Non-Transitive Two-Octet AS-Specific Extended Community";
356 }
357 }
358
359 typedef route-distinguisher {
360 type string {
361 pattern
362 '(0:(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|'
363 + '6[0-4][0-9]{3}|'
364 + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0):(429496729[0-5]|'
365 + '42949672[0-8][0-9]|'
366 + '4294967[01][0-9]{2}|429496[0-6][0-9]{3}|'
367 + '42949[0-5][0-9]{4}|'
368 + '4294[0-8][0-9]{5}|429[0-3][0-9]{6}|'
369 + '42[0-8][0-9]{7}|4[01][0-9]{8}|'
370 + '[1-3][0-9]{9}|[1-9][0-9]{0,8}|0))|'
371 + '(1:((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|'
372 + '25[0-5])\.){3}([0-9]|[1-9][0-9]|'
373 + '1[0-9]{2}|2[0-4][0-9]|25[0-5])):(6553[0-5]|'
374 + '655[0-2][0-9]|'
375 + '65[0-4][0-9]{2}|6[0-4][0-9]{3}|'
376 + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0))|'
377 + '(2:(429496729[0-5]|42949672[0-8][0-9]|'
378 + '4294967[01][0-9]{2}|'
379 + '429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|'
380 + '4294[0-8][0-9]{5}|'
381 + '429[0-3][0-9]{6}|42[0-8][0-9]{7}|4[01][0-9]{8}|'
382 + '[1-3][0-9]{9}|[1-9][0-9]{0,8}|0):'
383 + '(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|'
384 + '6[0-4][0-9]{3}|'
385 + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0))|'
386 + '(6(:[a-fA-F0-9]{2}){6})|'
387 + '(([3-57-9a-fA-F]|[1-9a-fA-F][0-9a-fA-F]{1,3}):'
388 + '[0-9a-fA-F]{1,12})|'
389 + '((6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|'
390 + '6[0-4][0-9]{3}|'
391 + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0):(429496729[0-5]|'
392 + '42949672[0-8][0-9]|'
393 + '4294967[01][0-9]{2}|429496[0-6][0-9]{3}|'
394 + '42949[0-5][0-9]{4}|'
395 + '4294[0-8][0-9]{5}|429[0-3][0-9]{6}|'
396 + '42[0-8][0-9]{7}|4[01][0-9]{8}|'
397 + '[1-3][0-9]{9}|[1-9][0-9]{0,8}|0)|'
398 + '((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|'
399 + '25[0-5])\.){3}([0-9]|[1-9][0-9]|'
400 + '1[0-9]{2}|2[0-4][0-9]|25[0-5])):(6553[0-5]|'
401 + '655[0-2][0-9]|'
402 + '65[0-4][0-9]{2}|6[0-4][0-9]{3}|'
403 + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0))|'
404 + '((429496729[0-5]|42949672[0-8][0-9]|'
405 + '4294967[01][0-9]{2}|'
406 + '429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|'
407 + '4294[0-8][0-9]{5}|'
408 + '429[0-3][0-9]{6}|42[0-8][0-9]{7}|4[01][0-9]{8}|'
409 + '[1-3][0-9]{9}|[1-9][0-9]{0,8}|0):'
410 + '(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|'
411 + '6[0-4][0-9]{3}|'
412 + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0))|'
413 + '((6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|'
414 + '6[0-4][0-9]{3}|'
415 + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0).'
416 + '(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|'
417 + '6[0-4][0-9]{3}|'
418 + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0):'
419 + '(429496729[0-5]|42949672[0-8][0-9]|'
420 + '4294967[01][0-9]{2}|'
421 + '429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|'
422 + '4294[0-8][0-9]{5}|'
423 + '429[0-3][0-9]{6}|42[0-8][0-9]{7}|4[01][0-9]{8}|'
424 + '[1-3][0-9]{9}|[1-9][0-9]{0,8}|0))';
425 }
426
427 description
428 "A Route Distinguisher is an 8-octet value used to
429 distinguish routes from different BGP VPNs (RFC 4364).
430 A Route Distinguisher will have the same format as a
431 Route Target as per RFC 4360 and will consist of
432 two or three fields: a 2-octet Type field, an administrator
433 field, and, optionally, an assigned number field.
434 According to the data formats for types 0, 1, 2, and 6 as
435 defined in RFC 4360, RFC 5668, and RFC 7432, the encoding
436 pattern is defined as:
437 0:2-octet-asn:4-octet-number
438 1:4-octet-ipv4addr:2-octet-number
439 2:4-octet-asn:2-octet-number
440 6:6-octet-mac-address
441 Additionally, a generic pattern is defined for future
442 route discriminator types:
443 2-octet-other-hex-number:6-octet-hex-number
444 Some valid examples are 0:100:100, 1:1.1.1.1:100,
445 2:1234567890:203, and 6:26:00:08:92:78:00.
446 The following route distinguisher with two fields are also
447 accepted : 10000:44 1.2.3.4:44.";
448 reference
449 "RFC 4360: BGP Extended Communities Attribute.
450 RFC 4364: BGP/MPLS IP Virtual Private Networks (VPNs).
451 RFC 5668: 4-Octet AS Specific BGP Extended Community.
452 RFC 7432: BGP MPLS-Based Ethernet VPN.";
453 }
454
455 typedef extcommunity-lb-type {
456 type enumeration {
457 enum "explicit-bandwidth" {
458 value 0;
459 description
460 "Bandwidth value in Mbps";
461 }
462 enum "cumulative-bandwidth" {
463 value 1;
464 description
465 "Cumulative bandwidth of all multipaths (outbound-only)";
466 }
467 enum "computed-bandwidth" {
468 value 2;
469 description
470 "Internally computed bandwidth based on number of multipaths (outbound-only)";
471 }
472 }
473 description
474 "ext-community link bandwidth types.";
475 }
476
477 typedef asn-type {
478 type union {
479 type uint32 {
480 range "1..4294967295";
481 }
482 type string {
483 pattern '(0|[1-9][0-9]{0,3}|[1-5][0-9]{4}|'
484 + '6[0-4][0-9]{3}|65[0-4][0-9]{2}|'
485 + '655[0-2][0-9]|6553[0-5])\.'
486 + '(0|[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|'
487 + '65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])' {
488 error-message "AS dot should be in the form [0..65535].[0..65535].";
489 }
490 pattern '^0\.0$' {
491 modifier "invert-match";
492 error-message "AS dot can't be equal to 0.0.";
493 }
494 }
495 }
496 }
497
498 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" {
499 case local-preference {
500 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')";
501 leaf local-preference {
502 type uint32 {
503 range "0..4294967295";
504 }
505 }
506 }
507
508 case alias {
509 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')";
510 leaf alias {
511 type string;
512 }
513 }
514
515 case script {
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:match-script')";
517 leaf script {
518 type string;
519 }
520 }
521
522 case origin {
523 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')";
524 leaf origin {
525 type enumeration {
526 enum "egp" {
527 value 0;
528 description
529 "Remote EGP";
530 }
531 enum "igp" {
532 value 1;
533 description
534 "Local IGP";
535 }
536 enum "incomplete" {
537 value 2;
538 description
539 "Unknown heritage";
540 }
541 }
542 }
543 }
544
545 case rpki {
546 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')";
547 leaf rpki {
548 type enumeration {
549 enum "invalid" {
550 value 0;
551 description
552 "Invalid prefix";
553 }
554 enum "notfound" {
555 value 1;
556 description
557 "Prefix not found";
558 }
559 enum "valid" {
560 value 2;
561 description
562 "Valid prefix";
563 }
564 }
565 }
566 }
567
568 case rpki-extcommunity {
569 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')";
570 leaf rpki-extcommunity {
571 type enumeration {
572 enum "valid" {
573 value 0;
574 description
575 "Valid prefix";
576 }
577 enum "notfound" {
578 value 1;
579 description
580 "Prefix not found";
581 }
582 enum "invalid" {
583 value 2;
584 description
585 "Invalid prefix";
586 }
587 }
588 }
589 }
590
591 case probability {
592 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')";
593 leaf probability {
594 type uint8 {
595 range "0..100";
596 }
597 }
598 }
599
600 case source-vrf {
601 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')";
602 leaf source-vrf {
603 type string;
604 }
605 }
606
607 case peer {
608 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')";
609 choice peer {
610 description
611 "Value of the peer";
612 case peer-ipv4-address {
613 description
614 "IP address of peer";
615 leaf peer-ipv4-address {
616 type inet:ipv4-address;
617 }
618 }
619
620 case peer-interface {
621 description
622 "Interface name of peer";
623 leaf peer-interface {
624 type string;
625 }
626 }
627
628 case peer-ipv6-address {
629 description
630 "IPv6 address of peer";
631 leaf peer-ipv6-address {
632 type inet:ipv6-address;
633 }
634 }
635
636 case peer-local {
637 description
638 "Static or Redistributed routes";
639 leaf peer-local {
640 type boolean;
641 }
642 }
643 }
644 }
645
646 case access-list-name {
647 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 "
648 + "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 "
649 + "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 "
650 + "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')";
651 description
652 "Access-list name";
653 leaf list-name {
654 type filter:access-list-name;
655 }
656 }
657
658 case evpn-default-route {
659 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')";
660 description
661 "Match default EVPN type-5 route";
662 leaf evpn-default-route {
663 type empty;
664 }
665 }
666
667 case evpn-vni {
668 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')";
669 description
670 "Match eVPN VNI";
671 leaf evpn-vni {
672 type uint32 {
673 range "1..16777215";
674 }
675 }
676 }
677
678 case evpn-route-type {
679 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')";
680 description
681 "Match eVPN route-type";
682 leaf evpn-route-type {
683 type enumeration {
684 enum "macip" {
685 value 0;
686 description
687 "Mac-IP route";
688 }
689 enum "multicast" {
690 value 1;
691 description
692 "IMET route";
693 }
694 enum "prefix" {
695 value 2;
696 description
697 "Prefix route";
698 }
699 enum "ead" {
700 value 3;
701 description
702 "Ethernet Auto-Discovery route";
703 }
704 enum "es" {
705 value 4;
706 description
707 "Ethernet Segment route";
708 }
709 }
710 }
711 }
712
713 case evpn-rd {
714 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')";
715 description
716 "Match eVPN route-distinguisher";
717 leaf route-distinguisher {
718 type route-distinguisher;
719 }
720 }
721
722 case comm-list-name {
723 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 "
724 + "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 "
725 + "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')";
726 container comm-list {
727 leaf comm-list-name {
728 type bgp-filter:bgp-list-name;
729 }
730
731 leaf comm-list-name-exact-match {
732 type boolean;
733 description
734 "Do exact matching of communities";
735 }
736 }
737 }
738
739 case ipv4-address {
740 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')";
741 leaf ipv4-address {
742 type inet:ipv4-address;
743 description
744 "IPv4 address";
745 }
746 }
747
748 case ipv6-address {
749 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')";
750 leaf ipv6-address {
751 type inet:ipv6-address;
752 description
753 "IPv6 address";
754 }
755 }
756 }
757
758 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" {
759 case distance {
760 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')";
761 leaf distance {
762 type uint8 {
763 range "1..255";
764 }
765 }
766 }
767
768 case extcommunity-none {
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:set-extcommunity-none')";
770 description
771 "Value of the BGP extended community attribute";
772 leaf extcommunity-none {
773 type boolean;
774 description "No extended community attribute";
775 }
776 }
777
778 case extcommunity-rt {
779 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')";
780 description
781 "Value of the ext-community";
782 leaf extcommunity-rt {
783 type string;
784 description
785 "Set BGP ext-community route-target attribute";
786 }
787 }
788
789 case extcommunity-soo {
790 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')";
791 description
792 "Value of the ext-community";
793 leaf extcommunity-soo {
794 type string;
795 description
796 "Set BGP ext-community site-of-origin attribute";
797 }
798 }
799
800 case extcommunity-lb {
801 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')";
802 container extcommunity-lb {
803 description
804 "Value of the ext-community.";
805 leaf lb-type {
806 type frr-bgp-route-map:extcommunity-lb-type;
807 }
808
809 leaf bandwidth {
810 when "../lb-type = 'explicit-bandwidth'";
811 type uint16 {
812 range "1..25600";
813 }
814 description
815 "Bandwidth value in Mbps";
816 }
817 uses extcommunity-non-transitive-types;
818 }
819 }
820
821 case ipv4-address {
822 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')";
823 description
824 "Set the IPv4 address";
825 leaf ipv4-address {
826 type inet:ipv4-address;
827 }
828 }
829
830 case ipv4-nexthop {
831 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')";
832 leaf ipv4-nexthop {
833 type string;
834 }
835 }
836
837 case ipv6-address {
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:ipv6-nexthop-global') or "
839 + "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')";
840 description
841 "Set the IPv6 address";
842 leaf ipv6-address {
843 type inet:ipv6-address;
844 }
845 }
846
847 case preference {
848 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 "
849 + "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')";
850 leaf preference {
851 type boolean;
852 }
853 }
854
855 case label-index {
856 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')";
857 leaf label-index {
858 type uint32 {
859 range "0..1048560";
860 }
861 }
862 }
863
864 case local-pref {
865 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')";
866 leaf local-pref {
867 type string;
868 }
869 }
870
871 case weight {
872 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')";
873 leaf weight {
874 type uint32 {
875 range "0..4294967295";
876 }
877 }
878 }
879
880 case origin {
881 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')";
882 leaf origin {
883 type enumeration {
884 enum "egp" {
885 value 0;
886 description
887 "Remote EGP";
888 }
889 enum "igp" {
890 value 1;
891 description
892 "Local IGP";
893 }
894 enum "incomplete" {
895 value 2;
896 description
897 "Unknown heritage";
898 }
899 }
900 }
901 }
902
903 case originator-id {
904 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')";
905 leaf originator-id {
906 type inet:ipv4-address;
907 }
908 }
909
910 case table {
911 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')";
912 leaf table {
913 type uint32 {
914 range "1..4294967295";
915 }
916 }
917 }
918
919 case atomic-aggregate {
920 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')";
921 leaf atomic-aggregate {
922 type empty;
923 }
924 }
925
926 case aigp-metric {
927 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')";
928 leaf aigp-metric {
929 type string;
930 description
931 "Set BGP AIGP attribute (AIGP Metric TLV)";
932 }
933 }
934
935 case as-path-prepend {
936 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')";
937 choice as-path-prepend {
938 description
939 "Value of the BGP AS-path attribute";
940 case prepend-as {
941 description
942 "Prepend the mentioned AS-path";
943 leaf prepend-as-path {
944 type string;
945 }
946 }
947
948 case last-as {
949 description
950 "Prepend the last ASN in the AS-path";
951 leaf last-as {
952 type uint8 {
953 range "1..10";
954 }
955 }
956 }
957 }
958 }
959
960 case as-path-exclude {
961 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')";
962 leaf exclude-as-path {
963 type string;
964 description
965 "Exclude the mentioned AS-path";
966 }
967 }
968
969 case as-path-replace {
970 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')";
971 leaf replace-as-path {
972 type string;
973 description
974 "Replace ASNs to local AS number";
975 }
976 }
977
978 case community {
979 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')";
980 choice community {
981 description
982 "Value of the BGP community attribute";
983 case none {
984 description
985 "No community attribute";
986 leaf community-none {
987 type boolean;
988 }
989 }
990
991 case community-string {
992 description
993 "Community string";
994 leaf community-string {
995 type string;
996 }
997 }
998 }
999 }
1000
1001 case large-community {
1002 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')";
1003 choice large-community {
1004 description
1005 "Value of the BGP large-community attribute";
1006 case none {
1007 description
1008 "No large-community attribute";
1009 leaf large-community-none {
1010 type boolean;
1011 }
1012 }
1013
1014 case large-community-string {
1015 description
1016 "Large-Community string";
1017 leaf large-community-string {
1018 type string;
1019 }
1020 }
1021 }
1022 }
1023
1024 case aggregator {
1025 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')";
1026 container aggregator {
1027 leaf aggregator-asn {
1028 type asn-type;
1029 description
1030 "ASN of the aggregator";
1031 }
1032
1033 leaf aggregator-address {
1034 type inet:ipv4-address;
1035 description
1036 "IPv4 address of the aggregator";
1037 }
1038 }
1039 }
1040
1041 case comm-list-name {
1042 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 "
1043 + "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')";
1044 leaf comm-list-name {
1045 type bgp-filter:bgp-list-name;
1046 }
1047 }
1048 case evpn-gateway-ip-ipv4 {
1049 when
1050 "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,
1051 'frr-bgp-route-map:set-evpn-gateway-ip-ipv4')";
1052 description
1053 "Set EVPN gateway IP overlay index IPv4";
1054 leaf evpn-gateway-ip-ipv4 {
1055 type inet:ipv4-address;
1056 }
1057 }
1058 case evpn-gateway-ip-ipv6 {
1059 when
1060 "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,
1061 'frr-bgp-route-map:set-evpn-gateway-ip-ipv6')";
1062 description
1063 "Set EVPN gateway IP overlay index IPv6";
1064 leaf evpn-gateway-ip-ipv6 {
1065 type inet:ipv6-address;
1066 }
1067 }
1068 case l3vpn-nexthop-encapsulation {
1069 when
1070 "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,
1071 'frr-bgp-route-map:set-l3vpn-nexthop-encapsulation')";
1072 description
1073 "Accept L3VPN traffic over other than LSP encapsulation";
1074 leaf l3vpn-nexthop-encapsulation {
1075 type enumeration {
1076 enum "gre" {
1077 value 0;
1078 description
1079 "GRE protocol";
1080 }
1081 }
1082 }
1083 }
1084 }
1085 }