mysql-reservations.json 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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 (hardware/MAC address
  25. # of the client) and duid (DUID inserted by the client). When told to do so, Kea can
  26. # check for each of these identifier types, but it takes a costly database lookup
  27. # to do so. It is therefore useful from a performance perspective to use only
  28. # the 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 MySQL 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": "mysql",
  41. "name": "kea",
  42. "user": "kea",
  43. "password": "kea",
  44. "host": "localhost",
  45. "port": 3306,
  46. "readonly": true
  47. },
  48. # Define a subnet with a pool of dynamic addresses and a pool of dynamic
  49. # prefixes. Addresses and prefixes from those pools will be assigned to
  50. # clients which don't have reservations in the database. Subnet identifier
  51. # is equal to 1. If this subnet is selected for the client, this subnet
  52. # id will be used to search for the reservations within the database.
  53. "subnet6": [
  54. {
  55. "subnet": "2001:db8:1::/48",
  56. "pools": [ { "pool": "2001:db8:1::/80" } ],
  57. "pd-pools": [
  58. {
  59. "prefix": "2001:db8:1:8000::",
  60. "prefix-len": 56,
  61. "delegated-len": 64
  62. }
  63. ],
  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-dhcp6",
  75. "output_options": [
  76. {
  77. "output": "stdout"
  78. }
  79. ],
  80. "debuglevel": 0,
  81. "severity": "INFO"
  82. }
  83. ]
  84. }
  85. }