From: Marcin Siodelski Date: Mon, 29 Aug 2016 14:32:51 +0000 (+0200) Subject: [3684] Added example file with MySQL host database connection. X-Git-Tag: trac5006_base~8^2~5 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5a5f430db7d63d479a54e146a9ce2d16d5ce4d81;p=thirdparty%2Fkea.git [3684] Added example file with MySQL host database connection. --- diff --git a/doc/Makefile.am b/doc/Makefile.am index be2d9f3752..9b597fb462 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -23,6 +23,7 @@ nobase_dist_doc_DATA += examples/kea6/classify.json nobase_dist_doc_DATA += examples/kea6/hooks.json nobase_dist_doc_DATA += examples/kea6/leases-expiration.json nobase_dist_doc_DATA += examples/kea6/multiple-options.json +nobase_dist_doc_DATA += examples/kea6/mysql-reservations.json nobase_dist_doc_DATA += examples/kea6/reservations.json nobase_dist_doc_DATA += examples/kea6/several-subnets.json nobase_dist_doc_DATA += examples/kea6/simple.json diff --git a/doc/examples/kea6/mysql-reservations.json b/doc/examples/kea6/mysql-reservations.json new file mode 100644 index 0000000000..ec50656ee2 --- /dev/null +++ b/doc/examples/kea6/mysql-reservations.json @@ -0,0 +1,91 @@ +# This is an example configuration file for the DHCPv6 server in Kea. +# It contains configuration of the MySQL host database backend, used +# to retrieve reserved addresses, host names, DHCPv4 message fields +# and DHCP options from MySQL database. +{ "Dhcp6": + +{ +# Kea is told to listen on ethX interface only. + "interfaces-config": { + "interfaces": [ "ethX" ] + }, + +# We need to specify lease type. As of May 2014, three backends are supported: +# memfile, mysql and pgsql. We'll just use memfile, because it doesn't require +# any prior set up. + "lease-database": { + "type": "memfile" + }, + +# This is pretty basic stuff, it has nothing to do with reservations. + "preferred-lifetime": 3000, + "valid-lifetime": 4000, + "renew-timer": 1000, + "rebind-timer": 2000, + +# Kea supports two types of identifiers in DHCPv6: hw-address (hardware/MAC address +# of the client) and duid (DUID inserted by the client). When told to do so, Kea can +# check for each of these identifier types, but it takes a costly database lookup +# to do so. It is therefore useful from a performance perspective to use only +# the reservation types that are actually used in a given network. + "host-reservation-identifiers": [ "duid", "hw-address" ], + +# Specify connection to the database holding host reservations. The type +# specifies that the MySQL database is used. user and password are the +# credentials used to connect to the database. host and name specify +# location of the host where the database instance is running, and the +# name of the database to use. The server processing a packet will first +# check if there are any reservations specified for this client in the +# reservations list, within the subnet (configuration file). If there are +# no reservations there, the server will try to retrieve reservations +# from this database. + "hosts-database": { + "type": "mysql", + "name": "kea", + "user": "kea", + "password": "kea", + "host": "localhost" + }, + +# Define a subnet with a pool of dynamic addresses and a pool of dynamic +# prefixes. Addresses and prefixes from those pools will be assigned to +# clients which don't have reservations in the database. Subnet identifier +# is equal to 1. If this subnet is selected for the client, this subnet +# id will be used to search for the reservations within the database. + "subnet6": [ + { + "subnet": "2001:db8:1::/48", + + "pools": [ { "pool": "2001:db8:1::/80" } ], + + "pd-pools": [ + { + "prefix": "2001:db8:1:8000::", + "prefix-len": 56, + "delegated-len": 64 + } + ], + "interface": "ethX", + "id": 1 + } + ] +}, + +# The following configures logging. Kea will log all debug messages +# to /var/log/kea-debug.log file. +"Logging": { + "loggers": [ + { + "name": "kea-dhcp6", + "output_options": [ + { + "output": "/var/log/kea-debug.log" + } + ], + "debuglevel": 99, + "severity": "DEBUG" + } + ] +} + +}