glfs/networking/connect/kea.xml

533 lines
16 KiB
XML
Raw Normal View History

2023-05-08 03:41:58 +08:00
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % general-entities SYSTEM "../../general.ent">
%general-entities;
<!ENTITY kea-download-http "https://downloads.isc.org/isc/kea/&kea-dhcp-version;/kea-&kea-dhcp-version;.tar.gz">
<!ENTITY kea-download-ftp "ftp://ftp.isc.org/isc/kea/&kea-dhcp-version;/kea-&kea-dhcp-version;.tar.gz">
<!ENTITY kea-md5sum "a0dae4b38288cb8c6fca4ff71b9c9c73">
<!ENTITY kea-size "9.8 MB">
<!ENTITY kea-buildsize "1.9 GB">
<!ENTITY kea-time "5 SBU"> <!-- CHECK -->
2023-06-11 19:54:16 +08:00
<!ENTITY kea-arm-vers "2.2.0">
2023-05-08 03:41:58 +08:00
]>
<sect1 id="kea" xreflabel="KEA-&kea-dhcp-version;">
<?dbhtml filename="kea.html"?>
<title>Kea &kea-dhcp-version;</title>
<indexterm zone="kea">
<primary sortas="a-KEA">Kea</primary>
</indexterm>
<sect2 role="package">
<title>Introduction to ISC Kea</title>
<para>
2023-06-11 19:54:16 +08:00
The <application>ISC Kea</application> package contains the
2023-05-08 03:41:58 +08:00
server programs for DHCP. It is the successor of the
<xref linkend="dhcp"/> server which is end-of-life since December 2022.
</para>
&lfs113_checked;
<bridgehead renderas="sect3">Package Information</bridgehead>
<itemizedlist spacing="compact">
<listitem>
<para>
Download (HTTP): <ulink url="&kea-download-http;"/>
</para>
</listitem>
<listitem>
<para>
Download (FTP): <ulink url="&kea-download-ftp;"/>
</para>
</listitem>
<listitem>
<para>
Download MD5 sum: &kea-md5sum;
</para>
</listitem>
<listitem>
<para>
Download size: &kea-size;
</para>
</listitem>
<listitem>
<para>
Estimated disk space required: &kea-buildsize;
</para>
</listitem>
<listitem>
<para>
Estimated build time: &kea-time;
</para>
</listitem>
</itemizedlist>
<bridgehead renderas="sect3">Kea Dependencies</bridgehead>
<bridgehead renderas="sect4">Required</bridgehead>
<para role="required">
<xref linkend="boost"/>,
2023-05-08 03:41:58 +08:00
<xref linkend="log4cplus"/>
</para>
2023-06-11 19:54:16 +08:00
<bridgehead renderas="sect4">Optional</bridgehead>
<para role="optional">
<xref linkend="doxygen"/>,
<xref linkend="graphviz"/>,
<xref linkend="mitkrb"/>,
<xref linkend="sphinx_rtd_theme"/>
</para>
<bridgehead renderas="sect4">Optional database backends</bridgehead>
<para role="optional">
<xref linkend="mariadb"/> or <ulink url="https://www.mysql.com/">MySQL</ulink>,
<xref linkend="postgresql"/>
</para>
2023-05-08 03:41:58 +08:00
<para condition="html" role="usernotes">User Notes:
<ulink url="&blfs-wiki;/kea"/>
</para>
</sect2>
<sect2 role="kernel" id="kea-dhcp-kernel">
<title>Kernel Configuration</title>
<para>
You must have Packet Socket support. IPv6 support is optional.
</para>
<screen><literal>[*] Networking support ---&gt; [CONFIG_NET]
Networking options ---&gt;
&lt;*&gt; Packet socket [CONFIG_PACKET]
&lt;*&gt; The IPv6 Protocol ---&gt; [CONFIG_IPV6]</literal></screen>
<indexterm zone="kea kea-dhcp-kernel">
<primary sortas="k-KEA">Kea</primary>
</indexterm>
</sect2>
<sect2 role="installation">
<title>Installation of ISC Kea DHCP</title>
<para>
Install <application>ISC Kea DHCP</application> by running
the following commands:
</para>
<screen><userinput>./configure --prefix=/usr \
--sysconfdir=/etc \
--docdir=/usr/share/doc/kea-&kea-dhcp-version; \
--localstatedir=/var \
--enable-shell \
--with-openssl &amp;&amp;
make</userinput></screen>
<para>
To test the results, issue: <command>make check</command>.
</para>
<para>
To install the <application>ISC Kea DHCP</application> suite,
issue the following commands as the
<systemitem class="username">root</systemitem> user:
</para>
2023-06-06 17:18:30 +08:00
<screen role="root"><userinput>make -j1 install</userinput></screen>
2023-05-08 03:41:58 +08:00
</sect2>
2023-06-06 17:18:30 +08:00
<sect2 role="commands">
<title>Command Explanations</title>
<para>
<parameter>--with-pgsql</parameter> or <parameter>--with-mysql</parameter>:
<application>ISC Kea</application> can store the leases on a
database. This might be useful in large environments running
a cluster of DHCP servers. Using the <emphasis>memfile</emphasis>
backend (which is a CSV file stored locally) is possible anyhow.
</para>
<para>
<parameter>make -j1 install</parameter>: ISC does not recommend
any form of parallel or job server options when doing the install.
2023-06-06 17:18:30 +08:00
</para>
</sect2>
2023-06-11 19:54:16 +08:00
2023-05-08 03:41:58 +08:00
<sect2 role="configuration">
<title>Configuring ISC Kea DHCP</title>
<para>The support of IPv4, IPv6 and DDNS has been splitted into
separate servers which runs independently from each other. Each
of them has its own configuration file. Additional configuration
files come from the keactrl agent which is uses to control the
servers in an easy way.</para>
2023-06-11 19:54:16 +08:00
<para>Consult the
<ulink url="https://kea.readthedocs.io/en/kea-&kea-arm-vers;/">Kea Administrator Reference Manual</ulink>
for detailled information about the configuration of <application>ISC Kea</application>
as it is a quite capable system. The configuration shown a bare
minimum to get a DHCP server running but it already includes
configuration for DDNS (Dynamic DNS). That setup might be working
for small networks with a few clients and low traffic. For greater
installations with thousands of clients, <application>ISC Kea</application>
can be configured to use databases (mariadb or postgresql) to store
2023-06-11 19:54:16 +08:00
the leases and build a cluster with multiple nodes. It can
be integrated to <ulink url="https://www.isc.org/categories/stork/">ISC Stork</ulink>
2023-06-11 19:54:16 +08:00
which is a management dashboard to <application>ISC Kea</application>.</para>
2023-05-08 03:41:58 +08:00
<sect3 id="kea-dhcp-config">
<title>Config Files</title>
<para>
<filename>/etc/kea/keactrl.conf</filename>,
<filename>/etc/kea/kea-ctrl-agent.conf</filename>,
<filename>/etc/kea/kea-dhcp4.conf</filename>,
<filename>/etc/kea/kea-dhcp6.conf</filename> and
<filename>/etc/kea/kea-dhcp-ddns.conf</filename>
</para>
2023-06-06 17:18:30 +08:00
2023-05-08 03:41:58 +08:00
<indexterm zone="kea keactrl-config">
<primary sortas="e-etc-kea-keactrl.conf">/etc/kea/keactrl.conf</primary>
</indexterm>
2023-06-06 17:18:30 +08:00
<!--
2023-05-08 03:41:58 +08:00
<indexterm zone="kea kea-ctrl-agent-config">
<primary sortas="e-etc-kea-kea-ctrl-agent.conf">/etc/kea/kea-ctrl-agent.conf</primary>
</indexterm>
2023-06-06 17:18:30 +08:00
-->
2023-05-08 03:41:58 +08:00
<indexterm zone="kea kea-dhcp4-config">
<primary sortas="e-etc-kea-dhcp4.conf">/etc/kea/kea-dhcp4.conf</primary>
</indexterm>
2023-06-06 17:18:30 +08:00
<!--
2023-05-08 03:41:58 +08:00
<indexterm zone="kea kea-dhcp6-config">
<primary sortas="e-etc-kea-dhcp6.conf">/etc/kea/kea-dhcp6.conf</primary>
</indexterm>
2023-06-11 19:54:16 +08:00
-->
2023-05-08 03:41:58 +08:00
<indexterm zone="kea kea-dhcp-ddns-config">
<primary sortas="e-etc-kea-dhcp-ddns.conf">/etc/kea/kea-dhcp-ddns.conf</primary>
</indexterm>
</sect3>
<sect3 id="keactrl-config">
<title>Kea Control Configuration</title>
2023-06-06 17:18:30 +08:00
2023-05-08 03:41:58 +08:00
<para><command>keactrl</command> is used to control the
independend servers (IPv4, IPv6, DDNS). Its configuration file
<filename>/etc/kea/keactrl.conf</filename> is installed by
default and includes many path settings which are defined
due to the <command>configure</command> at build time. It also
includes settings to specify which of the servers should be
started.</para>
<itemizedlist>
<listitem>
<para>IPv4 DHCP server</para>
2023-06-06 17:18:30 +08:00
<para>This daemon handles requests for IPv4 addresses.
2023-06-11 19:54:16 +08:00
Set <literal>dhcp4=yes</literal> to start it, set
2023-05-08 03:41:58 +08:00
<literal>dhcp4=no</literal> in case DHCP service for IPv4
is not wanted.</para>
</listitem>
<listitem>
<para>IPv6 DHCP server</para>
2023-06-06 17:18:30 +08:00
<para>This daemon handles requests for IPv6 addresses.
2023-06-11 19:54:16 +08:00
Set <literal>dhcp6=yes</literal> to start it, set
2023-05-08 03:41:58 +08:00
<literal>dhcp6=no</literal> in case DHCP service for IPv6
is not wanted.</para>
</listitem>
<listitem>
<para>Dynamic DNS</para>
2023-06-06 17:18:30 +08:00
<para>This daemon is used to update a DNS server dynamically
2023-06-11 19:54:16 +08:00
when Kea assignes an IP address to a device.
Set <literal>dhcp_ddns=yes</literal> to enable it, set
2023-05-08 03:41:58 +08:00
<literal>dhcp_ddns=no</literal> in case dynamic DNS updates
are not wanted.</para>
</listitem>
<listitem>
<para>Control Agent</para>
2023-06-06 17:18:30 +08:00
<para>The Control Agent is a daemon which allows the
(re)configuration of the Kea DHCP service via REST API.
Set <literal>ctrl_agent=yes</literal> to start the
2023-05-08 03:41:58 +08:00
control agent (service providing a REST API), set
<literal>ctrl_agent=no</literal> in case the control agent
is not needed.</para>
2023-05-08 03:41:58 +08:00
</listitem>
</itemizedlist>
<para>The Netconf service is not installed because required
dependencies are not covered by the current BLFS book.</para>
2023-06-06 17:18:30 +08:00
<para>With the following command, Kea will be configured to
2023-06-11 19:54:16 +08:00
start the dhcp service for IPv4 and the
2023-06-06 17:18:30 +08:00
dynamic DNS update, while the control agent and
the dhcp service for IPv6 remains down. Tweak the command to
match your needs on started services and execute as the
<systemitem class="username">root</systemitem> user:</para>
<screen><userinput role="root">sed -e "s/^dhcp4=.*/dhcp4=yes/" \
-e "s/^dhcp6=.*/dhcp6=no/" \
-e "s/^dhcp_ddns=.*/dhcp_ddns=yes/" \
-e "s/^ctrl_agent=.*/ctrl_agent=no/" \
-i /etc/kea/keactrl.conf
</userinput></screen>
2023-05-08 03:41:58 +08:00
</sect3>
<sect3 id="kea-dhcp4-config">
2023-06-11 19:54:16 +08:00
<title>IPv4 DHCP Server Configuration</title>
<para>
If you want to start the DHCP Server at boot, install the
<phrase revision="sysv"><filename>/etc/rc.d/init.d/kea-dhcpd</filename>
init script</phrase>
<phrase revision="systemd"><filename>kea-dhcpd.service</filename>
unit</phrase> included in the
<xref linkend="bootscripts" revision="sysv"/>
<xref linkend="systemd-units" revision="systemd"/>
package:
</para>
<screen role="root"><userinput>make install-kea-dhcpd</userinput></screen>
2023-05-08 03:41:58 +08:00
<para>
A sample configuration file is created in <filename>/etc/kea/kea-dhcpd4.conf</filename>.
Adjust the file to suit your needs or overwrite it by using
the following sample as the <systemitem class="username">root</systemitem>
user:
</para>
<screen role="nodump" ><userinput>cat &gt; /etc/kea/kea-dhcpd4.conf &lt;&lt; "EOF"
<literal>// Begin /etc/kea/kea-dhcpd4.conf
2023-06-06 17:18:30 +08:00
{
"Dhcp4": {
2023-06-11 19:54:16 +08:00
// Add names of your network interfaces to listen on.
2023-05-08 03:41:58 +08:00
"interfaces-config": {
"interfaces": [ "eth0", "eth2" ]
2023-05-08 03:41:58 +08:00
},
2023-06-11 19:54:16 +08:00
2023-05-08 03:41:58 +08:00
"control-socket": {
"socket-type": "unix",
"socket-name": "/tmp/kea4-ctrl-socket"
2023-05-08 03:41:58 +08:00
},
2023-06-11 19:54:16 +08:00
2023-05-08 03:41:58 +08:00
"lease-database": {
"type": "memfile",
"lfc-interval": 3600
2023-05-08 03:41:58 +08:00
},
2023-06-11 19:54:16 +08:00
"expired-leases-processing": {
"reclaim-timer-wait-time": 10,
"flush-reclaimed-timer-wait-time": 25,
"hold-reclaimed-time": 3600,
"max-reclaim-leases": 100,
"max-reclaim-time": 250,
"unwarned-reclaim-cycles": 5
2023-06-11 19:54:16 +08:00
},
2023-05-08 03:41:58 +08:00
"renew-timer": 900,
"rebind-timer": 1800,
"valid-lifetime": 3600,
2023-06-11 19:54:16 +08:00
// Enable DDNS - Kea will dynamically update the DNS
"ddns-send-updates" : true,
"ddns-qualifying-suffix": "your.domain.tld",
"dhcp-ddns" : {
"enable-updates": true
2023-06-11 19:54:16 +08:00
},
2023-05-08 03:41:58 +08:00
"subnet4": [
{
"subnet": "192.168.56.0/24",
"pools": [ { "pool": "192.168.56.16 - 192.168.56.254" } ],
"option-data": [
{
"name": "domain-name",
"data": "your.domain.tld"
},
{
"name": "domain-name-servers",
"data": "192.168.56.2, 192.168.3.7"
},
{
"name": "domain-search",
"data": "your.domain.tld"
},
{
"name": "routers",
"data": "192.168.56.2"
}
]
}
2023-06-11 19:54:16 +08:00
],
"loggers": [
{
"name": "kea-dhcp4",
"output_options": [
{
"output": "/var/log/kea-dhcp4.log",
"pattern": "%D{%Y-%m-%d %H:%M:%S.%q} %-5p %m\n"
}
],
"severity": "INFO",
"debuglevel": 0
}
2023-05-08 03:41:58 +08:00
]
}
2023-06-06 17:18:30 +08:00
}
2023-05-08 03:41:58 +08:00
// End /etc/kea/kea-dhcpd4.conf</literal>
EOF</userinput></screen>
<para>
The configuration for IPv6 is similar to the configuration
of IPv4. The configuration file is
<filename>/etc/kea/kea-dhcpd6.conf</filename>.
</para>
2023-05-08 03:41:58 +08:00
2023-06-11 19:54:16 +08:00
</sect3>
<sect3 id="kea-dhcp-ddns-config">
<title>Dynamic DNS Configuration</title>
2023-05-08 03:41:58 +08:00
<para>
2023-06-11 19:54:16 +08:00
If there is a <xref linkend="bind"/> server running, <application>ISC Kea</application>
can update the DNS when it gives an IP address to a client.
A sample configuration file is created in <filename>/etc/kea/kea-dhcp-ddns.conf</filename>.
Adjust the file to suit your needs or overwrite it by using
the following sample as the <systemitem class="username">root</systemitem>
user:
2023-05-08 03:41:58 +08:00
</para>
2023-06-11 19:54:16 +08:00
<screen role="nodump" ><userinput>cat &gt; /etc/kea/kea-dhcp-ddns.conf &lt;&lt; "EOF"
<literal>// Begin /etc/kea/kea-dhcp-ddns.conf
{
"DhcpDdns": {
2023-06-11 19:54:16 +08:00
"ip-address": "127.0.0.1",
"port": 53001,
"control-socket": {
"socket-type": "unix",
"socket-name": "/tmp/kea-ddns-ctrl-socket"
2023-06-11 19:54:16 +08:00
},
"tsig-keys": [
{
"name" : "rndc-key",
"algorithm" : "hmac-sha256",
"secret" : "1FU5hD7faYaajQCjSdA54JkTPQxbbPrRnzOKqHcD9cM="
}
2023-06-11 19:54:16 +08:00
],
"forward-ddns" : {
"ddns-domains" : [
{
"name" : "your.domain.tld.",
"dns-servers" : [
2023-06-11 19:54:16 +08:00
{
"ip-address" : "127.0.0.1",
"port" : 53
2023-06-11 19:54:16 +08:00
}
]
}
]
2023-06-11 19:54:16 +08:00
},
"reverse-ddns" : {
"ddns-domains" : [
{
"name" : "56.168.192.in-addr.arpa.",
"dns-servers" : [
2023-06-11 19:54:16 +08:00
{
"ip-address" : "127.0.0.1",
"port" : 53
2023-06-11 19:54:16 +08:00
}
]
}
]
2023-06-11 19:54:16 +08:00
},
2023-05-08 03:41:58 +08:00
2023-06-11 19:54:16 +08:00
"loggers": [
{
"name": "kea-dhcp-ddns",
"output_options": [
{
"output": "/var/log/kea-ddns.log"
"pattern": "%D{%Y-%m-%d %H:%M:%S.%q} %-5p %m\n"
}
],
"severity": "INFO",
"debuglevel": 0
}
2023-06-11 19:54:16 +08:00
]
}
2023-06-11 19:54:16 +08:00
}
// End /etc/kea/kea-dhcp-ddns.conf</literal>
EOF</userinput></screen>
<note>
<para>
The value of <literal>secret</literal> is just an example.
Generate the key for your installation by using the
<command>rndc-confgen -a</command> command or the
<command>tsig-keygen</command> command which both are
provided by <xref linkend="bind"/>.
</para>
</note>
2023-05-08 03:41:58 +08:00
</sect3>
</sect2>
<sect2 role="content">
<title>Contents</title>
<segmentedlist>
<segtitle>Installed Programs</segtitle>
<segtitle>Installed Libraries</segtitle>
<segtitle>Installed Directories</segtitle>
<seglistitem>
<seg>
keactrl, kea-admin, kea-ctrl-agent, kea-dhcp4, kea-dhcp6,
kea-dhcp-ddns, kea-lfc, kea-shell
</seg>
<seg>
libkea-*
</seg>
<seg>
/etc/kea,
/usr/include/kea,
/var/lib/kea
</seg>
</seglistitem>
</segmentedlist>
<variablelist>
<bridgehead renderas="sect3">Short Descriptions</bridgehead>
<?dbfo list-presentation="list"?>
<?dbhtml list-presentation="table"?>
<varlistentry id="keactrl">
<term><command>keactrl</command></term>
<listitem>
<para>
Tool to control the server processes
</para>
<indexterm zone="kea keactrl">
<primary sortas="b-keactrl">keactrl</primary>
</indexterm>
</listitem>
</varlistentry>
<!-- ...to be completed... -->
2023-05-08 03:41:58 +08:00
</variablelist>
</sect2>
</sect1>