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