Internet Engineering Task Force (IETF)                      M. Bjorklund
Request for Comments: 7277                                Tail-f Systems
Category: Standards Track                                      June 2014
ISSN: 2070-1721
        
Internet Engineering Task Force (IETF)                      M. Bjorklund
Request for Comments: 7277                                Tail-f Systems
Category: Standards Track                                      June 2014
ISSN: 2070-1721
        

A YANG Data Model for IP Management

一种用于IP管理的YANG数据模型

Abstract

摘要

This document defines a YANG data model for management of IP implementations. The data model includes configuration data and state data.

本文档定义了一个用于管理IP实现的数据模型。数据模型包括配置数据和状态数据。

Status of This Memo

关于下段备忘

This is an Internet Standards Track document.

这是一份互联网标准跟踪文件。

This document is a product of the Internet Engineering Task Force (IETF). It represents the consensus of the IETF community. It has received public review and has been approved for publication by the Internet Engineering Steering Group (IESG). Further information on Internet Standards is available in Section 2 of RFC 5741.

本文件是互联网工程任务组(IETF)的产品。它代表了IETF社区的共识。它已经接受了公众审查,并已被互联网工程指导小组(IESG)批准出版。有关互联网标准的更多信息,请参见RFC 5741第2节。

Information about the current status of this document, any errata, and how to provide feedback on it may be obtained at http://www.rfc-editor.org/info/rfc7277.

有关本文件当前状态、任何勘误表以及如何提供反馈的信息,请访问http://www.rfc-editor.org/info/rfc7277.

Copyright Notice

版权公告

Copyright (c) 2014 IETF Trust and the persons identified as the document authors. All rights reserved.

版权所有(c)2014 IETF信托基金和确定为文件作者的人员。版权所有。

This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.

本文件受BCP 78和IETF信托有关IETF文件的法律规定的约束(http://trustee.ietf.org/license-info)自本文件出版之日起生效。请仔细阅读这些文件,因为它们描述了您对本文件的权利和限制。从本文件中提取的代码组件必须包括信托法律条款第4.e节中所述的简化BSD许可证文本,并提供简化BSD许可证中所述的无担保。

Table of Contents

目录

   1. Introduction ....................................................2
      1.1. Terminology ................................................2
      1.2. Tree Diagrams ..............................................3
   2. IP Data Model ...................................................3
   3. Relationship to the IP-MIB ......................................6
   4. IP Management YANG Module .......................................8
   5. IANA Considerations ............................................24
   6. Security Considerations ........................................24
   7. Acknowledgments ................................................25
   8. References .....................................................25
      8.1. Normative References ......................................25
      8.2. Informative References ....................................26
   Appendix A. Example: NETCONF <get> Reply ..........................28
        
   1. Introduction ....................................................2
      1.1. Terminology ................................................2
      1.2. Tree Diagrams ..............................................3
   2. IP Data Model ...................................................3
   3. Relationship to the IP-MIB ......................................6
   4. IP Management YANG Module .......................................8
   5. IANA Considerations ............................................24
   6. Security Considerations ........................................24
   7. Acknowledgments ................................................25
   8. References .....................................................25
      8.1. Normative References ......................................25
      8.2. Informative References ....................................26
   Appendix A. Example: NETCONF <get> Reply ..........................28
        
1. Introduction
1. 介绍

This document defines a YANG [RFC6020] data model for management of IP implementations.

本文件定义了用于管理IP实施的YANG[RFC6020]数据模型。

The data model covers configuration of per-interface IPv4 and IPv6 parameters, and mappings of IP addresses to link-layer addresses. It also provides information about which IP addresses are operationally used, and which link-layer mappings exist. Per-interface parameters are added through augmentation of the interface data model defined in [RFC7223].

数据模型包括每个接口IPv4和IPv6参数的配置,以及IP地址到链路层地址的映射。它还提供了有关操作上使用哪些IP地址以及存在哪些链路层映射的信息。通过扩展[RFC7223]中定义的接口数据模型添加每个接口参数。

1.1. Terminology
1.1. 术语

The following terms are defined in [RFC6241] and are not redefined here:

[RFC6241]中定义了以下术语,此处未重新定义:

o client

o 客户

o configuration data

o 配置数据

o server

o 服务器

o state data

o 状态数据

The following terms are defined in [RFC6020] and are not redefined here:

[RFC6020]中定义了以下术语,此处未重新定义:

o augment

o 加强

o data model

o 数据模型

o data node

o 数据节点

The terminology for describing YANG data models is found in [RFC6020].

描述YANG数据模型的术语见[RFC6020]。

1.2. Tree Diagrams
1.2. 树形图

A simplified graphical representation of the data model is used in this document. The meaning of the symbols in these diagrams is as follows:

本文件中使用了数据模型的简化图形表示。这些图表中符号的含义如下:

o Brackets "[" and "]" enclose list keys.

o 括号“[”和“]”包含列表键。

o Abbreviations before data node names: "rw" means configuration data (read-write), and "ro" means state data (read-only).

o 数据节点名称前的缩写:“rw”表示配置数据(读写),“ro”表示状态数据(只读)。

o Symbols after data node names: "?" means an optional node, "!" means a presence container, and "*" denotes a list and leaf-list.

o 数据节点名称后的符号:“?”表示可选节点,“!”表示状态容器,“*”表示列表和叶列表。

o Parentheses enclose choice and case nodes, and case nodes are also marked with a colon (":").

o 括号括住选项和事例节点,事例节点也用冒号(“:”)标记。

o Ellipsis ("...") stands for contents of subtrees that are not shown.

o 省略号(“…”)表示未显示的子树的内容。

2. IP Data Model
2. IP数据模型

This document defines the YANG module "ietf-ip", which augments the "interface" and "interface-state" lists defined in the "ietf-interfaces" module [RFC7223] with IP-specific data nodes, and also adds IP-specific state data.

本文件定义了YANG模块“ietf ip”,该模块使用特定于ip的数据节点扩充了“ietf接口”模块[RFC7223]中定义的“接口”和“接口状态”列表,并添加了特定于ip的状态数据。

The data model has the following structure for IP configuration per interface:

对于每个接口的IP配置,数据模型具有以下结构:

     +--rw if:interfaces
        +--rw if:interface* [name]
           ...
           +--rw ipv4!
           |  +--rw enabled?            boolean
           |  +--rw forwarding?         boolean
           |  +--rw mtu?                uint16
           |  +--rw address* [ip]
           |  |  +--rw ip               inet:ipv4-address-no-zone
           |  |  +--rw (subnet)
           |  |     +--:(prefix-length)
           |  |     |  +--rw ip:prefix-length?   uint8
           |  |     +--:(netmask)
           |  |        +--rw ip:netmask?         yang:dotted-quad
           |  +--rw neighbor* [ip]
           |     +--rw ip                    inet:ipv4-address-no-zone
           |     +--rw link-layer-address    yang:phys-address
           +--rw ipv6!
              +--rw enabled?            boolean
              +--rw forwarding?         boolean
              +--rw mtu?                uint32
              +--rw address* [ip]
              |  +--rw ip               inet:ipv6-address-no-zone
              |  +--rw prefix-length    uint8
              +--rw neighbor* [ip]
              |  +--rw ip                    inet:ipv6-address-no-zone
              |  +--rw link-layer-address    yang:phys-address
              +--rw dup-addr-detect-transmits?   uint32
              +--rw autoconf
                 +--rw create-global-addresses?        boolean
                 +--rw create-temporary-addresses?     boolean
                 +--rw temporary-valid-lifetime?       uint32
                 +--rw temporary-preferred-lifetime?   uint32
        
     +--rw if:interfaces
        +--rw if:interface* [name]
           ...
           +--rw ipv4!
           |  +--rw enabled?            boolean
           |  +--rw forwarding?         boolean
           |  +--rw mtu?                uint16
           |  +--rw address* [ip]
           |  |  +--rw ip               inet:ipv4-address-no-zone
           |  |  +--rw (subnet)
           |  |     +--:(prefix-length)
           |  |     |  +--rw ip:prefix-length?   uint8
           |  |     +--:(netmask)
           |  |        +--rw ip:netmask?         yang:dotted-quad
           |  +--rw neighbor* [ip]
           |     +--rw ip                    inet:ipv4-address-no-zone
           |     +--rw link-layer-address    yang:phys-address
           +--rw ipv6!
              +--rw enabled?            boolean
              +--rw forwarding?         boolean
              +--rw mtu?                uint32
              +--rw address* [ip]
              |  +--rw ip               inet:ipv6-address-no-zone
              |  +--rw prefix-length    uint8
              +--rw neighbor* [ip]
              |  +--rw ip                    inet:ipv6-address-no-zone
              |  +--rw link-layer-address    yang:phys-address
              +--rw dup-addr-detect-transmits?   uint32
              +--rw autoconf
                 +--rw create-global-addresses?        boolean
                 +--rw create-temporary-addresses?     boolean
                 +--rw temporary-valid-lifetime?       uint32
                 +--rw temporary-preferred-lifetime?   uint32
        

The data model defines two configuration containers per interface -- "ipv4" and "ipv6", representing the IPv4 and IPv6 address families. In each container, there is a leaf "enabled" that controls whether or not the address family is enabled on that interface, and a leaf "forwarding" that controls whether or not IP packet forwarding for the address family is enabled on the interface. In each container, there is also a list of configured addresses, and a list of configured mappings from IP addresses to link-layer addresses.

数据模型为每个接口定义了两个配置容器——“ipv4”和“ipv6”,表示ipv4和ipv6地址族。在每个容器中,都有一个叶“enabled”,用于控制该接口上是否启用了地址族,还有一个叶“forwarding”,用于控制该接口上是否启用了地址族的IP数据包转发。在每个容器中,还有一个已配置地址列表,以及一个从IP地址到链路层地址的已配置映射列表。

The data model has the following structure for IP state per interface:

对于每个接口的IP状态,数据模型具有以下结构:

     +--ro if:interfaces-state
        +--ro if:interface* [name]
           ...
           +--ro ipv4!
           |  +--ro forwarding?   boolean
           |  +--ro mtu?          uint16
           |  +--ro address* [ip]
           |  |  +--ro ip               inet:ipv4-address-no-zone
           |  |  +--ro (subnet)?
           |  |  |  +--:(prefix-length)
           |  |  |  |  +--ro prefix-length?   uint8
           |  |  |  +--:(netmask)
           |  |  |     +--ro netmask?         yang:dotted-quad
           |  |  +--ro origin?          ip-address-origin
           |  +--ro neighbor* [ip]
           |     +--ro ip                    inet:ipv4-address-no-zone
           |     +--ro link-layer-address?   yang:phys-address
           |     +--ro origin?               neighbor-origin
           +--ro ipv6!
              +--ro forwarding?   boolean
              +--ro mtu?          uint32
              +--ro address* [ip]
              |  +--ro ip               inet:ipv6-address-no-zone
              |  +--ro prefix-length    uint8
              |  +--ro origin?          ip-address-origin
              |  +--ro status?          enumeration
              +--ro neighbor* [ip]
                 +--ro ip                    inet:ipv6-address-no-zone
                 +--ro link-layer-address?   yang:phys-address
                 +--ro origin?               neighbor-origin
                 +--ro is-router?            empty
                 +--ro state?                enumeration
        
     +--ro if:interfaces-state
        +--ro if:interface* [name]
           ...
           +--ro ipv4!
           |  +--ro forwarding?   boolean
           |  +--ro mtu?          uint16
           |  +--ro address* [ip]
           |  |  +--ro ip               inet:ipv4-address-no-zone
           |  |  +--ro (subnet)?
           |  |  |  +--:(prefix-length)
           |  |  |  |  +--ro prefix-length?   uint8
           |  |  |  +--:(netmask)
           |  |  |     +--ro netmask?         yang:dotted-quad
           |  |  +--ro origin?          ip-address-origin
           |  +--ro neighbor* [ip]
           |     +--ro ip                    inet:ipv4-address-no-zone
           |     +--ro link-layer-address?   yang:phys-address
           |     +--ro origin?               neighbor-origin
           +--ro ipv6!
              +--ro forwarding?   boolean
              +--ro mtu?          uint32
              +--ro address* [ip]
              |  +--ro ip               inet:ipv6-address-no-zone
              |  +--ro prefix-length    uint8
              |  +--ro origin?          ip-address-origin
              |  +--ro status?          enumeration
              +--ro neighbor* [ip]
                 +--ro ip                    inet:ipv6-address-no-zone
                 +--ro link-layer-address?   yang:phys-address
                 +--ro origin?               neighbor-origin
                 +--ro is-router?            empty
                 +--ro state?                enumeration
        

The data model defines two state containers per interface -- "ipv4" and "ipv6", representing the IPv4 and IPv6 address families. In each container, there is a leaf "forwarding" that indicates whether or not IP packet forwarding is enabled on that interface. In each container, there is also a list of all addresses in use and a list of known mappings from IP addresses to link-layer addresses.

数据模型为每个接口定义了两个状态容器——“ipv4”和“ipv6”,表示ipv4和ipv6地址族。在每个容器中,都有一个叶“转发”,指示该接口上是否启用了IP数据包转发。在每个容器中,还有一个正在使用的所有地址的列表,以及一个从IP地址到链路层地址的已知映射的列表。

3. Relationship to the IP-MIB
3. 与IP-MIB的关系

If the device implements the IP-MIB [RFC4293], each entry in the "ipv4/address" and "ipv6/address" lists is mapped to one ipAddressEntry, where the ipAddressIfIndex refers to the "address" entry's interface.

如果设备实现IP-MIB[RFC4293],则“ipv4/地址”和“ipv6/地址”列表中的每个条目都映射到一个IPAddressEssentry,其中IPAddressLishFindex指的是“地址”条目的接口。

The IP-MIB defines objects to control IPv6 Router Advertisement messages. The corresponding YANG data nodes are defined in [ROUTING-MGMT].

IP-MIB定义用于控制IPv6路由器播发消息的对象。[ROUTING-MGMT]中定义了相应的数据节点。

The entries in "ipv4/neighbor" and "ipv6/neighbor" are mapped to ipNetToPhysicalTable.

“ipv4/邻居”和“ipv6/邻居”中的条目映射到ipNetToPhysicalTable。

The following tables list the YANG data nodes with corresponding objects in the IP-MIB.

下表列出了IP-MIB中具有相应对象的数据节点。

   +----------------------------------+--------------------------------+
   | YANG data node in                | IP-MIB object                  |
   | /if:interfaces/if:interface      |                                |
   +----------------------------------+--------------------------------+
   | ipv4/enabled                     | ipv4InterfaceEnableStatus      |
   | ipv4/address                     | ipAddressEntry                 |
   | ipv4/address/ip                  | ipAddressAddrType              |
   |                                  | ipAddressAddr                  |
   | ipv4/neighbor                    | ipNetToPhysicalEntry           |
   | ipv4/neighbor/ip                 | ipNetToPhysicalNetAddressType  |
   |                                  | ipNetToPhysicalNetAddress      |
   | ipv4/neighbor/link-layer-address | ipNetToPhysicalPhysAddress     |
   |                                  |                                |
   | ipv6/enabled                     | ipv6InterfaceEnableStatus      |
   | ipv6/forwarding                  | ipv6InterfaceForwarding        |
   | ipv6/address                     | ipAddressEntry                 |
   | ipv6/address/ip                  | ipAddressAddrType              |
   |                                  | ipAddressAddr                  |
   | ipv6/neighbor                    | ipNetToPhysicalEntry           |
   | ipv6/neighbor/link-layer-address | ipNetToPhysicalPhysAddress     |
   | ipv6/neighbor/origin             | ipNetToPhysicalType            |
   +----------------------------------+--------------------------------+
        
   +----------------------------------+--------------------------------+
   | YANG data node in                | IP-MIB object                  |
   | /if:interfaces/if:interface      |                                |
   +----------------------------------+--------------------------------+
   | ipv4/enabled                     | ipv4InterfaceEnableStatus      |
   | ipv4/address                     | ipAddressEntry                 |
   | ipv4/address/ip                  | ipAddressAddrType              |
   |                                  | ipAddressAddr                  |
   | ipv4/neighbor                    | ipNetToPhysicalEntry           |
   | ipv4/neighbor/ip                 | ipNetToPhysicalNetAddressType  |
   |                                  | ipNetToPhysicalNetAddress      |
   | ipv4/neighbor/link-layer-address | ipNetToPhysicalPhysAddress     |
   |                                  |                                |
   | ipv6/enabled                     | ipv6InterfaceEnableStatus      |
   | ipv6/forwarding                  | ipv6InterfaceForwarding        |
   | ipv6/address                     | ipAddressEntry                 |
   | ipv6/address/ip                  | ipAddressAddrType              |
   |                                  | ipAddressAddr                  |
   | ipv6/neighbor                    | ipNetToPhysicalEntry           |
   | ipv6/neighbor/link-layer-address | ipNetToPhysicalPhysAddress     |
   | ipv6/neighbor/origin             | ipNetToPhysicalType            |
   +----------------------------------+--------------------------------+
        

YANG Interface Configuration Data Nodes and Related IP-MIB Objects

YANG接口配置数据节点和相关IP-MIB对象

   +-----------------------------------+-------------------------------+
   | YANG data node in                 | IP-MIB object                 |
   | /if:interfaces-state/if:interface |                               |
   +-----------------------------------+-------------------------------+
   | ipv4                              | ipv4InterfaceEnableStatus     |
   | ipv4/address                      | ipAddressEntry                |
   | ipv4/address/ip                   | ipAddressAddrType             |
   |                                   | ipAddressAddr                 |
   | ipv4/address/origin               | ipAddressOrigin               |
   | ipv4/neighbor                     | ipNetToPhysicalEntry          |
   | ipv4/neighbor/ip                  | ipNetToPhysicalNetAddressType |
   |                                   | ipNetToPhysicalNetAddress     |
   | ipv4/neighbor/link-layer-address  | ipNetToPhysicalPhysAddress    |
   | ipv4/neighbor/origin              | ipNetToPhysicalType           |
   |                                   |                               |
   | ipv6                              | ipv6InterfaceEnableStatus     |
   | ipv6/forwarding                   | ipv6InterfaceForwarding       |
   | ipv6/address                      | ipAddressEntry                |
   | ipv6/address/ip                   | ipAddressAddrType             |
   |                                   | ipAddressAddr                 |
   | ipv6/address/origin               | ipAddressOrigin               |
   | ipv6/address/status               | ipAddressStatus               |
   | ipv6/neighbor                     | ipNetToPhysicalEntry          |
   | ipv6/neighbor/ip                  | ipNetToPhysicalNetAddressType |
   |                                   | ipNetToPhysicalNetAddress     |
   | ipv6/neighbor/link-layer-address  | ipNetToPhysicalPhysAddress    |
   | ipv6/neighbor/origin              | ipNetToPhysicalType           |
   | ipv6/neighbor/state               | ipNetToPhysicalState          |
   +-----------------------------------+-------------------------------+
        
   +-----------------------------------+-------------------------------+
   | YANG data node in                 | IP-MIB object                 |
   | /if:interfaces-state/if:interface |                               |
   +-----------------------------------+-------------------------------+
   | ipv4                              | ipv4InterfaceEnableStatus     |
   | ipv4/address                      | ipAddressEntry                |
   | ipv4/address/ip                   | ipAddressAddrType             |
   |                                   | ipAddressAddr                 |
   | ipv4/address/origin               | ipAddressOrigin               |
   | ipv4/neighbor                     | ipNetToPhysicalEntry          |
   | ipv4/neighbor/ip                  | ipNetToPhysicalNetAddressType |
   |                                   | ipNetToPhysicalNetAddress     |
   | ipv4/neighbor/link-layer-address  | ipNetToPhysicalPhysAddress    |
   | ipv4/neighbor/origin              | ipNetToPhysicalType           |
   |                                   |                               |
   | ipv6                              | ipv6InterfaceEnableStatus     |
   | ipv6/forwarding                   | ipv6InterfaceForwarding       |
   | ipv6/address                      | ipAddressEntry                |
   | ipv6/address/ip                   | ipAddressAddrType             |
   |                                   | ipAddressAddr                 |
   | ipv6/address/origin               | ipAddressOrigin               |
   | ipv6/address/status               | ipAddressStatus               |
   | ipv6/neighbor                     | ipNetToPhysicalEntry          |
   | ipv6/neighbor/ip                  | ipNetToPhysicalNetAddressType |
   |                                   | ipNetToPhysicalNetAddress     |
   | ipv6/neighbor/link-layer-address  | ipNetToPhysicalPhysAddress    |
   | ipv6/neighbor/origin              | ipNetToPhysicalType           |
   | ipv6/neighbor/state               | ipNetToPhysicalState          |
   +-----------------------------------+-------------------------------+
        

YANG Interface State Data Nodes and Related IP-MIB Objects

YANG接口状态数据节点和相关IP-MIB对象

4. IP Management YANG Module
4. IP管理模块

This module imports typedefs from [RFC6991] and [RFC7223], and it references [RFC0791], [RFC0826], [RFC2460], [RFC4861], [RFC4862], [RFC4941], and [RFC7217].

此模块从[RFC6991]和[RFC7223]导入typedefs,并引用[RFC0791]、[RFC0826]、[RFC2460]、[RFC4861]、[RFC4862]、[RFC4941]和[RFC7217]。

   <CODE BEGINS> file "ietf-ip@2014-06-16.yang"
        
   <CODE BEGINS> file "ietf-ip@2014-06-16.yang"
        

module ietf-ip {

模块ietf ip{

    namespace "urn:ietf:params:xml:ns:yang:ietf-ip";
    prefix ip;
        
    namespace "urn:ietf:params:xml:ns:yang:ietf-ip";
    prefix ip;
        
    import ietf-interfaces {
      prefix if;
    }
    import ietf-inet-types {
      prefix inet;
    }
    import ietf-yang-types {
      prefix yang;
    }
        
    import ietf-interfaces {
      prefix if;
    }
    import ietf-inet-types {
      prefix inet;
    }
    import ietf-yang-types {
      prefix yang;
    }
        

organization "IETF NETMOD (NETCONF Data Modeling Language) Working Group";

组织“IETF NETMOD(NETCONF数据建模语言)工作组”;

    contact
      "WG Web:   <http://tools.ietf.org/wg/netmod/>
       WG List:  <mailto:netmod@ietf.org>
        
    contact
      "WG Web:   <http://tools.ietf.org/wg/netmod/>
       WG List:  <mailto:netmod@ietf.org>
        
       WG Chair: Thomas Nadeau
                 <mailto:tnadeau@lucidvision.com>
        
       WG Chair: Thomas Nadeau
                 <mailto:tnadeau@lucidvision.com>
        
       WG Chair: Juergen Schoenwaelder
                 <mailto:j.schoenwaelder@jacobs-university.de>
        
       WG Chair: Juergen Schoenwaelder
                 <mailto:j.schoenwaelder@jacobs-university.de>
        
       Editor:   Martin Bjorklund
                 <mailto:mbj@tail-f.com>";
        
       Editor:   Martin Bjorklund
                 <mailto:mbj@tail-f.com>";
        

description "This module contains a collection of YANG definitions for configuring IP implementations.

description“此模块包含用于配置IP实现的定义集合。

Copyright (c) 2014 IETF Trust and the persons identified as authors of the code. All rights reserved.

版权所有(c)2014 IETF信托基金和被确定为代码作者的人员。版权所有。

Redistribution and use in source and binary forms, with or without modification, is permitted pursuant to, and subject to the license terms contained in, the Simplified BSD License set forth in Section 4.c of the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info).

根据IETF信托有关IETF文件的法律规定第4.c节规定的简化BSD许可证中包含的许可条款,允许以源代码和二进制格式重新分发和使用,无论是否修改(http://trustee.ietf.org/license-info).

This version of this YANG module is part of RFC 7277; see the RFC itself for full legal notices.";

此模块的此版本是RFC 7277的一部分;有关完整的法律通知,请参见RFC本身。“;

    revision 2014-06-16 {
      description
        "Initial revision.";
      reference
        "RFC 7277: A YANG Data Model for IP Management";
    }
        
    revision 2014-06-16 {
      description
        "Initial revision.";
      reference
        "RFC 7277: A YANG Data Model for IP Management";
    }
        
    /*
        
    /*
        

* Features */

* 特征*/

    feature ipv4-non-contiguous-netmasks {
      description
        "Indicates support for configuring non-contiguous
         subnet masks.";
    }
        
    feature ipv4-non-contiguous-netmasks {
      description
        "Indicates support for configuring non-contiguous
         subnet masks.";
    }
        
    feature ipv6-privacy-autoconf {
      description
        "Indicates support for Privacy Extensions for Stateless Address
         Autoconfiguration in IPv6.";
      reference
        "RFC 4941: Privacy Extensions for Stateless Address
                   Autoconfiguration in IPv6";
    }
        
    feature ipv6-privacy-autoconf {
      description
        "Indicates support for Privacy Extensions for Stateless Address
         Autoconfiguration in IPv6.";
      reference
        "RFC 4941: Privacy Extensions for Stateless Address
                   Autoconfiguration in IPv6";
    }
        
    /*
     * Typedefs
     */
        
    /*
     * Typedefs
     */
        
    typedef ip-address-origin {
      type enumeration {
        enum other {
          description
            "None of the following.";
        }
        enum static {
          description
            "Indicates that the address has been statically
             configured - for example, using NETCONF or a Command Line
             Interface.";
        }
        enum dhcp {
          description
            "Indicates an address that has been assigned to this
             system by a DHCP server.";
        }
        enum link-layer {
          description
            "Indicates an address created by IPv6 stateless
             autoconfiguration that embeds a link-layer address in its
             interface identifier.";
        }
        enum random {
          description
            "Indicates an address chosen by the system at
        
    typedef ip-address-origin {
      type enumeration {
        enum other {
          description
            "None of the following.";
        }
        enum static {
          description
            "Indicates that the address has been statically
             configured - for example, using NETCONF or a Command Line
             Interface.";
        }
        enum dhcp {
          description
            "Indicates an address that has been assigned to this
             system by a DHCP server.";
        }
        enum link-layer {
          description
            "Indicates an address created by IPv6 stateless
             autoconfiguration that embeds a link-layer address in its
             interface identifier.";
        }
        enum random {
          description
            "Indicates an address chosen by the system at
        
             random, e.g., an IPv4 address within 169.254/16, an
             RFC 4941 temporary address, or an RFC 7217 semantically
             opaque address.";
          reference
            "RFC 4941: Privacy Extensions for Stateless Address
                       Autoconfiguration in IPv6
             RFC 7217: A Method for Generating Semantically Opaque
                       Interface Identifiers with IPv6 Stateless
                       Address Autoconfiguration (SLAAC)";
        }
      }
      description
        "The origin of an address.";
    }
        
             random, e.g., an IPv4 address within 169.254/16, an
             RFC 4941 temporary address, or an RFC 7217 semantically
             opaque address.";
          reference
            "RFC 4941: Privacy Extensions for Stateless Address
                       Autoconfiguration in IPv6
             RFC 7217: A Method for Generating Semantically Opaque
                       Interface Identifiers with IPv6 Stateless
                       Address Autoconfiguration (SLAAC)";
        }
      }
      description
        "The origin of an address.";
    }
        
    typedef neighbor-origin {
      type enumeration {
        enum other {
          description
            "None of the following.";
        }
        enum static {
          description
            "Indicates that the mapping has been statically
             configured - for example, using NETCONF or a Command Line
             Interface.";
        }
        enum dynamic {
          description
            "Indicates that the mapping has been dynamically resolved
             using, e.g., IPv4 ARP or the IPv6 Neighbor Discovery
             protocol.";
        }
      }
      description
        "The origin of a neighbor entry.";
    }
        
    typedef neighbor-origin {
      type enumeration {
        enum other {
          description
            "None of the following.";
        }
        enum static {
          description
            "Indicates that the mapping has been statically
             configured - for example, using NETCONF or a Command Line
             Interface.";
        }
        enum dynamic {
          description
            "Indicates that the mapping has been dynamically resolved
             using, e.g., IPv4 ARP or the IPv6 Neighbor Discovery
             protocol.";
        }
      }
      description
        "The origin of a neighbor entry.";
    }
        
    /*
     * Configuration data nodes
     */
        
    /*
     * Configuration data nodes
     */
        

augment "/if:interfaces/if:interface" { description "Parameters for configuring IP on interfaces.

增加“/if:interfaces/if:interface”{description”参数,用于在接口上配置IP。

If an interface is not capable of running IP, the server must not allow the client to configure these parameters.";

如果接口不能运行IP,则服务器不得允许客户端配置这些参数。“;

      container ipv4 {
        presence
          "Enables IPv4 unless the 'enabled' leaf
           (which defaults to 'true') is set to 'false'";
        description
          "Parameters for the IPv4 address family.";
        
      container ipv4 {
        presence
          "Enables IPv4 unless the 'enabled' leaf
           (which defaults to 'true') is set to 'false'";
        description
          "Parameters for the IPv4 address family.";
        
        leaf enabled {
          type boolean;
          default true;
          description
            "Controls whether IPv4 is enabled or disabled on this
             interface.  When IPv4 is enabled, this interface is
             connected to an IPv4 stack, and the interface can send
             and receive IPv4 packets.";
        }
        leaf forwarding {
          type boolean;
          default false;
          description
            "Controls IPv4 packet forwarding of datagrams received by,
             but not addressed to, this interface.  IPv4 routers
             forward datagrams.  IPv4 hosts do not (except those
             source-routed via the host).";
        }
        leaf mtu {
          type uint16 {
            range "68..max";
          }
          units octets;
          description
            "The size, in octets, of the largest IPv4 packet that the
             interface will send and receive.
        
        leaf enabled {
          type boolean;
          default true;
          description
            "Controls whether IPv4 is enabled or disabled on this
             interface.  When IPv4 is enabled, this interface is
             connected to an IPv4 stack, and the interface can send
             and receive IPv4 packets.";
        }
        leaf forwarding {
          type boolean;
          default false;
          description
            "Controls IPv4 packet forwarding of datagrams received by,
             but not addressed to, this interface.  IPv4 routers
             forward datagrams.  IPv4 hosts do not (except those
             source-routed via the host).";
        }
        leaf mtu {
          type uint16 {
            range "68..max";
          }
          units octets;
          description
            "The size, in octets, of the largest IPv4 packet that the
             interface will send and receive.
        

The server may restrict the allowed values for this leaf, depending on the interface's type.

服务器可能会根据接口的类型限制此叶的允许值。

             If this leaf is not configured, the operationally used MTU
             depends on the interface's type.";
          reference
            "RFC 791: Internet Protocol";
        }
        list address {
          key "ip";
          description
            "The list of configured IPv4 addresses on the interface.";
        
             If this leaf is not configured, the operationally used MTU
             depends on the interface's type.";
          reference
            "RFC 791: Internet Protocol";
        }
        list address {
          key "ip";
          description
            "The list of configured IPv4 addresses on the interface.";
        
          leaf ip {
            type inet:ipv4-address-no-zone;
            description
              "The IPv4 address on the interface.";
          }
        
          leaf ip {
            type inet:ipv4-address-no-zone;
            description
              "The IPv4 address on the interface.";
          }
        
          choice subnet {
            mandatory true;
            description
              "The subnet can be specified as a prefix-length, or,
               if the server supports non-contiguous netmasks, as
               a netmask.";
            leaf prefix-length {
              type uint8 {
                range "0..32";
              }
              description
                "The length of the subnet prefix.";
            }
            leaf netmask {
              if-feature ipv4-non-contiguous-netmasks;
              type yang:dotted-quad;
              description
                "The subnet specified as a netmask.";
            }
          }
        }
        list neighbor {
          key "ip";
          description
            "A list of mappings from IPv4 addresses to
             link-layer addresses.
        
          choice subnet {
            mandatory true;
            description
              "The subnet can be specified as a prefix-length, or,
               if the server supports non-contiguous netmasks, as
               a netmask.";
            leaf prefix-length {
              type uint8 {
                range "0..32";
              }
              description
                "The length of the subnet prefix.";
            }
            leaf netmask {
              if-feature ipv4-non-contiguous-netmasks;
              type yang:dotted-quad;
              description
                "The subnet specified as a netmask.";
            }
          }
        }
        list neighbor {
          key "ip";
          description
            "A list of mappings from IPv4 addresses to
             link-layer addresses.
        
             Entries in this list are used as static entries in the
             ARP Cache.";
          reference
            "RFC 826: An Ethernet Address Resolution Protocol";
        
             Entries in this list are used as static entries in the
             ARP Cache.";
          reference
            "RFC 826: An Ethernet Address Resolution Protocol";
        
          leaf ip {
            type inet:ipv4-address-no-zone;
            description
              "The IPv4 address of the neighbor node.";
          }
          leaf link-layer-address {
            type yang:phys-address;
            mandatory true;
            description
              "The link-layer address of the neighbor node.";
          }
        }
        
          leaf ip {
            type inet:ipv4-address-no-zone;
            description
              "The IPv4 address of the neighbor node.";
          }
          leaf link-layer-address {
            type yang:phys-address;
            mandatory true;
            description
              "The link-layer address of the neighbor node.";
          }
        }
        

}

}

      container ipv6 {
        presence
          "Enables IPv6 unless the 'enabled' leaf
           (which defaults to 'true') is set to 'false'";
        description
          "Parameters for the IPv6 address family.";
        
      container ipv6 {
        presence
          "Enables IPv6 unless the 'enabled' leaf
           (which defaults to 'true') is set to 'false'";
        description
          "Parameters for the IPv6 address family.";
        
        leaf enabled {
          type boolean;
          default true;
          description
            "Controls whether IPv6 is enabled or disabled on this
             interface.  When IPv6 is enabled, this interface is
             connected to an IPv6 stack, and the interface can send
             and receive IPv6 packets.";
        }
        leaf forwarding {
          type boolean;
          default false;
          description
            "Controls IPv6 packet forwarding of datagrams received by,
             but not addressed to, this interface.  IPv6 routers
             forward datagrams.  IPv6 hosts do not (except those
             source-routed via the host).";
          reference
            "RFC 4861: Neighbor Discovery for IP version 6 (IPv6)
                       Section 6.2.1, IsRouter";
        }
        leaf mtu {
          type uint32 {
            range "1280..max";
          }
          units octets;
          description
            "The size, in octets, of the largest IPv6 packet that the
             interface will send and receive.
        
        leaf enabled {
          type boolean;
          default true;
          description
            "Controls whether IPv6 is enabled or disabled on this
             interface.  When IPv6 is enabled, this interface is
             connected to an IPv6 stack, and the interface can send
             and receive IPv6 packets.";
        }
        leaf forwarding {
          type boolean;
          default false;
          description
            "Controls IPv6 packet forwarding of datagrams received by,
             but not addressed to, this interface.  IPv6 routers
             forward datagrams.  IPv6 hosts do not (except those
             source-routed via the host).";
          reference
            "RFC 4861: Neighbor Discovery for IP version 6 (IPv6)
                       Section 6.2.1, IsRouter";
        }
        leaf mtu {
          type uint32 {
            range "1280..max";
          }
          units octets;
          description
            "The size, in octets, of the largest IPv6 packet that the
             interface will send and receive.
        

The server may restrict the allowed values for this leaf, depending on the interface's type.

服务器可能会根据接口的类型限制此叶的允许值。

             If this leaf is not configured, the operationally used MTU
             depends on the interface's type.";
          reference
            "RFC 2460: Internet Protocol, Version 6 (IPv6) Specification
                       Section 5";
        }
        
             If this leaf is not configured, the operationally used MTU
             depends on the interface's type.";
          reference
            "RFC 2460: Internet Protocol, Version 6 (IPv6) Specification
                       Section 5";
        }
        
        list address {
          key "ip";
          description
            "The list of configured IPv6 addresses on the interface.";
        
        list address {
          key "ip";
          description
            "The list of configured IPv6 addresses on the interface.";
        
          leaf ip {
            type inet:ipv6-address-no-zone;
            description
              "The IPv6 address on the interface.";
          }
          leaf prefix-length {
            type uint8 {
              range "0..128";
            }
            mandatory true;
            description
              "The length of the subnet prefix.";
          }
        }
        list neighbor {
          key "ip";
          description
            "A list of mappings from IPv6 addresses to
             link-layer addresses.
        
          leaf ip {
            type inet:ipv6-address-no-zone;
            description
              "The IPv6 address on the interface.";
          }
          leaf prefix-length {
            type uint8 {
              range "0..128";
            }
            mandatory true;
            description
              "The length of the subnet prefix.";
          }
        }
        list neighbor {
          key "ip";
          description
            "A list of mappings from IPv6 addresses to
             link-layer addresses.
        
             Entries in this list are used as static entries in the
             Neighbor Cache.";
          reference
            "RFC 4861: Neighbor Discovery for IP version 6 (IPv6)";
        
             Entries in this list are used as static entries in the
             Neighbor Cache.";
          reference
            "RFC 4861: Neighbor Discovery for IP version 6 (IPv6)";
        
          leaf ip {
            type inet:ipv6-address-no-zone;
            description
              "The IPv6 address of the neighbor node.";
          }
          leaf link-layer-address {
            type yang:phys-address;
            mandatory true;
            description
              "The link-layer address of the neighbor node.";
          }
        }
        
          leaf ip {
            type inet:ipv6-address-no-zone;
            description
              "The IPv6 address of the neighbor node.";
          }
          leaf link-layer-address {
            type yang:phys-address;
            mandatory true;
            description
              "The link-layer address of the neighbor node.";
          }
        }
        
        leaf dup-addr-detect-transmits {
          type uint32;
          default 1;
          description
            "The number of consecutive Neighbor Solicitation messages
             sent while performing Duplicate Address Detection on a
             tentative address.  A value of zero indicates that
             Duplicate Address Detection is not performed on
             tentative addresses.  A value of one indicates a single
             transmission with no follow-up retransmissions.";
          reference
            "RFC 4862: IPv6 Stateless Address Autoconfiguration";
        }
        container autoconf {
          description
            "Parameters to control the autoconfiguration of IPv6
             addresses, as described in RFC 4862.";
          reference
            "RFC 4862: IPv6 Stateless Address Autoconfiguration";
        
        leaf dup-addr-detect-transmits {
          type uint32;
          default 1;
          description
            "The number of consecutive Neighbor Solicitation messages
             sent while performing Duplicate Address Detection on a
             tentative address.  A value of zero indicates that
             Duplicate Address Detection is not performed on
             tentative addresses.  A value of one indicates a single
             transmission with no follow-up retransmissions.";
          reference
            "RFC 4862: IPv6 Stateless Address Autoconfiguration";
        }
        container autoconf {
          description
            "Parameters to control the autoconfiguration of IPv6
             addresses, as described in RFC 4862.";
          reference
            "RFC 4862: IPv6 Stateless Address Autoconfiguration";
        
          leaf create-global-addresses {
            type boolean;
            default true;
            description
              "If enabled, the host creates global addresses as
               described in RFC 4862.";
            reference
              "RFC 4862: IPv6 Stateless Address Autoconfiguration
                         Section 5.5";
          }
          leaf create-temporary-addresses {
            if-feature ipv6-privacy-autoconf;
            type boolean;
            default false;
            description
              "If enabled, the host creates temporary addresses as
               described in RFC 4941.";
            reference
              "RFC 4941: Privacy Extensions for Stateless Address
                         Autoconfiguration in IPv6";
          }
        
          leaf create-global-addresses {
            type boolean;
            default true;
            description
              "If enabled, the host creates global addresses as
               described in RFC 4862.";
            reference
              "RFC 4862: IPv6 Stateless Address Autoconfiguration
                         Section 5.5";
          }
          leaf create-temporary-addresses {
            if-feature ipv6-privacy-autoconf;
            type boolean;
            default false;
            description
              "If enabled, the host creates temporary addresses as
               described in RFC 4941.";
            reference
              "RFC 4941: Privacy Extensions for Stateless Address
                         Autoconfiguration in IPv6";
          }
        
          leaf temporary-valid-lifetime {
            if-feature ipv6-privacy-autoconf;
            type uint32;
            units "seconds";
            default 604800;
            description
              "The time period during which the temporary address
               is valid.";
            reference
              "RFC 4941: Privacy Extensions for Stateless Address
                         Autoconfiguration in IPv6
                         - TEMP_VALID_LIFETIME";
          }
          leaf temporary-preferred-lifetime {
            if-feature ipv6-privacy-autoconf;
            type uint32;
            units "seconds";
            default 86400;
            description
              "The time period during which the temporary address is
               preferred.";
            reference
              "RFC 4941: Privacy Extensions for Stateless Address
                         Autoconfiguration in IPv6
                         - TEMP_PREFERRED_LIFETIME";
          }
        }
      }
    }
        
          leaf temporary-valid-lifetime {
            if-feature ipv6-privacy-autoconf;
            type uint32;
            units "seconds";
            default 604800;
            description
              "The time period during which the temporary address
               is valid.";
            reference
              "RFC 4941: Privacy Extensions for Stateless Address
                         Autoconfiguration in IPv6
                         - TEMP_VALID_LIFETIME";
          }
          leaf temporary-preferred-lifetime {
            if-feature ipv6-privacy-autoconf;
            type uint32;
            units "seconds";
            default 86400;
            description
              "The time period during which the temporary address is
               preferred.";
            reference
              "RFC 4941: Privacy Extensions for Stateless Address
                         Autoconfiguration in IPv6
                         - TEMP_PREFERRED_LIFETIME";
          }
        }
      }
    }
        
    /*
     * Operational state data nodes
     */
        
    /*
     * Operational state data nodes
     */
        
    augment "/if:interfaces-state/if:interface" {
      description
        "Data nodes for the operational state of IP on interfaces.";
        
    augment "/if:interfaces-state/if:interface" {
      description
        "Data nodes for the operational state of IP on interfaces.";
        
      container ipv4 {
        presence "Present if IPv4 is enabled on this interface";
        config false;
        description
          "Interface-specific parameters for the IPv4 address family.";
        
      container ipv4 {
        presence "Present if IPv4 is enabled on this interface";
        config false;
        description
          "Interface-specific parameters for the IPv4 address family.";
        
        leaf forwarding {
          type boolean;
          description
            "Indicates whether IPv4 packet forwarding is enabled or
             disabled on this interface.";
        }
        leaf mtu {
          type uint16 {
            range "68..max";
          }
          units octets;
          description
            "The size, in octets, of the largest IPv4 packet that the
             interface will send and receive.";
          reference
            "RFC 791: Internet Protocol";
        }
        list address {
          key "ip";
          description
            "The list of IPv4 addresses on the interface.";
        
        leaf forwarding {
          type boolean;
          description
            "Indicates whether IPv4 packet forwarding is enabled or
             disabled on this interface.";
        }
        leaf mtu {
          type uint16 {
            range "68..max";
          }
          units octets;
          description
            "The size, in octets, of the largest IPv4 packet that the
             interface will send and receive.";
          reference
            "RFC 791: Internet Protocol";
        }
        list address {
          key "ip";
          description
            "The list of IPv4 addresses on the interface.";
        
          leaf ip {
            type inet:ipv4-address-no-zone;
            description
              "The IPv4 address on the interface.";
          }
          choice subnet {
            description
              "The subnet can be specified as a prefix-length, or,
               if the server supports non-contiguous netmasks, as
               a netmask.";
            leaf prefix-length {
              type uint8 {
                range "0..32";
              }
              description
                "The length of the subnet prefix.";
            }
            leaf netmask {
              if-feature ipv4-non-contiguous-netmasks;
              type yang:dotted-quad;
              description
                "The subnet specified as a netmask.";
            }
          }
        
          leaf ip {
            type inet:ipv4-address-no-zone;
            description
              "The IPv4 address on the interface.";
          }
          choice subnet {
            description
              "The subnet can be specified as a prefix-length, or,
               if the server supports non-contiguous netmasks, as
               a netmask.";
            leaf prefix-length {
              type uint8 {
                range "0..32";
              }
              description
                "The length of the subnet prefix.";
            }
            leaf netmask {
              if-feature ipv4-non-contiguous-netmasks;
              type yang:dotted-quad;
              description
                "The subnet specified as a netmask.";
            }
          }
        
          leaf origin {
            type ip-address-origin;
            description
              "The origin of this address.";
          }
        }
        list neighbor {
          key "ip";
          description
            "A list of mappings from IPv4 addresses to
             link-layer addresses.
        
          leaf origin {
            type ip-address-origin;
            description
              "The origin of this address.";
          }
        }
        list neighbor {
          key "ip";
          description
            "A list of mappings from IPv4 addresses to
             link-layer addresses.
        
             This list represents the ARP Cache.";
          reference
            "RFC 826: An Ethernet Address Resolution Protocol";
        
             This list represents the ARP Cache.";
          reference
            "RFC 826: An Ethernet Address Resolution Protocol";
        
          leaf ip {
            type inet:ipv4-address-no-zone;
            description
              "The IPv4 address of the neighbor node.";
          }
          leaf link-layer-address {
            type yang:phys-address;
            description
              "The link-layer address of the neighbor node.";
          }
          leaf origin {
            type neighbor-origin;
            description
              "The origin of this neighbor entry.";
          }
        }
        
          leaf ip {
            type inet:ipv4-address-no-zone;
            description
              "The IPv4 address of the neighbor node.";
          }
          leaf link-layer-address {
            type yang:phys-address;
            description
              "The link-layer address of the neighbor node.";
          }
          leaf origin {
            type neighbor-origin;
            description
              "The origin of this neighbor entry.";
          }
        }
        

}

}

      container ipv6 {
        presence "Present if IPv6 is enabled on this interface";
        config false;
        description
          "Parameters for the IPv6 address family.";
        
      container ipv6 {
        presence "Present if IPv6 is enabled on this interface";
        config false;
        description
          "Parameters for the IPv6 address family.";
        
        leaf forwarding {
          type boolean;
          default false;
          description
            "Indicates whether IPv6 packet forwarding is enabled or
             disabled on this interface.";
          reference
            "RFC 4861: Neighbor Discovery for IP version 6 (IPv6)
                       Section 6.2.1, IsRouter";
        }
        leaf mtu {
          type uint32 {
            range "1280..max";
          }
          units octets;
          description
            "The size, in octets, of the largest IPv6 packet that the
             interface will send and receive.";
          reference
            "RFC 2460: Internet Protocol, Version 6 (IPv6) Specification
                       Section 5";
        }
        list address {
          key "ip";
          description
            "The list of IPv6 addresses on the interface.";
        
        leaf forwarding {
          type boolean;
          default false;
          description
            "Indicates whether IPv6 packet forwarding is enabled or
             disabled on this interface.";
          reference
            "RFC 4861: Neighbor Discovery for IP version 6 (IPv6)
                       Section 6.2.1, IsRouter";
        }
        leaf mtu {
          type uint32 {
            range "1280..max";
          }
          units octets;
          description
            "The size, in octets, of the largest IPv6 packet that the
             interface will send and receive.";
          reference
            "RFC 2460: Internet Protocol, Version 6 (IPv6) Specification
                       Section 5";
        }
        list address {
          key "ip";
          description
            "The list of IPv6 addresses on the interface.";
        
          leaf ip {
            type inet:ipv6-address-no-zone;
            description
              "The IPv6 address on the interface.";
          }
          leaf prefix-length {
            type uint8 {
              range "0..128";
            }
            mandatory true;
            description
              "The length of the subnet prefix.";
          }
          leaf origin {
            type ip-address-origin;
            description
              "The origin of this address.";
          }
        
          leaf ip {
            type inet:ipv6-address-no-zone;
            description
              "The IPv6 address on the interface.";
          }
          leaf prefix-length {
            type uint8 {
              range "0..128";
            }
            mandatory true;
            description
              "The length of the subnet prefix.";
          }
          leaf origin {
            type ip-address-origin;
            description
              "The origin of this address.";
          }
        
          leaf status {
            type enumeration {
              enum preferred {
                description
                  "This is a valid address that can appear as the
                   destination or source address of a packet.";
              }
              enum deprecated {
                description
                  "This is a valid but deprecated address that should
                   no longer be used as a source address in new
                   communications, but packets addressed to such an
                   address are processed as expected.";
              }
              enum invalid {
                description
                  "This isn't a valid address, and it shouldn't appear
                   as the destination or source address of a packet.";
              }
              enum inaccessible {
                description
                  "The address is not accessible because the interface
                   to which this address is assigned is not
                   operational.";
              }
              enum unknown {
                description
                  "The status cannot be determined for some reason.";
              }
              enum tentative {
                description
                  "The uniqueness of the address on the link is being
                   verified.  Addresses in this state should not be
                   used for general communication and should only be
                   used to determine the uniqueness of the address.";
              }
              enum duplicate {
                description
                  "The address has been determined to be non-unique on
                   the link and so must not be used.";
              }
        
          leaf status {
            type enumeration {
              enum preferred {
                description
                  "This is a valid address that can appear as the
                   destination or source address of a packet.";
              }
              enum deprecated {
                description
                  "This is a valid but deprecated address that should
                   no longer be used as a source address in new
                   communications, but packets addressed to such an
                   address are processed as expected.";
              }
              enum invalid {
                description
                  "This isn't a valid address, and it shouldn't appear
                   as the destination or source address of a packet.";
              }
              enum inaccessible {
                description
                  "The address is not accessible because the interface
                   to which this address is assigned is not
                   operational.";
              }
              enum unknown {
                description
                  "The status cannot be determined for some reason.";
              }
              enum tentative {
                description
                  "The uniqueness of the address on the link is being
                   verified.  Addresses in this state should not be
                   used for general communication and should only be
                   used to determine the uniqueness of the address.";
              }
              enum duplicate {
                description
                  "The address has been determined to be non-unique on
                   the link and so must not be used.";
              }
        
              enum optimistic {
                description
                  "The address is available for use, subject to
                   restrictions, while its uniqueness on a link is
                   being verified.";
              }
            }
            description
              "The status of an address.  Most of the states correspond
               to states from the IPv6 Stateless Address
               Autoconfiguration protocol.";
            reference
              "RFC 4293: Management Information Base for the
                         Internet Protocol (IP)
                         - IpAddressStatusTC
               RFC 4862: IPv6 Stateless Address Autoconfiguration";
          }
        }
        list neighbor {
          key "ip";
          description
            "A list of mappings from IPv6 addresses to
             link-layer addresses.
        
              enum optimistic {
                description
                  "The address is available for use, subject to
                   restrictions, while its uniqueness on a link is
                   being verified.";
              }
            }
            description
              "The status of an address.  Most of the states correspond
               to states from the IPv6 Stateless Address
               Autoconfiguration protocol.";
            reference
              "RFC 4293: Management Information Base for the
                         Internet Protocol (IP)
                         - IpAddressStatusTC
               RFC 4862: IPv6 Stateless Address Autoconfiguration";
          }
        }
        list neighbor {
          key "ip";
          description
            "A list of mappings from IPv6 addresses to
             link-layer addresses.
        
             This list represents the Neighbor Cache.";
          reference
            "RFC 4861: Neighbor Discovery for IP version 6 (IPv6)";
        
             This list represents the Neighbor Cache.";
          reference
            "RFC 4861: Neighbor Discovery for IP version 6 (IPv6)";
        
          leaf ip {
            type inet:ipv6-address-no-zone;
            description
              "The IPv6 address of the neighbor node.";
          }
          leaf link-layer-address {
            type yang:phys-address;
            description
              "The link-layer address of the neighbor node.";
          }
          leaf origin {
            type neighbor-origin;
            description
              "The origin of this neighbor entry.";
          }
          leaf is-router {
            type empty;
            description
              "Indicates that the neighbor node acts as a router.";
          }
        
          leaf ip {
            type inet:ipv6-address-no-zone;
            description
              "The IPv6 address of the neighbor node.";
          }
          leaf link-layer-address {
            type yang:phys-address;
            description
              "The link-layer address of the neighbor node.";
          }
          leaf origin {
            type neighbor-origin;
            description
              "The origin of this neighbor entry.";
          }
          leaf is-router {
            type empty;
            description
              "Indicates that the neighbor node acts as a router.";
          }
        
          leaf state {
            type enumeration {
              enum incomplete {
                description
                  "Address resolution is in progress, and the link-layer
                   address of the neighbor has not yet been
                   determined.";
              }
              enum reachable {
                description
                  "Roughly speaking, the neighbor is known to have been
                   reachable recently (within tens of seconds ago).";
              }
              enum stale {
                description
                  "The neighbor is no longer known to be reachable, but
                   until traffic is sent to the neighbor no attempt
                   should be made to verify its reachability.";
              }
              enum delay {
                description
                  "The neighbor is no longer known to be reachable, and
                   traffic has recently been sent to the neighbor.
                   Rather than probe the neighbor immediately, however,
                   delay sending probes for a short while in order to
                   give upper-layer protocols a chance to provide
                   reachability confirmation.";
              }
              enum probe {
                description
                  "The neighbor is no longer known to be reachable, and
                   unicast Neighbor Solicitation probes are being sent
                   to verify reachability.";
              }
            }
            description
              "The Neighbor Unreachability Detection state of this
               entry.";
            reference
              "RFC 4861: Neighbor Discovery for IP version 6 (IPv6)
                         Section 7.3.2";
          }
        }
      }
    }
   }
        
          leaf state {
            type enumeration {
              enum incomplete {
                description
                  "Address resolution is in progress, and the link-layer
                   address of the neighbor has not yet been
                   determined.";
              }
              enum reachable {
                description
                  "Roughly speaking, the neighbor is known to have been
                   reachable recently (within tens of seconds ago).";
              }
              enum stale {
                description
                  "The neighbor is no longer known to be reachable, but
                   until traffic is sent to the neighbor no attempt
                   should be made to verify its reachability.";
              }
              enum delay {
                description
                  "The neighbor is no longer known to be reachable, and
                   traffic has recently been sent to the neighbor.
                   Rather than probe the neighbor immediately, however,
                   delay sending probes for a short while in order to
                   give upper-layer protocols a chance to provide
                   reachability confirmation.";
              }
              enum probe {
                description
                  "The neighbor is no longer known to be reachable, and
                   unicast Neighbor Solicitation probes are being sent
                   to verify reachability.";
              }
            }
            description
              "The Neighbor Unreachability Detection state of this
               entry.";
            reference
              "RFC 4861: Neighbor Discovery for IP version 6 (IPv6)
                         Section 7.3.2";
          }
        }
      }
    }
   }
        

<CODE ENDS>

<代码结束>

5. IANA Considerations
5. IANA考虑

This document registers a URI in the "IETF XML Registry" [RFC3688]. Following the format in RFC 3688, the following registration has been made.

本文档在“IETF XML注册表”[RFC3688]中注册URI。按照RFC 3688中的格式,进行了以下注册。

       URI: urn:ietf:params:xml:ns:yang:ietf-ip
        
       URI: urn:ietf:params:xml:ns:yang:ietf-ip
        

Registrant Contact: The NETMOD WG of the IETF.

注册人联系人:IETF的NETMOD工作组。

XML: N/A; the requested URI is an XML namespace.

XML:不适用;请求的URI是一个XML命名空间。

This document registers a YANG module in the "YANG Module Names" registry [RFC6020].

本文件在“阳模块名称”注册表[RFC6020]中注册阳模块。

    Name:         ietf-ip
    Namespace:    urn:ietf:params:xml:ns:yang:ietf-ip
    Prefix:       ip
    Reference:    RFC 7277
        
    Name:         ietf-ip
    Namespace:    urn:ietf:params:xml:ns:yang:ietf-ip
    Prefix:       ip
    Reference:    RFC 7277
        
6. Security Considerations
6. 安全考虑

The YANG module defined in this memo is designed to be accessed via the NETCONF protocol [RFC6241]. The lowest NETCONF layer is the secure transport layer and the mandatory-to-implement secure transport is SSH [RFC6242]. The NETCONF access control model [RFC6536] provides the means to restrict access for particular NETCONF users to a pre-configured subset of all available NETCONF protocol operations and content.

本备忘录中定义的模块旨在通过NETCONF协议[RFC6241]访问。最低的NETCONF层是安全传输层,实现安全传输的必需层是SSH[RFC6242]。NETCONF访问控制模型[RFC6536]提供了将特定NETCONF用户的访问限制为所有可用NETCONF协议操作和内容的预配置子集的方法。

There are a number of data nodes defined in the YANG module which are writable/creatable/deletable (i.e., config true, which is the default). These data nodes may be considered sensitive or vulnerable in some network environments. Write operations (e.g., edit-config) to these data nodes without proper protection can have a negative effect on network operations. These are the subtrees and data nodes and their sensitivity/vulnerability:

YANG模块中定义了许多数据节点,这些节点是可写/可创建/可删除的(即config true,这是默认值)。在某些网络环境中,这些数据节点可能被视为敏感或易受攻击。对这些数据节点的写入操作(如编辑配置)如果没有适当的保护,可能会对网络操作产生负面影响。这些是子树和数据节点及其敏感性/漏洞:

ipv4/enabled and ipv6/enabled: These leafs are used to enable or disable IPv4 and IPv6 on a specific interface. By enabling a protocol on an interface, an attacker might be able to create an unsecured path into a node (or through it if routing is also enabled). By disabling a protocol on an interface, an attacker might be able to force packets to be routed through some other interface or deny access to some or all of the network via that protocol.

ipv4/已启用和ipv6/已启用:这些leaf用于在特定接口上启用或禁用ipv4和ipv6。通过在接口上启用协议,攻击者可能能够创建进入节点的不安全路径(如果还启用了路由,则可以通过该路径)。通过禁用接口上的协议,攻击者可以强制数据包通过其他接口路由,或拒绝通过该协议访问部分或全部网络。

ipv4/address and ipv6/address: These lists specify the configured IP addresses on an interface. By modifying this information, an attacker can cause a node to either ignore messages destined to it or accept (at least at the IP layer) messages it would otherwise ignore. The use of filtering or security associations may reduce the potential damage in the latter case.

ipv4/地址和ipv6/地址:这些列表指定接口上配置的IP地址。通过修改此信息,攻击者可以使节点忽略发送给它的消息,或者接受(至少在IP层)它本来会忽略的消息。在后一种情况下,使用过滤或安全关联可以减少潜在的损害。

ipv4/forwarding and ipv6/forwarding: These leafs allow a client to enable or disable the forwarding functions on the entity. By disabling the forwarding functions, an attacker would possibly be able to deny service to users. By enabling the forwarding functions, an attacker could open a conduit into an area. This might result in the area providing transit for packets it shouldn't, or it might allow the attacker access to the area, bypassing security safeguards.

ipv4/转发和ipv6/转发:这些叶子允许客户端启用或禁用实体上的转发功能。通过禁用转发功能,攻击者可能会拒绝向用户提供服务。通过启用转发功能,攻击者可以打开进入某个区域的管道。这可能导致该区域为不应该传输的数据包提供传输,或者允许攻击者绕过安全防护措施访问该区域。

ipv6/autoconf: The leafs in this branch control the autoconfiguration of IPv6 addresses and, in particular, whether or not temporary addresses are used. By modifying the corresponding leafs, an attacker might impact the addresses used by a node and thus indirectly the privacy of the users using the node.

ipv6/autoconf:此分支中的LEAF控制ipv6地址的自动配置,特别是是否使用临时地址。通过修改相应的leaf,攻击者可能会影响节点使用的地址,从而间接影响使用节点的用户的隐私。

ipv4/mtu and ipv6/mtu: Setting these leafs to very small values can be used to slow down interfaces.

ipv4/mtu和ipv6/mtu:将这些LEAF设置为非常小的值可用于降低接口速度。

7. Acknowledgments
7. 致谢

The author wishes to thank Jeffrey Lange, Ladislav Lhotka, Juergen Schoenwaelder, and Dave Thaler for their helpful comments.

作者希望感谢杰弗里·兰格、拉迪斯拉夫·洛特卡、尤尔根·舍恩瓦埃尔德和戴夫·泰勒的有益评论。

8. References
8. 工具书类
8.1. Normative References
8.1. 规范性引用文件

[RFC0791] Postel, J., "Internet Protocol", STD 5, RFC 791, September 1981.

[RFC0791]Postel,J.,“互联网协议”,STD 5,RFC 7911981年9月。

[RFC2460] Deering, S. and R. Hinden, "Internet Protocol, Version 6 (IPv6) Specification", RFC 2460, December 1998.

[RFC2460]Deering,S.和R.Hinden,“互联网协议,第6版(IPv6)规范”,RFC 2460,1998年12月。

[RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688, January 2004.

[RFC3688]Mealling,M.“IETF XML注册表”,BCP 81,RFC 3688,2004年1月。

[RFC4861] Narten, T., Nordmark, E., Simpson, W., and H. Soliman, "Neighbor Discovery for IP version 6 (IPv6)", RFC 4861, September 2007.

[RFC4861]Narten,T.,Nordmark,E.,Simpson,W.,和H.Soliman,“IP版本6(IPv6)的邻居发现”,RFC 48612007年9月。

[RFC4862] Thomson, S., Narten, T., and T. Jinmei, "IPv6 Stateless Address Autoconfiguration", RFC 4862, September 2007.

[RFC4862]Thomson,S.,Narten,T.,和T.Jinmei,“IPv6无状态地址自动配置”,RFC 48622007年9月。

[RFC4941] Narten, T., Draves, R., and S. Krishnan, "Privacy Extensions for Stateless Address Autoconfiguration in IPv6", RFC 4941, September 2007.

[RFC4941]Narten,T.,Draves,R.,和S.Krishnan,“IPv6中无状态地址自动配置的隐私扩展”,RFC 49412007年9月。

[RFC6020] Bjorklund, M., "YANG - A Data Modeling Language for the Network Configuration Protocol (NETCONF)", RFC 6020, October 2010.

[RFC6020]Bjorklund,M.“YANG-网络配置协议(NETCONF)的数据建模语言”,RFC6020,2010年10月。

[RFC6241] Enns, R., Bjorklund, M., Schoenwaelder, J., and A. Bierman, "Network Configuration Protocol (NETCONF)", RFC 6241, June 2011.

[RFC6241]Enns,R.,Bjorklund,M.,Schoenwaeld,J.,和A.Bierman,“网络配置协议(NETCONF)”,RFC 62412011年6月。

[RFC6991] Schoenwaelder, J., "Common YANG Data Types", RFC 6991, July 2013.

[RFC6991]Schoenwaeld,J.,“常见的杨氏数据类型”,RFC 69912013年7月。

[RFC7223] Bjorklund, M., "A YANG Data Model for Interface Management", RFC 7223, May 2014.

[RFC7223]Bjorklund,M.“用于接口管理的YANG数据模型”,RFC 7223,2014年5月。

[XML] Bray, T., Paoli, J., Sperberg-McQueen, C., Maler, E., and F. Yergeau, "Extensible Markup Language (XML) 1.0 (Fifth Edition)", W3C Recommendation, November 2008, <http://www.w3.org/TR/xml/>.

[XML]Bray,T.,Paoli,J.,Sperberg McQueen,C.,Maler,E.,和F.Yergeau,“可扩展标记语言(XML)1.0(第五版)”,W3C建议,2008年11月<http://www.w3.org/TR/xml/>.

8.2. Informative References
8.2. 资料性引用

[RFC0826] Plummer, D., "Ethernet Address Resolution Protocol: Or converting network protocol addresses to 48.bit Ethernet address for transmission on Ethernet hardware", STD 37, RFC 826, November 1982.

[RFC0826]Plummer,D.,“以太网地址解析协议:或将网络协议地址转换为48位以太网地址,以便在以太网硬件上传输”,STD 37,RFC 826,1982年11月。

[RFC4293] Routhier, S., "Management Information Base for the Internet Protocol (IP)", RFC 4293, April 2006.

[RFC4293]Routhier,S.,“互联网协议(IP)的管理信息库”,RFC 4293,2006年4月。

[RFC6242] Wasserman, M., "Using the NETCONF Protocol over Secure Shell (SSH)", RFC 6242, June 2011.

[RFC6242]Wasserman,M.“在安全Shell(SSH)上使用NETCONF协议”,RFC6242,2011年6月。

[RFC6536] Bierman, A. and M. Bjorklund, "Network Configuration Protocol (NETCONF) Access Control Model", RFC 6536, March 2012.

[RFC6536]Bierman,A.和M.Bjorklund,“网络配置协议(NETCONF)访问控制模型”,RFC 65362012年3月。

[RFC7217] Gont, F., "A Method for Generating Semantically Opaque Interface Identifiers with IPv6 Stateless Address Autoconfiguration (SLAAC)", RFC 7217, April 2014.

[RFC7217]Gont,F.“使用IPv6无状态地址自动配置(SLAAC)生成语义不透明接口标识符的方法”,RFC 72172014年4月。

[ROUTING-MGMT] Lhotka, L., "A YANG Data Model for Routing Management", Work in Progress, May 2014.

[ROUTING-MGMT]Lhotka,L.,“用于路由管理的YANG数据模型”,正在进行的工作,2014年5月。

Appendix A.  Example: NETCONF <get> Reply
        
Appendix A.  Example: NETCONF <get> Reply
        

This section gives an example of a reply to the NETCONF <get> request for a device that implements the data model defined in this document. The example is written in XML [XML].

本节给出了对实现本文档中定义的数据模型的设备的NETCONF<get>请求的回复示例。该示例是用XML[XML]编写的。

   <rpc-reply
      xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"
      message-id="101">
    <data>
      <interfaces
          xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces"
          xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">
        <interface>
          <name>eth0</name>
          <type>ianaift:ethernetCsmacd</type>
          <ipv4 xmlns="urn:ietf:params:xml:ns:yang:ietf-ip">
            <address>
              <ip>192.0.2.1</ip>
              <prefix-length>24</prefix-length>
            </address>
          </ipv4>
          <ipv6 xmlns="urn:ietf:params:xml:ns:yang:ietf-ip">
            <mtu>1280</mtu>
            <address>
              <ip>2001:db8::10</ip>
              <prefix-length>32</prefix-length>
            </address>
            <dup-addr-detect-transmits>0</dup-addr-detect-transmits>
          </ipv6>
        </interface>
      </interfaces>
        
   <rpc-reply
      xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"
      message-id="101">
    <data>
      <interfaces
          xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces"
          xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">
        <interface>
          <name>eth0</name>
          <type>ianaift:ethernetCsmacd</type>
          <ipv4 xmlns="urn:ietf:params:xml:ns:yang:ietf-ip">
            <address>
              <ip>192.0.2.1</ip>
              <prefix-length>24</prefix-length>
            </address>
          </ipv4>
          <ipv6 xmlns="urn:ietf:params:xml:ns:yang:ietf-ip">
            <mtu>1280</mtu>
            <address>
              <ip>2001:db8::10</ip>
              <prefix-length>32</prefix-length>
            </address>
            <dup-addr-detect-transmits>0</dup-addr-detect-transmits>
          </ipv6>
        </interface>
      </interfaces>
        
      <interfaces-state
          xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces"
          xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">
        <interface>
          <name>eth0</name>
          <type>ianaift:ethernetCsmacd</type>
          <!-- other parameters from ietf-interfaces omitted -->
        
      <interfaces-state
          xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces"
          xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">
        <interface>
          <name>eth0</name>
          <type>ianaift:ethernetCsmacd</type>
          <!-- other parameters from ietf-interfaces omitted -->
        
          <ipv4 xmlns="urn:ietf:params:xml:ns:yang:ietf-ip">
            <forwarding>false</forwarding>
            <mtu>1500</mtu>
            <address>
              <ip>192.0.2.1</ip>
              <prefix-length>24</prefix-length>
              <origin>static</origin>
            </address>
            <neighbor>
              <ip>192.0.2.2</ip>
              <link-layer-address>00:01:02:03:04:05</link-layer-address>
            </neighbor>
          </ipv4>
          <ipv6 xmlns="urn:ietf:params:xml:ns:yang:ietf-ip">
            <forwarding>false</forwarding>
            <mtu>1500</mtu>
            <address>
              <ip>2001:db8::10</ip>
              <prefix-length>32</prefix-length>
              <origin>static</origin>
              <status>preferred</status>
            </address>
            <address>
              <ip>2001:db8::1:100</ip>
              <prefix-length>32</prefix-length>
              <origin>dhcp</origin>
              <status>preferred</status>
            </address>
            <neighbor>
              <ip>2001:db8::1</ip>
              <link-layer-address>00:01:02:03:04:05</link-layer-address>
              <origin>dynamic</origin>
              <is-router/>
              <state>reachable</state>
            </neighbor>
            <neighbor>
              <ip>2001:db8::4</ip>
              <origin>dynamic</origin>
              <state>incomplete</state>
            </neighbor>
          </ipv6>
        </interface>
      </interfaces-state>
    </data>
   </rpc-reply>
        
          <ipv4 xmlns="urn:ietf:params:xml:ns:yang:ietf-ip">
            <forwarding>false</forwarding>
            <mtu>1500</mtu>
            <address>
              <ip>192.0.2.1</ip>
              <prefix-length>24</prefix-length>
              <origin>static</origin>
            </address>
            <neighbor>
              <ip>192.0.2.2</ip>
              <link-layer-address>00:01:02:03:04:05</link-layer-address>
            </neighbor>
          </ipv4>
          <ipv6 xmlns="urn:ietf:params:xml:ns:yang:ietf-ip">
            <forwarding>false</forwarding>
            <mtu>1500</mtu>
            <address>
              <ip>2001:db8::10</ip>
              <prefix-length>32</prefix-length>
              <origin>static</origin>
              <status>preferred</status>
            </address>
            <address>
              <ip>2001:db8::1:100</ip>
              <prefix-length>32</prefix-length>
              <origin>dhcp</origin>
              <status>preferred</status>
            </address>
            <neighbor>
              <ip>2001:db8::1</ip>
              <link-layer-address>00:01:02:03:04:05</link-layer-address>
              <origin>dynamic</origin>
              <is-router/>
              <state>reachable</state>
            </neighbor>
            <neighbor>
              <ip>2001:db8::4</ip>
              <origin>dynamic</origin>
              <state>incomplete</state>
            </neighbor>
          </ipv6>
        </interface>
      </interfaces-state>
    </data>
   </rpc-reply>
        

Author's Address

作者地址

Martin Bjorklund Tail-f Systems

Martin Bjorklund Tail-f系统

   EMail: mbj@tail-f.com
        
   EMail: mbj@tail-f.com