1 module org-openroadm-ip {
2 namespace "http://org/openroadm/ip";
3 prefix org-openroadm-ip;
5 import org-openroadm-device {
6 prefix org-openroadm-device;
7 revision-date 2020-05-29;
9 import org-openroadm-interfaces {
11 revision-date 2019-11-29;
13 import ietf-inet-types {
15 revision-date 2013-07-15;
17 import ietf-yang-types {
19 revision-date 2013-07-15;
27 "This model defines Yang model for IP (IPv4 and IPv6) interfaces.
29 This model reuses data items defined in the IETF YANG model for
30 interfaces described by RFC 7277.
32 Some attributes which are not required in Open ROADM MSA are removed.
33 Yang file included are changed to fit into Open ROADM MSA yang structure.
35 IETF code is subject to the following copyright and license:
36 Copyright (c) IETF Trust and the persons identified as authors of
40 Redistribution and use in source and binary forms, with or without
41 modification, is permitted pursuant to, and subject to the license
42 terms contained in, the Simplified BSD License set forth in
43 Section 4.c of the IETF Trust's Legal Provisions Relating
44 to IETF Documents (http://trustee.ietf.org/license-info).";
74 "RFC 7277: A YANG Data Model for IP Management";
77 feature ipv4-non-contiguous-netmasks {
79 "Indicates support for configuring non-contiguous
83 feature ipv6-privacy-autoconf {
85 "Indicates support for Privacy Extensions for Stateless Address
86 Autoconfiguration in IPv6.";
88 "RFC 4941: Privacy Extensions for Stateless Address
89 Autoconfiguration in IPv6";
92 typedef ip-address-origin {
96 "None of the following.";
100 "Indicates that the address has been statically
101 configured - for example, using NETCONF or a Command Line
106 "Indicates an address that has been assigned to this
107 system by a DHCP server.";
111 "Indicates an address created by IPv6 stateless
112 autoconfiguration that embeds a link-layer address in its
113 interface identifier.";
117 "Indicates an address chosen by the system at
119 random, e.g., an IPv4 address within 169.254/16, an
120 RFC 4941 temporary address, or an RFC 7217 semantically
123 "RFC 4941: Privacy Extensions for Stateless Address
124 Autoconfiguration in IPv6
125 RFC 7217: A Method for Generating Semantically Opaque
126 Interface Identifiers with IPv6 Stateless
127 Address Autoconfiguration (SLAAC)";
131 "The origin of an address.";
134 typedef neighbor-origin {
138 "None of the following.";
142 "Indicates that the mapping has been statically
143 configured - for example, using NETCONF or a Command Line
148 "Indicates that the mapping has been dynamically resolved
149 using, e.g., IPv4 ARP or the IPv6 Neighbor Discovery
154 "The origin of a neighbor entry.";
159 presence "Enables IPv4 unless the 'enabled' leaf
160 (which defaults to 'true') is set to 'false'";
162 "Parameters for the IPv4 address family.";
167 "Controls whether IPv4 is enabled or disabled on this
168 interface. When IPv4 is enabled, this interface is
169 connected to an IPv4 stack, and the interface can send
170 and receive IPv4 packets.";
176 "Controls IPv4 packet forwarding of datagrams received by,
177 but not addressed to, this interface. IPv4 routers
178 forward datagrams. IPv4 hosts do not (except those
179 source-routed via the host).";
188 "The size, in octets, of the largest IPv4 packet that the
189 interface will send and receive.
191 The server may restrict the allowed values for this leaf,
192 depending on the interface's type.
194 If this leaf is not configured, the operationally used MTU
195 depends on the interface's type.
197 The max value supported must be at least 9000.";
199 "RFC 791: Internet Protocol";
202 when "/org-openroadm-device:org-openroadm-device/org-openroadm-device:interface[org-openroadm-device:name='UNNUMBERED']";
209 "The source of the shared IP address for unnumbered IP interface.";
212 when "/org-openroadm-device:org-openroadm-device/org-openroadm-device:interface[org-openroadm-device:name='UNNUMBERED']";
214 path "/org-openroadm-device:org-openroadm-device/org-openroadm-device:interface/org-openroadm-ip:ipv4/org-openroadm-ip:address/org-openroadm-ip:ip";
216 must "/org-openroadm-device:org-openroadm-device/org-openroadm-device:interface[org-openroadm-device:name='NEM']/org-openroadm-ip:ipv4/org-openroadm-ip:address[org-openroadm-ip:ip=current()]/org-openroadm-ip:ip = current()" {
217 error-message "IP address shall be sourced from the NEM interface only";
219 must 'not (../address-src)' {
220 error-message "Both address-src & address-force cannot be configured at the same time";
223 "The IP address to use for the unnumbered interface";
228 "The list of configured IPv4 addresses on the interface.";
230 type inet:ipv4-address-no-zone;
232 "The IPv4 address on the interface.";
235 when "/org-openroadm-device:org-openroadm-device/org-openroadm-device:interface[org-openroadm-device:name='NEM']";
246 "Mark address availability for unnumbered interface use.";
251 "The subnet can be specified as a prefix-length, or,
252 if the server supports non-contiguous netmasks, as
259 "The length of the subnet prefix.";
262 if-feature "ipv4-non-contiguous-netmasks";
263 type yang:dotted-quad;
265 "The subnet specified as a netmask.";
271 presence "Enables IPv6 unless the 'enabled' leaf
272 (which defaults to 'true') is set to 'false'";
274 "Parameters for the IPv6 address family.";
279 "Controls whether IPv6 is enabled or disabled on this
280 interface. When IPv6 is enabled, this interface is
281 connected to an IPv6 stack, and the interface can send
282 and receive IPv6 packets.";
288 "Controls IPv6 packet forwarding of datagrams received by,
289 but not addressed to, this interface. IPv6 routers
290 forward datagrams. IPv6 hosts do not (except those
291 source-routed via the host).";
293 "RFC 4861: Neighbor Discovery for IP version 6 (IPv6)
294 Section 6.2.1, IsRouter";
303 "The size, in octets, of the largest IPv6 packet that the
304 interface will send and receive.
306 The server may restrict the allowed values for this leaf,
307 depending on the interface's type.
309 If this leaf is not configured, the operationally used MTU
310 depends on the interface's type.";
312 "RFC 2460: Internet Protocol, Version 6 (IPv6) Specification
318 "The list of configured IPv6 addresses on the interface.";
320 type inet:ipv6-address-no-zone;
322 "The IPv6 address on the interface.";
330 "The length of the subnet prefix.";
338 augment "/org-openroadm-device:org-openroadm-device/org-openroadm-device:interface" {
339 when "org-openroadm-device:type = 'openROADM-if:ip'";
341 "Parameters for configuring IP on interfaces.
343 If an interface is not capable of running IP, the server
344 must not allow the client to configure these parameters.";