aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/yang/openconfig/openconfig-bgp-global.yang
blob: 643fba1c16d4b9b69d5df5b8af14dca09d1c7026 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
submodule openconfig-bgp-global {

  belongs-to openconfig-bgp {
    prefix "oc-bgp";
  }

  import openconfig-extensions { prefix oc-ext; }
  import openconfig-yang-types { prefix oc-yang; }
  import openconfig-inet-types { prefix oc-inet; }

  // Include common submodules
  include openconfig-bgp-common;
  include openconfig-bgp-common-multiprotocol;
  include openconfig-bgp-peer-group;
  include openconfig-bgp-common-structure;

  // meta
  organization
    "OpenConfig working group";

  contact
    "OpenConfig working group
    netopenconfig@googlegroups.com";

  description
    "This sub-module contains groupings that are specific to the
    global context of the OpenConfig BGP module";

  oc-ext:openconfig-version "5.0.1";

  revision "2018-08-20" {
    description
      "Correct description of AFI-SAFI enabled leaf.";
    reference "5.0.1";
  }

  revision "2018-04-11" {
    description
      "Correct naming of BGP maximum prefix warning percentage leaf.";
    reference "5.0.0";
  }

  revision "2018-03-20" {
    description
      "Added SR-TE policy SAFI";
    reference "4.1.0";
  }

  revision "2017-07-10" {
    description
      "Add error notifications; moved add-paths config; add AS
      prepend policy features; removed unneeded config leaves";
    reference "4.0.0";
  }

  revision "2017-02-02" {
    description
      "Bugfix to remove remaining global-level policy data";
    reference "3.0.1";
  }

  revision "2017-01-26" {
    description
      "Add dynamic neighbor support, migrate to OpenConfig types";
    reference "3.0.0";
  }

  revision "2016-06-21" {
    description
      "OpenConfig BGP refactor";
    reference "2.1.1";
  }

  grouping bgp-global-config {
    description
      "Global configuration options for the BGP router.";

    leaf as {
      type oc-inet:as-number;
//       mandatory true;
      description
        "Local autonomous system number of the router.  Uses
        the 32-bit as-number type from the model in RFC 6991.";
    }

    leaf router-id {
      type oc-yang:dotted-quad;
      description
        "Router id of the router - an unsigned 32-bit integer
        expressed in dotted quad notation.";
      reference
        "RFC4271 - A Border Gateway Protocol 4 (BGP-4),
        Section 4.2";
    }
  }

  grouping bgp-global-state {
    description
      "Operational state parameters for the BGP neighbor";

    uses bgp-common-state;
  }

  grouping bgp-global-default-route-distance-config {
    description
      "Configuration options relating to the administrative distance
      (or preference) assigned to routes received from different
      sources (external, internal, and local).";

    leaf external-route-distance {
      type uint8 {
        range "1..255";
      }
      description
        "Administrative distance for routes learned from external
        BGP (eBGP).";
    }
    leaf internal-route-distance {
      type uint8 {
        range "1..255";
      }
      description
        "Administrative distance for routes learned from internal
        BGP (iBGP).";
    }
  }

  grouping bgp-global-confederation-config {
    description
      "Configuration options specifying parameters when the local
      router is within an autonomous system which is part of a BGP
      confederation.";

    leaf identifier {
      type oc-inet:as-number;
      description
        "Confederation identifier for the autonomous system.
        Setting the identifier indicates that the local-AS is part
        of a BGP confederation.";
    }

    leaf-list member-as {
      type oc-inet:as-number;
      description
        "Remote autonomous systems that are to be treated
        as part of the local confederation.";
    }
  }

  grouping bgp-global-dynamic-neighbors {
    description
      "Grouping containing configuration relating to dynamic peers.";

    container dynamic-neighbor-prefixes {
      description
        "A list of IP prefixes from which the system should:
          - Accept connections to the BGP daemon
          - Dynamically configure a BGP neighbor corresponding to the
            source address of the remote system, using the parameters
            of the specified peer-group.
         For such neighbors, an entry within the neighbor list should
         be created, indicating that the peer was dynamically
         configured, and referencing the peer-group from which the
         configuration was derived.";

      list dynamic-neighbor-prefix {
        key "prefix";
        description
          "An individual prefix from which dynamic neighbor
          connections are allowed.";

        leaf prefix {
          type leafref {
            path "../config/prefix";
          }
          description
            "Reference to the IP prefix from which source connections
            are allowed for the dynamic neighbor group.";
        }

        container config {
          description
            "Configuration parameters relating to the source prefix
            for the dynamic BGP neighbor connections.";

          uses bgp-global-dynamic-neighbor-config;
        }

        container state {
          config false;
          description
            "Operational state parameters relating to the source
            prefix for the dynamic BGP neighbor connections.";

          uses bgp-global-dynamic-neighbor-config;
        }
      }
    }
  }

  grouping bgp-global-dynamic-neighbor-config {
    description
      "Configuration parameters relating to an individual prefix from
      which dynamic neighbors are accepted.";

    leaf prefix {
      type oc-inet:ip-prefix;
      description
        "The IP prefix within which the source address of the remote
        BGP speaker must fall to be considered eligible to the
        dynamically configured."; }

    leaf peer-group {
      type leafref {
        // At bgp/global/dynamic-neighbor-prefixes/dynamic-neighbor
        // prefix/config/peer-group
        path "../../../../../peer-groups/peer-group/config/" +
             "peer-group-name";
      }
      description
        "The peer-group within which the dynamic neighbor will be
        configured.  The configuration parameters used for the dynamic
        neighbor are those specified within the referenced peer
        group.";
    }
  }

  grouping bgp-global-mp-all-afi-safi-list-contents {
    description
      "A grouping used for contents of the list of AFI-SAFI
      entries at the global BGP level.";

    // import and export policy included for the afi/safi

    uses bgp-common-mp-ipv4-unicast-group;
    uses bgp-common-mp-ipv6-unicast-group;
    uses bgp-common-mp-ipv4-labeled-unicast-group;
    uses bgp-common-mp-ipv6-labeled-unicast-group;
    uses bgp-common-mp-l3vpn-ipv4-unicast-group;
    uses bgp-common-mp-l3vpn-ipv6-unicast-group;
    uses bgp-common-mp-l3vpn-ipv4-multicast-group;
    uses bgp-common-mp-l3vpn-ipv6-multicast-group;
    uses bgp-common-mp-l2vpn-vpls-group;
    uses bgp-common-mp-l2vpn-evpn-group;
    uses bgp-common-mp-srte-policy-ipv4-group;
    uses bgp-common-mp-srte-policy-ipv6-group;
  }

  grouping bgp-global-afi-safi-list {
    description
      "List of address-families associated with the BGP instance";

    list afi-safi {
      key "afi-safi-name";

      description
        "AFI,SAFI configuration available for the
        neighbour or group";

      leaf afi-safi-name {
        type leafref {
          path "../config/afi-safi-name";
        }
        description
          "Reference to the AFI-SAFI name used as a key
          for the AFI-SAFI list";
      }

      container config {
        description
          "Configuration parameters for the AFI-SAFI";
        uses bgp-common-mp-afi-safi-config;
      }
      container state {
        config false;
        description
          "State information relating to the AFI-SAFI";
        uses bgp-common-mp-afi-safi-config;
        uses bgp-common-state;
      }

      container graceful-restart {
        description
          "Parameters relating to BGP graceful-restart";
        container config {
          description
            "Configuration options for BGP graceful-restart";
          uses bgp-common-mp-afi-safi-graceful-restart-config;
        }
        container state {
          config false;
          description
            "State information for BGP graceful-restart";
          uses bgp-common-mp-afi-safi-graceful-restart-config;
        }
      }

      uses bgp-common-route-selection-options;
      uses bgp-common-global-group-use-multiple-paths;
      uses bgp-common-structure-neighbor-group-add-paths;
      uses bgp-global-mp-all-afi-safi-list-contents;
    }
  }

  // Structural groupings
  grouping bgp-global-base {
    description
      "Global configuration parameters for the BGP router";

    container config {
      description
        "Configuration parameters relating to the global BGP router";
      uses bgp-global-config;
    }
    container state {
      config false;
      description
        "State information relating to the global BGP router";
      uses bgp-global-config;
      uses bgp-global-state;
    }

    container default-route-distance {
      description
        "Administrative distance (or preference) assigned to
        routes received from different sources
        (external, internal, and local).";

      container config {
        description
          "Configuration parameters relating to the default route
          distance";
        uses bgp-global-default-route-distance-config;
      }
      container state {
        config false;
        description
          "State information relating to the default route distance";
        uses bgp-global-default-route-distance-config;
      }
    }

    container confederation {
      description
        "Parameters indicating whether the local system acts as part
        of a BGP confederation";

      container config {
        description
          "Configuration parameters relating to BGP confederations";
        uses bgp-global-confederation-config;
      }
      container state {
        config false;
        description
          "State information relating to the BGP confederations";
        uses bgp-global-confederation-config;
      }
    }

    container graceful-restart {
      description
        "Parameters relating the graceful restart mechanism for BGP";
      container config {
        description
          "Configuration parameters relating to graceful-restart";
        uses bgp-common-graceful-restart-config;
      }
      container state {
        config false;
        description
          "State information associated with graceful-restart";
        uses bgp-common-graceful-restart-config;
      }
    }

    uses bgp-common-global-group-use-multiple-paths;
    uses bgp-common-route-selection-options;

    container afi-safis {
      description
        "Address family specific configuration";
      uses bgp-global-afi-safi-list;
    }

    uses bgp-global-dynamic-neighbors;
  }

}