2019-06-06 18:25:46 +02:00
|
|
|
.. _netconf:
|
|
|
|
|
2021-08-18 20:06:44 +02:00
|
|
|
YANG/NETCONF
|
|
|
|
============
|
2019-06-06 18:25:46 +02:00
|
|
|
|
|
|
|
.. _netconf-overview:
|
|
|
|
|
|
|
|
Overview
|
2021-08-18 20:06:44 +02:00
|
|
|
--------
|
2019-06-06 18:25:46 +02:00
|
|
|
|
2021-08-18 20:06:44 +02:00
|
|
|
The Network Configuration Protocol, or NETCONF, is a network management protocol defined
|
2023-04-07 15:12:25 +00:00
|
|
|
in `RFC 4741 <https://tools.ietf.org/html/rfc4741>`__. It uses the YANG modeling language,
|
2021-08-18 20:06:44 +02:00
|
|
|
defined in `RFC 6020 <https://tools.ietf.org/html/rfc6020>`__, to provide a uniform way
|
2023-04-07 15:12:25 +00:00
|
|
|
of handling the configuration syntax of various networking devices. Kea provides optional
|
2023-06-06 13:43:11 +03:00
|
|
|
support for a YANG/NETCONF interface with the :iscman:`kea-netconf` agent.
|
2019-06-06 18:25:46 +02:00
|
|
|
|
|
|
|
.. _netconf-install:
|
|
|
|
|
|
|
|
Installing NETCONF
|
2021-08-18 20:06:44 +02:00
|
|
|
------------------
|
2019-06-06 18:25:46 +02:00
|
|
|
|
2022-11-09 10:51:43 +02:00
|
|
|
To get its NETCONF capabilities, Kea requires the v2 versions of libyang and
|
2023-04-07 15:12:25 +00:00
|
|
|
Sysrepo. The specific versions that have been thoroughly tested with Kea are:
|
2022-10-05 21:14:58 +03:00
|
|
|
|
2022-11-09 10:51:43 +02:00
|
|
|
* libyang v2.1.4
|
|
|
|
* sysrepo v2.2.12
|
|
|
|
* libyang-cpp v1.1.0 (ae7d649ea75da081725c119dd553b2ef3121a6f8)
|
|
|
|
* sysrepo-cpp v1.1.0 (02634174ffc60568301c3d9b9b7cf710cff6a586)
|
|
|
|
|
|
|
|
.. note::
|
|
|
|
|
2023-04-07 15:12:25 +00:00
|
|
|
For users who are unable to upgrade to one of the versions of libyang
|
|
|
|
and Sysrepo listed above, these are the oldest versions known to work
|
|
|
|
reliably with current Kea releases:
|
2022-11-09 10:51:43 +02:00
|
|
|
|
|
|
|
* libyang v2.0.256 (56d4e07ef1cdeab3eb2e6700247f83ec9148edcc)
|
|
|
|
* sysrepo v2.1.84
|
|
|
|
* libyang-cpp v1.1.0 (7824d9a862f2dc1d8ad4f6a90ab6cee9200f7c81)
|
|
|
|
* sysrepo-cpp v1.1.0 (e66b2f0c53a428eeb743d355cf86fb30e8e491f1)
|
2022-10-05 21:14:58 +03:00
|
|
|
|
|
|
|
.. note::
|
|
|
|
|
2023-06-06 13:43:11 +03:00
|
|
|
:iscman:`kea-netconf` may be compatible with later versions of libyang and
|
2023-04-07 15:12:25 +00:00
|
|
|
Sysrepo, but only the versions listed above have been thoroughly
|
|
|
|
tested by ISC.
|
2022-10-05 21:14:58 +03:00
|
|
|
|
2023-04-07 15:12:25 +00:00
|
|
|
Installing from packages is recommended, if they are provided by the system. If
|
|
|
|
not, users can build from sources following the directions below, which
|
|
|
|
should work on all popular operating systems.
|
2019-06-06 18:25:46 +02:00
|
|
|
|
2021-07-28 11:48:00 +03:00
|
|
|
.. _libyang-install-sources:
|
2019-06-06 18:25:46 +02:00
|
|
|
|
2022-10-05 21:14:58 +03:00
|
|
|
Installing ``libyang`` From Sources
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
2019-06-06 18:25:46 +02:00
|
|
|
|
2021-07-28 11:48:00 +03:00
|
|
|
.. code-block:: console
|
2019-06-06 18:25:46 +02:00
|
|
|
|
2021-07-28 11:48:00 +03:00
|
|
|
$ git clone https://github.com/CESNET/libyang.git
|
|
|
|
$ cd libyang
|
2022-11-09 10:51:43 +02:00
|
|
|
$ git checkout v2.1.4
|
2021-07-28 11:48:00 +03:00
|
|
|
$ mkdir build
|
|
|
|
$ cd build
|
2022-10-05 21:14:58 +03:00
|
|
|
$ cmake ..
|
2021-07-28 11:48:00 +03:00
|
|
|
$ make
|
2022-10-05 21:14:58 +03:00
|
|
|
$ make install
|
2019-06-06 18:25:46 +02:00
|
|
|
|
2021-07-28 11:48:00 +03:00
|
|
|
.. _sysrepo-install-sources:
|
2019-06-06 18:25:46 +02:00
|
|
|
|
2022-10-05 21:14:58 +03:00
|
|
|
Installing ``sysrepo`` From Sources
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
2019-06-06 18:25:46 +02:00
|
|
|
|
2021-07-28 11:48:00 +03:00
|
|
|
.. code-block:: console
|
|
|
|
|
|
|
|
$ git clone https://github.com/sysrepo/sysrepo.git
|
|
|
|
$ cd sysrepo
|
2022-11-09 10:51:43 +02:00
|
|
|
$ git checkout v2.2.12
|
2021-07-28 11:48:00 +03:00
|
|
|
$ mkdir build
|
|
|
|
$ cd build
|
2022-10-05 21:14:58 +03:00
|
|
|
$ cmake -DREPO_PATH=/etc/sysrepo ..
|
2021-07-28 11:48:00 +03:00
|
|
|
$ make
|
|
|
|
$ make install # without sudo if you're doing development and want to run unit tests
|
|
|
|
|
2022-10-05 21:14:58 +03:00
|
|
|
.. _libyang-cpp-install-sources:
|
|
|
|
|
|
|
|
Installing ``libyang-cpp`` From Sources
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
.. code-block:: console
|
|
|
|
|
|
|
|
$ git clone https://github.com/CESNET/libyang-cpp.git
|
|
|
|
$ cd libyang-cpp
|
2022-11-09 10:51:43 +02:00
|
|
|
$ git checkout ae7d649ea75da081725c119dd553b2ef3121a6f8
|
2022-10-05 21:14:58 +03:00
|
|
|
$ mkdir build
|
|
|
|
$ cd build
|
|
|
|
$ cmake -DBUILD_TESTING=OFF ..
|
|
|
|
$ make
|
|
|
|
$ make install
|
|
|
|
|
|
|
|
.. _sysrepo-cpp-install-sources:
|
|
|
|
|
|
|
|
Installing ``sysrepo-cpp`` From Sources
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
.. code-block:: console
|
|
|
|
|
|
|
|
$ git clone https://github.com/sysrepo/sysrepo-cpp.git
|
|
|
|
$ cd sysrepo-cpp
|
2022-11-09 10:51:43 +02:00
|
|
|
$ git checkout 02634174ffc60568301c3d9b9b7cf710cff6a586
|
2022-10-05 21:14:58 +03:00
|
|
|
$ mkdir build
|
|
|
|
$ cd build
|
|
|
|
$ cmake -DBUILD_TESTING=OFF ..
|
|
|
|
$ make
|
|
|
|
$ make install
|
|
|
|
|
|
|
|
.. _compiling-with-netconf:
|
|
|
|
|
|
|
|
Compiling With NETCONF
|
|
|
|
----------------------
|
|
|
|
|
|
|
|
1. Obtain the Kea sources.
|
|
|
|
|
|
|
|
.. code-block:: console
|
|
|
|
|
|
|
|
$ git clone gitlab.isc.org/isc-projects/kea.git
|
|
|
|
$ cd kea
|
|
|
|
|
|
|
|
2. Configure the build.
|
|
|
|
|
|
|
|
.. code-block:: console
|
|
|
|
|
|
|
|
$ autoreconf -f -i
|
|
|
|
$ ./configure --with-libyang --with-libyang-cpp --with-sysrepo --with-sysrepo-cpp
|
|
|
|
|
|
|
|
.. note::
|
|
|
|
|
|
|
|
If any of the libraries are installed in a custom location, the
|
|
|
|
``--with`` flags accept the installations paths as values.
|
|
|
|
|
2023-04-07 15:12:25 +00:00
|
|
|
3. Check ``config.report`` to verify NETCONF support.
|
2022-10-05 21:14:58 +03:00
|
|
|
|
|
|
|
::
|
|
|
|
|
|
|
|
NETCONF:
|
|
|
|
yes
|
|
|
|
|
|
|
|
libyang:
|
|
|
|
LIBYANG_CPPFLAGS:
|
|
|
|
LIBYANG_INCLUDEDIR: -I/usr/local/include
|
2022-11-09 10:51:43 +02:00
|
|
|
LIBYANG_LIBS: -L/usr/local/lib -lyang -Wl,-R/usr/local/lib -lyang
|
2022-10-05 21:14:58 +03:00
|
|
|
LIBYANG_PREFIX: /usr/local
|
2022-11-09 10:51:43 +02:00
|
|
|
LIBYANG_VERSION: 2.1.4
|
2022-10-05 21:14:58 +03:00
|
|
|
|
|
|
|
libyang-cpp:
|
|
|
|
LIBYANGCPP_CPPFLAGS:
|
|
|
|
LIBYANGCPP_INCLUDEDIR: -I/usr/local/include
|
2022-11-09 10:51:43 +02:00
|
|
|
LIBYANGCPP_LIBS: -L/usr/local/lib -lyang-cpp -Wl,-R/usr/local/lib -lyang-cpp
|
2022-10-05 21:14:58 +03:00
|
|
|
LIBYANGCPP_PREFIX: /usr/local
|
|
|
|
LIBYANGCPP_VERSION: 1.1.0
|
|
|
|
|
|
|
|
sysrepo:
|
|
|
|
SYSREPO_CPPFLAGS:
|
|
|
|
SYSREPO_INCLUDEDIR: -I/usr/local/include
|
2022-11-09 10:51:43 +02:00
|
|
|
SYSREPO_LIBS: -L/usr/local/lib -lsysrepo -Wl,-R/usr/local/lib -lsysrepo
|
2022-10-05 21:14:58 +03:00
|
|
|
SYSREPO_PREFIX: /usr/local
|
2022-11-09 10:51:43 +02:00
|
|
|
SYSREPO_VERSION: 2.2.12
|
2022-10-05 21:14:58 +03:00
|
|
|
|
|
|
|
SR_REPO_PATH: /etc/sysrepo
|
2022-11-09 10:51:43 +02:00
|
|
|
SR_PLUGINS_PATH: /usr/local/lib/sysrepo/plugins
|
|
|
|
SRPD_PLUGINS_PATH: /usr/local/lib/sysrepo-plugind/plugins
|
2022-10-05 21:14:58 +03:00
|
|
|
|
|
|
|
sysrepo-cpp:
|
|
|
|
SYSREPOCPP_CPPFLAGS:
|
|
|
|
SYSREPOCPP_INCLUDEDIR: -I/usr/local/include
|
2022-11-09 10:51:43 +02:00
|
|
|
SYSREPOCPP_LIBS: -L/usr/local/lib -lsysrepo-cpp -Wl,-R/usr/local/lib -lsysrepo-cpp
|
2022-10-05 21:14:58 +03:00
|
|
|
SYSREPOCPP_PREFIX : /usr/local
|
|
|
|
SYSREPOCPP_VERSION: 1.1.0
|
|
|
|
|
2023-04-07 15:12:25 +00:00
|
|
|
4. Build as usual.
|
2022-10-05 21:14:58 +03:00
|
|
|
|
|
|
|
$ make
|
|
|
|
|
2021-07-28 11:48:00 +03:00
|
|
|
.. _sysrepo-overview:
|
2019-06-06 18:25:46 +02:00
|
|
|
|
|
|
|
Quick Sysrepo Overview
|
2021-08-18 20:06:44 +02:00
|
|
|
----------------------
|
2019-06-06 18:25:46 +02:00
|
|
|
|
2021-12-06 22:45:56 +00:00
|
|
|
This section offers a brief overview of a subset of available
|
2022-10-05 21:14:58 +03:00
|
|
|
functions in Sysrepo. For more complete information, see the
|
|
|
|
`Sysrepo homepage <https://www.sysrepo.org>`__.
|
2019-06-06 18:25:46 +02:00
|
|
|
|
2022-10-05 21:14:58 +03:00
|
|
|
In YANG, configurations and state data are described in YANG syntax
|
2023-04-07 15:12:25 +00:00
|
|
|
in module files named ``<module-name>[@<revision>].yang``
|
2019-06-06 18:25:46 +02:00
|
|
|
|
2023-04-07 15:12:25 +00:00
|
|
|
The revision part is optional and follows the ``YYYY-MM-DD`` format. An alternate
|
2019-06-06 18:25:46 +02:00
|
|
|
XML syntax YIN is defined but less user-friendly. Top-level modules are
|
|
|
|
named in Kea models (a short version of schema models).
|
|
|
|
|
2021-12-06 22:45:56 +00:00
|
|
|
There are two major modules that Kea is able to support: ``kea-dhcp4-server`` and
|
|
|
|
``kea-dhcp6-server``. While there is an active effort in the DHC working group at
|
2021-07-16 14:34:18 +03:00
|
|
|
IETF to develop a DHCPv6 YANG model, a similar initiative in the past for DHCPv4
|
|
|
|
failed. Therefore, Kea uses its own dedicated models for DHCPv4 and DHCPv6 but
|
|
|
|
partially supports the IETF model for DHCPv6.
|
2019-06-06 18:25:46 +02:00
|
|
|
|
2023-04-07 15:12:25 +00:00
|
|
|
All of the models have extra modules as dependencies, which are also provided.
|
2022-10-05 21:14:58 +03:00
|
|
|
All of the modules can be found in ``src/share/yang/modules`` in sources and in
|
2023-04-07 15:12:25 +00:00
|
|
|
``share/kea/yang/modules`` in the installation directory. This directory is
|
2022-10-05 21:14:58 +03:00
|
|
|
referred to as `${share_directory}` in the commands below.
|
2019-06-06 18:25:46 +02:00
|
|
|
|
2023-04-07 15:12:25 +00:00
|
|
|
To install modules from sources or upgrade them from older revisions,
|
|
|
|
run the following command. In the case of a revision upgrade, YANG
|
2022-10-05 21:14:58 +03:00
|
|
|
data will be migrated automatically to the new module schema.
|
2019-06-06 18:25:46 +02:00
|
|
|
|
2021-07-16 14:34:18 +03:00
|
|
|
.. code-block:: console
|
2019-06-06 18:25:46 +02:00
|
|
|
|
2022-10-05 21:14:58 +03:00
|
|
|
$ ${share_directory}/yang/modules/utils/reinstall.sh
|
|
|
|
|
2023-04-07 15:12:25 +00:00
|
|
|
However, if there are any issues during the upgrade process, and data can be recreated from a NETCONF
|
|
|
|
client or through other means, Kea modules can be easily uninstalled before installing again
|
|
|
|
via this command:
|
2022-10-05 21:14:58 +03:00
|
|
|
|
|
|
|
.. code-block:: console
|
|
|
|
|
|
|
|
$ ${share_directory}/yang/modules/utils/reinstall.sh -u
|
2019-06-06 18:25:46 +02:00
|
|
|
|
2023-04-07 15:12:25 +00:00
|
|
|
This script should be able to reinstall Sysrepo. However, the ``-s``
|
|
|
|
flag can also be used to specify a path:
|
2019-06-06 18:25:46 +02:00
|
|
|
|
2019-07-15 08:32:02 +02:00
|
|
|
.. code-block:: console
|
2019-06-06 18:25:46 +02:00
|
|
|
|
2021-07-16 14:34:18 +03:00
|
|
|
$ ./src/share/yang/modules/utils/reinstall.sh -s /path/to/sysrepo
|
|
|
|
|
2021-12-06 22:45:56 +00:00
|
|
|
To individually install all modules:
|
2021-07-16 14:34:18 +03:00
|
|
|
|
|
|
|
.. code-block:: console
|
2019-06-06 18:25:46 +02:00
|
|
|
|
2021-07-16 14:34:18 +03:00
|
|
|
$ cd ./src/share/yang/modules
|
|
|
|
$ sysrepoctl -i ./ietf-dhcpv6-server*.yang
|
|
|
|
$ sysrepoctl -i ./kea-dhcp4-server*.yang
|
|
|
|
$ sysrepoctl -i ./kea-dhcp6-server*.yang
|
|
|
|
...
|
2019-06-06 18:25:46 +02:00
|
|
|
|
|
|
|
The installation should look similar to the following:
|
|
|
|
|
2019-07-15 08:32:02 +02:00
|
|
|
.. code-block:: console
|
2019-06-06 18:25:46 +02:00
|
|
|
|
2021-07-16 14:34:18 +03:00
|
|
|
$ ./src/share/yang/modules/utils/reinstall.sh
|
2022-10-05 21:14:58 +03:00
|
|
|
[INF] Connection 2 created.
|
|
|
|
[INF] Module "keatest-module" was installed.
|
2022-11-07 17:43:07 +02:00
|
|
|
[INF] File "keatest-module@2022-11-30.yang" was installed.
|
2022-10-05 21:14:58 +03:00
|
|
|
[INF] No datastore changes to apply.
|
|
|
|
[INF] Connection 4 created.
|
|
|
|
[ERR] Module "ietf-interfaces@2018-02-20" already installed.
|
|
|
|
[INF] No datastore changes to apply.
|
|
|
|
[INF] Connection 7 created.
|
|
|
|
[ERR] Module "ietf-dhcpv6-client" is already in sysrepo.
|
|
|
|
[INF] No datastore changes to apply.
|
|
|
|
[INF] Connection 9 created.
|
|
|
|
[ERR] Module "ietf-dhcpv6-relay" is already in sysrepo.
|
|
|
|
[INF] No datastore changes to apply.
|
|
|
|
[INF] Connection 11 created.
|
|
|
|
[ERR] Module "ietf-dhcpv6-server" is already in sysrepo.
|
|
|
|
[INF] No datastore changes to apply.
|
|
|
|
[INF] Connection 13 created.
|
|
|
|
[ERR] Write permission "ietf-yang-types" check failed.
|
|
|
|
[INF] No datastore changes to apply.
|
|
|
|
[INF] Connection 15 created.
|
|
|
|
[ERR] Module "ietf-dhcpv6-options" is already in sysrepo.
|
|
|
|
[INF] No datastore changes to apply.
|
|
|
|
[INF] Connection 17 created.
|
|
|
|
[ERR] Module "ietf-dhcpv6-types" is already in sysrepo.
|
|
|
|
[INF] No datastore changes to apply.
|
|
|
|
[INF] Connection 21 created.
|
|
|
|
[INF] Module "kea-types" was installed.
|
|
|
|
[INF] File "kea-types@2019-08-12.yang" was installed.
|
|
|
|
[INF] No datastore changes to apply.
|
|
|
|
[INF] Connection 23 created.
|
|
|
|
[INF] Module "kea-dhcp-types" was installed.
|
2022-11-08 12:21:44 +02:00
|
|
|
[INF] File "kea-dhcp-types@2022-11-30.yang" was installed.
|
2022-10-05 21:14:58 +03:00
|
|
|
[INF] No datastore changes to apply.
|
|
|
|
[INF] Connection 25 created.
|
|
|
|
[INF] Module "kea-dhcp-ddns" was installed.
|
|
|
|
[INF] File "kea-dhcp-ddns@2022-07-27.yang" was installed.
|
|
|
|
[INF] No datastore changes to apply.
|
|
|
|
[INF] Connection 27 created.
|
|
|
|
[INF] Module "kea-ctrl-agent" was installed.
|
|
|
|
[INF] File "kea-ctrl-agent@2019-08-12.yang" was installed.
|
|
|
|
[INF] No datastore changes to apply.
|
|
|
|
[INF] Connection 29 created.
|
|
|
|
[INF] Module "kea-dhcp4-server" was installed.
|
2022-11-08 12:21:44 +02:00
|
|
|
[INF] File "kea-dhcp4-server@2022-11-30.yang" was installed.
|
2022-10-05 21:14:58 +03:00
|
|
|
[INF] No datastore changes to apply.
|
|
|
|
[INF] Connection 31 created.
|
|
|
|
[INF] Module "kea-dhcp6-server" was installed.
|
2022-11-08 12:21:44 +02:00
|
|
|
[INF] File "kea-dhcp6-server@2022-11-30.yang" was installed.
|
2022-10-05 21:14:58 +03:00
|
|
|
[INF] No datastore changes to apply.
|
|
|
|
|
2023-04-07 15:12:25 +00:00
|
|
|
To confirm whether the modules have been imported correctly, check the list of
|
|
|
|
currently installed YANG modules. It should be similar to this:
|
2019-06-06 18:25:46 +02:00
|
|
|
|
2019-07-15 08:32:02 +02:00
|
|
|
.. code-block:: console
|
2019-06-06 18:25:46 +02:00
|
|
|
|
2022-10-05 21:14:58 +03:00
|
|
|
$ sysrepoctl -l
|
2021-07-16 14:34:18 +03:00
|
|
|
Sysrepo repository: /etc/sysrepo
|
|
|
|
|
2022-10-05 21:14:58 +03:00
|
|
|
Module Name | Revision | Flags | Owner | Startup Perms | Submodules | Features
|
|
|
|
---------------------------------------------------------------------------------------------------
|
|
|
|
ietf-datastores | 2018-02-14 | I | user:user | 444 | |
|
|
|
|
ietf-dhcpv6-client | 2018-09-04 | I | user:user | 600 | |
|
|
|
|
ietf-dhcpv6-options | 2018-09-04 | I | user:user | 600 | |
|
|
|
|
ietf-dhcpv6-relay | 2018-09-04 | I | user:user | 600 | |
|
|
|
|
ietf-dhcpv6-server | 2018-09-04 | I | user:user | 600 | |
|
|
|
|
ietf-dhcpv6-types | 2018-09-04 | I | user:user | 600 | |
|
|
|
|
ietf-inet-types | 2013-07-15 | I | user:user | 444 | |
|
|
|
|
ietf-interfaces | 2018-02-20 | I | user:user | 600 | |
|
|
|
|
ietf-netconf | 2013-09-29 | I | user:user | 644 | |
|
|
|
|
ietf-netconf-acm | 2018-02-14 | I | user:user | 600 | |
|
|
|
|
ietf-netconf-notifications | 2012-02-06 | I | user:user | 644 | |
|
|
|
|
ietf-netconf-with-defaults | 2011-06-01 | I | user:user | 444 | |
|
|
|
|
ietf-origin | 2018-02-14 | I | user:user | 444 | |
|
|
|
|
ietf-yang-library | 2019-01-04 | I | user:user | 644 | |
|
|
|
|
ietf-yang-metadata | 2016-08-05 | i | | | |
|
|
|
|
ietf-yang-schema-mount | 2019-01-14 | I | user:user | 644 | |
|
|
|
|
ietf-yang-types | 2013-07-15 | I | user:user | 444 | |
|
|
|
|
kea-ctrl-agent | 2019-08-12 | I | user:user | 600 | |
|
|
|
|
kea-dhcp-ddns | 2022-07-27 | I | user:user | 600 | |
|
2022-11-08 12:21:44 +02:00
|
|
|
kea-dhcp-types | 2022-11-30 | I | user:user | 600 | |
|
|
|
|
kea-dhcp4-server | 2022-11-30 | I | user:user | 600 | |
|
|
|
|
kea-dhcp6-server | 2022-11-30 | I | user:user | 600 | |
|
2022-10-05 21:14:58 +03:00
|
|
|
kea-types | 2019-08-12 | I | user:user | 600 | |
|
2022-11-07 17:43:07 +02:00
|
|
|
keatest-module | 2022-11-30 | I | user:user | 600 | |
|
2022-10-05 21:14:58 +03:00
|
|
|
sysrepo-monitoring | 2022-04-08 | I | user:user | 600 | |
|
|
|
|
sysrepo-plugind | 2022-03-10 | I | user:user | 644 | |
|
|
|
|
yang | 2022-06-16 | I | user:user | 444 | |
|
|
|
|
|
|
|
|
Flags meaning: I - Installed/i - Imported; R - Replay support
|
2021-07-16 14:34:18 +03:00
|
|
|
|
|
|
|
To reinstall a module, if the revision YANG entry was bumped, simply installing
|
2021-08-13 14:39:16 +03:00
|
|
|
it will update it automatically. Otherwise, it must first be uninstalled:
|
2019-06-06 18:25:46 +02:00
|
|
|
|
2019-07-15 08:32:02 +02:00
|
|
|
.. code-block:: console
|
2019-06-06 18:25:46 +02:00
|
|
|
|
2021-07-16 14:34:18 +03:00
|
|
|
$ sysrepoctl -u kea-dhcp4-server
|
2019-06-06 18:25:46 +02:00
|
|
|
|
2021-07-16 14:34:18 +03:00
|
|
|
If the module is used (i.e. imported) by other modules, it can be uninstalled
|
2021-12-06 22:45:56 +00:00
|
|
|
only after the dependent modules have first been uninstalled.
|
2019-06-06 18:25:46 +02:00
|
|
|
Installation and uninstallation must be done in dependency order and
|
2023-04-07 15:12:25 +00:00
|
|
|
reverse-dependency order, as appropriate.
|
2019-06-06 18:25:46 +02:00
|
|
|
|
|
|
|
.. _netconf-models:
|
|
|
|
|
|
|
|
Supported YANG Models
|
2021-08-18 20:06:44 +02:00
|
|
|
---------------------
|
2019-06-06 18:25:46 +02:00
|
|
|
|
2023-04-07 15:12:25 +00:00
|
|
|
The currently supported models are ``kea-dhcp4-server`` and
|
2019-06-06 18:25:46 +02:00
|
|
|
``kea-dhcp6-server``. There is partial support for
|
2019-06-28 17:57:37 -04:00
|
|
|
``ietf-dhcpv6-server``, but the primary focus of testing has been on Kea DHCP
|
2023-06-06 13:43:11 +03:00
|
|
|
servers. Other models (:iscman:`kea-dhcp-ddns` and :iscman:`kea-ctrl-agent`)
|
2019-06-06 18:25:46 +02:00
|
|
|
are currently not supported.
|
|
|
|
|
|
|
|
.. _using-netconf:
|
|
|
|
|
|
|
|
Using the NETCONF Agent
|
2021-08-18 20:06:44 +02:00
|
|
|
-----------------------
|
2019-06-06 18:25:46 +02:00
|
|
|
|
|
|
|
The NETCONF agent follows this algorithm:
|
|
|
|
|
|
|
|
- For each managed server, get the initial configuration from the
|
|
|
|
server through the control socket.
|
|
|
|
|
|
|
|
- Open a connection with the Sysrepo environment and establish two
|
|
|
|
sessions with the startup and running datastores.
|
|
|
|
|
2021-12-06 22:45:56 +00:00
|
|
|
- Check that the used (not-essential) and required (essential) modules are
|
2019-06-28 17:57:37 -04:00
|
|
|
installed in the Sysrepo repository at the right revision. If an
|
|
|
|
essential module - that is, a module where the configuration schema for a
|
|
|
|
managed server is defined - is not installed, raise a fatal error.
|
2019-06-06 18:25:46 +02:00
|
|
|
|
|
|
|
- For each managed server, get the YANG configuration from the startup
|
|
|
|
datastore, translate it to JSON, and load it onto the server being
|
|
|
|
configured.
|
|
|
|
|
|
|
|
- For each managed server, subscribe a module change callback using its
|
|
|
|
model name.
|
|
|
|
|
|
|
|
- When a running configuration is changed, try to validate or load the
|
|
|
|
updated configuration via the callback to the managed server.
|
|
|
|
|
|
|
|
.. _netconf-configuration:
|
|
|
|
|
|
|
|
Configuration
|
2021-08-18 20:06:44 +02:00
|
|
|
-------------
|
2019-06-06 18:25:46 +02:00
|
|
|
|
2019-06-28 17:57:37 -04:00
|
|
|
The behavior described in :ref:`using-netconf`
|
2021-12-06 22:45:56 +00:00
|
|
|
is controlled by several configuration flags, which can be set in the
|
|
|
|
global scope or in a specific managed-server scope. If the latter,
|
2019-06-06 18:25:46 +02:00
|
|
|
the value defined in the managed-server scope takes precedence. These
|
|
|
|
flags are:
|
|
|
|
|
2019-06-28 17:57:37 -04:00
|
|
|
- ``boot-update`` - controls the initial configuration phase; when
|
2021-12-06 22:45:56 +00:00
|
|
|
``true`` (the default), the initial configuration retrieved from the
|
2019-06-06 18:25:46 +02:00
|
|
|
classic Kea server JSON configuration file is loaded first, and then
|
|
|
|
the startup YANG model is loaded. This setting lets administrators
|
|
|
|
define a control socket in the local JSON file and then download the
|
2021-12-06 22:45:56 +00:00
|
|
|
configuration from YANG. When set to ``false``, this phase is skipped.
|
2019-06-06 18:25:46 +02:00
|
|
|
|
2019-06-28 17:57:37 -04:00
|
|
|
- ``subscribe-changes`` - controls the module change
|
2021-12-06 22:45:56 +00:00
|
|
|
subscription; when ``true`` (the default), a module change callback is
|
|
|
|
subscribed, but when ``false`` the phase is skipped and running
|
|
|
|
configuration updates are disabled. When set to ``true``, the running
|
2019-06-06 18:25:46 +02:00
|
|
|
datastore is used to subscribe for changes.
|
|
|
|
|
2019-06-28 17:57:37 -04:00
|
|
|
- ``validate-changes`` - controls how Kea monitors changes in
|
|
|
|
the Sysrepo configuration. Sysrepo offers two stages where Kea can
|
2019-06-06 18:25:46 +02:00
|
|
|
interact: validation and application. At the validation (or
|
2021-12-06 22:45:56 +00:00
|
|
|
``SR_EV_CHANGE`` event, in the Sysrepo naming convention) stage, Kea
|
2019-06-06 18:25:46 +02:00
|
|
|
retrieves the newly committed configuration and verifies it. If the
|
|
|
|
configuration is incorrect for any reason, the Kea servers reject it
|
|
|
|
and the error is propagated back to the Sysrepo, which then returns
|
2021-12-06 22:45:56 +00:00
|
|
|
an error. This step only takes place if ``validate-changes`` is set to
|
|
|
|
``true``. In the application (or ``SR_EV_UPDATE`` event in the Sysrepo naming
|
2019-06-06 18:25:46 +02:00
|
|
|
convention) stage, the actual configuration is applied. At this stage
|
|
|
|
Kea can receive the configuration, but it is too late to signal back
|
|
|
|
any errors as the configuration has already been committed.
|
|
|
|
|
|
|
|
The idea behind the initial configuration phase is to boot Kea servers
|
|
|
|
with a minimal configuration which includes only a control socket,
|
|
|
|
making them manageable. For instance, for the DHCPv4 server:
|
|
|
|
|
2021-07-16 14:34:18 +03:00
|
|
|
.. code-block:: json
|
2019-06-06 18:25:46 +02:00
|
|
|
|
2021-07-16 14:34:18 +03:00
|
|
|
{
|
|
|
|
"Dhcp4": {
|
|
|
|
"control-socket": {
|
|
|
|
"socket-name": "/tmp/kea-dhcp4-ctrl.sock",
|
|
|
|
"socket-type": "unix"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-06-06 18:25:46 +02:00
|
|
|
|
2023-06-06 13:43:11 +03:00
|
|
|
With module change subscriptions enabled, the :iscman:`kea-netconf` daemon
|
2021-12-06 22:45:56 +00:00
|
|
|
monitors any configuration changes as they appear in the Sysrepo. Such
|
2019-06-06 18:25:46 +02:00
|
|
|
changes can be done using the ``sysrepocfg`` tool or remotely using any
|
|
|
|
NETCONF client. For details, please see the Sysrepo documentation or
|
2019-06-28 17:57:37 -04:00
|
|
|
:ref:`operation-example`.
|
2019-06-06 18:25:46 +02:00
|
|
|
Those tools can be used to modify YANG configurations in the running
|
|
|
|
datastore. Note that committed configurations are only updated in the
|
|
|
|
running datastore; to keep them between server reboots they must be
|
|
|
|
copied to the startup datastore.
|
|
|
|
|
|
|
|
When module changes are tracked (using ``subscribe-changes`` set to
|
2021-12-06 22:45:56 +00:00
|
|
|
``true``) and the running configuration has changed (e.g. using
|
2019-06-06 18:25:46 +02:00
|
|
|
``sysrepocfg`` or any NETCONF client), the callback validates the
|
2021-12-06 22:45:56 +00:00
|
|
|
modified configuration (if ``validate-changes`` was not set to ``false``)
|
2019-06-06 18:25:46 +02:00
|
|
|
and runs a second time to apply the new configuration. If the validation
|
2021-12-06 22:45:56 +00:00
|
|
|
fails, the callback is still called again but with an ``SR_EV_ABORT``
|
|
|
|
(vs. ``SR_EV_DONE``) event with rollback changes.
|
2019-06-06 18:25:46 +02:00
|
|
|
|
2021-12-06 22:45:56 +00:00
|
|
|
The returned code of the callback on an ``SR_EV_DONE`` event is ignored, as it is
|
2019-06-06 18:25:46 +02:00
|
|
|
too late to refuse a bad configuration.
|
|
|
|
|
2021-12-06 22:45:56 +00:00
|
|
|
There are four ways in which a modified YANG configuration might
|
|
|
|
be incorrect:
|
2019-06-06 18:25:46 +02:00
|
|
|
|
2021-12-06 22:45:56 +00:00
|
|
|
1. It could be non-compliant with the schema, e.g. an unknown entry, missing a
|
2019-06-28 17:57:37 -04:00
|
|
|
mandatory entry, a value with a bad type, or not matching a constraint.
|
2019-06-06 18:25:46 +02:00
|
|
|
|
2021-12-06 22:45:56 +00:00
|
|
|
2. It could fail to be translated from YANG to JSON, e.g. an invalid user
|
2019-06-06 18:25:46 +02:00
|
|
|
context.
|
|
|
|
|
2021-12-06 22:45:56 +00:00
|
|
|
3. It could fail Kea server sanity checks, e.g. an out-of-subnet-pool range
|
2019-06-28 17:57:37 -04:00
|
|
|
or an unsupported database type.
|
2019-06-06 18:25:46 +02:00
|
|
|
|
2019-06-28 17:57:37 -04:00
|
|
|
4. The syntax may be correct and pass server sanity checks but the
|
2021-12-06 22:45:56 +00:00
|
|
|
configuration could fail to run, e.g. the configuration specifies database
|
2019-06-28 17:57:37 -04:00
|
|
|
credentials but the database refuses the connection.
|
2019-06-06 18:25:46 +02:00
|
|
|
|
|
|
|
The first case is handled by Sysrepo. The second and third cases are
|
2023-06-06 13:43:11 +03:00
|
|
|
handled by :iscman:`kea-netconf` in the validation phase (if not disabled by
|
2021-12-06 22:45:56 +00:00
|
|
|
setting ``validate-changes`` to ``true``). The last case causes the
|
2019-06-06 18:25:46 +02:00
|
|
|
application phase to fail without a sensible report to Sysrepo.
|
|
|
|
|
2021-12-06 22:45:56 +00:00
|
|
|
The managed Kea servers and agents are described in the
|
|
|
|
``managed-servers`` section. Each sub-section begins with the service
|
2019-06-06 18:25:46 +02:00
|
|
|
name: ``dhcp4``, ``dhcp6``, ``d2`` (the DHCP-DDNS server does not
|
2021-12-06 22:45:56 +00:00
|
|
|
support the control-channel feature yet), and ``ca`` (the control
|
2019-06-06 18:25:46 +02:00
|
|
|
agent).
|
|
|
|
|
2021-12-08 18:12:03 +00:00
|
|
|
Each managed server entry may contain:
|
2019-06-06 18:25:46 +02:00
|
|
|
|
2021-12-08 18:12:03 +00:00
|
|
|
- control flags - ``boot-update``, ``subscribe-changes``, and/or ``validate-changes``.
|
2019-06-06 18:25:46 +02:00
|
|
|
|
2021-12-06 22:45:56 +00:00
|
|
|
- ``model`` - specifies the YANG model/module name. For each service,
|
2019-06-06 18:25:46 +02:00
|
|
|
the default is the corresponding Kea YANG model, e.g. for ``"dhcp4"``
|
|
|
|
it is ``"kea-dhcp4-server"``.
|
|
|
|
|
2019-06-28 17:57:37 -04:00
|
|
|
- ``control-socket`` - specifies the control socket for managing the
|
2019-06-06 18:25:46 +02:00
|
|
|
service configuration.
|
|
|
|
|
|
|
|
A control socket is specified by:
|
|
|
|
|
2019-06-28 17:57:37 -04:00
|
|
|
- ``socket-type`` - the socket type is either ``stdout``, ``unix``, or ``http``.
|
|
|
|
``stdout`` is the default;
|
2023-06-06 13:43:11 +03:00
|
|
|
it is not really a socket, but it allows :iscman:`kea-netconf` to run in
|
2019-06-28 17:57:37 -04:00
|
|
|
debugging mode where everything is printed on stdout, and it can also be
|
|
|
|
used to redirect commands easily. ``unix`` is the standard direct
|
2021-12-06 22:45:56 +00:00
|
|
|
server control channel, which uses UNIX sockets; ``http`` uses
|
2019-06-28 17:57:37 -04:00
|
|
|
a control agent, which accepts HTTP connections.
|
2019-06-06 18:25:46 +02:00
|
|
|
|
2019-06-28 17:57:37 -04:00
|
|
|
- ``socket-name`` - the local socket name for the ``unix`` socket type
|
2019-06-06 18:25:46 +02:00
|
|
|
(default empty string).
|
|
|
|
|
2019-06-28 17:57:37 -04:00
|
|
|
- ``socket-url`` - the HTTP URL for the ``http`` socket type (default
|
2019-06-06 18:25:46 +02:00
|
|
|
``http://127.0.0.1:8000/``).
|
|
|
|
|
2021-07-22 23:02:54 +03:00
|
|
|
User contexts can store arbitrary data as long as they are in valid JSON
|
2019-06-06 18:25:46 +02:00
|
|
|
syntax and their top-level element is a map (i.e. the data must be
|
|
|
|
enclosed in curly brackets). They are accepted at the NETCONF entry,
|
|
|
|
i.e. below the top-level, managed-service entry, and control-socket
|
|
|
|
entry scopes.
|
|
|
|
|
2021-12-06 22:45:56 +00:00
|
|
|
Hook libraries can be loaded by the NETCONF agent just as with other
|
2019-06-06 18:25:46 +02:00
|
|
|
servers or agents; however, currently no hook points are defined. The
|
2021-12-06 22:45:56 +00:00
|
|
|
``hooks-libraries`` list contains the list of hook libraries that
|
2023-06-06 13:43:11 +03:00
|
|
|
should be loaded by :iscman:`kea-netconf`, along with their configuration
|
2019-06-06 18:25:46 +02:00
|
|
|
information specified with ``parameters``.
|
|
|
|
|
2019-06-28 17:57:37 -04:00
|
|
|
Please consult :ref:`logging` for details on how to configure
|
2023-06-06 13:43:11 +03:00
|
|
|
logging. The name of the NETCONF agent's main logger is :iscman:`kea-netconf`, as
|
2019-06-06 18:25:46 +02:00
|
|
|
given in the example above.
|
|
|
|
|
|
|
|
.. _netconf-example:
|
|
|
|
|
2023-06-06 13:43:11 +03:00
|
|
|
A :iscman:`kea-netconf` Configuration Example
|
|
|
|
---------------------------------------------
|
2019-06-06 18:25:46 +02:00
|
|
|
|
|
|
|
The following example demonstrates the basic NETCONF configuration. More
|
|
|
|
examples are available in the ``doc/examples/netconf`` directory in the
|
|
|
|
Kea sources.
|
|
|
|
|
2021-07-22 16:02:25 +02:00
|
|
|
.. code-block:: javascript
|
2019-06-06 18:25:46 +02:00
|
|
|
|
2021-07-22 16:02:25 +02:00
|
|
|
// This is a simple example of a configuration for the NETCONF agent.
|
|
|
|
// This server provides a YANG interface for all Kea servers and the agent.
|
2019-06-06 18:25:46 +02:00
|
|
|
{
|
|
|
|
"Netconf":
|
|
|
|
{
|
2021-07-22 16:02:25 +02:00
|
|
|
// Control flags can be defined in the global scope or
|
|
|
|
// in a managed server scope. Precedences are:
|
|
|
|
// - use the default value (true)
|
|
|
|
// - use the global value
|
|
|
|
// - use the local value.
|
|
|
|
// So this overwrites the default value:
|
2019-06-06 18:25:46 +02:00
|
|
|
"boot-update": false,
|
|
|
|
|
2021-07-22 16:02:25 +02:00
|
|
|
// This map specifies how each server is managed. For each server there
|
|
|
|
// is a name of the YANG model to be used and the control channel.
|
|
|
|
// Currently three control channel types are supported:
|
|
|
|
// "stdout" which outputs the configuration on the standard output,
|
|
|
|
// "unix" which uses the local control channel supported by the
|
|
|
|
// "dhcp4" and "dhcp6" servers ("d2" support is not yet available),
|
|
|
|
// and "http" which uses the Control Agent "ca" to manage itself or
|
|
|
|
// to forward commands to "dhcp4" or "dhcp6".
|
2019-06-06 18:25:46 +02:00
|
|
|
"managed-servers":
|
|
|
|
{
|
2021-07-22 16:02:25 +02:00
|
|
|
// This is how kea-netconf can communicate with the DHCPv4 server.
|
2019-06-06 18:25:46 +02:00
|
|
|
"dhcp4":
|
|
|
|
{
|
2022-11-25 23:51:51 +02:00
|
|
|
"comment": "DHCPv4 server",
|
2019-06-06 18:25:46 +02:00
|
|
|
"model": "kea-dhcp4-server",
|
|
|
|
"control-socket":
|
|
|
|
{
|
|
|
|
"socket-type": "unix",
|
|
|
|
"socket-name": "/tmp/kea4-ctrl-socket"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2021-07-22 16:02:25 +02:00
|
|
|
// DHCPv6 parameters.
|
2019-06-06 18:25:46 +02:00
|
|
|
"dhcp6":
|
|
|
|
{
|
|
|
|
"model": "kea-dhcp6-server",
|
|
|
|
"control-socket":
|
|
|
|
{
|
|
|
|
"socket-type": "unix",
|
|
|
|
"socket-name": "/tmp/kea6-ctrl-socket"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2021-07-22 16:02:25 +02:00
|
|
|
// Currently the DHCP-DDNS (nicknamed D2) server does not support
|
|
|
|
// a command channel.
|
2019-06-06 18:25:46 +02:00
|
|
|
"d2":
|
|
|
|
{
|
|
|
|
"model": "kea-dhcp-ddns",
|
|
|
|
"control-socket":
|
|
|
|
{
|
|
|
|
"socket-type": "stdout",
|
|
|
|
"user-context": { "in-use": false }
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2021-07-22 16:02:25 +02:00
|
|
|
// Of course the Control Agent (CA) supports HTTP.
|
2019-06-06 18:25:46 +02:00
|
|
|
"ca":
|
|
|
|
{
|
|
|
|
"model": "kea-ctrl-agent",
|
|
|
|
"control-socket":
|
|
|
|
{
|
|
|
|
"socket-type": "http",
|
|
|
|
"socket-url": "http://127.0.0.1:8000/"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2021-12-06 22:45:56 +00:00
|
|
|
// kea-netconf is able to load hook libraries that augment its operation.
|
2021-07-22 16:02:25 +02:00
|
|
|
// Currently there are no hook points defined in kea-netconf
|
|
|
|
// processing.
|
2019-06-06 18:25:46 +02:00
|
|
|
"hooks-libraries": [
|
2023-04-19 17:58:06 +03:00
|
|
|
// The hook libraries list may contain more than one library.
|
2019-06-06 18:25:46 +02:00
|
|
|
{
|
2021-07-22 16:02:25 +02:00
|
|
|
// The only necessary parameter is the library filename.
|
2023-08-15 06:36:11 +03:00
|
|
|
"library": "/opt/local/custom_hooks_example.so",
|
2019-06-06 18:25:46 +02:00
|
|
|
|
2021-07-22 16:02:25 +02:00
|
|
|
// Some libraries may support parameters. Make sure you
|
|
|
|
// type this section carefully, as kea-netconf does not
|
|
|
|
// validate it (because the format is library-specific).
|
2019-06-06 18:25:46 +02:00
|
|
|
"parameters": {
|
|
|
|
"param1": "foo"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
|
2021-07-22 16:02:25 +02:00
|
|
|
// Similar to other Kea components, NETCONF also uses logging.
|
2019-06-06 18:25:46 +02:00
|
|
|
"loggers": [
|
|
|
|
{
|
|
|
|
"name": "kea-netconf",
|
2023-08-10 14:54:36 +02:00
|
|
|
"output-options": [
|
2019-06-06 18:25:46 +02:00
|
|
|
{
|
|
|
|
"output": "/var/log/kea-netconf.log",
|
2021-07-22 16:02:25 +02:00
|
|
|
// Several additional parameters are possible in
|
|
|
|
// addition to the typical output.
|
|
|
|
// Flush determines whether logger flushes output
|
|
|
|
// to a file.
|
|
|
|
// Maxsize determines maximum filesize before
|
2023-04-19 17:58:06 +03:00
|
|
|
// the file is rotated.
|
2021-07-22 16:02:25 +02:00
|
|
|
// Maxver specifies the maximum number of
|
2023-04-19 17:58:06 +03:00
|
|
|
// rotated files to be kept.
|
2019-06-06 18:25:46 +02:00
|
|
|
"flush": true,
|
|
|
|
"maxsize": 204800,
|
|
|
|
"maxver": 4
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"severity": "INFO",
|
|
|
|
"debuglevel": 0
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.. _netconf-start-stop:
|
|
|
|
|
|
|
|
Starting and Stopping the NETCONF Agent
|
2021-08-18 20:06:44 +02:00
|
|
|
---------------------------------------
|
2019-06-06 18:25:46 +02:00
|
|
|
|
2023-06-06 13:43:11 +03:00
|
|
|
:iscman:`kea-netconf` accepts the following command-line switches:
|
2019-06-06 18:25:46 +02:00
|
|
|
|
|
|
|
- ``-c file`` - specifies the configuration file.
|
|
|
|
|
|
|
|
- ``-d`` - specifies whether the agent logging should be switched to
|
|
|
|
debug/verbose mode. In verbose mode, the logging severity and
|
|
|
|
debuglevel specified in the configuration file are ignored and
|
|
|
|
"debug" severity and the maximum debuglevel (99) are assumed. The
|
|
|
|
flag is convenient for temporarily switching the server into maximum
|
|
|
|
verbosity, e.g. when debugging.
|
|
|
|
|
|
|
|
- ``-t file`` - specifies the configuration file to be tested.
|
2023-06-06 13:43:11 +03:00
|
|
|
:iscman:`kea-netconf` attempts to load it and conducts sanity checks;
|
2019-06-06 18:25:46 +02:00
|
|
|
certain checks are possible only while running the actual server. The
|
2021-12-08 16:39:06 +00:00
|
|
|
actual status is reported with exit code (0 = configuration appears valid,
|
2021-12-06 22:45:56 +00:00
|
|
|
1 = error encountered). Kea prints out log messages to standard
|
|
|
|
output and error to standard error when testing the configuration.
|
2019-06-06 18:25:46 +02:00
|
|
|
|
2023-06-06 13:43:11 +03:00
|
|
|
- ``-v`` - displays the version of :iscman:`kea-netconf` and exits.
|
2019-06-06 18:25:46 +02:00
|
|
|
|
2023-06-06 13:43:11 +03:00
|
|
|
- ``-V`` - displays the extended version information for :iscman:`kea-netconf`
|
2019-06-06 18:25:46 +02:00
|
|
|
and exits. The listing includes the versions of the libraries
|
|
|
|
dynamically linked to Kea.
|
|
|
|
|
|
|
|
- ``-W`` - displays the Kea configuration report and exits. The report
|
|
|
|
is a copy of the ``config.report`` file produced by ``./configure``;
|
|
|
|
it is embedded in the executable binary.
|
|
|
|
|
2023-03-20 19:00:21 +02:00
|
|
|
The contents of the ``config.report`` file may also be accessed by examining
|
|
|
|
certain libraries in the installation tree or in the source tree.
|
2023-03-16 21:16:22 +02:00
|
|
|
|
2023-03-20 19:00:21 +02:00
|
|
|
.. code-block:: shell
|
2023-03-16 21:16:22 +02:00
|
|
|
|
2023-03-20 19:00:21 +02:00
|
|
|
# from installation using libkea-process.so
|
|
|
|
$ strings ${prefix}/lib/libkea-process.so | sed -n 's/;;;; //p'
|
2023-03-16 21:16:22 +02:00
|
|
|
|
2023-03-20 19:00:21 +02:00
|
|
|
# from sources using libkea-process.so
|
|
|
|
$ strings src/lib/process/.libs/libkea-process.so | sed -n 's/;;;; //p'
|
2023-03-16 21:16:22 +02:00
|
|
|
|
2023-03-20 19:00:21 +02:00
|
|
|
# from sources using libkea-process.a
|
|
|
|
$ strings src/lib/process/.libs/libkea-process.a | sed -n 's/;;;; //p'
|
2023-03-16 21:16:22 +02:00
|
|
|
|
2023-03-20 19:00:21 +02:00
|
|
|
# from sources using libcfgrpt.a
|
|
|
|
$ strings src/lib/process/cfgrpt/.libs/libcfgrpt.a | sed -n 's/;;;; //p'
|
2023-03-16 21:16:22 +02:00
|
|
|
|
2019-06-06 18:25:46 +02:00
|
|
|
.. _operation-example:
|
|
|
|
|
2019-06-28 17:57:37 -04:00
|
|
|
A Step-by-Step NETCONF Agent Operation Example
|
2021-08-18 20:06:44 +02:00
|
|
|
----------------------------------------------
|
2019-06-06 18:25:46 +02:00
|
|
|
|
2019-07-17 12:22:20 -04:00
|
|
|
.. note::
|
2019-06-06 18:25:46 +02:00
|
|
|
|
|
|
|
Copies of example configurations presented within this section can be
|
|
|
|
found in the Kea source code, under
|
|
|
|
``doc/examples/netconf/kea-dhcp6-operations``.
|
|
|
|
|
|
|
|
.. _operation-example-setup:
|
|
|
|
|
|
|
|
Setup of NETCONF Agent Operation Example
|
2021-08-18 20:06:44 +02:00
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
2019-06-06 18:25:46 +02:00
|
|
|
|
|
|
|
The test box has an Ethernet interface named eth1. On some systems it is
|
2021-12-06 22:45:56 +00:00
|
|
|
possible to rename interfaces; for instance, on Linux with an ens38
|
2019-06-06 18:25:46 +02:00
|
|
|
interface:
|
|
|
|
|
2019-07-15 08:32:02 +02:00
|
|
|
.. code-block:: console
|
2019-06-06 18:25:46 +02:00
|
|
|
|
|
|
|
# ip link set down dev ens38
|
|
|
|
# ip link set name eth1 dev ens38
|
|
|
|
# ip link set up dev eth1
|
|
|
|
|
|
|
|
The interface must have an address in the test prefix:
|
|
|
|
|
2019-07-15 08:32:02 +02:00
|
|
|
.. code-block:: console
|
2019-06-06 18:25:46 +02:00
|
|
|
|
|
|
|
# ip -6 addr add 2001:db8::1/64 dev eth1
|
|
|
|
|
|
|
|
The Kea DHCPv6 server must be launched with the configuration specifying
|
2023-06-06 13:43:11 +03:00
|
|
|
a control socket used to receive control commands. The :iscman:`kea-netconf`
|
2019-06-06 18:25:46 +02:00
|
|
|
process uses this socket to communicate with the DHCPv6 server, i.e. it
|
|
|
|
pushes translated configurations to that server using control commands.
|
2021-12-06 22:45:56 +00:00
|
|
|
The following is an example control socket specification for the Kea
|
2019-06-06 18:25:46 +02:00
|
|
|
DHCPv6 server:
|
|
|
|
|
2021-07-16 14:34:18 +03:00
|
|
|
.. code-block:: json
|
2019-06-06 18:25:46 +02:00
|
|
|
|
2021-07-16 14:34:18 +03:00
|
|
|
{
|
|
|
|
"Dhcp6": {
|
|
|
|
"control-socket": {
|
|
|
|
"socket-name": "/tmp/kea-dhcp6-ctrl.sock",
|
|
|
|
"socket-type": "unix"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-06-06 18:25:46 +02:00
|
|
|
|
|
|
|
In order to launch the Kea DHCPv6 server using the configuration
|
|
|
|
contained within the ``boot.json`` file, run:
|
|
|
|
|
2019-07-15 08:32:02 +02:00
|
|
|
.. code-block:: console
|
2019-06-06 18:25:46 +02:00
|
|
|
|
|
|
|
# kea-dhcp6 -d -c boot.json
|
|
|
|
|
2021-12-06 22:45:56 +00:00
|
|
|
The current configuration of the server can be fetched via a control
|
2019-06-06 18:25:46 +02:00
|
|
|
socket by running:
|
|
|
|
|
2019-07-15 08:32:02 +02:00
|
|
|
.. code-block:: console
|
2019-06-06 18:25:46 +02:00
|
|
|
|
2021-07-16 14:34:18 +03:00
|
|
|
# echo '{ "command": "config-get" }' | socat UNIX:/tmp/kea-dhcp6-ctrl.sock '-,ignoreeof'
|
2019-06-06 18:25:46 +02:00
|
|
|
|
|
|
|
The following is the example ``netconf.json`` configuration for
|
2023-06-06 13:43:11 +03:00
|
|
|
:iscman:`kea-netconf`, to manage the Kea DHCPv6 server:
|
2019-06-06 18:25:46 +02:00
|
|
|
|
2021-07-16 14:34:18 +03:00
|
|
|
.. code-block:: json
|
|
|
|
|
|
|
|
{
|
|
|
|
"Netconf": {
|
|
|
|
"loggers": [
|
|
|
|
{
|
|
|
|
"debuglevel": 99,
|
|
|
|
"name": "kea-netconf",
|
2023-08-10 14:54:36 +02:00
|
|
|
"output-options": [
|
2021-07-16 14:34:18 +03:00
|
|
|
{
|
|
|
|
"output": "stderr"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"severity": "DEBUG"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"managed-servers": {
|
|
|
|
"dhcp6": {
|
|
|
|
"control-socket": {
|
|
|
|
"socket-name": "/tmp/kea-dhcp6-ctrl.sock",
|
|
|
|
"socket-type": "unix"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-06-06 18:25:46 +02:00
|
|
|
|
2019-06-28 17:57:37 -04:00
|
|
|
Note that in production there should not be a need to log at the DEBUG level.
|
2019-06-06 18:25:46 +02:00
|
|
|
|
|
|
|
The Kea NETCONF agent is launched by:
|
|
|
|
|
2019-07-15 08:32:02 +02:00
|
|
|
.. code-block:: console
|
2019-06-06 18:25:46 +02:00
|
|
|
|
|
|
|
# kea-netconf -d -c netconf.json
|
|
|
|
|
2023-06-06 13:43:11 +03:00
|
|
|
Now that both :iscman:`kea-netconf` and :iscman:`kea-dhcp6` are running, it is
|
2019-06-06 18:25:46 +02:00
|
|
|
possible to populate updates to the configuration to the DHCPv6 server.
|
|
|
|
The following is the configuration extracted from ``startup.xml``:
|
|
|
|
|
2019-07-15 08:32:02 +02:00
|
|
|
.. code-block:: xml
|
2019-06-06 18:25:46 +02:00
|
|
|
|
|
|
|
<config xmlns="urn:ietf:params:xml:ns:yang:kea-dhcp6-server">
|
|
|
|
<subnet6>
|
|
|
|
<id>1</id>
|
|
|
|
<pool>
|
|
|
|
<start-address>2001:db8::1:0</start-address>
|
|
|
|
<end-address>2001:db8::1:ffff</end-address>
|
|
|
|
<prefix>2001:db8::1:0/112</prefix>
|
|
|
|
</pool>
|
|
|
|
<subnet>2001:db8::/64</subnet>
|
|
|
|
</subnet6>
|
|
|
|
<interfaces-config>
|
|
|
|
<interfaces>eth1</interfaces>
|
|
|
|
</interfaces-config>
|
|
|
|
<control-socket>
|
2021-07-16 14:34:18 +03:00
|
|
|
<socket-name>/tmp/kea-dhcp6-ctrl.sock</socket-name>
|
2019-06-06 18:25:46 +02:00
|
|
|
<socket-type>unix</socket-type>
|
|
|
|
</control-socket>
|
|
|
|
</config>
|
|
|
|
|
|
|
|
To populate this new configuration:
|
|
|
|
|
2019-07-15 08:32:02 +02:00
|
|
|
.. code-block:: console
|
2019-06-06 18:25:46 +02:00
|
|
|
|
2021-07-16 14:34:18 +03:00
|
|
|
$ sysrepocfg -d startup -f xml -m kea-dhcp6-server --edit=startup.xml
|
2019-06-06 18:25:46 +02:00
|
|
|
|
2023-06-06 13:43:11 +03:00
|
|
|
:iscman:`kea-netconf` pushes the configuration found in the Sysrepo startup
|
2019-06-06 18:25:46 +02:00
|
|
|
datastore to all Kea servers during its initialization phase, after it
|
|
|
|
subscribes to module changes in the Sysrepo running datastore. This
|
|
|
|
action copies the configuration from the startup datastore to the
|
|
|
|
running datastore and enables the running datastore, making it
|
|
|
|
available.
|
|
|
|
|
|
|
|
Changes to the running datastore are applied after validation to the Kea
|
|
|
|
servers. Note that they are not by default copied back to the startup
|
|
|
|
datastore, i.e. changes are not permanent.
|
|
|
|
|
2022-10-24 09:48:30 +03:00
|
|
|
.. note::
|
|
|
|
|
2023-06-06 13:43:11 +03:00
|
|
|
:iscman:`kea-netconf` fetches the entire configuration from any Sysrepo datastore in a
|
2023-04-07 15:12:25 +00:00
|
|
|
single ``get-config`` NETCONF operation. Prior to Kea 2.3.2, a ``get-config`` operation
|
|
|
|
was done for each leaf and leaf-list node. Because of the significant changes,
|
2023-06-06 13:43:11 +03:00
|
|
|
:iscman:`kea-netconf` is considered experimental.
|
2022-10-24 09:48:30 +03:00
|
|
|
|
2019-06-06 18:25:46 +02:00
|
|
|
.. _operation-example-errors:
|
|
|
|
|
2023-04-07 15:12:25 +00:00
|
|
|
Example of Error Handling in NETCONF Operation
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
2019-06-06 18:25:46 +02:00
|
|
|
|
2021-12-06 22:45:56 +00:00
|
|
|
There are four classes of issues with configurations applied via
|
2019-06-06 18:25:46 +02:00
|
|
|
NETCONF:
|
|
|
|
|
|
|
|
1. The configuration does not comply with the YANG schema.
|
|
|
|
|
|
|
|
2. The configuration cannot be translated from YANG to the Kea JSON.
|
|
|
|
|
|
|
|
3. The configuration is rejected by the Kea server.
|
|
|
|
|
|
|
|
4. The configuration was validated by the Kea server but cannot be
|
|
|
|
applied.
|
|
|
|
|
|
|
|
In the first case, consider the following ``BAD-schema.xml``
|
|
|
|
configuration file:
|
|
|
|
|
2019-07-15 08:32:02 +02:00
|
|
|
.. code-block:: xml
|
2019-06-06 18:25:46 +02:00
|
|
|
|
|
|
|
<config xmlns="urn:ietf:params:xml:ns:yang:kea-dhcp6-server">
|
|
|
|
<subnet4>
|
|
|
|
<id>1</id>
|
|
|
|
<pool>
|
|
|
|
<start-address>2001:db8::1:0</start-address>
|
|
|
|
<end-address>2001:db8::1:ffff</end-address>
|
|
|
|
<prefix>2001:db8::1:0/112</prefix>
|
|
|
|
</pool>
|
|
|
|
<subnet>2001:db8::/64</subnet>
|
|
|
|
</subnet6>
|
|
|
|
<interfaces-config>
|
|
|
|
<interfaces>eth1</interfaces>
|
|
|
|
</interfaces-config>
|
|
|
|
<control-socket>
|
2021-07-16 14:34:18 +03:00
|
|
|
<socket-name>/tmp/kea-dhcp6-ctrl.sock</socket-name>
|
2019-06-06 18:25:46 +02:00
|
|
|
<socket-type>unix</socket-type>
|
|
|
|
</control-socket>
|
|
|
|
</config>
|
|
|
|
|
2019-06-28 17:57:37 -04:00
|
|
|
It is directly rejected by ``sysrepocfg``:
|
2019-06-06 18:25:46 +02:00
|
|
|
|
2019-07-15 08:32:02 +02:00
|
|
|
.. code-block:: console
|
2019-06-06 18:25:46 +02:00
|
|
|
|
2021-07-16 14:34:18 +03:00
|
|
|
$ sysrepocfg -d running -f xml -m kea-dhcp6-server --edit=BAD-schema.xml
|
2019-06-06 18:25:46 +02:00
|
|
|
|
2023-06-06 13:43:11 +03:00
|
|
|
In the second case, the configuration is rejected by :iscman:`kea-netconf`.
|
2019-06-06 18:25:46 +02:00
|
|
|
For example, consider this ``BAD-translator.xml`` file:
|
|
|
|
|
2019-07-15 08:32:02 +02:00
|
|
|
.. code-block:: xml
|
2019-06-06 18:25:46 +02:00
|
|
|
|
|
|
|
<config xmlns="urn:ietf:params:xml:ns:yang:kea-dhcp6-server">
|
|
|
|
<subnet6>
|
|
|
|
<id>1</id>
|
|
|
|
<pool>
|
|
|
|
<start-address>2001:db8::1:0</start-address>
|
|
|
|
<end-address>2001:db8::1:ffff</end-address>
|
|
|
|
<prefix>2001:db8::1:0/112</prefix>
|
|
|
|
</pool>
|
|
|
|
<subnet>2001:db8::/64</subnet>
|
|
|
|
</subnet6>
|
|
|
|
<interfaces-config>
|
|
|
|
<interfaces>eth1</interfaces>
|
|
|
|
</interfaces-config>
|
|
|
|
<control-socket>
|
2021-07-16 14:34:18 +03:00
|
|
|
<socket-name>/tmp/kea-dhcp6-ctrl.sock</socket-name>
|
2019-06-06 18:25:46 +02:00
|
|
|
<socket-type>unix</socket-type>
|
|
|
|
</control-socket>
|
|
|
|
<user-context>bad</user-context>
|
|
|
|
</config>
|
|
|
|
|
|
|
|
In the third case, the configuration is presented to the Kea DHCPv6
|
2021-12-06 22:45:56 +00:00
|
|
|
server and fails to validate, as in this ``BAD-config.xml`` file:
|
2019-06-06 18:25:46 +02:00
|
|
|
|
2019-07-15 08:32:02 +02:00
|
|
|
.. code-block:: xml
|
2019-06-06 18:25:46 +02:00
|
|
|
|
|
|
|
<config xmlns="urn:ietf:params:xml:ns:yang:kea-dhcp6-server">
|
|
|
|
<subnet6>
|
|
|
|
<id>1</id>
|
|
|
|
<pool>
|
|
|
|
<start-address>2001:db8:1::0</start-address>
|
|
|
|
<end-address>2001:db8:1::ffff</end-address>
|
|
|
|
<prefix>2001:db8:1::0/112</prefix>
|
|
|
|
</pool>
|
|
|
|
<subnet>2001:db8::/64</subnet>
|
|
|
|
</subnet6>
|
|
|
|
<interfaces-config>
|
|
|
|
<interfaces>eth1</interfaces>
|
|
|
|
</interfaces-config>
|
|
|
|
<control-socket>
|
2021-07-16 14:34:18 +03:00
|
|
|
<socket-name>/tmp/kea-dhcp6-ctrl.sock</socket-name>
|
2019-06-06 18:25:46 +02:00
|
|
|
<socket-type>unix</socket-type>
|
|
|
|
</control-socket>
|
|
|
|
</config>
|
|
|
|
|
|
|
|
In the last case, the misconfiguration is detected too late and the
|
|
|
|
change must be reverted in Sysrepo, e.g. using the startup datastore as
|
2021-07-16 14:34:18 +03:00
|
|
|
a backup.
|
2019-06-06 18:25:46 +02:00
|
|
|
|
|
|
|
.. _operation-example-2pools:
|
|
|
|
|
|
|
|
NETCONF Operation Example with Two Pools
|
2021-08-18 20:06:44 +02:00
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
2019-06-06 18:25:46 +02:00
|
|
|
|
|
|
|
This example adds a second pool to the initial (i.e. startup)
|
|
|
|
configuration in the ``twopools.xml`` file:
|
|
|
|
|
2019-07-15 08:32:02 +02:00
|
|
|
.. code-block:: xml
|
2019-06-06 18:25:46 +02:00
|
|
|
|
|
|
|
<config xmlns="urn:ietf:params:xml:ns:yang:kea-dhcp6-server">
|
|
|
|
<subnet6>
|
|
|
|
<id>1</id>
|
|
|
|
<pool>
|
|
|
|
<start-address>2001:db8::1:0</start-address>
|
|
|
|
<end-address>2001:db8::1:ffff</end-address>
|
|
|
|
<prefix>2001:db8::1:0/112</prefix>
|
|
|
|
</pool>
|
|
|
|
<pool>
|
|
|
|
<start-address>2001:db8::2:0</start-address>
|
|
|
|
<end-address>2001:db8::2:ffff</end-address>
|
|
|
|
<prefix>2001:db8::2:0/112</prefix>
|
|
|
|
</pool>
|
|
|
|
<subnet>2001:db8::/64</subnet>
|
|
|
|
</subnet6>
|
|
|
|
<interfaces-config>
|
|
|
|
<interfaces>eth1</interfaces>
|
|
|
|
</interfaces-config>
|
|
|
|
<control-socket>
|
2021-07-16 14:34:18 +03:00
|
|
|
<socket-name>/tmp/kea-dhcp6-ctrl.sock</socket-name>
|
2019-06-06 18:25:46 +02:00
|
|
|
<socket-type>unix</socket-type>
|
|
|
|
</control-socket>
|
|
|
|
</config>
|
|
|
|
|
|
|
|
This configuration is installed by:
|
|
|
|
|
2019-07-15 08:32:02 +02:00
|
|
|
.. code-block:: console
|
2019-06-06 18:25:46 +02:00
|
|
|
|
2021-07-16 14:34:18 +03:00
|
|
|
$ sysrepocfg -d running -f xml -m kea-dhcp6-server --edit=twopools.xml
|
2019-06-06 18:25:46 +02:00
|
|
|
|
|
|
|
.. _operation-example-2subnets:
|
|
|
|
|
|
|
|
NETCONF Operation Example with Two Subnets
|
2021-08-18 20:06:44 +02:00
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
2019-06-06 18:25:46 +02:00
|
|
|
|
|
|
|
This example specifies two subnets in the ``twosubnets.xml`` file:
|
|
|
|
|
2019-07-15 08:32:02 +02:00
|
|
|
.. code-block:: xml
|
2019-06-06 18:25:46 +02:00
|
|
|
|
|
|
|
<config xmlns="urn:ietf:params:xml:ns:yang:kea-dhcp6-server">
|
|
|
|
<subnet6>
|
|
|
|
<id>1</id>
|
|
|
|
<pool>
|
|
|
|
<start-address>2001:db8:1::</start-address>
|
|
|
|
<end-address>2001:db8:1::ffff</end-address>
|
|
|
|
<prefix>2001:db8:1::/112</prefix>
|
|
|
|
</pool>
|
|
|
|
<subnet>2001:db8:1::/64</subnet>
|
|
|
|
</subnet6>
|
|
|
|
<subnet6>
|
|
|
|
<id>2</id>
|
|
|
|
<pool>
|
|
|
|
<start-address>2001:db8:2::</start-address>
|
|
|
|
<end-address>2001:db8:2::ffff</end-address>
|
|
|
|
<prefix>2001:db8:2::/112</prefix>
|
|
|
|
</pool>
|
|
|
|
<subnet>2001:db8:2::/64</subnet>
|
|
|
|
</subnet6>
|
|
|
|
<interfaces-config>
|
|
|
|
<interfaces>eth1</interfaces>
|
|
|
|
</interfaces-config>
|
|
|
|
<control-socket>
|
2021-07-16 14:34:18 +03:00
|
|
|
<socket-name>/tmp/kea-dhcp6-ctrl.sock</socket-name>
|
2019-06-06 18:25:46 +02:00
|
|
|
<socket-type>unix</socket-type>
|
|
|
|
</control-socket>
|
|
|
|
</config>
|
|
|
|
|
|
|
|
This configuration is installed by:
|
|
|
|
|
2019-07-15 08:32:02 +02:00
|
|
|
.. code-block:: console
|
2019-06-06 18:25:46 +02:00
|
|
|
|
2021-07-16 14:34:18 +03:00
|
|
|
$ sysrepocfg -d running -f xml -m kea-dhcp6-server --edit=twosubnets.xml
|
2019-06-06 18:25:46 +02:00
|
|
|
|
|
|
|
.. _operation-example-logging:
|
|
|
|
|
2023-04-07 15:12:25 +00:00
|
|
|
NETCONF Operation Example With Logging
|
2021-08-18 20:06:44 +02:00
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
2019-06-06 18:25:46 +02:00
|
|
|
|
|
|
|
This example adds a logger entry to the initial (i.e. startup)
|
|
|
|
configuration in the ``logging.xml`` file:
|
|
|
|
|
2019-07-15 08:32:02 +02:00
|
|
|
.. code-block:: xml
|
2019-06-06 18:25:46 +02:00
|
|
|
|
|
|
|
<config xmlns="urn:ietf:params:xml:ns:yang:kea-dhcp6-server">
|
|
|
|
<interfaces-config>
|
|
|
|
<interfaces>eth1</interfaces>
|
|
|
|
</interfaces-config>
|
|
|
|
<subnet6>
|
|
|
|
<id>1</id>
|
|
|
|
<pool>
|
|
|
|
<start-address>2001:db8::1:0</start-address>
|
|
|
|
<end-address>2001:db8::1:ffff</end-address>
|
|
|
|
<prefix>2001:db8::1:0/112</prefix>
|
|
|
|
</pool>
|
|
|
|
<subnet>2001:db8::/64</subnet>
|
|
|
|
</subnet6>
|
|
|
|
<control-socket>
|
2021-07-16 14:34:18 +03:00
|
|
|
<socket-name>/tmp/kea-dhcp6-ctrl.sock</socket-name>
|
2019-06-06 18:25:46 +02:00
|
|
|
<socket-type>unix</socket-type>
|
|
|
|
</control-socket>
|
|
|
|
<logger>
|
|
|
|
<name>kea-dhcp6</name>
|
|
|
|
<output-option>
|
|
|
|
<output>stderr</output>
|
|
|
|
</output-option>
|
|
|
|
<debuglevel>99</debuglevel>
|
|
|
|
<severity>DEBUG</severity>
|
|
|
|
</logger>
|
|
|
|
</config>
|
|
|
|
|
|
|
|
The corresponding Kea configuration in JSON is:
|
|
|
|
|
2021-07-16 14:34:18 +03:00
|
|
|
.. code-block:: json
|
2019-06-06 18:25:46 +02:00
|
|
|
|
|
|
|
{
|
|
|
|
"Dhcp6": {
|
|
|
|
"control-socket": {
|
2021-07-16 14:34:18 +03:00
|
|
|
"socket-name": "/tmp/kea-dhcp6-ctrl.sock",
|
2019-06-06 18:25:46 +02:00
|
|
|
"socket-type": "unix"
|
|
|
|
},
|
|
|
|
"interfaces-config": {
|
|
|
|
"interfaces": [ "eth1" ]
|
|
|
|
},
|
|
|
|
"subnet6": [
|
|
|
|
{
|
|
|
|
"id": 1,
|
|
|
|
"pools": [
|
|
|
|
{
|
|
|
|
"pool": "2001:db8::1:0/112"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"subnet": "2001:db8::/64"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"loggers": [
|
|
|
|
{
|
|
|
|
"name": "kea-dhcp6",
|
2023-08-10 14:54:36 +02:00
|
|
|
"output-options": [
|
2019-06-06 18:25:46 +02:00
|
|
|
{
|
|
|
|
"output": "stderr"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"severity": "DEBUG",
|
|
|
|
"debuglevel": 99
|
|
|
|
}
|
2022-10-05 21:14:58 +03:00
|
|
|
]
|
|
|
|
}
|
2019-06-06 18:25:46 +02:00
|
|
|
}
|
|
|
|
|
2021-07-16 14:34:18 +03:00
|
|
|
Finally, any of the previous examples can be replayed by using
|
2019-06-06 18:25:46 +02:00
|
|
|
``sysrepocfg`` in edit mode as follows:
|
|
|
|
|
2019-07-15 08:32:02 +02:00
|
|
|
.. code-block:: console
|
2019-06-06 18:25:46 +02:00
|
|
|
|
2021-07-16 14:34:18 +03:00
|
|
|
$ sysrepocfg -d running -f xml -m kea-dhcp6-server --edit
|
2019-06-06 18:25:46 +02:00
|
|
|
|
2021-07-16 14:34:18 +03:00
|
|
|
or by using a NETCONF client like ``netopeer2-cli`` from the
|
2019-06-28 17:57:37 -04:00
|
|
|
`Netopeer2 <https://github.com/CESNET/Netopeer2>`__ NETCONF Toolset.
|
2021-07-22 23:37:48 +03:00
|
|
|
|
2022-10-05 21:14:58 +03:00
|
|
|
.. _migrating-yang-data:
|
2021-07-22 23:37:48 +03:00
|
|
|
|
2023-04-07 15:12:25 +00:00
|
|
|
Migrating YANG Data From a Prior Sysrepo Version
|
2022-10-05 21:14:58 +03:00
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
2021-07-22 23:37:48 +03:00
|
|
|
|
2023-06-06 13:43:11 +03:00
|
|
|
1. Shut down :iscman:`kea-netconf`. This ensures that backups for both datastores
|
2023-04-07 15:12:25 +00:00
|
|
|
are done at the same configuration state and that no change happens between exporting them.
|
2021-07-22 23:37:48 +03:00
|
|
|
|
2023-04-07 15:12:25 +00:00
|
|
|
2. Make data backups for all YANG modules, with one XML for each datastore.
|
2021-07-22 23:37:48 +03:00
|
|
|
|
|
|
|
.. code-block:: console
|
|
|
|
|
2022-10-05 21:14:58 +03:00
|
|
|
$ sysrepocfg --datastore running --export=save.xml --format=xml
|
|
|
|
$ sysrepocfg --datastore startup --export=save.xml --format=xml
|
2021-07-22 23:37:48 +03:00
|
|
|
|
2022-10-05 21:14:58 +03:00
|
|
|
.. note::
|
|
|
|
|
2023-04-07 15:12:25 +00:00
|
|
|
Sysrepo v0 does not support import/export of all YANG modules; this capability was added in
|
2022-11-08 12:12:53 +02:00
|
|
|
Sysrepo v1. Users that are migrating from Sysrepo v0 will need to do per-module backups. This has
|
2022-10-05 21:14:58 +03:00
|
|
|
the added benefit of isolating potential failures and preventing them from affecting all
|
2023-04-07 15:12:25 +00:00
|
|
|
modules. The command is the same, except it has the module name added to it at the end.
|
2022-10-05 21:14:58 +03:00
|
|
|
|
|
|
|
.. code-block:: console
|
|
|
|
|
|
|
|
$ sysrepocfg --datastore running --export=save.xml --format=xml kea-dhcp6-server
|
|
|
|
$ sysrepocfg --datastore startup --export=save.xml --format=xml kea-dhcp6-server
|
|
|
|
|
2023-04-07 15:12:25 +00:00
|
|
|
3. Upgrade Sysrepo to the newer version and then run:
|
2021-07-22 23:37:48 +03:00
|
|
|
|
|
|
|
.. code-block:: console
|
|
|
|
|
|
|
|
$ sysrepocfg --datastore running --edit=save.xml
|
|
|
|
$ sysrepocfg --datastore startup --edit=save.xml
|