mysql-reservations.json 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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
  28. // identifiers: hw-address (hardware/MAC address of the client), duid
  29. // (DUID inserted by the client), client-id (client identifier inserted
  30. // by the client) and circuit-id (circuit identifier inserted by the
  31. // relay agent). When told to do so, Kea can check for all of those
  32. // identifier types, but it takes a costly database lookup to do so. It
  33. // is therefore useful from a performance perspective to use only the
  34. // reservation types that are actually used in a given network.
  35. // The example below is not optimal from a performance perspective, but it
  36. // nicely showcases the host reservation capabilities. Please use the minimum
  37. // set of identifier types used in your network.
  38. "host-reservation-identifiers":
  39. [ "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. "port": 3306
  56. },
  57. // Define a subnet with a single pool of dynamic addresses. Addresses from
  58. // this pool will be assigned to clients which don't have reservations in the
  59. // database. Subnet identifier is equal to 1. If this subnet is selected for
  60. // the client, this subnet id will be used to search for the reservations
  61. // within the database.
  62. "subnet4": [
  63. {
  64. "pools": [ { "pool": "192.0.2.10 - 192.0.2.200" } ],
  65. "subnet": "192.0.2.0/24",
  66. "interface": "ethX",
  67. "id": 1
  68. }
  69. ]
  70. },
  71. // The following configures logging. It assumes that messages with at
  72. // least informational level (info, warn, error and fatal) should be
  73. // logged to stdout.
  74. "Logging": {
  75. "loggers": [
  76. {
  77. "name": "kea-dhcp4",
  78. "output_options": [
  79. {
  80. "output": "stdout"
  81. }
  82. ],
  83. "severity": "INFO"
  84. }
  85. ]
  86. }
  87. }