mysql-reservations.json 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. // This is an example configuration file for the DHCPv6 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. { "Dhcp6":
  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. // This is pretty basic stuff, it has nothing to do with reservations.
  20. "preferred-lifetime": 3000,
  21. "valid-lifetime": 4000,
  22. "renew-timer": 1000,
  23. "rebind-timer": 2000,
  24. // Kea supports two types of identifiers in DHCPv6: hw-address
  25. // (hardware/MAC address of the client) and duid (DUID inserted by the
  26. // client). When told to do so, Kea can check for each of these
  27. // identifier types, but it takes a costly database lookup to do so. It
  28. // is therefore useful from a performance perspective to use only the
  29. // reservation types that are actually used in a given network.
  30. "host-reservation-identifiers": [ "duid", "hw-address" ],
  31. // Specify connection to the database holding host reservations. The type
  32. // specifies that the MySQL database is used. user and password are the
  33. // credentials used to connect to the database. host and name specify
  34. // location of the host where the database instance is running, and the
  35. // name of the database to use. The server processing a packet will first
  36. // check if there are any reservations specified for this client in the
  37. // reservations list, within the subnet (configuration file). If there are
  38. // no reservations there, the server will try to retrieve reservations
  39. // from this database.
  40. "hosts-database": {
  41. "type": "mysql",
  42. "name": "kea",
  43. "user": "kea",
  44. "password": "kea",
  45. "host": "localhost",
  46. "port": 3306,
  47. "readonly": true
  48. },
  49. // Define a subnet with a pool of dynamic addresses and a pool of dynamic
  50. // prefixes. Addresses and prefixes from those pools will be assigned to
  51. // clients which don't have reservations in the database. Subnet identifier
  52. // is equal to 1. If this subnet is selected for the client, this subnet
  53. // id will be used to search for the reservations within the database.
  54. "subnet6": [
  55. {
  56. "subnet": "2001:db8:1::/48",
  57. "pools": [ { "pool": "2001:db8:1::/80" } ],
  58. "pd-pools": [
  59. {
  60. "prefix": "2001:db8:1:8000::",
  61. "prefix-len": 56,
  62. "delegated-len": 64
  63. }
  64. ],
  65. "interface": "ethX",
  66. "id": 1
  67. }
  68. ]
  69. },
  70. // The following configures logging. It assumes that messages with at
  71. // least informational level (info, warn, error and fatal) should be
  72. // logged to stdout.
  73. "Logging": {
  74. "loggers": [
  75. {
  76. "name": "kea-dhcp6",
  77. "output_options": [
  78. {
  79. "output": "stdout"
  80. }
  81. ],
  82. "debuglevel": 0,
  83. "severity": "INFO"
  84. }
  85. ]
  86. }
  87. }