backends.json 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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
  57. // database. Make sure it is up, running and properly initialized. See
  58. // kea-admin documentation for details on how to initialize the
  59. // database. The only strictly required parameters are type, keyspace
  60. // and contact-points. At least one contact point must be specified, but
  61. // more than one is required for redundancy. Make sure you specify the
  62. // contact points without spaces. Kea must be compiled with --with-cql
  63. // option to use this backend.
  64. // "lease-database": {
  65. // "type": "cql",
  66. // "keyspace": "keatest",
  67. // "contact-points": "192.0.2.1,192.0.2.2,192.0.2.3",
  68. // "port": 9042
  69. // },
  70. // Addresses will be assigned with a lifetime of 4000 seconds.
  71. "valid-lifetime": 4000,
  72. // Renew and rebind timers are commented out. This implies that options
  73. // 58 and 59 will not be sent to the client. In this case it is up to
  74. // the client to pick the timer values according to RFC2131. Uncomment the
  75. // timers to send these options to the client.
  76. // "renew-timer": 1000,
  77. // "rebind-timer": 2000,
  78. // The following list defines subnets. We have only one subnet
  79. // here. We tell Kea that it is directly available over local interface.
  80. "subnet4": [
  81. {
  82. "pools": [ { "pool": "192.0.2.1 - 192.0.2.200" } ],
  83. "subnet": "192.0.2.0/24",
  84. "interface": "ethX"
  85. }
  86. ]
  87. },
  88. // The following configures logging. It assumes that messages with at
  89. // least informational level (info, warn, error and fatal) should be
  90. // logged to stdout.
  91. "Logging": {
  92. "loggers": [
  93. {
  94. "name": "kea-dhcp4",
  95. "output_options": [
  96. {
  97. "output": "stdout"
  98. }
  99. ],
  100. "severity": "INFO"
  101. }
  102. ]
  103. }
  104. }