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