-
Notifications
You must be signed in to change notification settings - Fork 0
/
auto-config-agent.yang
416 lines (376 loc) · 16 KB
/
auto-config-agent.yang
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
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
module auto_config_agent {
yang-version 1.1; // for require-instance in leafref
// namespace
namespace "urn:srl_test/auto-config-agent";
prefix "auto_config_agent";
import srl_nokia-common {
prefix srl_nokia-comm;
}
// Note that this module needs to be in the path for source-directories
import srl_nokia-extensions {
prefix srl_nokia-ext;
}
import srl_nokia-features {prefix srl_feat; }
import srl_nokia-interfaces { prefix srl_nokia-if; }
revision "2021-04-11" {
description "Initial revision";
reference "TBD";
}
grouping auto-config-agent-top {
description "Top level grouping for auto config agent sample app";
container auto-config-agent {
presence "Auto-config agent parameters";
description "Top level enclosing container for auto config agent sample app
config and operational state data";
leaf base-as {
description "Baseline 2-byte or 4-byte Autonomous System to auto-assign for EBGP";
// type srl_nokia-comm:as-number;
type uint32;
default 4200000000; // Superspines get this, each leaf gets base+1+rank
}
leaf leaf-as {
description "AS to use for leaves, 0=auto (eBGP)";
// type srl_nokia-comm:as-number;
type uint32;
default 0; // Default base+rank = eBGP
}
leaf host-as {
description "AS to use for hosts, 0=same as leaf (iBGP)";
// type srl_nokia-comm:as-number;
type uint32;
default 0; // could also vary this by port offset
}
leaf dhcp {
description "Enable auto-provisioned DHCP server and relay";
type boolean;
default true;
}
container peerlinks {
leaf prefix {
description "IPv4 prefix range to use for auto-assigned peering links /31";
type srl_nokia-comm:ipv4-prefix;
default "192.168.127.0/24"; // enough for 128 /31 links
}
leaf host-subnet-size {
description "Size of subnet to use towards hosts, default /31 to have many";
type uint8 {
range "24 .. 31";
}
default 31;
}
leaf host-enable-ipv6 {
description "Whether to enable IPv6 towards hosts, default True";
type boolean;
default true;
}
leaf reuse-overlay-ips {
description "Whether to use the same IP at every host peerlink";
type boolean;
default false;
}
}
leaf loopbacks-prefix {
description "IPv4 prefix range to use for auto-assigned loopback IPs /32";
type srl_nokia-comm:ipv4-prefix;
default "1.1.0.0/22"; // spines get 1.1.0.x, leaves 1.1.1.x
}
leaf max-spine-ports {
description "Maximum number of active ports on spines, controls IP link addressing; must match across fabric";
type uint8;
default 8; // Higher values require a larger peerlinks-prefix space
}
leaf max-leaves {
description "Maximum number of leafs, controls AS allocation; must match across fabric";
type uint16;
default 16; // Currently only affects max AS that spines accept BGP peering from
}
leaf max-hosts-per-leaf {
description "Maximum number of host ports per leaf, controls IP allocation; must match across fabric";
type uint16;
default 4; // Too high -> out of peer link IP space
}
leaf max-lag-links {
description "Maximum number of links in a LAG bundle, controls IP allocation; must match across fabric";
type uint8;
default 4; // Too high -> out of peer link IP space
}
leaf ports-per-service {
description "Controls how access ports are mapped to services, default 0 = all ports in 1 service.
service-id = <port> modulo <ports-per-service>";
type uint8 { range "0 .. 8"; }
default 0; // all ports in 1 service
}
leaf vrf-per-service {
description "Use a separate ip-vrf per mac-vrf, default false";
type boolean;
default false; // Use single overlay VRF by default
}
container evpn {
presence "EVPN settings";
leaf model {
description "BGP EVPN control plane model to use for VXLAN endpoints";
type enumeration {
enum asymmetric-irb;
enum symmetric-irb;
enum l2-only-leaves; // no ip-vrf on leaves
enum lag-discovery-only {
description "Use only for MC-LAG discovery, not VxLAN";
}
enum disabled;
}
default "disabled";
}
leaf overlay-as {
description "iBGP AS number to use for the EVPN overlay, should not overlap with underlay";
type uint32;
default 65534; // 65535 SHOULD NOT be used because of overlap with special communities
// default 65000; // Use 2-byte AS for easier RT interop
// see https://www.ipspace.net/Data_Center_BGP/EVPN_Route_Target_Considerations
must ". != 65535" {
error-message "Private AS 65535 overlaps with certain reserved communities and SHOULD NOT be used";
}
}
leaf route-reflector {
description "Where to run an EVPN Route Reflector, defaults to the top node(s) as determined dynamically";
type union {
type string { // List of router IDs, slightly simplified pattern
pattern '[0-9]{1,3}(\.[0-9]{1,3}){3}([,][0-9]{1,3}(\.[0-9]{1,3}){3})*';
}
type enumeration {
enum auto-top-nodes;
enum leaf-pairs; // Topology in which pairs of leaves are peered
enum spine;
enum superspine;
enum disabled;
}
}
default auto-top-nodes;
}
leaf ebgp {
description "Use a full mesh eBGP between leaves for the EVPN overlay, instead of iBGP";
type boolean;
default false;
}
leaf auto-lags {
description "Discover and provision LAGs on leaves, using LLDP and EVPN communities or IPv6";
type enumeration {
enum encoded-ipv6; // LLDP data encoded as IPv6 loopback IPs
enum large-communities; // LLDP data encoded as communities
enum disabled;
}
default "encoded-ipv6";
must ". = 'disabled' or ../model != 'disabled'" {
error-message "EVPN auto-LAG discovery requires EVPN to be enabled";
}
}
leaf-list auto-lag-ports {
description "Subset of ports for which auto-lag is enabled, empty(default)=all";
type leafref {
path "/srl_nokia-if:interface/srl_nokia-if:name";
require-instance "true";
}
}
leaf bgp-peering {
description "IP version to use for iBGP EVPN peering, default ipv4 to match OSPF";
type enumeration {
enum ipv4;
enum ipv6;
}
default "ipv4";
}
leaf ipv6-nexthops {
description "Enable use of IPv6 nexthops for BGP EVPN, default false";
type boolean;
default false;
}
}
// Cannot reference system lacp settings group due to must clause
leaf lacp {
description "Enable LACP on LAGs";
type enumeration {
enum active;
enum passive; // When SLOW may add up to 30s of delay to 'up'
enum disabled;
}
default disabled;
}
leaf lacp-fallback {
description "Time to wait (seconds) before enabling links that have not received LACP, default 0=disabled";
type uint16 { range "0 | 4..3600"; }
default 0;
}
leaf igp {
description "IGP to use for distributing loopback IPs";
type enumeration {
enum bgp;
enum bgp-unnumbered { // Using 22.6 feature
// if-feature "srl_feat:bgp-unnumbered-peers";
}
enum bgp-unnumbered-frr; // Using FRR agent
enum isis;
enum ospf; // could do both v2 and v3
// NEW using 23.10 unnumbered IP feature
enum isis-unnumbered;
enum ospf-unnumbered;
}
default isis-unnumbered; // v3
}
leaf enable-bfd {
description "Whether to enable BFD for IGP, default 'true'";
type boolean;
default true;
}
leaf host-use-irb {
description "Use IRB interface for L2 service towards hosts";
type boolean;
default true;
}
leaf overlay-bgp-admin-state {
description "admin-state for overlay BGP group, default 'enable'";
type enumeration {
enum disable;
enum enable;
}
default enable;
}
leaf anycast-nexthops {
description "Enable anycast nexthops for BGP, requires FRR agent";
type boolean;
default false;
must ".=false() or ../igp = 'bgp-unnumbered'" {
error-message "Anycast nexthops can only be used in combination with BGP unnumbered";
}
}
container gateway {
// Allow a single config to be loaded across multiple types of platforms
leaf anycast-supported {
if-feature "srl_feat:anycast-gw"; // Only supported on platforms with anycast support
description "Flag that gets set when platform supports anycast-gw";
type boolean;
default true;
}
leaf use-anycast-if-supported {
description "Allows user to disable use of anycast feature";
type boolean;
default true;
}
leaf ipv4 {
description "IPv4 gateway address to provision, can use '{vrf}' parameter";
// type srl_nokia-comm:ipv4-prefix-with-host-bits;
type string;
}
leaf ipv6 {
description "IPv6 gateway address to provision, can use '{vrf}' parameter";
type string;
}
// location is implied: leaf if (a)symmetric irb, else spine
}
leaf bridging-supported {
if-feature "srl_feat:bridged"; // Could use YANG 1.1 and 'not'?
description "Flag that gets set when platform supports bridging / mac-vrfs / irb interfaces";
type boolean;
default true;
}
leaf reload-delay-supported {
if-feature srl_feat:reload-delay;
description "Flag that gets set when reload-delay is supported";
type boolean;
default true;
}
leaf reload-delay-secs {
description "Length of reload-delay to configure on mc-lag interfaces, if supported. 0=disabled";
type uint32 { range "0 .. 86400"; }
default 20;
}
// container tweaks {
// presence "Minor system tweaks for various demo purposes";
// description "Contains some custom flags to tweak system settings";
// leaf disable-icmp-ttl0-rate-limiting {
// description "Configures net.ipv4.icmp_ratemask as 4120 to keep TTL=0 ICMP errors from being rate limited to 1pps";
// type boolean;
// default true;
// }
// }
container ddos-protection {
presence "DDoS related configuration";
leaf server {
description "IP address or DNS hostname of an sFlow server to receive sampled packets";
type string;
mandatory true;
}
leaf sample-rate {
description "sFlow sample rate to provision";
type uint32;
default 1; // 1 in 1 packets, for demo purposes
}
}
// The core of provisioning: end user services
list service {
key evi;
leaf evi {
description "EVPN Instance for this service";
type uint16 { range "1..65535"; } // or SRL:evi-type
}
leaf name {
description "Optional name for the service, default generated based on EVI";
type string;
}
leaf vni {
description "VxLAN Virtual Network Identifier for this service, set equal to EVI if not specified";
type uint32 { range "1..16777215"; }
}
leaf vlan {
description "VLAN to use, 0=untagged. Default 0 for lowest EVI service, then equal to EVI";
type uint16 { range "0..4094"; }
}
leaf-list only-on-ports {
description "Optional list of ports to provide the service on, default empty=all access ports";
type leafref {
path "/srl_nokia-if:interface/srl_nokia-if:name";
require-instance "true";
}
}
container l3 {
description "L3 properties of the service";
leaf gateway {
description "Location of the gateway, defaults to 'anycast-gw-on-leaves'";
type enumeration {
enum anycast-gw-on-leaves;
enum on-spines;
}
default "anycast-gw-on-leaves";
}
leaf gateway-ipv4 { type srl_nokia-comm:ipv4-prefix-with-host-bits; }
leaf gateway-ipv6 { type srl_nokia-comm:ipv6-prefix; }
}
}
// info from state
list leaf {
key leaf-id;
config false;
leaf leaf-id {
type string;
}
container lldp {
srl_nokia-ext:delivery-node-override true;
presence "State LLDP operational parameters";
list port {
key port-name;
leaf port-name {
type string;
}
container neighbor {
srl_nokia-ext:delivery-node-override true;
presence "State LLDP neighbor operational parameters";
leaf host-name {
type string;
}
}
}
}
}
}
}
// data definition statements
uses auto-config-agent-top;
}