mysql-reservations.json 3.5 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 the the database used to store leases. As of
  12. // September 2016, four database backends are supported: MySQL,
  13. // PostgreSQL, Cassandra, and the in-memory database, Memfile.
  14. // We'll use memfile because it doesn't require any prior set up.
  15. "lease-database": {
  16. "type": "memfile",
  17. "lfc-interval": 3600
  18. },
  19. // Addresses will be assigned with a lifetime of 4000 seconds.
  20. "valid-lifetime": 4000,
  21. // Renew and rebind timers are commented out. This implies that options
  22. // 58 and 59 will not be sent to the client. In this case it is up to
  23. // the client to pick the timer values according to RFC2131. Uncomment the
  24. // timers to send these options to the client.
  25. // "renew-timer": 1000,
  26. // "rebind-timer": 2000,
  27. // Kea supports reservations by several different types of identifiers:
  28. // hw-address (hardware/MAC address of the client), duid (DUID inserted by the
  29. // client), client-id (client identifier inserted by the client) and circuit-id
  30. // (circuit identifier inserted by the relay agent). When told to do so, Kea can
  31. // check for all of those identifier types, but it takes a costly database lookup
  32. // to do so. It is therefore useful from a performance perspective to use only
  33. // the reservation types that are actually used in a given network.
  34. // The example below is not optimal from a performance perspective, but it
  35. // nicely showcases the host reservation capabilities. Please use the minimum
  36. // set of identifier types used in your network.
  37. "host-reservation-identifiers": [ "circuit-id", "hw-address", "duid", "client-id" ],
  38. // Specify connection to the database holding host reservations. The type
  39. // specifies that the MySQL database is used. user and password are the
  40. // credentials used to connect to the database. host and name specify
  41. // location of the host where the database instance is running, and the
  42. // name of the database to use. The server processing a packet will first
  43. // check if there are any reservations specified for this client in the
  44. // reservations list, within the subnet (configuration file). If there are
  45. // no reservations there, the server will try to retrieve reservations
  46. // from this database.
  47. "hosts-database": {
  48. "type": "mysql",
  49. "name": "kea",
  50. "user": "kea",
  51. "password": "kea",
  52. "host": "localhost",
  53. "port": 3306
  54. },
  55. // Define a subnet with a single pool of dynamic addresses. Addresses from
  56. // this pool will be assigned to clients which don't have reservations in the
  57. // database. Subnet identifier is equal to 1. If this subnet is selected for
  58. // the client, this subnet id will be used to search for the reservations
  59. // within the database.
  60. "subnet4": [
  61. {
  62. "pools": [ { "pool": "192.0.2.10 - 192.0.2.200" } ],
  63. "subnet": "192.0.2.0/24",
  64. "interface": "ethX",
  65. "id": 1
  66. }
  67. ]
  68. },
  69. // The following configures logging. It assumes that messages with at least
  70. // informational level (info, warn, error and fatal) should be logged to stdout.
  71. "Logging": {
  72. "loggers": [
  73. {
  74. "name": "kea-dhcp4",
  75. "output_options": [
  76. {
  77. "output": "stdout"
  78. }
  79. ],
  80. "severity": "INFO"
  81. }
  82. ]
  83. }
  84. }