netconf.xml 9.55 KB
Newer Older
1 2 3 4 5 6 7 8
<!--
 - Copyright (C) 2018 Internet Systems Consortium, Inc. ("ISC")
 -
 - This Source Code Form is subject to the terms of the Mozilla Public
 - License, v. 2.0. If a copy of the MPL was not distributed with this
 - file, You can obtain one at http://mozilla.org/MPL/2.0/.
-->
<!-- Converted by db4-upgrade version 1.1 -->
Tomek Mrugalski's avatar
Tomek Mrugalski committed
9
<chapter xmlns="http://docbook.org/ns/docbook" version="5.0" xml:id="kea-netconf">
10 11 12 13 14 15 16
  <title>YANG/NETCONF Support</title>

  <section xml:id="netconf-overview">
    <title>Overview</title>
    <para>Kea 1.5.0 introduced an optional support for YANG/NETCONF
    interface. </para>

Tomek Mrugalski's avatar
Tomek Mrugalski committed
17 18 19
    <para>This bare bones documentation is a work in progress. Its
    current purpose is to let engineers joining the project or perhaps
    advanced early adopters to get up to speed quickly.</para>
20 21 22 23 24
  </section>

  <section xml:id="netconf-install">
    <title>Installing NETCONF Dependencies</title>

Tomek Mrugalski's avatar
Tomek Mrugalski committed
25 26 27 28 29
    <para>Note that to get NETCONF capabilities Kea uses Sysrepo software, which has many
    dependencies. Unfortunately, many of them are not available as packages, so some need
    to be compiled manually.</para>

    <para>The following installation instruction was tested on Ubuntu 18.04.</para>
30

Tomek Mrugalski's avatar
Tomek Mrugalski committed
31 32
    <para>STEP 1. Install dependencies. Note that some of those dependencies are likely to
    be present in your system already.
33 34 35

<screen>
$ sudo apt-get install git cmake build-essential bison flex libpcre3-dev libev-dev libavl-dev libprotobuf-c-dev protobuf-c-compiler
Tomek Mrugalski's avatar
Tomek Mrugalski committed
36 37 38
</screen>

    </para>
39

Tomek Mrugalski's avatar
Tomek Mrugalski committed
40
    <para>STEP 2. Install libyang. Download libyang from
41
    https://github.com/CESNET/libyang.git. Checkout the devel branch.
42 43

<screen>
44 45 46
    git clone https://github.com/CESNET/libyang.git
    cd libyang
    git checkout devel
47 48 49 50 51
    mkdir build
    cd build
    cmake ..
    make
    sudo make install
Tomek Mrugalski's avatar
Tomek Mrugalski committed
52
</screen>
53

Tomek Mrugalski's avatar
Tomek Mrugalski committed
54
    For detailed build instructions, see https://github.com/CESNET/libyang/.</para>
55

56
    <para>STEP 3. Install syrepo. Download sysrepo from
57
    https://github.com/sysrepo/sysrepo.git. Checkout the last devel branch.
58 59

<screen>
60 61 62
git clone https://github.com/sysrepo/sysrepo.git
cd sysrepo
git checkout devel
63 64 65 66 67 68 69
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Debug -DGEN_LANGUAGE_BINDINGS=ON -DGEN_CPP_BINDINGS=ON\
      -DGEN_PYTHON_BINDINGS=OFF -DGEN_LUA_BINDINGS=OFF -DENABLE_TESTS=OFF ..
make
sudo make install
</screen>
Tomek Mrugalski's avatar
Tomek Mrugalski committed
70 71 72

For detailed instructions, see Build &amp; Installation Steps Section on the project page
located at https://github.com/sysrepo/sysrepo.
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123
</para>
</section>

  <section>
    <title>Quick sysrepo overview</title>
    <para>
    This section covers a rather brief overview of a subset of available
    functionality in sysrepo. For more complete document, see sysrepo homepage.
    You may also want to take a look at
    <uri xmlns:xlink="http://www.w3.org/1999/xlink"
         xlink:href="https://github.com/isc-projects/kea-yang">notes made during a series of IETF
    Hackathons</uri>.
    </para>

    <para>
      List currently installed YANG modules:
<screen>
  $ sysrepoctl -l
</screen>

After installation the result should be similar to this:
<screen>
Sysrepo schema directory: /home/thomson/devel/sysrepo-0.7.4/build/repository/yang/
Sysrepo data directory:   /home/thomson/devel/sysrepo-0.7.4/build/repository/data/
(Do not alter contents of these directories manually)

Module Name                | Revision   | Conformance | Data Owner          | Permissions | Submodules                    | Enabled Features
-----------------------------------------------------------------------------------------------------------------------------------------------
ietf-netconf-notifications | 2012-02-06 | Installed   | root:root           | 666         |                               |
ietf-netconf               | 2011-06-01 | Imported    |                     |             |                               |
ietf-netconf-acm           | 2012-02-22 | Imported    |                     |             |                               |
nc-notifications           | 2008-07-14 | Installed   | root:root           | 666         |                               |
notifications              | 2008-07-14 | Installed   | root:root           | 666         |                               |
turing-machine             | 2013-12-27 | Installed   | root:root           | 666         |                               |
iana-if-type               | 2014-05-08 | Installed   |                     |             |                               |
ietf-interfaces            | 2014-05-08 | Installed   | root:root           | 666         |                               |
ietf-ip                    | 2014-06-16 | Installed   |                     |             |                               |
</screen>
    </para>

    <para>
Installing Kea YANG modules. There are two major modules that Kea is able to
support: kea-dhcp4-server and ietf-dhcp6-server. Note that while there is an
active effort at DHC working group at IETF to develop an DHCPv6 YANG model,
similar initiative for DHCPv4 died long time ago. As such, Kea uses IETF model
for DHCPv6 and its own dedicated model for DHCPv4. Those two models have extra
models as dependencies. The dependency models are also provided in
src/lib/libyang/models. To install Kea models, do the following:

<screen>
cd src/lib/yang/models
124 125
sudo sysrepoctl -i -g kea-dhcp4-server.yang -s /home/thomson/devel/sysrepo-0.7.4/build/repository/yang/ -s ./
sudo sysrepoctl -i -g ietf-dhcp6-server.yang -s /home/thomson/devel/sysrepo-0.7.4/build/repository/yang/ -s ./
126 127 128 129 130 131 132 133 134
</screen>

Note the first -s parameter specifies the location of your YANG schema
directory. You can check it with sysrepoctl -l. This is a parameter that is
configured during sysrepo compilation.


The installation should look similar to the following:
<screen>
135 136 137 138 139 140 141 142 143 144
$ sudo sysrepoctl -i -g ietf-dhcp6-server.yang -s /home/thomson/devel/sysrepo-0.7.4/build/repository/yang/ -s ./
Installing a new module from file 'ietf-dhcp6-server.yang'...
Installing the YANG file to '/home/thomson/devel/sysrepo-0.7.4/build/repository/yang/ietf-dhcp6-server@2018-07-14.yang'...
Resolving dependency: 'ietf-dhcp6-server' imports 'ietf-dhcp6-options'...
Installing the YANG file to '/home/thomson/devel/sysrepo-0.7.4/build/repository/yang/ietf-dhcp6-options@2018-07-14.yang'...
Resolving dependency: 'ietf-dhcp6-options' imports 'ietf-dhcp6-types'...
Installing the YANG file to '/home/thomson/devel/sysrepo-0.7.4/build/repository/yang/ietf-dhcp6-types@2018-07-14.yang'...
Resolving dependency: 'ietf-dhcp6-server' imports 'ietf-dhcp6-types'...
Installing the YANG file to '/home/thomson/devel/sysrepo-0.7.4/build/repository/yang/ietf-dhcp6-types@2018-07-14.yang'...
Resolving dependency: 'ietf-dhcp6-server' imports 'ietf-interfaces'...
145
Schema of the module ietf-interfaces is already installed, skipping...
146 147 148 149 150 151 152 153
Installing data files for module 'ietf-dhcp6-server'...
Resolving dependency: 'ietf-dhcp6-server' imports 'ietf-dhcp6-options'...
Skipping installation of data files for module 'ietf-dhcp6-options'...
Resolving dependency: 'ietf-dhcp6-options' imports 'ietf-dhcp6-types'...
Skipping installation of data files for module 'ietf-dhcp6-types'...
Resolving dependency: 'ietf-dhcp6-server' imports 'ietf-dhcp6-types'...
Skipping installation of data files for module 'ietf-dhcp6-types'...
Resolving dependency: 'ietf-dhcp6-server' imports 'ietf-interfaces'...
154 155 156
Installing data files for module 'ietf-interfaces'...
Notifying sysrepo about the change...
Install operation completed successfully.
Tomek Mrugalski's avatar
Tomek Mrugalski committed
157
</screen>
158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177

You can confirm whether the models are imported correctly by using sysrepoctl -l

<screen>
$ sysrepoctl -l
Sysrepo schema directory: /home/thomson/devel/sysrepo-0.7.4/build/repository/yang/
Sysrepo data directory:   /home/thomson/devel/sysrepo-0.7.4/build/repository/data/
(Do not alter contents of these directories manually)

Module Name                | Revision   | Conformance | Data Owner          | Permissions | Submodules                    | Enabled Features
-----------------------------------------------------------------------------------------------------------------------------------------------
ietf-netconf-notifications | 2012-02-06 | Installed   | root:root           | 666         |                               |
ietf-netconf               | 2011-06-01 | Imported    |                     |             |                               |
ietf-netconf-acm           | 2012-02-22 | Imported    |                     |             |                               |
nc-notifications           | 2008-07-14 | Installed   | root:root           | 666         |                               |
notifications              | 2008-07-14 | Installed   | root:root           | 666         |                               |
turing-machine             | 2013-12-27 | Installed   | root:root           | 666         |                               |
iana-if-type               | 2014-05-08 | Installed   |                     |             |                               |
ietf-interfaces            | 2014-05-08 | Installed   | root:root           | 666         |                               |
ietf-ip                    | 2014-06-16 | Installed   |                     |             |                               |
178
kea-dhcp4-server           | 2018-07-14 | Installed   | root:root           | 666         |                               |
179 180 181 182 183 184 185 186
ietf-dhcpv6-server         | 2018-03-04 | Installed   | root:root           | 666         |                               |
ietf-dhcpv6-options        | 2018-03-04 | Imported    |                     |             |                               |
ietf-dhcpv6-types          | 2018-01-30 | Imported    |                     |             |                               |
</screen>
</para>

  </section>
</chapter>