Project

General

Profile

Actions

Feature #17615

open

Introduce KEA DHCP provider for smart-proxy

Added by Konstantin Orekhov over 7 years ago. Updated 6 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
DHCP
Target version:
-
Difficulty:
Triaged:
No
Fixed in Releases:
Found in Releases:

Description

Introduce KEA DHCP provider for smart-proxy.

KEA is next-gen fast milti-node DHCP server by ISC. It uses DB backend not just for leases and reservations, but for a configuration as well.
The (planned) API allows user to query/configure/manage all aspects of KEA and DHCP operations eliminating the need for access to KEA nodes or DB.

However, that API is UNIX sockets only, thus this request to implement RESTful HTTP frontend to that API.

http://kea.isc.org/wiki

Actions #1

Updated by Konstantin Orekhov over 7 years ago

Some additional resources on KEA that Dmitri had asked me in the original thread:

Kea has no management api whatsoever (it's a step backwards compared to dhcpd in this regard), which makes it pretty challenging to interface with it.

As per KEA's engineers, here's the current state of API - http://kea.isc.org/wiki/ControlAPIDesign.
and http://kea.isc.org/wiki/ControlAPIRequirements.

It's something, and in a way better than parsing leases file (oth it's worse -- db schemas change more often, which makes such an interface brittle). I don't remember finding db schema docs though, and personally would be hesitant to jump in before the project publishes this information.

KEA team response:
--------------------
The schemas are stable for a while, but we occasionally add something new. Obviously, our goal is to keep the changes backward compatible, but if that's not possible, we try to make the old schema migration as easy as possible. So far we mostly added new columns and new tables and not changed any of the existing fields. As you may be aware, we do have support for MySQL, PostgreSQL and recently added support for Cassandra, which remains a bit experimental. Regarding our schemas, you may want to read the following:
http://kea.isc.org/docs/kea-guide.html#kea-database-version

Sections 4.1 through 4.3 give you a good overview. As for the actual schemas, they're available in src/share/database/scripts in the Kea sources. Here's the direct link for our github repo:

https://github.com/isc-projects/kea/tree/master/src/share/database/scripts

For example, for MySQL go to mysql/dhcpdb_create.mysql for the latest schema or check the upgrade_A.B_to_C.D files for upgrade scripts for older schemas.
--------------------

Until KEA APIs are released, this page describes interactions with the DB directly (something I think KEA smart-proxy could use now) - http://kea.isc.org/wiki/HostReservationsHowTo

Actions #2

Updated by Perry Gagne almost 7 years ago

Looks like there management API is coming along.

http://kea.isc.org/wiki/Commands

Actions #3

Updated by Matt Williams over 5 years ago

Perry Gagne wrote:

Looks like there management API is coming along.

http://kea.isc.org/wiki/Commands

As of Kea 1.2 (released April 2017), there is a full REST API provided https://kea.isc.org/docs/kea-guide.html#kea-ctrl-agent and https://kea.isc.org/docs/kea-guide.html#ctrl-channel

Actions #4

Updated by Lukas Zapletal over 1 year ago

For the record, a smart proxy plugin does seem to exist, but the code is not available (e.g. might not be even open source): https://rubygems.org/gems/smart_proxy_dhcp_kea

Actions #5

Updated by Bernhard Suttner over 1 year ago

I contacted the author of the smart_proxy_dhcp_kea plugin. Hope he will respond and provide the source code of the plugin.

Actions #6

Updated by Djerk Geurts over 1 year ago

Bernhard Suttner wrote:

I contacted the author of the smart_proxy_dhcp_kea plugin. Hope he will respond and provide the source code of the plugin.

Thank you!

As a note of caution, this plugin expects a local KEA installation. As such it doesn't use a REST API for remotely managing a KEA server. At least that's my understanding from the example config file /usr/local/share/gems/gems/smart_proxy_dhcp_kea-0.1.2/config/dhcp_remote_kea.yml.example:

---
#
# Configuration file for ISC dhcp provider
#

#:config: /etc/dhcp/dhcpd.conf
#:leases: /var/lib/dhcpd/dhcpd.leases
#
# Redhat 5
#
#:config: /etc/dhcpd.conf
#
# Settings for Ubuntu
#
#:config: /etc/dhcp3/dhcpd.conf
#:leases: /var/lib/dhcp3/dhcpd.leases

# Specifies TSIG key name and secret
#:key_name: secret_key_name
#:key_secret: secret_key

#:omapi_port: 7911

# use :server setting in dhcp.yml if you are managing a dhcp server which is not localhost
Actions #7

Updated by Stephen Collier 6 months ago

the repo is at
https://gitlab.cern.ch/pcifra/smart-proxy-dhcp-kea
Source code can be examined

Actions

Also available in: Atom PDF