pgsql-reservations.json 3.1 KB

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