pgsql-reservations.json 3.51 KB
Newer Older
1 2 3 4
// This is an example configuration file for the DHCPv4 server in Kea.
// It contains configuration of the PostgreSQL host database backend, used
// to retrieve reserved addresses, host names, DHCPv4 message fields
// and DHCP options from PostgreSQL database.
5 6 7
{ "Dhcp4":

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

13

14 15 16 17
// 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.
18 19 20 21
  "lease-database": {
    "type": "memfile"
  },

22
// Addresses will be assigned with a lifetime of 4000 seconds.
23 24
  "valid-lifetime": 4000,

25 26 27 28 29 30
// Renew and rebind timers are commented out. This implies that options
// 58 and 59 will not be sent to the client. In this case it is up to
// the client to pick the timer values according to RFC2131. Uncomment the
// timers to send these options to the client.
//  "renew-timer": 1000,
//  "rebind-timer": 2000,
31 32


33 34 35 36 37 38 39 40
// Kea supports reservations by several different types of
// identifiers: hw-address (hardware/MAC address of the client), duid
// (DUID inserted by the client), client-id (client identifier inserted
// by the client) and circuit-id (circuit identifier inserted by the
// relay agent). When told to do so, Kea can check for all of those
// 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.
41

42 43 44
// The example below is not optimal from a performance perspective, but it
// nicely showcases the host reservation capabilities. Please use the minimum
// set of identifier types used in your network.
45 46
  "host-reservation-identifiers":
    [ "circuit-id", "hw-address", "duid", "client-id" ],
47

48 49 50 51 52 53 54 55 56
// Specify connection to the database holding host reservations. The type
// specifies that the PostgreSQL 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.
57 58 59 60 61 62 63 64
  "hosts-database": {
    "type": "postgresql",
    "name": "kea",
    "user": "kea",
    "password": "kea",
    "host": "localhost"
  },

65 66 67 68 69
// Define a subnet with a single pool of dynamic addresses. Addresses from
// this pool 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.
70 71 72 73 74 75 76 77 78 79
  "subnet4": [
    {
       "pools": [ { "pool":  "192.0.2.10 - 192.0.2.200" } ],
       "subnet": "192.0.2.0/24",
       "interface": "ethX",
       "id": 1
    }
  ]
},

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

}