mysql-reservations.json 3.19 KB
Newer Older
1 2 3 4
// 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.
5 6 7
{ "Dhcp6":

{
8
// Kea is told to listen on ethX interface only.
9 10 11 12
  "interfaces-config": {
    "interfaces": [ "ethX" ]
  },

13 14 15 16
// We need to specify the the database used to store leases. As of
// September 2016, four database backends are supported: MySQL,
// PostgreSQL, Cassandra, and the in-memory database, Memfile.
// We'll use memfile  because it doesn't require any prior set up.
17
  "lease-database": {
18 19
      "type": "memfile",
      "lfc-interval": 3600
20 21
  },

22
// This is pretty basic stuff, it has nothing to do with reservations.
23 24 25 26 27
  "preferred-lifetime": 3000,
  "valid-lifetime": 4000,
  "renew-timer": 1000,
  "rebind-timer": 2000,

28 29 30 31 32 33
// 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.
34 35
    "host-reservation-identifiers": [ "duid", "hw-address" ],

36 37 38 39 40 41 42 43 44
// 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.
45 46 47 48 49
  "hosts-database": {
    "type": "mysql",
    "name": "kea",
    "user": "kea",
    "password": "kea",
50
    "host": "localhost",
51
    "port": 3306,
52
    "readonly": true
53 54
  },

55 56 57 58 59
// 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.
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
  "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
    }
  ]
},

79 80 81
// The following configures logging. It assumes that messages with at
// least informational level (info, warn, error and fatal) should be
// logged to stdout.
82 83 84 85 86 87
"Logging": {
    "loggers": [
        {
            "name": "kea-dhcp6",
            "output_options": [
                {
88
                    "output": "stdout"
89 90
                }
            ],
91 92
            "debuglevel": 0,
            "severity": "INFO"
93 94 95 96 97
        }
    ]
}

}