blob: 14991205bee9d73c680311149b8b64b584b5d339 [file] [log] [blame]
Radek Krejcied5acc52019-04-25 15:57:04 +02001module ietf-ip {
2
3 namespace "urn:ietf:params:xml:ns:yang:ietf-ip";
4 prefix ip;
5
6 import ietf-interfaces {
7 prefix if;
8 }
9 import ietf-inet-types {
10 prefix inet;
11 }
12 import ietf-yang-types {
13 prefix yang;
14 }
15
16 organization
17 "IETF NETMOD (NETCONF Data Modeling Language) Working Group";
18
19 contact
20 "WG Web: <http://tools.ietf.org/wg/netmod/>
21 WG List: <mailto:netmod@ietf.org>
22
23 WG Chair: Thomas Nadeau
24 <mailto:tnadeau@lucidvision.com>
25
26 WG Chair: Juergen Schoenwaelder
27 <mailto:j.schoenwaelder@jacobs-university.de>
28
29 Editor: Martin Bjorklund
30 <mailto:mbj@tail-f.com>";
31
32
33
34
35
36
37
38
39
40
41 description
42 "This module contains a collection of YANG definitions for
43 configuring IP implementations.
44
45 Copyright (c) 2014 IETF Trust and the persons identified as
46 authors of the code. All rights reserved.
47
48 Redistribution and use in source and binary forms, with or
49 without modification, is permitted pursuant to, and subject
50 to the license terms contained in, the Simplified BSD License
51 set forth in Section 4.c of the IETF Trust's Legal Provisions
52 Relating to IETF Documents
53 (http://trustee.ietf.org/license-info).
54
55 This version of this YANG module is part of RFC 7277; see
56 the RFC itself for full legal notices.";
57
58 revision 2014-06-16 {
59 description
60 "Initial revision.";
61 reference
62 "RFC 7277: A YANG Data Model for IP Management";
63 }
64
65 /*
66
67 * Features
68 */
69
70 feature ipv4-non-contiguous-netmasks {
71 description
72 "Indicates support for configuring non-contiguous
73 subnet masks.";
74 }
75
76 feature ipv6-privacy-autoconf {
77 description
78 "Indicates support for Privacy Extensions for Stateless Address
79 Autoconfiguration in IPv6.";
80 reference
81 "RFC 4941: Privacy Extensions for Stateless Address
82 Autoconfiguration in IPv6";
83 }
84
85
86
87
88
89 /*
90 * Typedefs
91 */
92
93 typedef ip-address-origin {
94 type enumeration {
95 enum other {
96 description
97 "None of the following.";
98 }
99 enum static {
100 description
101 "Indicates that the address has been statically
102 configured - for example, using NETCONF or a Command Line
103 Interface.";
104 }
105 enum dhcp {
106 description
107 "Indicates an address that has been assigned to this
108 system by a DHCP server.";
109 }
110 enum link-layer {
111 description
112 "Indicates an address created by IPv6 stateless
113 autoconfiguration that embeds a link-layer address in its
114 interface identifier.";
115 }
116 enum random {
117 description
118 "Indicates an address chosen by the system at
119
120 random, e.g., an IPv4 address within 169.254/16, an
121 RFC 4941 temporary address, or an RFC 7217 semantically
122 opaque address.";
123 reference
124 "RFC 4941: Privacy Extensions for Stateless Address
125 Autoconfiguration in IPv6
126 RFC 7217: A Method for Generating Semantically Opaque
127 Interface Identifiers with IPv6 Stateless
128 Address Autoconfiguration (SLAAC)";
129 }
130 }
131 description
132 "The origin of an address.";
133 }
134
135
136
137 typedef neighbor-origin {
138 type enumeration {
139 enum other {
140 description
141 "None of the following.";
142 }
143 enum static {
144 description
145 "Indicates that the mapping has been statically
146 configured - for example, using NETCONF or a Command Line
147 Interface.";
148 }
149 enum dynamic {
150 description
151 "Indicates that the mapping has been dynamically resolved
152 using, e.g., IPv4 ARP or the IPv6 Neighbor Discovery
153 protocol.";
154 }
155 }
156 description
157 "The origin of a neighbor entry.";
158 }
159
160 /*
161 * Configuration data nodes
162 */
163
164 augment "/if:interfaces/if:interface" {
165 description
166 "Parameters for configuring IP on interfaces.
167
168 If an interface is not capable of running IP, the server
169 must not allow the client to configure these parameters.";
170
171 container ipv4 {
172 presence
173 "Enables IPv4 unless the 'enabled' leaf
174 (which defaults to 'true') is set to 'false'";
175 description
176 "Parameters for the IPv4 address family.";
177
178
179
180
181
182
183
184
185 leaf enabled {
186 type boolean;
187 default true;
188 description
189 "Controls whether IPv4 is enabled or disabled on this
190 interface. When IPv4 is enabled, this interface is
191 connected to an IPv4 stack, and the interface can send
192 and receive IPv4 packets.";
193 }
194 leaf forwarding {
195 type boolean;
196 default false;
197 description
198 "Controls IPv4 packet forwarding of datagrams received by,
199 but not addressed to, this interface. IPv4 routers
200 forward datagrams. IPv4 hosts do not (except those
201 source-routed via the host).";
202 }
203 leaf mtu {
204 type uint16 {
205 range "68..max";
206 }
207 units octets;
208 description
209 "The size, in octets, of the largest IPv4 packet that the
210 interface will send and receive.
211
212 The server may restrict the allowed values for this leaf,
213 depending on the interface's type.
214
215 If this leaf is not configured, the operationally used MTU
216 depends on the interface's type.";
217 reference
218 "RFC 791: Internet Protocol";
219 }
220 list address {
221 key "ip";
222 description
223 "The list of configured IPv4 addresses on the interface.";
224
225 leaf ip {
226 type inet:ipv4-address-no-zone;
227 description
228 "The IPv4 address on the interface.";
229 }
230
231
232
233 choice subnet {
234 mandatory true;
235 description
236 "The subnet can be specified as a prefix-length, or,
237 if the server supports non-contiguous netmasks, as
238 a netmask.";
239 leaf prefix-length {
240 type uint8 {
241 range "0..32";
242 }
243 description
244 "The length of the subnet prefix.";
245 }
246 leaf netmask {
247 if-feature ipv4-non-contiguous-netmasks;
248 type yang:dotted-quad;
249 description
250 "The subnet specified as a netmask.";
251 }
252 }
253 }
254 list neighbor {
255 key "ip";
256 description
257 "A list of mappings from IPv4 addresses to
258 link-layer addresses.
259
260 Entries in this list are used as static entries in the
261 ARP Cache.";
262 reference
263 "RFC 826: An Ethernet Address Resolution Protocol";
264
265 leaf ip {
266 type inet:ipv4-address-no-zone;
267 description
268 "The IPv4 address of the neighbor node.";
269 }
270 leaf link-layer-address {
271 type yang:phys-address;
272 mandatory true;
273 description
274 "The link-layer address of the neighbor node.";
275 }
276 }
277
278 }
279
280
281 container ipv6 {
282 presence
283 "Enables IPv6 unless the 'enabled' leaf
284 (which defaults to 'true') is set to 'false'";
285 description
286 "Parameters for the IPv6 address family.";
287
288 leaf enabled {
289 type boolean;
290 default true;
291 description
292 "Controls whether IPv6 is enabled or disabled on this
293 interface. When IPv6 is enabled, this interface is
294 connected to an IPv6 stack, and the interface can send
295 and receive IPv6 packets.";
296 }
297 leaf forwarding {
298 type boolean;
299 default false;
300 description
301 "Controls IPv6 packet forwarding of datagrams received by,
302 but not addressed to, this interface. IPv6 routers
303 forward datagrams. IPv6 hosts do not (except those
304 source-routed via the host).";
305 reference
306 "RFC 4861: Neighbor Discovery for IP version 6 (IPv6)
307 Section 6.2.1, IsRouter";
308 }
309 leaf mtu {
310 type uint32 {
311 range "1280..max";
312 }
313 units octets;
314 description
315 "The size, in octets, of the largest IPv6 packet that the
316 interface will send and receive.
317
318 The server may restrict the allowed values for this leaf,
319 depending on the interface's type.
320
321 If this leaf is not configured, the operationally used MTU
322 depends on the interface's type.";
323 reference
324 "RFC 2460: Internet Protocol, Version 6 (IPv6) Specification
325 Section 5";
326 }
327
328
329 list address {
330 key "ip";
331 description
332 "The list of configured IPv6 addresses on the interface.";
333
334 leaf ip {
335 type inet:ipv6-address-no-zone;
336 description
337 "The IPv6 address on the interface.";
338 }
339 leaf prefix-length {
340 type uint8 {
341 range "0..128";
342 }
343 mandatory true;
344 description
345 "The length of the subnet prefix.";
346 }
347 }
348 list neighbor {
349 key "ip";
350 description
351 "A list of mappings from IPv6 addresses to
352 link-layer addresses.
353
354 Entries in this list are used as static entries in the
355 Neighbor Cache.";
356 reference
357 "RFC 4861: Neighbor Discovery for IP version 6 (IPv6)";
358
359 leaf ip {
360 type inet:ipv6-address-no-zone;
361 description
362 "The IPv6 address of the neighbor node.";
363 }
364 leaf link-layer-address {
365 type yang:phys-address;
366 mandatory true;
367 description
368 "The link-layer address of the neighbor node.";
369 }
370 }
371
372
373
374
375
376
377 leaf dup-addr-detect-transmits {
378 type uint32;
379 default 1;
380 description
381 "The number of consecutive Neighbor Solicitation messages
382 sent while performing Duplicate Address Detection on a
383 tentative address. A value of zero indicates that
384 Duplicate Address Detection is not performed on
385 tentative addresses. A value of one indicates a single
386 transmission with no follow-up retransmissions.";
387 reference
388 "RFC 4862: IPv6 Stateless Address Autoconfiguration";
389 }
390 container autoconf {
391 description
392 "Parameters to control the autoconfiguration of IPv6
393 addresses, as described in RFC 4862.";
394 reference
395 "RFC 4862: IPv6 Stateless Address Autoconfiguration";
396
397 leaf create-global-addresses {
398 type boolean;
399 default true;
400 description
401 "If enabled, the host creates global addresses as
402 described in RFC 4862.";
403 reference
404 "RFC 4862: IPv6 Stateless Address Autoconfiguration
405 Section 5.5";
406 }
407 leaf create-temporary-addresses {
408 if-feature ipv6-privacy-autoconf;
409 type boolean;
410 default false;
411 description
412 "If enabled, the host creates temporary addresses as
413 described in RFC 4941.";
414 reference
415 "RFC 4941: Privacy Extensions for Stateless Address
416 Autoconfiguration in IPv6";
417 }
418
419
420
421
422
423
424
425 leaf temporary-valid-lifetime {
426 if-feature ipv6-privacy-autoconf;
427 type uint32;
428 units "seconds";
429 default 604800;
430 description
431 "The time period during which the temporary address
432 is valid.";
433 reference
434 "RFC 4941: Privacy Extensions for Stateless Address
435 Autoconfiguration in IPv6
436 - TEMP_VALID_LIFETIME";
437 }
438 leaf temporary-preferred-lifetime {
439 if-feature ipv6-privacy-autoconf;
440 type uint32;
441 units "seconds";
442 default 86400;
443 description
444 "The time period during which the temporary address is
445 preferred.";
446 reference
447 "RFC 4941: Privacy Extensions for Stateless Address
448 Autoconfiguration in IPv6
449 - TEMP_PREFERRED_LIFETIME";
450 }
451 }
452 }
453 }
454
455 /*
456 * Operational state data nodes
457 */
458
459 augment "/if:interfaces-state/if:interface" {
460 description
461 "Data nodes for the operational state of IP on interfaces.";
462
463 container ipv4 {
464 presence "Present if IPv4 is enabled on this interface";
465 config false;
466 description
467 "Interface-specific parameters for the IPv4 address family.";
468
469
470
471
472
473 leaf forwarding {
474 type boolean;
475 description
476 "Indicates whether IPv4 packet forwarding is enabled or
477 disabled on this interface.";
478 }
479 leaf mtu {
480 type uint16 {
481 range "68..max";
482 }
483 units octets;
484 description
485 "The size, in octets, of the largest IPv4 packet that the
486 interface will send and receive.";
487 reference
488 "RFC 791: Internet Protocol";
489 }
490 list address {
491 key "ip";
492 description
493 "The list of IPv4 addresses on the interface.";
494
495 leaf ip {
496 type inet:ipv4-address-no-zone;
497 description
498 "The IPv4 address on the interface.";
499 }
500 choice subnet {
501 description
502 "The subnet can be specified as a prefix-length, or,
503 if the server supports non-contiguous netmasks, as
504 a netmask.";
505 leaf prefix-length {
506 type uint8 {
507 range "0..32";
508 }
509 description
510 "The length of the subnet prefix.";
511 }
512 leaf netmask {
513 if-feature ipv4-non-contiguous-netmasks;
514 type yang:dotted-quad;
515 description
516 "The subnet specified as a netmask.";
517 }
518 }
519
520
521 leaf origin {
522 type ip-address-origin;
523 description
524 "The origin of this address.";
525 }
526 }
527 list neighbor {
528 key "ip";
529 description
530 "A list of mappings from IPv4 addresses to
531 link-layer addresses.
532
533 This list represents the ARP Cache.";
534 reference
535 "RFC 826: An Ethernet Address Resolution Protocol";
536
537 leaf ip {
538 type inet:ipv4-address-no-zone;
539 description
540 "The IPv4 address of the neighbor node.";
541 }
542 leaf link-layer-address {
543 type yang:phys-address;
544 description
545 "The link-layer address of the neighbor node.";
546 }
547 leaf origin {
548 type neighbor-origin;
549 description
550 "The origin of this neighbor entry.";
551 }
552 }
553
554 }
555
556 container ipv6 {
557 presence "Present if IPv6 is enabled on this interface";
558 config false;
559 description
560 "Parameters for the IPv6 address family.";
561
562
563
564
565
566
567
568
569 leaf forwarding {
570 type boolean;
571 default false;
572 description
573 "Indicates whether IPv6 packet forwarding is enabled or
574 disabled on this interface.";
575 reference
576 "RFC 4861: Neighbor Discovery for IP version 6 (IPv6)
577 Section 6.2.1, IsRouter";
578 }
579 leaf mtu {
580 type uint32 {
581 range "1280..max";
582 }
583 units octets;
584 description
585 "The size, in octets, of the largest IPv6 packet that the
586 interface will send and receive.";
587 reference
588 "RFC 2460: Internet Protocol, Version 6 (IPv6) Specification
589 Section 5";
590 }
591 list address {
592 key "ip";
593 description
594 "The list of IPv6 addresses on the interface.";
595
596 leaf ip {
597 type inet:ipv6-address-no-zone;
598 description
599 "The IPv6 address on the interface.";
600 }
601 leaf prefix-length {
602 type uint8 {
603 range "0..128";
604 }
605 mandatory true;
606 description
607 "The length of the subnet prefix.";
608 }
609 leaf origin {
610 type ip-address-origin;
611 description
612 "The origin of this address.";
613 }
614
615
616
617 leaf status {
618 type enumeration {
619 enum preferred {
620 description
621 "This is a valid address that can appear as the
622 destination or source address of a packet.";
623 }
624 enum deprecated {
625 description
626 "This is a valid but deprecated address that should
627 no longer be used as a source address in new
628 communications, but packets addressed to such an
629 address are processed as expected.";
630 }
631 enum invalid {
632 description
633 "This isn't a valid address, and it shouldn't appear
634 as the destination or source address of a packet.";
635 }
636 enum inaccessible {
637 description
638 "The address is not accessible because the interface
639 to which this address is assigned is not
640 operational.";
641 }
642 enum unknown {
643 description
644 "The status cannot be determined for some reason.";
645 }
646 enum tentative {
647 description
648 "The uniqueness of the address on the link is being
649 verified. Addresses in this state should not be
650 used for general communication and should only be
651 used to determine the uniqueness of the address.";
652 }
653 enum duplicate {
654 description
655 "The address has been determined to be non-unique on
656 the link and so must not be used.";
657 }
658
659
660
661
662
663
664
665 enum optimistic {
666 description
667 "The address is available for use, subject to
668 restrictions, while its uniqueness on a link is
669 being verified.";
670 }
671 }
672 description
673 "The status of an address. Most of the states correspond
674 to states from the IPv6 Stateless Address
675 Autoconfiguration protocol.";
676 reference
677 "RFC 4293: Management Information Base for the
678 Internet Protocol (IP)
679 - IpAddressStatusTC
680 RFC 4862: IPv6 Stateless Address Autoconfiguration";
681 }
682 }
683 list neighbor {
684 key "ip";
685 description
686 "A list of mappings from IPv6 addresses to
687 link-layer addresses.
688
689 This list represents the Neighbor Cache.";
690 reference
691 "RFC 4861: Neighbor Discovery for IP version 6 (IPv6)";
692
693 leaf ip {
694 type inet:ipv6-address-no-zone;
695 description
696 "The IPv6 address of the neighbor node.";
697 }
698 leaf link-layer-address {
699 type yang:phys-address;
700 description
701 "The link-layer address of the neighbor node.";
702 }
703 leaf origin {
704 type neighbor-origin;
705 description
706 "The origin of this neighbor entry.";
707 }
708 leaf is-router {
709 type empty;
710 description
711 "Indicates that the neighbor node acts as a router.";
712 }
713 leaf state {
714 type enumeration {
715 enum incomplete {
716 description
717 "Address resolution is in progress, and the link-layer
718 address of the neighbor has not yet been
719 determined.";
720 }
721 enum reachable {
722 description
723 "Roughly speaking, the neighbor is known to have been
724 reachable recently (within tens of seconds ago).";
725 }
726 enum stale {
727 description
728 "The neighbor is no longer known to be reachable, but
729 until traffic is sent to the neighbor no attempt
730 should be made to verify its reachability.";
731 }
732 enum delay {
733 description
734 "The neighbor is no longer known to be reachable, and
735 traffic has recently been sent to the neighbor.
736 Rather than probe the neighbor immediately, however,
737 delay sending probes for a short while in order to
738 give upper-layer protocols a chance to provide
739 reachability confirmation.";
740 }
741 enum probe {
742 description
743 "The neighbor is no longer known to be reachable, and
744 unicast Neighbor Solicitation probes are being sent
745 to verify reachability.";
746 }
747 }
748 description
749 "The Neighbor Unreachability Detection state of this
750 entry.";
751 reference
752 "RFC 4861: Neighbor Discovery for IP version 6 (IPv6)
753 Section 7.3.2";
754 }
755 }
756 }
757 }
758}