From 1eb3eae862f943f47c6e3d90472813aad5f390f4 Mon Sep 17 00:00:00 2001 From: Marcin Siodelski Date: Thu, 23 May 2019 09:36:21 +0200 Subject: [PATCH] [#71,!314] Added config-backend.json examples. --- doc/Makefile.am | 2 + doc/examples/kea4/config-backend.json | 78 +++++++++++++++++++++++++++ doc/examples/kea6/config-backend.json | 78 +++++++++++++++++++++++++++ 3 files changed, 158 insertions(+) create mode 100644 doc/examples/kea4/config-backend.json create mode 100644 doc/examples/kea6/config-backend.json diff --git a/doc/Makefile.am b/doc/Makefile.am index 18aaeaf90d..8c98c82405 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -26,6 +26,7 @@ nobase_dist_doc_DATA += examples/kea4/cassandra.json nobase_dist_doc_DATA += examples/kea4/classify.json nobase_dist_doc_DATA += examples/kea4/classify2.json nobase_dist_doc_DATA += examples/kea4/comments.json +nobase_dist_doc_DATA += examples/kea4/config-backend.json nobase_dist_doc_DATA += examples/kea4/dhcpv4-over-dhcpv6.json nobase_dist_doc_DATA += examples/kea4/global-reservations.json nobase_dist_doc_DATA += examples/kea4/ha-load-balancing-primary.json @@ -48,6 +49,7 @@ nobase_dist_doc_DATA += examples/kea6/cassandra.json nobase_dist_doc_DATA += examples/kea6/classify.json nobase_dist_doc_DATA += examples/kea6/classify2.json nobase_dist_doc_DATA += examples/kea6/comments.json +nobase_dist_doc_DATA += examples/kea6/config-backend.json nobase_dist_doc_DATA += examples/kea6/dhcpv4-over-dhcpv6.json nobase_dist_doc_DATA += examples/kea6/duid.json nobase_dist_doc_DATA += examples/kea6/global-reservations.json diff --git a/doc/examples/kea4/config-backend.json b/doc/examples/kea4/config-backend.json new file mode 100644 index 0000000000..e695716785 --- /dev/null +++ b/doc/examples/kea4/config-backend.json @@ -0,0 +1,78 @@ +// This is an example configuration file for the DHCPv4 server in Kea. +// It demonstrates how to enable Kea Configuration Backend using MySQL. +// It requires that libdhcp_mysql_cb.so library is available and +// optionally libdhcp_cb_cmds.so hooks library. + +{ "Dhcp4": + +{ + // Kea is told to listen on ethX interface only. + "interfaces-config": { + "interfaces": [ "ethX" ] + }, + + // Use memfile lease database backend. + "lease-database": { + "type": "memfile", + "lfc-interval": 3600 + }, + + // This parameter controls how the server accesses the configuration + // database. Currently only one database type is available - "mysql". + // It requires that libdhcp_mysql_cb.so hooks library is loaded. + "config-control": { + // A list of database backends to connect to. Currently, it is limited + // to a single backend. + "config-databases": [ + { + "type": "mysql", + "name": "kea", + "user": "kea", + "password": "kea", + "host": "localhost", + "port": 3306 + } + ], + // Controls how often the server polls the database for the + // configuration updates. The setting below implies that it + // will take up to approx. 20 seconds for the server to + // discover and fetch configuration changes. + "config-fetch-wait-time": 20 + }, + + // Hooks libraries that enable configuration backend are loaded. + "hooks-libraries": [ + // The libdhcp_mysql_cb.so is required to use MySQL Configuration + // Backend. + { + "library": "/usr/local/lib/kea/hooks/libdhcp_mysql_cb.so" + } + // The libdhcp_cb_cmds.so is optional. It allows for managing the + // configuration in the database. If this library is not loaded, + // the configuration can be managed directly using available + // tools that work directly with the MySQL database. + //,{ + // "library": "/usr/local/lib/kea/hooks/libdhcp_cb_cmds.so" + //} + ] +}, + +// The following configures logging. It assumes that messages with at +// least informational level (info, warn, error and fatal) should be +// logged to stdout. Alternatively, you can specify stderr here, a filename +// or 'syslog', which will store output messages via syslog. +"Logging": { + "loggers": [ + { + "name": "kea-dhcp4", + "output_options": [ + { + "output": "stdout" + } + ], + "severity": "INFO" + } + ] +} + +} diff --git a/doc/examples/kea6/config-backend.json b/doc/examples/kea6/config-backend.json new file mode 100644 index 0000000000..73d1dd5245 --- /dev/null +++ b/doc/examples/kea6/config-backend.json @@ -0,0 +1,78 @@ +// This is an example configuration file for the DHCPv4 server in Kea. +// It demonstrates how to enable Kea Configuration Backend using MySQL. +// It requires that libdhcp_mysql_cb.so library is available and +// optionally libdhcp_cb_cmds.so hooks library. + +{ "Dhcp6": + +{ + // Kea is told to listen on ethX interface only. + "interfaces-config": { + "interfaces": [ "ethX" ] + }, + + // Use memfile lease database backend. + "lease-database": { + "type": "memfile", + "lfc-interval": 3600 + }, + + // This parameter controls how the server accesses the configuration + // database. Currently only one database type is available - "mysql". + // It requires that libdhcp_mysql_cb.so hooks library is loaded. + "config-control": { + // A list of database backends to connect to. Currently, it is limited + // to a single backend. + "config-databases": [ + { + "type": "mysql", + "name": "kea", + "user": "kea", + "password": "kea", + "host": "localhost", + "port": 3306 + } + ], + // Controls how often the server polls the database for the + // configuration updates. The setting below implies that it + // will take up to approx. 20 seconds for the server to + // discover and fetch configuration changes. + "config-fetch-wait-time": 20 + }, + + // Hooks libraries that enable configuration backend are loaded. + "hooks-libraries": [ + // The libdhcp_mysql_cb.so is required to use MySQL Configuration + // Backend. + { + "library": "/usr/local/lib/kea/hooks/libdhcp_mysql_cb.so" + } + // The libdhcp_cb_cmds.so is optional. It allows for managing the + // configuration in the database. If this library is not loaded, + // the configuration can be managed directly using available + // tools that work directly with the MySQL database. + //,{ + // "library": "/usr/local/lib/kea/hooks/libdhcp_cb_cmds.so" + //} + ] +}, + +// The following configures logging. It assumes that messages with at +// least informational level (info, warn, error and fatal) should be +// logged to stdout. Alternatively, you can specify stderr here, a filename +// or 'syslog', which will store output messages via syslog. +"Logging": { + "loggers": [ + { + "name": "kea-dhcp6", + "output_options": [ + { + "output": "stdout" + } + ], + "debuglevel": 0, + "severity": "INFO" + } + ] +} +} -- 2.47.2