mysql-reservations.json 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. # This is an example configuration file for the DHCPv4 server in Kea.
  2. # It contains configuration of the MySQL host database backend, used
  3. # to retrieve reserved addresses, host names, DHCPv4 message fields
  4. # and DHCP options from MySQL database.
  5. { "Dhcp4":
  6. {
  7. # Kea is told to listen on ethX interface only.
  8. "interfaces-config": {
  9. "interfaces": [ "ethX" ]
  10. },
  11. # We need to specify lease type. As of May 2014, three backends are supported:
  12. # memfile, mysql and pgsql. We'll just use memfile, because it doesn't require
  13. # any prior set up.
  14. "lease-database": {
  15. "type": "memfile"
  16. },
  17. # Addresses will be assigned with valid lifetimes being 4000. Client
  18. # is told to start renewing after 1000 seconds. If the server does not respond
  19. # after 2000 seconds since the lease was granted, client is supposed
  20. # to start REBIND procedure (emergency renewal that allows switching
  21. # to a different server).
  22. "valid-lifetime": 4000,
  23. # Renew and rebind timers are commented out. This implies that options
  24. # 58 and 59 will not be sent to the client. In this case it is up to
  25. # the client to pick the timer values according to RFC2131. Uncomment the
  26. # timers to send these options to the client.
  27. # "renew-timer": 1000,
  28. # "rebind-timer": 2000,
  29. # Kea supports reservations by several different types of identifiers:
  30. # hw-address (hardware/MAC address of the client), duid (DUID inserted by the
  31. # client), client-id (client identifier inserted by the client) and circuit-id
  32. # (circuit identifier inserted by the relay agent). When told to do so, Kea can
  33. # check for all of those identifier types, but it takes a costly database lookup
  34. # to do so. It is therefore useful from a performance perspective to use only
  35. # the reservation types that are actually used in a given network.
  36. # The example below is not optimal from a performance perspective, but it
  37. # nicely showcases the host reservation capabilities. Please use the minimum
  38. # set of identifier types used in your network.
  39. "host-reservation-identifiers": [ "circuit-id", "hw-address", "duid", "client-id" ],
  40. # Specify connection to the database holding host reservations. The type
  41. # specifies that the MySQL database is used. user and password are the
  42. # credentials used to connect to the database. host and name specify
  43. # location of the host where the database instance is running, and the
  44. # name of the database to use. The server processing a packet will first
  45. # check if there are any reservations specified for this client in the
  46. # reservations list, within the subnet (configuration file). If there are
  47. # no reservations there, the server will try to retrieve reservations
  48. # from this database.
  49. "hosts-database": {
  50. "type": "mysql",
  51. "name": "kea",
  52. "user": "kea",
  53. "password": "kea",
  54. "host": "localhost"
  55. },
  56. # Define a subnet with a single pool of dynamic addresses. Addresses from
  57. # this pool will be assigned to clients which don't have reservations in the
  58. # database. Subnet identifier is equal to 1. If this subnet is selected for
  59. # the client, this subnet id will be used to search for the reservations
  60. # within the database.
  61. "subnet4": [
  62. {
  63. "pools": [ { "pool": "192.0.2.10 - 192.0.2.200" } ],
  64. "subnet": "192.0.2.0/24",
  65. "interface": "ethX",
  66. "id": 1
  67. }
  68. ]
  69. },
  70. # The following configures logging. It assumes that messages with at least
  71. # informational level (info, warn, error) will will be logged to stdout.
  72. "Logging": {
  73. "loggers": [
  74. {
  75. "name": "kea-dhcp4",
  76. "output_options": [
  77. {
  78. "output": "stdout"
  79. }
  80. ],
  81. "severity": "INFO"
  82. }
  83. ]
  84. }
  85. }