]> git.proxmox.com Git - mirror_frr.git/blob - yang/frr-bgp-common-structure.yang
Merge pull request #9708 from mobash-rasool/new_b
[mirror_frr.git] / yang / frr-bgp-common-structure.yang
1 submodule frr-bgp-common-structure {
2 yang-version 1.1;
3
4 belongs-to frr-bgp {
5 prefix "bgp";
6 }
7
8 import ietf-inet-types {
9 prefix inet;
10 }
11
12 import frr-route-map {
13 prefix frr-route-map;
14 }
15
16 import frr-interface {
17 prefix frr-interface;
18 }
19
20 import ietf-bgp-types {
21 prefix bt;
22 }
23
24 import frr-bgp-types {
25 prefix frr-bt;
26 }
27
28 include "frr-bgp-common";
29
30 organization
31 "FRRouting";
32 contact
33 "FRR Users List: <mailto:frog@lists.frrouting.org> FRR Development
34 List: <mailto:dev@lists.frrouting.org>";
35 description
36 "This submodule contains general data definitions for use in BGP.
37
38 Copyright 2020 FRRouting
39
40 Redistribution and use in source and binary forms, with or without
41 modification, are permitted provided that the following conditions
42 are met:
43
44 1. Redistributions of source code must retain the above copyright notice,
45 this list of conditions and the following disclaimer.
46
47 2. Redistributions in binary form must reproduce the above copyright
48 notice, this list of conditions and the following disclaimer in the
49 documentation and/or other materials provided with the distribution.
50
51 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
52 \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
53 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
54 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
55 HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
56 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
57 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
58 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
59 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
60 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
61 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.";
62
63 revision 2019-12-03 {
64 description
65 "Initial revision.";
66 }
67
68 grouping structure-neighbor-group-ebgp-multihop {
69 description
70 "Structural grouping used to include EBGP multi-hop
71 configuration for both BGP neighbors and peer groups.";
72 container ebgp-multihop {
73 description
74 "EBGP multi-hop parameters for the BGP group.";
75 choice hop-count-choice {
76 case default-hop-count {
77 leaf enabled {
78 type boolean;
79 default "false";
80 description
81 "When enabled the referenced group or neighbors are
82 permitted to be indirectly connected - including cases
83 where the TTL can be decremented between the BGP peers.";
84 }
85 }
86
87 case max-hop-count {
88 leaf multihop-ttl {
89 type uint8 {
90 range "1..255";
91 }
92 description
93 "Time-to-live value to use when packets are sent to the
94 referenced group or neighbors and ebgp-multihop is
95 enabled.";
96 }
97 }
98 }
99
100 leaf disable-connected-check {
101 type boolean;
102 default "false";
103 description
104 "When set to 'true' it enforces EBGP neighbors perform multihop.";
105 }
106 }
107 }
108
109 grouping neighbor-local-as-options {
110 container local-as {
111 leaf local-as {
112 type inet:as-number;
113 description
114 "The local autonomous system number that is to be used when
115 establishing sessions with the remote peer or peer group, if
116 this differs from the global BGP router autonomous system
117 number.";
118 }
119
120 leaf no-prepend {
121 type boolean;
122 default "false";
123 description
124 "Do not prepend local-as to updates from EBGP peers. When
125 set to 'true' it will not prepend local-as to updates. When
126 set to 'false' it will prepend local-as to updates.";
127 }
128
129 leaf replace-as {
130 type boolean;
131 default "false";
132 description
133 "Do not prepend local-as to updates from IBGP peers.";
134 }
135 }
136 }
137
138 grouping neighbor-bfd-options {
139 container bfd-options {
140 leaf enable {
141 type boolean;
142 default "false";
143 description
144 "BFD support.";
145 }
146
147 leaf detect-multiplier {
148 when "../enable = 'true'";
149 type uint8 {
150 range "2..255";
151 }
152 default "3";
153 description
154 "Detect multiplier.";
155 }
156
157 leaf required-min-rx {
158 when "../enable = 'true'";
159 type uint16 {
160 range "50..60000";
161 }
162 units "miliseconds";
163 default "300";
164 description
165 "Required min receive interval.";
166 }
167
168 leaf desired-min-tx {
169 when "../enable = 'true'";
170 type uint16 {
171 range "50..60000";
172 }
173 units "miliseconds";
174 default "300";
175 description
176 "Desired min transmit interval.";
177 }
178
179 leaf session-type {
180 when "../enable = 'true'";
181 type frr-bt:bfd-session-type;
182 default "not-configured";
183 description
184 "BFD session type.";
185 }
186
187 leaf check-cp-failure {
188 when "../enable = 'true'";
189 type boolean;
190 default "false";
191 description
192 "Link dataplane status with BGP control plane.";
193 }
194 }
195 }
196
197 grouping neighbor-remote-as {
198 container neighbor-remote-as {
199 leaf remote-as-type {
200 type frr-bt:as-type;
201 description
202 "Remote AS type.";
203 }
204
205 leaf remote-as {
206 when "../remote-as-type = 'as-specified'";
207 type inet:as-number;
208 description
209 "The remote autonomous system number received in
210 the BGP OPEN message.";
211 reference
212 "RFC 4271";
213 }
214 }
215 }
216
217 grouping neighbor-update-source {
218 description
219 "Source of routing updates.";
220 container update-source {
221 description
222 "Source of routing updates config.";
223 choice source {
224 case ip-based {
225 leaf ip {
226 type inet:ip-address;
227 description
228 "IPv4 address/IPv6 address.";
229 }
230 }
231
232 case interface-based {
233 leaf interface {
234 type frr-interface:interface-ref {
235 require-instance false;
236 }
237 description
238 "The local interface.";
239 }
240 }
241 }
242 }
243 }
244
245 grouping structure-neighbor-group-add-paths {
246 description
247 "Structural grouping used to include ADD-PATHs configuration
248 and state for both BGP neighbors and peer groups.";
249 container add-paths {
250 description
251 "Parameters relating to the advertisement and receipt of
252 multiple paths for a single NLRI (add-paths).";
253 reference
254 "RFC 7911: ADD-PATH.";
255 leaf path-type {
256 type frr-bt:add-path-type;
257 default "none";
258 description
259 "Enable ability to receive multiple path advertisements for
260 an NLRI from the neighbor or group.";
261 }
262 }
263 }
264
265 grouping structure-neighbor-group-as-path-options {
266 description
267 "Structural grouping used to include AS_PATH manipulation
268 configuration both BGP neighbors and peer groups.";
269 container as-path-options {
270 description
271 "AS_PATH manipulation parameters for the BGP neighbor or
272 group.";
273 choice allowas-in {
274 case occurence-based {
275 leaf allow-own-as {
276 type uint8 {
277 range "1..10";
278 }
279 description
280 "Specify the number of occurrences of the local BGP
281 speaker's AS that can occur within the AS_PATH before it
282 is rejected.";
283 }
284 }
285
286 case origin-based {
287 leaf allow-own-origin-as {
288 type boolean;
289 default "false";
290 description
291 "When set to 'true' only accept my AS in the as-path
292 if the route was originated in my AS.";
293 }
294 }
295 }
296
297 leaf replace-peer-as {
298 type boolean;
299 default "false";
300 description
301 "Replace occurrences of the peer's AS in the AS_PATH with
302 the local autonomous system number. This is same as override
303 ASN CLI.";
304 }
305 }
306 }
307
308 grouping structure-neighbor-group-capability-options {
309 description
310 "Structural grouping used to include capability
311 configuration for both BGP neighbors and peer groups.";
312 container capability-options {
313 description
314 "Capability manipulation parameters for the BGP neighbor or
315 group.";
316 leaf dynamic-capability {
317 type boolean;
318 default "false";
319 description
320 "When set to 'true' dynamic capability is advertise to this peer.";
321 }
322
323 leaf strict-capability {
324 type boolean;
325 default "false";
326 description
327 "Strict capability negotiation match. When set to 'true'
328 remote and local capabilities are strictly compared
329 if capabilities are different, send Unsupported Capability
330 error then reset connection.";
331 }
332
333 leaf extended-nexthop-capability {
334 type boolean;
335 default "false";
336 description
337 "When set to 'true' extended next-hop capability is advertise
338 to this peer.";
339 }
340
341 leaf capability-negotiate {
342 type boolean;
343 default "true";
344 description
345 "When set to 'true' sending Capability Negotiation in the open
346 message is suppressed to this peer.";
347 }
348
349 leaf override-capability {
350 type boolean;
351 default "false";
352 description
353 "Overrides the result of Capability Negotiation, ignoring remote
354 peer's capability value, when set to 'true'.";
355 }
356 }
357 }
358
359 grouping structure-neighbor-default-originate-options {
360 description
361 "Structural grouping used to include default-originate
362 configuration for both BGP neighbors and peer groups.";
363 container default-originate {
364 description
365 "default originate parameters for the BGP neighbor or
366 group.";
367 leaf originate {
368 type boolean;
369 default "false";
370 description
371 "If set to 'true', send the default-route to the neighbour(s).";
372 }
373
374 leaf route-map {
375 type frr-route-map:route-map-ref;
376 description
377 "Route-map to specify criteria to originate default.";
378 }
379 }
380 }
381
382 grouping structure-neighbor-prefix-limit {
383 container prefix-limit {
384 description
385 "Parameters relating to the prefix limit for the AFI-SAFI.";
386 list direction-list {
387 key "direction";
388 leaf direction {
389 type frr-bt:direction;
390 description
391 "Prefix limit applied on Tx route-updates or Rx route-updates.";
392 }
393
394 leaf max-prefixes {
395 type uint32;
396 mandatory true;
397 description
398 "Maximum number of prefixes that will be accepted from the
399 neighbour.";
400 }
401
402 leaf force-check {
403 type boolean;
404 default false;
405 description
406 "Force check all received routes.";
407 }
408
409 container options {
410 when "../direction = 'in'";
411 choice options {
412 case warning {
413 leaf warning-only {
414 type boolean;
415 default "false";
416 description
417 "When set to 'true' only give warning message when limit
418 is exceeded.";
419 }
420 }
421
422 case restart {
423 leaf restart-timer {
424 type uint16;
425 units "minutes";
426 description
427 "Time interval in seconds after which the BGP session is
428 re-established after being torn down due to exceeding the
429 max-prefix limit.";
430 }
431 }
432
433 case threshold {
434 leaf shutdown-threshold-pct {
435 type bt:percentage;
436 description
437 "Threshold on number of prefixes that can be received from
438 a neighbour before generation of warning messages or log
439 entries. Expressed as a percentage of max-prefixes.";
440 }
441 }
442
443 case threshold-restart {
444 leaf tr-shutdown-threshold-pct {
445 type bt:percentage;
446 description
447 "Threshold on number of prefixes that can be received from
448 a neighbour before generation of warning messages or log
449 entries. Expressed as a percentage of max-prefixes.";
450 }
451
452 leaf tr-restart-timer {
453 type uint16;
454 units "minutes";
455 description
456 "Time interval in seconds after which the BGP session is
457 re-established after being torn down due to exceeding the
458 max-prefix limit.";
459 }
460 }
461
462 case threshold-warning {
463 leaf tw-shutdown-threshold-pct {
464 type bt:percentage;
465 description
466 "Threshold on number of prefixes that can be received from
467 a neighbour before generation of warning messages or log
468 entries. Expressed as a percentage of max-prefixes.";
469 }
470
471 leaf tw-warning-only {
472 type boolean;
473 default "false";
474 description
475 "When set to 'true' only give warning message when limit
476 is exceeded.";
477 }
478 }
479 }
480 }
481 }
482 }
483 }
484
485 grouping structure-neighbor-nexthop-self {
486 container nexthop-self {
487 description
488 "Parameters relating to the nexthop-self for the AFI-SAFI.";
489 leaf next-hop-self {
490 type boolean;
491 default "false";
492 description
493 "When set to 'true', EBGP learned routes are announced with the
494 local speaker's nexthop.";
495 }
496
497 leaf next-hop-self-force {
498 type boolean;
499 default "false";
500 description
501 "When set to 'true', EBGP learned routes are announced with the
502 local speaker's nexthop.";
503 }
504 }
505 }
506
507 grouping structure-neighbor-private-as {
508 container private-as {
509 description
510 "Parameters relating to the private-as for the AFI-SAFI.";
511 leaf remove-private-as-all {
512 type boolean;
513 default "false";
514 description
515 "When set to 'true', private ASNs are removed from outbound updates;
516 applies to all AS numbers.";
517 }
518
519 leaf remove-private-as-all-replace {
520 type boolean;
521 default "false";
522 description
523 "When set to 'true', private ASNs are replaced by the local
524 speaker's ASN in all outbound updates; applies to all AS numbers.";
525 }
526
527 leaf remove-private-as {
528 type boolean;
529 default "false";
530 description
531 "When set to 'true', removes private ASNs in outbound updates;
532 applies to all AS numbers.";
533 }
534
535 leaf remove-private-as-replace {
536 type boolean;
537 default "false";
538 description
539 "When set to 'true', private ASNs are replaced with the local
540 speaker's ASN in all outbound updates; applies to all AS numbers.";
541 }
542 }
543 }
544
545 grouping structure-neighbor-weight {
546 container weight {
547 description
548 "Parameters relating to the weight for the AFI-SAFI.";
549 leaf weight-attribute {
550 type uint16 {
551 range "0..65535";
552 }
553 description
554 "Set default weight for routes from this neighbor.";
555 }
556 }
557 }
558
559 grouping structure-neighbor-route-reflector {
560 container route-reflector {
561 description
562 "Parameters relating to the route-reflector for the AFI-SAFI.";
563 leaf route-reflector-client {
564 type boolean;
565 default "false";
566 description
567 "Configure a neighbor as route reflector client.";
568 }
569 }
570 }
571
572 grouping structure-neighbor-route-server {
573 container route-server {
574 description
575 "Parameters relating to the route-server for the AFI-SAFI.";
576 leaf route-server-client {
577 type boolean;
578 default "false";
579 description
580 "Configure a neighbor as route server client.";
581 }
582 }
583 }
584
585 grouping structure-neighbor-send-community {
586 container send-community {
587 description
588 "Parameters relating to the send-community for the AFI-SAFI.";
589 leaf send-community {
590 type boolean;
591 default "true";
592 description
593 "Send standard community attribute to this neighbor.";
594 }
595
596 leaf send-ext-community {
597 type boolean;
598 default "true";
599 description
600 "Send extended community attribute to this neighbor.";
601 }
602
603 leaf send-large-community {
604 type boolean;
605 default "true";
606 description
607 "Send large community attribute to this neighbor.";
608 }
609 }
610 }
611
612 grouping structure-neighbor-group-admin-shutdown {
613 description
614 "Structural grouping used to include admin-shutdown
615 configuration for both BGP neighbors and peer groups.";
616 container admin-shutdown {
617 description
618 "BGP Administrative Shutdown Communication.";
619 leaf enable {
620 type boolean;
621 description
622 "When set to 'true', BGP shutdown communication is enabled.";
623 }
624
625 leaf message {
626 type string;
627 description
628 "Shutdown message.";
629 reference
630 "draft-ietf-idr-shutdown-06";
631 }
632 }
633 }
634
635 grouping structure-neighbor-group-graceful-restart {
636 description
637 "Structural grouping used to include graceful-restart
638 configuration for both BGP neighbors and peer groups.";
639 container graceful-restart {
640 description
641 "BGP Graceful restart feature.";
642 choice mode {
643 case graceful-restart-mode {
644 leaf enable {
645 type boolean;
646 default "false";
647 description
648 "Enable or disable the graceful-restart capability.
649 Setting this value to 'true' enables the graceful-restart
650 and helper both at peer level. Setting this value to 'false'
651 disables graceful restart and helper mode. The peer will inherit
652 global configuration.";
653 }
654 }
655
656 case graceful-restart-helper-mode {
657 leaf graceful-restart-helper {
658 type boolean;
659 default "false";
660 description
661 "Setting this value to 'true' enables helper mode for the peer
662 Setting this value to 'false' disables the helper mode. The
663 peer will inherit global configuration.";
664 }
665 }
666
667 case graceful-restart-disable-mode {
668 leaf graceful-restart-disable {
669 type boolean;
670 default "false";
671 description
672 "Setting this value to 'true' disables the graceful-restart
673 and helper Mode. Setting this value to 'false' causes the peer
674 to inherit global configuration.";
675 }
676 }
677 }
678 }
679 }
680
681 grouping structure-neighbor-group-soft-reconfiguration {
682 description
683 "Structural grouping used to include soft-reconfiguration
684 configuration for both BGP neighbors and peer groups.";
685 leaf soft-reconfiguration {
686 type boolean;
687 default "false";
688 description
689 "Allow inbound soft reconfiguration for this neighbor.";
690 }
691 }
692
693 grouping structure-neighbor-group-attr-unchanged {
694 description
695 "Structural grouping used to include BGP route propagation
696 rules configuration for both BGP neighbors and peer groups.";
697 container attr-unchanged {
698 description
699 "BGP route propagation rules configuration.";
700 leaf as-path-unchanged {
701 type boolean;
702 default "false";
703 description
704 "When set to 'true' as-path attribute is propagated unchanged.";
705 }
706
707 leaf next-hop-unchanged {
708 type boolean;
709 default "false";
710 description
711 "When set to 'true' next-hop attribute is propagated unchanged.";
712 }
713
714 leaf med-unchanged {
715 type boolean;
716 default "false";
717 description
718 "When set to 'true' med attribute is propagated unchanged.";
719 }
720 }
721 }
722
723 grouping structure-neighbor-group-orf-capability {
724 description
725 "Structural grouping used to include orf
726 configuration for both BGP neighbors and peer groups.";
727 container orf-capability {
728 choice orf-update {
729 case send {
730 leaf orf-send {
731 type boolean;
732 default "false";
733 description
734 "Setting to 'true' advertises the ORF capability.";
735 }
736 }
737
738 case receive {
739 leaf orf-receive {
740 type boolean;
741 default "false";
742 description
743 "When set to 'true' it receives the orf capability.";
744 }
745 }
746
747 case both {
748 leaf orf-both {
749 type boolean;
750 default "false";
751 description
752 "When set to 'true' it advertises/receives the orf capability.";
753 }
754 }
755 }
756 }
757 }
758
759 grouping structure-neighbor-config-timers {
760 description
761 "Structural grouping used to include per neighbor timers
762 configuration for both BGP neighbors and peer groups.";
763 container timers {
764 leaf advertise-interval {
765 type uint16 {
766 range "0..600";
767 }
768 units "seconds";
769 description
770 "Minimum interval between sending BGP routing updates.";
771 }
772
773 leaf connect-time {
774 type uint16 {
775 range "1..65535";
776 }
777 units "seconds";
778 description
779 "BGP connect timer.";
780 }
781
782 uses neighbor-timers;
783 }
784 }
785
786 grouping structure-neighbor-group-filter-config {
787 description
788 "Structural grouping used to include filter
789 configuration for both BGP neighbors and peer groups.";
790 container filter-config {
791 description
792 "BGP Policy configuration for both BGP neighbors and groups.";
793 uses rmap-policy-import;
794
795 uses rmap-policy-export;
796
797 uses plist-policy-import;
798
799 uses plist-policy-export;
800
801 uses access-list-policy-import;
802
803 uses access-list-policy-export;
804
805 uses as-path-filter-list-policy-import;
806
807 uses as-path-filter-list-policy-export;
808
809 uses unsuppress-map-policy-import;
810
811 uses unsuppress-map-policy-export;
812 }
813 }
814 }