]> git.proxmox.com Git - mirror_frr.git/blob - yang/frr-bgp-common.yang
ospf6d : Transformation changes for ospf6 vrf support.
[mirror_frr.git] / yang / frr-bgp-common.yang
1 submodule frr-bgp-common {
2 yang-version 1.1;
3
4 belongs-to frr-bgp {
5 prefix "bgp";
6 }
7
8 import ietf-bgp-types {
9 prefix bt;
10 }
11
12 import ietf-inet-types {
13 prefix inet;
14 }
15
16 import frr-bgp-types {
17 prefix frr-bt;
18 }
19
20 import frr-route-map {
21 prefix frr-route-map;
22 }
23
24 import frr-route-types {
25 prefix frr-rt-type;
26 }
27
28 import frr-vrf {
29 prefix frr-vrf;
30 }
31
32 import ietf-routing-types {
33 prefix rt-types;
34 }
35
36 import frr-interface {
37 prefix frr-interface;
38 }
39
40 organization
41 "FRRouting";
42 contact
43 "FRR Users List: <mailto:frog@lists.frrouting.org> FRR Development
44 List: <mailto:dev@lists.frrouting.org>";
45 description
46 "This submodule contains general data definitions for use in BGP.
47
48 Copyright 2020 FRRouting
49
50 Redistribution and use in source and binary forms, with or without
51 modification, are permitted provided that the following conditions
52 are met:
53
54 1. Redistributions of source code must retain the above copyright notice,
55 this list of conditions and the following disclaimer.
56
57 2. Redistributions in binary form must reproduce the above copyright
58 notice, this list of conditions and the following disclaimer in the
59 documentation and/or other materials provided with the distribution.
60
61 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
62 \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
63 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
64 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
65 HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
66 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
67 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
68 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
69 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
70 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
71 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.";
72
73 revision 2019-12-03 {
74 description
75 "Initial revision.";
76 }
77
78 grouping rmap-policy-import {
79 leaf rmap-import {
80 type frr-route-map:route-map-ref;
81 }
82 }
83
84 grouping rmap-policy-export {
85 leaf rmap-export {
86 type frr-route-map:route-map-ref;
87 }
88 }
89
90 grouping unsupress-map-policy-import {
91 leaf unsupress-map-import {
92 type frr-route-map:route-map-ref;
93 }
94 }
95
96 grouping unsupress-map-policy-export {
97 leaf unsupress-map-export {
98 type frr-route-map:route-map-ref;
99 }
100 }
101
102 grouping plist-policy-import {
103 leaf plist-import {
104 type frr-bt:plist-ref;
105 }
106 }
107
108 grouping plist-policy-export {
109 leaf plist-export {
110 type frr-bt:plist-ref;
111 }
112 }
113
114 grouping access-list-policy-import {
115 leaf access-list-import {
116 type frr-bt:access-list-ref;
117 }
118 }
119
120 grouping access-list-policy-export {
121 leaf access-list-export {
122 type frr-bt:access-list-ref;
123 }
124 }
125
126 grouping as-path-filter-list-policy-import {
127 leaf as-path-filter-list-import {
128 type frr-bt:as-path-filter-ref;
129 }
130 }
131
132 grouping as-path-filter-list-policy-export {
133 leaf as-path-filter-list-export {
134 type frr-bt:as-path-filter-ref;
135 }
136 }
137
138 grouping route-selection-options {
139 description
140 "Configuration relating to route selection options.";
141 container route-selection-options {
142 description
143 "Parameters relating to options for route selection.";
144 leaf always-compare-med {
145 type boolean;
146 default "false";
147 description
148 "Compare multi-exit discriminator (MED) value from
149 different ASes when selecting the best route. The
150 default behaviour is to only compare MEDs for paths
151 received from the same AS.";
152 }
153
154 leaf deterministic-med {
155 type boolean;
156 default "false";
157 description
158 "Compare multi-exit discriminator (MED) value from
159 Same ASes when selecting the best route.";
160 }
161
162 leaf confed-med {
163 type boolean;
164 default "false";
165 description
166 "Compare multi-exit discriminator (MED) value from
167 different Sub ASes when selecting the best route.";
168 }
169
170 leaf missing-as-worst-med {
171 type boolean;
172 default "false";
173 description
174 "Missing multi-exit discriminator (MED) value is
175 considered as value of infinity, making the path
176 least desirable when selecting the best route.";
177 }
178
179 leaf aspath-confed {
180 type boolean;
181 default "false";
182 description
183 "Compare path lengths including confederation sets
184 and sequences in selecting a route.";
185 }
186
187 leaf ignore-as-path-length {
188 type boolean;
189 default "false";
190 description
191 "Ignore the AS path length when selecting the best path.
192 The default is to use the AS path length and prefer paths
193 with shorter length.";
194 }
195
196 leaf external-compare-router-id {
197 type boolean;
198 default "false";
199 description
200 "When comparing similar routes received from external BGP
201 peers, use the router-id as a criterion to select the
202 active path.";
203 }
204
205 leaf allow-multiple-as {
206 type boolean;
207 default "false";
208 description
209 "Allow multi-path to use paths from different neighbouring
210 ASes. The default is to only consider multiple paths
211 from the same neighbouring AS.";
212 }
213
214 leaf multi-path-as-set {
215 when "../allow-multiple-as = 'true'";
216 type boolean;
217 default "false";
218 description
219 "Multi-path with AS-SET, When set to 'true' it adds AS set
220 information for aggregate routes, When set to 'false' it
221 prevents AS set generation.";
222 }
223 }
224 }
225
226 grouping med-config {
227 description
228 "Configuration relating to MED.";
229 container med-config {
230 leaf enable-med-admin {
231 type boolean;
232 default "false";
233 description
234 "Flag to enable receiving of MED metric attribute
235 in routing updates.";
236 }
237 leaf max-med-admin {
238 type uint32 {
239 range "0..4294967295";
240 }
241 default "4294967294";
242 description
243 "Tells the router to announce routes with this MED value
244 This MED value is applicable for indefinite time.";
245 }
246
247 leaf max-med-onstart-up-time {
248 type uint32 {
249 range "5..86400";
250 }
251 units "seconds";
252 description
253 "Tells the router to announce routes with MED value,
254 This MED value is applicable for this duration during
255 start-up.";
256 }
257
258 leaf max-med-onstart-up-value {
259 type uint32 {
260 range "0..4294967295";
261 }
262 default "4294967294";
263 description
264 "Tells the router to announce routes with this MED value
265 This MED value is applicable for start-up time.";
266 }
267 }
268 }
269
270 grouping route-reflector-config {
271 description
272 "Grouping used to include route reflector
273 configuration for BGP global.";
274 container route-reflector {
275 description
276 "Route reflector parameters for the BGP global.";
277 leaf route-reflector-cluster-id {
278 type bt:rr-cluster-id-type;
279 description
280 "Route Reflector cluster ID to use when local router is
281 configured as a route reflector. Commonly set at the
282 group level, but allows a different cluster ID to be set
283 for each neighbor.";
284 reference
285 "RFC 4456: BGP Route Reflection: An Alternative to
286 Full Mesh.";
287 }
288
289 leaf no-client-reflect {
290 type boolean;
291 default "false";
292 description
293 "When set to 'true', this disables route redistribution
294 by the Route Reflector. It is set 'true' when the client is
295 fully meshed to prevent sending of redundant route
296 advertisements.";
297 reference
298 "TODO: Add reference when IETF writes a draft describing
299 this.";
300 }
301
302 leaf allow-outbound-policy {
303 type boolean;
304 default "false";
305 description
306 "When set to 'true', this allow RR to modify the attributes of the
307 reflected IBGP routes as per the out route-map. It is set 'false'
308 RR will not modify the attributes of the reflected IBGP routes as
309 per the out route-map rules.";
310 }
311 }
312 }
313
314 grouping global-bgp-config {
315 leaf instance-type-view {
316 type boolean;
317 default "false";
318 description
319 "When set to 'true' BGP instance type is view.
320 When set to 'false' BGP instance type is regular.";
321 }
322
323 leaf ebgp-multihop-connected-route-check {
324 type boolean;
325 default "false";
326 description
327 "When set to 'true' it will disable checking if nexthop is connected
328 on EBGP sessions. When set to 'false' it will enable checking if
329 nexthop is connected on EBGP sessions.";
330 }
331
332 leaf fast-external-failover {
333 type boolean;
334 default "true";
335 description
336 "It's an interface tracking mechanism. When set to 'true' don't
337 immediately reset session if a link to a directly connected
338 external peer goes down. When set to 'false' it will immediately
339 reset session if a link to a directly connected external peer goes down.";
340 }
341
342 leaf local-pref {
343 type uint32;
344 default "100";
345 description
346 "BGP local preference attribute sent to internal peers to
347 indicate the degree of preference for externally learned
348 routes. The route with the highest local preference
349 value is preferred.";
350 reference
351 "RFC 4271.";
352 }
353
354 leaf default-shutdown {
355 type boolean;
356 default "false";
357 description
358 "Apply administrative shutdown to newly configured peers.";
359 }
360
361 leaf ebgp-requires-policy {
362 type boolean;
363 default "true";
364 description
365 "When set to 'true' BGP speaker requires in and out policy
366 for EBGP peers (RFC8212).";
367 }
368
369 leaf show-hostname {
370 type boolean;
371 default "false";
372 description
373 "When set to 'true' BGP show hostname in certain command outputs.";
374 }
375
376 leaf show-nexthop-hostname {
377 type boolean;
378 default "false";
379 description
380 "When set to 'true' BGP show hostname for nexthop in certain
381 command outputs.";
382 }
383 }
384
385 grouping global-neighbor-config {
386 container global-neighbor-config {
387 leaf dynamic-neighbors-limit {
388 type uint32 {
389 range "1..5000";
390 }
391 description
392 "Maximum number of BGP Dynamic Neighbors that can be created.";
393 }
394
395 leaf log-neighbor-changes {
396 type boolean;
397 default "false";
398 description
399 "When set to 'true' BGP will start logging neighbor up/down and reset reason.
400 When set to 'false' BGP will stop logging neighbor up/down and reset reason.";
401 }
402
403 container packet-quanta-config {
404 leaf wpkt-quanta {
405 type uint32 {
406 range "1..64";
407 }
408 default "64";
409 description
410 "How many packets to write to peer socket per run.";
411 }
412
413 leaf rpkt-quanta {
414 type uint32 {
415 range "1..10";
416 }
417 default "10";
418 description
419 "How many packets to read from peer socket per I/O cycle.";
420 }
421 }
422 }
423 }
424
425 grouping global-update-group-config {
426 container global-update-group-config {
427 leaf subgroup-pkt-queue-size {
428 type uint32 {
429 range "20..100";
430 }
431 default "40";
432 description
433 "Subgroup packet queue size.";
434 }
435
436 leaf coalesce-time {
437 type uint32 {
438 range "0..4294967295";
439 }
440 units "miliseconds";
441 default "1000";
442 description
443 "Configures the Subgroup coalesce timer.";
444 }
445 }
446 }
447
448 grouping global-network-config {
449 leaf import-check {
450 type boolean;
451 default "false";
452 description
453 "When set to 'true' bgp creates entries for network statements
454 if a matching prefix exists in the rib. When set to 'false' bgp
455 creates entries for networks that the router cannot reach.";
456 }
457 }
458
459 grouping neighbor-timers {
460 leaf hold-time {
461 type uint16 {
462 range "0 | 3..65535";
463 }
464 units "seconds";
465 default "180";
466 description
467 "Time interval (in seconds) for the HoldTimer established
468 with the peer. When read as operational data (ro), the
469 value of this object is calculated by this BGP speaker,
470 using the smaller of the values in hold-time that was
471 configured (rw) in the running datastore and the Hold Time
472 received in the OPEN message.
473
474 This value must be at least three seconds
475 if it is not zero (0).
476
477 If the Hold Timer has not been established
478 with the peer this object MUST have a value
479 of zero (0).
480
481 If the configured value of hold-time object was
482 a value of (0), then when read this object MUST have a
483 value of (0) also.";
484 reference
485 "RFC 4271";
486 }
487
488 leaf keepalive {
489 type uint16 {
490 range "0..65535";
491 }
492 units "seconds";
493 default "60";
494 description
495 "When used as a configuration (rw) value, this Time interval
496 (in seconds) for the KeepAlive timer configured for this BGP
497 speaker with this peer. The value of this object will only
498 determine the KEEPALIVE messages' frequency relative to
499 the value specified in configured value for hold-time.
500
501 If the value of this object is zero (0), no periodical
502 KEEPALIVE messages are sent to the peer after the BGP
503 connection has been established. The suggested value for
504 this timer is 30 seconds.;
505
506 The actual time interval for the KEEPALIVE messages is
507 indicated by operational value of keepalive. That value
508 of this object is calculated by this BGP speaker such that,
509 when compared with hold-time, it has the same proportion
510 that keepalive has, compared with hold-time. A
511 reasonable maximum value for this timer would be one third
512 of that of hold-time.";
513 reference
514 "RFC 4271";
515 }
516 }
517
518 grouping global-config-timers {
519 container global-config-timers {
520 leaf rmap-delay-time {
521 type uint16 {
522 range "0..600";
523 }
524 units "seconds";
525 default "5";
526 description
527 "Time to wait before processing route-map changes.";
528 }
529
530 leaf update-delay-time {
531 type uint16 {
532 range "0..3600";
533 }
534 units "seconds";
535 description
536 "Time to force initial delay for best-path and updates.";
537 }
538
539 leaf establish-wait-time {
540 type uint16 {
541 range "1..3600";
542 }
543 units "seconds";
544 description
545 "Time to force initial delay for updates.";
546 }
547
548 leaf connect-retry-interval {
549 type uint16 {
550 range "1..max";
551 }
552 units "seconds";
553 default "120";
554 description
555 "Time interval (in seconds) for the ConnectRetryTimer. The
556 suggested value for this timer is 120 seconds.";
557 reference
558 "RFC 4271, This is the value used
559 to initialize the 'ConnectRetryTimer'.";
560 }
561
562 uses neighbor-timers;
563 }
564 }
565
566 grouping graceful-restart-config {
567 description
568 "Configuration parameters relating to BGP graceful restart.";
569 choice mode {
570 case graceful-restart-mode {
571 leaf enabled {
572 type boolean;
573 default "false";
574 description
575 "Enable or disable the graceful-restart capability. When set to 'true'
576 it will enable graceful restart and helper both globally. When set
577 to 'false' it will enable the default behaviour global helper mode.";
578 }
579 }
580
581 case graceful-restart-disable-mode {
582 leaf graceful-restart-disable {
583 type boolean;
584 default "false";
585 description
586 "When set to 'true' it will disable graceful restart and helper both
587 globally. when set to 'false' it will enable the default behaviour
588 global helper mode.";
589 }
590 }
591 }
592
593 leaf preserve-fw-entry {
594 type boolean;
595 default "false";
596 description
597 "Sets F-bit indication that fib is preserved while doing Graceful Restart.
598 When set to 'true' Zebra would preserve the FIB entry on the restarting
599 node.";
600 }
601
602 leaf restart-time {
603 type uint16 {
604 range "1..3600";
605 }
606 units "seconds";
607 default "120";
608 description
609 "Estimated time (in seconds) for the local BGP speaker to
610 restart a session. This value is advertise in the graceful
611 restart BGP capability. This is a 12-bit value, referred to
612 as Restart Time in RFC4724. Per RFC4724, the suggested
613 default value is <= the hold-time value. This timer is
614 applicable for helper node.";
615 reference
616 "RFC 4724: Graceful Restart Mechanism for BGP.";
617 }
618
619 leaf stale-routes-time {
620 type uint16 {
621 range "1..3600";
622 }
623 units "seconds";
624 default "360";
625 description
626 "An upper-bound on the time that stale routes will be
627 retained by a router after a session is restarted. If an
628 End-of-RIB (EOR) marker is received prior to this timer
629 expiring stale-routes will be flushed upon its receipt - if
630 no EOR is received, then when this timer expires stale paths
631 will be purged. This timer is applicable for restarting node.";
632 reference
633 "RFC 4724: Graceful Restart Mechanism for BGP.";
634 }
635
636 leaf selection-deferral-time {
637 type uint16 {
638 range "0..3600";
639 }
640 units "seconds";
641 default "360";
642 description
643 "An upper-bound on the time that restarting router defers
644 the route selection process after restart.";
645 reference
646 "RFC 4724: Graceful Restart Mechanism for BGP.";
647 }
648
649 leaf rib-stale-time {
650 type uint16 {
651 range "1..3600";
652 }
653 units "seconds";
654 default "500";
655 description
656 "An upper-bound on the time that helper router holds the
657 stale routes in Zebra, When this timer gets expired Zebra
658 removes the stale routes.";
659 }
660 }
661
662 grouping global-group-use-multiple-paths {
663 description
664 "Common grouping used for both global and groups which provides
665 configuration parameters relating to use of multiple paths.";
666 container use-multiple-paths {
667 description
668 "Parameters related to the use of multiple paths for the
669 same NLRI.";
670 container ebgp {
671 description
672 "Multi-Path parameters for EBGP.";
673 leaf maximum-paths {
674 type uint16;
675 default "64";
676 description
677 "Maximum number of parallel paths to consider when using
678 BGP multi-path. The default is use a single path.";
679 }
680 }
681
682 container ibgp {
683 description
684 "Multi-Path parameters for IBGP.";
685 leaf maximum-paths {
686 type uint16;
687 default "64";
688 description
689 "Maximum number of parallel paths to consider when using
690 IBGP multi-path. The default is to use a single path.";
691 }
692
693 leaf cluster-length-list {
694 when "../maximum-paths != 0";
695 type boolean;
696 default "false";
697 description
698 "When set to 'true' route with the shortest cluster-list
699 length is used. The cluster-list reflects the IBGP
700 reflection path the route has taken. It's the part
701 of route selection algo.";
702 }
703 }
704 }
705 }
706
707 grouping global-redistribute {
708 description
709 "List of route redistribution per AFI.";
710 list redistribution-list {
711 key "route-type route-instance";
712 leaf route-type {
713 type frr-rt-type:frr-route-types;
714 description
715 "Protocol route type.";
716 }
717
718 leaf route-instance {
719 type uint16 {
720 range "0..65535";
721 }
722 description
723 "Protocol Instance.";
724 }
725
726 leaf metric {
727 type uint32 {
728 range "0..4294967295";
729 }
730 description
731 "Metric for redistributed routes.";
732 }
733
734 leaf rmap-policy-import {
735 type frr-route-map:route-map-ref;
736 description
737 "Route-map to be applied for redistributed routes into the bgp.";
738 }
739 }
740 }
741
742 grouping mp-afi-safi-network-config {
743 leaf label-index {
744 type rt-types:mpls-label;
745 description
746 "Label index to associate with the prefix.";
747 }
748
749 leaf rmap-policy-export {
750 type frr-route-map:route-map-ref;
751 description
752 "Route-map to modify the attributes for Routes going out
753 via BGP updates.";
754 }
755 }
756
757 grouping mp-afi-safi-agg-route-config {
758 leaf as-set {
759 type boolean;
760 default "false";
761 description
762 "When set to 'true' AS set path information is generated
763 for aggregate address. When set to 'false' AS set path
764 information is not generated.";
765 }
766
767 leaf summary-only {
768 type boolean;
769 default "false";
770 description
771 "When set to 'true' it advertise only the aggregate route
772 and suppress the advertisement of all the component routes.
773 When set to 'false' all more-specific routes summarized
774 by the aggregate route are advertised.";
775 }
776
777 leaf rmap-policy-export {
778 type frr-route-map:route-map-ref;
779 description
780 "Apply route map to aggregate network.";
781 }
782 }
783
784 grouping admin-distance {
785 container admin-distance {
786 description
787 "Administrative distance (or preference) assigned to
788 routes received from different sources
789 (external, internal, and local).";
790 leaf external {
791 type uint8 {
792 range "1..255";
793 }
794 description
795 "Administrative distance for routes learned from
796 external BGP (EBGP).";
797 }
798
799 leaf internal {
800 type uint8 {
801 range "1..255";
802 }
803 description
804 "Administrative distance for routes learned from
805 internal BGP (IBGP).";
806 }
807
808 leaf local {
809 type uint8 {
810 range "1..255";
811 }
812 description
813 "Administrative distance for routes learned from
814 local.";
815 }
816 }
817 }
818
819 grouping distance-per-route-config {
820 leaf distance {
821 type uint8 {
822 range "1..255";
823 }
824 mandatory true;
825 description
826 "Administrative distance for route.";
827 }
828
829 leaf access-list-policy-export {
830 type frr-bt:access-list-ref;
831 description
832 "Access-list policy applied on routes going from BGP to Zebra.";
833 }
834 }
835
836 grouping route-flap-dampening {
837 container route-flap-dampening {
838 description
839 "Dampening feature";
840 leaf enable {
841 type boolean;
842 default "false";
843 description
844 "Enable route flap dampening.";
845 }
846
847 leaf reach-decay {
848 when "../enable = 'true'";
849 type uint8 {
850 range "1..45";
851 }
852 units "seconds";
853 default "15";
854 description
855 "This value specifies the time desired for the instability
856 metric value to reach one-half of its current value when
857 the route is reachable. This half-life value determines
858 the rate at which the metric value is decayed. A smaller
859 half-life value makes a suppressed route reusable sooner
860 than a larger value. The accumulated penalty will be reduced
861 to half after this duration.";
862 }
863
864 leaf reuse-above {
865 when "../enable = 'true'";
866 type uint16 {
867 range "1..20000";
868 }
869 default "750";
870 description
871 "This is the value of the instability metric at which a
872 suppressed route becomes unsuppressed if it is reachable
873 but currently suppressed. The value assigned to
874 reuse-below must be less than suppress-above.";
875 }
876
877 leaf suppress-above {
878 when "../enable = 'true'";
879 type uint16 {
880 range "1..20000";
881 }
882 default "2000";
883 description
884 "This is the value of the instability metric at which
885 route suppression takes place. A route is not installed
886 in the forwarding information base (FIB), or announced
887 even if it is reachable during the period that it is
888 suppressed.";
889 }
890
891 leaf unreach-decay {
892 when "../enable = 'true'";
893 type uint8 {
894 range "1..255";
895 }
896 units "seconds";
897 default "60";
898 description
899 "This value acts the same as reach-decay except that it
900 specifies the rate at which the instability metric is
901 decayed when a route is unreachable. It should have a
902 value greater than or equal to reach-decay.";
903 }
904 }
905 }
906
907 grouping flow-spec-config {
908 container flow-spec-config {
909 description
910 "Flow spec feature.";
911 leaf interface {
912 type frr-interface:interface-ref {
913 require-instance false;
914 }
915 description
916 "The local interface.";
917 }
918 }
919 }
920
921 grouping global-graceful-shutdown {
922 description
923 "Structural grouping used to include graceful-shutdown
924 configuration for both BGP neighbors and peer groups.";
925 container graceful-shutdown {
926 description
927 "BGP Graceful shutdown feature.";
928 leaf enable {
929 type boolean;
930 default "false";
931 description
932 "Enable graceful-shutdown feature.";
933 }
934 }
935 }
936
937 grouping global-filter-config {
938 description
939 "Structural grouping used to include filter
940 configuration for BGP RIB table.";
941 container filter-config {
942 description
943 "BGP table to RIB route download filter.";
944 uses rmap-policy-export;
945 }
946 }
947
948 grouping route-distinguisher-params {
949 description
950 "Route distinguisher value as per RFC4364.";
951 leaf rd {
952 type rt-types:route-distinguisher;
953 description
954 "Route distinguisher value as per RFC4364.";
955 }
956 }
957
958 grouping vpn-label-params {
959 description
960 "Label value for VRF.";
961 choice label-allocation-mode {
962 case manual {
963 leaf label {
964 type rt-types:mpls-label;
965 description
966 "Label index to associate with the prefix.";
967 }
968 }
969
970 case auto {
971 leaf label-auto {
972 type boolean;
973 default "false";
974 description
975 "Automatically assign a label.";
976 }
977 }
978 }
979 }
980
981 grouping vpn-nexthop-params {
982 description
983 "Specify next hop to use for VRF advertised prefixes.";
984 leaf nexthop {
985 type inet:ip-address;
986 description
987 "Nexthop IP address.";
988 }
989 }
990
991 grouping rt-list {
992 description
993 "Route Target list";
994 leaf-list import-rt-list {
995 type rt-types:route-target;
996 description
997 "For routes leaked from vpn to current address-family: match any.";
998 }
999
1000 leaf-list export-rt-list {
1001 type rt-types:route-target;
1002 description
1003 "For routes leaked from current address-family to vpn: set.";
1004 }
1005 }
1006
1007 grouping vpn-route-target-params {
1008 description
1009 "Route Target value.";
1010 leaf redirect-rt {
1011 type rt-types:route-target;
1012 description
1013 "Flow-spec redirect type route target.";
1014 }
1015
1016 choice rt-direction {
1017 case import-export {
1018 uses rt-list;
1019 }
1020 case both {
1021 leaf-list rt-list {
1022 type rt-types:route-target;
1023 description
1024 "Both import: match any and export: set.";
1025 }
1026 }
1027 }
1028 }
1029
1030 grouping vpn-import-params {
1031 description
1032 "VPN route leaking parameters.";
1033 leaf import-vpn {
1034 type boolean;
1035 default "false";
1036 description
1037 "Import routes from default instance VPN RIB.";
1038 }
1039
1040 leaf export-vpn {
1041 type boolean;
1042 default "false";
1043 description
1044 "Export routes to default instance VPN RIB.";
1045 }
1046
1047 list import-vrf-list {
1048 key "vrf";
1049 description
1050 "List of VRFs to import routes from.";
1051 leaf vrf {
1052 type frr-vrf:vrf-ref {
1053 require-instance false;
1054 }
1055 description
1056 "Routing instance.";
1057 }
1058 }
1059
1060 uses rmap-policy-import;
1061
1062 uses rmap-policy-export;
1063 }
1064
1065 grouping global-afi-safi-vpn-config {
1066 container vpn-config {
1067 uses route-distinguisher-params;
1068
1069 uses vpn-label-params;
1070
1071 uses vpn-nexthop-params;
1072
1073 uses vpn-import-params;
1074
1075 uses vpn-route-target-params;
1076 }
1077 }
1078
1079 grouping global-afi-safi-vpn-network-config {
1080 list network-config {
1081 key "rd";
1082 description
1083 "A list of rd.";
1084 uses route-distinguisher-params;
1085
1086 list prefix-list {
1087 key "prefix";
1088 description
1089 "A list of prefix.";
1090 leaf prefix {
1091 type inet:ip-prefix;
1092 description
1093 "IP destination prefix.";
1094 }
1095
1096 leaf label-index {
1097 type uint32;
1098 mandatory true;
1099 description
1100 "Label index to associate with the prefix.";
1101 }
1102
1103 leaf rmap-policy-export {
1104 type frr-route-map:route-map-ref;
1105 description
1106 "Route-map to modify the attributes for Routes going out
1107 via BGP updates.";
1108 }
1109 }
1110 }
1111 }
1112 }