backends.json 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. # This is an example configuration file for the DHCPv4 server in Kea.
  2. # It is a basic scenario with one IPv4 subnet configured. It demonstrates
  3. # how to configure Kea to use various backends to store leases:
  4. # - memfile
  5. # - MySQL
  6. # - PostgreSQL
  7. # - CQL (Cassandra) backend
  8. { "Dhcp4":
  9. {
  10. # Kea is told to listen on ethX interface only.
  11. "interfaces-config": {
  12. "interfaces": [ "ethX" ]
  13. },
  14. # We need to specify lease type. Exactly one lease-database section
  15. # should be present. Make sure you uncomment only one.
  16. # 1. memfile backend. Leases information will be stored in flat CSV file.
  17. # This is the easiest backend to use as it does not require any extra
  18. # dependencies or services running.
  19. # "lease-database": {
  20. # "type": "memfile",
  21. # "persist": true,
  22. # "lfc-interval": 3600
  23. # },
  24. # 2. MySQL backend. Leases will be stored in MySQL database. Make sure it
  25. # is up, running and properly initialized. See kea-admin documentation
  26. # for details on how to initialize the database. The only strictly required
  27. # parameters are type and name. If other parameters are not specified,
  28. # Kea will assume the database is available on localhost, that user and
  29. # password is not necessary to connect and that timeout is 5 seconds.
  30. # Kea must be compiled with --with-dhcp-mysql option to use this backend.
  31. # "lease-database": {
  32. # "type": "mysql",
  33. # "name": "keatest",
  34. # "host": "localhost",
  35. # "port": 3306,
  36. # "user": "keatest",
  37. # "password": "secret1",
  38. # "connect-timeout": 3
  39. # },
  40. # 3. PostgreSQL backend. Leases will be stored in PostgreSQL database. Make
  41. # sure it is up, running and properly initialized. See kea-admin documentation
  42. # for details on how to initialize the database. The only strictly required
  43. # parameters are type and name. If other parameters are not specified,
  44. # Kea will assume the database is available on localhost, that user and
  45. # password is not necessary to connect and that timeout is 5 seconds.
  46. # Kea must be compiled with --with-dhcp-pgsql option to use this backend.
  47. # "lease-database": {
  48. # "type": "pgsql",
  49. # "name": "keatest",
  50. # "host": "localhost",
  51. # "port": 5432,
  52. # "user": "keatest",
  53. # "password": "secret1",
  54. # "connect-timeout": 3
  55. # },
  56. # 4. CQL (Cassandra) backend. Leases will be stored in Cassandra database. Make
  57. # sure it is up, running and properly initialized. See kea-admin documentation
  58. # for details on how to initialize the database. The only strictly required
  59. # parameters are type, keyspace and contact-points. At least one contact point
  60. # must be specified, but more than one is required for redundancy. Make sure
  61. # you specify the contact points without spaces. Kea must be compiled with
  62. # --with-cql option to use this backend.
  63. # "lease-database": {
  64. # "type": "cql",
  65. # "keyspace": "keatest",
  66. # "contact-points": "192.0.2.1,192.0.2.2,192.0.2.3",
  67. # "port": 9042
  68. # },
  69. # Addresses will be assigned with a lifetime of 4000 seconds.
  70. "valid-lifetime": 4000,
  71. # Renew and rebind timers are commented out. This implies that options
  72. # 58 and 59 will not be sent to the client. In this case it is up to
  73. # the client to pick the timer values according to RFC2131. Uncomment the
  74. # timers to send these options to the client.
  75. # "renew-timer": 1000,
  76. # "rebind-timer": 2000,
  77. # The following list defines subnets. We have only one subnet
  78. # here. We tell Kea that it is directly available over local interface.
  79. "subnet4": [
  80. {
  81. "pools": [ { "pool": "192.0.2.1 - 192.0.2.200" } ],
  82. "subnet": "192.0.2.0/24",
  83. "interface": "ethX"
  84. }
  85. ]
  86. },
  87. # The following configures logging. It assumes that messages with at least
  88. # informational level (info, warn, error and fatal) should be logged to stdout.
  89. "Logging": {
  90. "loggers": [
  91. {
  92. "name": "kea-dhcp4",
  93. "output_options": [
  94. {
  95. "output": "stdout"
  96. }
  97. ],
  98. "severity": "INFO"
  99. }
  100. ]
  101. }
  102. }