1 submodule frr-bgp-common {
8 import ietf-bgp-types {
12 import ietf-inet-types {
16 import frr-bgp-types {
20 import frr-route-map {
24 import frr-route-types {
32 import ietf-routing-types {
36 import frr-interface {
43 "FRR Users List: <mailto:frog@lists.frrouting.org> FRR Development
44 List: <mailto:dev@lists.frrouting.org>";
46 "This submodule contains general data definitions for use in BGP.
48 Copyright 2020 FRRouting
50 Redistribution and use in source and binary forms, with or without
51 modification, are permitted provided that the following conditions
54 1. Redistributions of source code must retain the above copyright notice,
55 this list of conditions and the following disclaimer.
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.
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.";
78 grouping rmap-policy-import {
80 type frr-route-map:route-map-ref;
84 grouping rmap-policy-export {
86 type frr-route-map:route-map-ref;
90 grouping unsupress-map-policy-import {
91 leaf unsupress-map-import {
92 type frr-route-map:route-map-ref;
96 grouping unsupress-map-policy-export {
97 leaf unsupress-map-export {
98 type frr-route-map:route-map-ref;
102 grouping plist-policy-import {
104 type frr-bt:plist-ref;
108 grouping plist-policy-export {
110 type frr-bt:plist-ref;
114 grouping access-list-policy-import {
115 leaf access-list-import {
116 type frr-bt:access-list-ref;
120 grouping access-list-policy-export {
121 leaf access-list-export {
122 type frr-bt:access-list-ref;
126 grouping as-path-filter-list-policy-import {
127 leaf as-path-filter-list-import {
128 type frr-bt:as-path-filter-ref;
132 grouping as-path-filter-list-policy-export {
133 leaf as-path-filter-list-export {
134 type frr-bt:as-path-filter-ref;
138 grouping route-selection-options {
140 "Configuration relating to route selection options.";
141 container route-selection-options {
143 "Parameters relating to options for route selection.";
144 leaf always-compare-med {
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.";
154 leaf deterministic-med {
158 "Compare multi-exit discriminator (MED) value from
159 Same ASes when selecting the best route.";
166 "Compare multi-exit discriminator (MED) value from
167 different Sub ASes when selecting the best route.";
170 leaf missing-as-worst-med {
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.";
183 "Compare path lengths including confederation sets
184 and sequences in selecting a route.";
187 leaf ignore-as-path-length {
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.";
196 leaf external-compare-router-id {
200 "When comparing similar routes received from external BGP
201 peers, use the router-id as a criterion to select the
205 leaf allow-multiple-as {
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.";
214 leaf multi-path-as-set {
215 when "../allow-multiple-as = 'true'";
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.";
226 grouping med-config {
228 "Configuration relating to MED.";
229 container med-config {
230 leaf enable-med-admin {
234 "Flag to enable receiving of MED metric attribute
235 in routing updates.";
239 range "0..4294967295";
241 default "4294967294";
243 "Tells the router to announce routes with this MED value
244 This MED value is applicable for indefinite time.";
247 leaf max-med-onstart-up-time {
253 "Tells the router to announce routes with MED value,
254 This MED value is applicable for this duration during
258 leaf max-med-onstart-up-value {
260 range "0..4294967295";
262 default "4294967294";
264 "Tells the router to announce routes with this MED value
265 This MED value is applicable for start-up time.";
270 grouping route-reflector-config {
272 "Grouping used to include route reflector
273 configuration for BGP global.";
274 container route-reflector {
276 "Route reflector parameters for the BGP global.";
277 leaf route-reflector-cluster-id {
278 type bt:rr-cluster-id-type;
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
285 "RFC 4456: BGP Route Reflection: An Alternative to
289 leaf no-client-reflect {
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
298 "TODO: Add reference when IETF writes a draft describing
302 leaf allow-outbound-policy {
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.";
314 grouping global-bgp-config {
315 leaf instance-type-view {
319 "When set to 'true' BGP instance type is view.
320 When set to 'false' BGP instance type is regular.";
323 leaf ebgp-multihop-connected-route-check {
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.";
332 leaf fast-external-failover {
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.";
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.";
354 leaf default-shutdown {
358 "Apply administrative shutdown to newly configured peers.";
361 leaf ebgp-requires-policy {
365 "When set to 'true' BGP speaker requires in and out policy
366 for EBGP peers (RFC8212).";
373 "When set to 'true' BGP show hostname in certain command outputs.";
376 leaf show-nexthop-hostname {
380 "When set to 'true' BGP show hostname for nexthop in certain
385 grouping global-neighbor-config {
386 container global-neighbor-config {
387 leaf dynamic-neighbors-limit {
392 "Maximum number of BGP Dynamic Neighbors that can be created.";
395 leaf log-neighbor-changes {
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.";
403 container packet-quanta-config {
410 "How many packets to write to peer socket per run.";
419 "How many packets to read from peer socket per I/O cycle.";
425 grouping global-update-group-config {
426 container global-update-group-config {
427 leaf subgroup-pkt-queue-size {
433 "Subgroup packet queue size.";
438 range "0..4294967295";
443 "Configures the Subgroup coalesce timer.";
448 grouping global-network-config {
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.";
459 grouping neighbor-timers {
462 range "0 | 3..65535";
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.
474 This value must be at least three seconds
475 if it is not zero (0).
477 If the Hold Timer has not been established
478 with the peer this object MUST have a value
481 If the configured value of hold-time object was
482 a value of (0), then when read this object MUST have a
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.
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.;
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.";
518 grouping global-config-timers {
519 container global-config-timers {
520 leaf rmap-delay-time {
527 "Time to wait before processing route-map changes.";
530 leaf update-delay-time {
536 "Time to force initial delay for best-path and updates.";
539 leaf establish-wait-time {
545 "Time to force initial delay for updates.";
548 leaf connect-retry-interval {
555 "Time interval (in seconds) for the ConnectRetryTimer. The
556 suggested value for this timer is 120 seconds.";
558 "RFC 4271, This is the value used
559 to initialize the 'ConnectRetryTimer'.";
562 uses neighbor-timers;
566 grouping graceful-restart-config {
568 "Configuration parameters relating to BGP graceful restart.";
570 case graceful-restart-mode {
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.";
581 case graceful-restart-disable-mode {
582 leaf graceful-restart-disable {
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.";
593 leaf preserve-fw-entry {
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
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.";
616 "RFC 4724: Graceful Restart Mechanism for BGP.";
619 leaf stale-routes-time {
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.";
633 "RFC 4724: Graceful Restart Mechanism for BGP.";
636 leaf selection-deferral-time {
643 "An upper-bound on the time that restarting router defers
644 the route selection process after restart.";
646 "RFC 4724: Graceful Restart Mechanism for BGP.";
649 leaf rib-stale-time {
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.";
662 grouping global-group-use-multiple-paths {
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 {
668 "Parameters related to the use of multiple paths for the
672 "Multi-Path parameters for EBGP.";
677 "Maximum number of parallel paths to consider when using
678 BGP multi-path. The default is use a single path.";
684 "Multi-Path parameters for IBGP.";
689 "Maximum number of parallel paths to consider when using
690 IBGP multi-path. The default is to use a single path.";
693 leaf cluster-length-list {
694 when "../maximum-paths != 0";
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.";
707 grouping global-redistribute {
709 "List of route redistribution per AFI.";
710 list redistribution-list {
711 key "route-type route-instance";
713 type frr-rt-type:frr-route-types;
715 "Protocol route type.";
718 leaf route-instance {
723 "Protocol Instance.";
728 range "0..4294967295";
731 "Metric for redistributed routes.";
734 leaf rmap-policy-import {
735 type frr-route-map:route-map-ref;
737 "Route-map to be applied for redistributed routes into the bgp.";
742 grouping mp-afi-safi-network-config {
744 type rt-types:mpls-label;
746 "Label index to associate with the prefix.";
749 leaf rmap-policy-export {
750 type frr-route-map:route-map-ref;
752 "Route-map to modify the attributes for Routes going out
757 grouping mp-afi-safi-agg-route-config {
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.";
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.";
777 leaf rmap-policy-export {
778 type frr-route-map:route-map-ref;
780 "Apply route map to aggregate network.";
806 default "unspecified";
815 "When set to 'true' aggregate-route matches only
822 "Suppress more specific routes specified in route-map.";
826 grouping admin-distance {
827 container admin-distance {
829 "Administrative distance (or preference) assigned to
830 routes received from different sources
831 (external, internal, and local).";
838 "Administrative distance for routes learned from
839 external BGP (EBGP).";
848 "Administrative distance for routes learned from
849 internal BGP (IBGP).";
858 "Administrative distance for routes learned from
864 grouping distance-per-route-config {
871 "Administrative distance for route.";
874 leaf access-list-policy-export {
875 type frr-bt:access-list-ref;
877 "Access-list policy applied on routes going from BGP to Zebra.";
881 grouping route-flap-dampening {
882 container route-flap-dampening {
889 "Enable route flap dampening.";
893 when "../enable = 'true'";
900 "This value specifies the time desired for the instability
901 metric value to reach one-half of its current value when
902 the route is reachable. This half-life value determines
903 the rate at which the metric value is decayed. A smaller
904 half-life value makes a suppressed route reusable sooner
905 than a larger value. The accumulated penalty will be reduced
906 to half after this duration.";
910 when "../enable = 'true'";
916 "This is the value of the instability metric at which a
917 suppressed route becomes unsuppressed if it is reachable
918 but currently suppressed. The value assigned to
919 reuse-below must be less than suppress-above.";
922 leaf suppress-above {
923 when "../enable = 'true'";
929 "This is the value of the instability metric at which
930 route suppression takes place. A route is not installed
931 in the forwarding information base (FIB), or announced
932 even if it is reachable during the period that it is
937 when "../enable = 'true'";
944 "This value acts the same as reach-decay except that it
945 specifies the rate at which the instability metric is
946 decayed when a route is unreachable. It should have a
947 value greater than or equal to reach-decay.";
952 grouping flow-spec-config {
953 container flow-spec-config {
955 "Flow spec feature.";
957 type frr-interface:interface-ref {
958 require-instance false;
961 "The local interface.";
966 grouping global-graceful-shutdown {
968 "Structural grouping used to include graceful-shutdown
969 configuration for both BGP neighbors and peer groups.";
970 container graceful-shutdown {
972 "BGP Graceful shutdown feature.";
977 "Enable graceful-shutdown feature.";
982 grouping global-filter-config {
984 "Structural grouping used to include filter
985 configuration for BGP RIB table.";
986 container filter-config {
988 "BGP table to RIB route download filter.";
989 uses rmap-policy-export;
993 grouping route-distinguisher-params {
995 "Route distinguisher value as per RFC4364.";
997 type rt-types:route-distinguisher;
999 "Route distinguisher value as per RFC4364.";
1003 grouping vpn-label-params {
1005 "Label value for VRF.";
1006 choice label-allocation-mode {
1009 type rt-types:mpls-label;
1011 "Label index to associate with the prefix.";
1020 "Automatically assign a label.";
1026 grouping vpn-nexthop-params {
1028 "Specify next hop to use for VRF advertised prefixes.";
1030 type inet:ip-address;
1032 "Nexthop IP address.";
1038 "Route Target list";
1039 leaf-list import-rt-list {
1040 type rt-types:route-target;
1042 "For routes leaked from vpn to current address-family: match any.";
1045 leaf-list export-rt-list {
1046 type rt-types:route-target;
1048 "For routes leaked from current address-family to vpn: set.";
1052 grouping vpn-route-target-params {
1054 "Route Target value.";
1056 type rt-types:route-target;
1058 "Flow-spec redirect type route target.";
1061 choice rt-direction {
1062 case import-export {
1068 type rt-types:route-target;
1070 "Both import: match any and export: set.";
1076 grouping vpn-import-params {
1078 "VPN route leaking parameters.";
1083 "Import routes from default instance VPN RIB.";
1090 "Export routes to default instance VPN RIB.";
1093 list import-vrf-list {
1096 "List of VRFs to import routes from.";
1098 type frr-vrf:vrf-ref {
1099 require-instance false;
1102 "Routing instance.";
1106 uses rmap-policy-import;
1108 uses rmap-policy-export;
1111 grouping global-afi-safi-vpn-config {
1112 container vpn-config {
1116 "Route distinguisher value as per RFC4364.";
1119 uses vpn-label-params;
1121 uses vpn-nexthop-params;
1123 uses vpn-import-params;
1125 uses vpn-route-target-params;
1129 grouping global-afi-safi-vpn-network-config {
1130 list network-config {
1134 uses route-distinguisher-params;
1139 "A list of prefix.";
1141 type inet:ip-prefix;
1143 "IP destination prefix.";
1150 "Label index to associate with the prefix.";
1153 leaf rmap-policy-export {
1154 type frr-route-map:route-map-ref;
1156 "Route-map to modify the attributes for Routes going out