advanced.json 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. // This is an example configuration file for DHCPv4 server in Kea.
  2. // It covers some of the more advanced features. This file may not be coherent
  3. // as its main purpose is to demonstrate the features. They don't necessarily
  4. // have to make sense used together.
  5. // The new parser supports 3 comment styles:
  6. // This is C++ style.
  7. # This is a bash style.
  8. /* This is a C style comment. */
  9. /* C style comment
  10. can span
  11. multiple lines */
  12. { "Dhcp4":
  13. {
  14. // Kea is told to listen on ethX interface only.
  15. "interfaces-config": {
  16. "interfaces": [ "ethX" ],
  17. // This specifies what type of socket Kea uses. Currently supported
  18. // are 'raw' (which is the default) and 'udp'. Raw has the benefit
  19. // of receiving all traffic every time and a downside of bypassing
  20. // all firewall rules and having marginally bigger performance impact.
  21. // 'udp' is generally better if you have only relayed traffic. Kea
  22. // than opens up normal UDP socket and the kernel does all the
  23. // Ethernet/IP stack processing.
  24. "dhcp-socket-type": "udp"
  25. },
  26. // We need to specify the the database used to store leases. As of
  27. // September 2016, four database backends are supported: MySQL,
  28. // PostgreSQL, Cassandra, and the in-memory database, Memfile.
  29. // We'll use memfile because it doesn't require any prior set up.
  30. // For memfile, it's important to always specify lfc-interval, so
  31. // the lease file would not grow without bounds and be sanitized
  32. // once per hour.
  33. "lease-database": {
  34. "type": "memfile",
  35. "lfc-interval": 3600
  36. },
  37. // Addresses will be assigned with a lifetime of 4000 seconds.
  38. // The client is told to start renewing after 1000 seconds. If the server
  39. // does not respond within 2000 seconds of the lease being granted, client
  40. // is supposed to start REBIND procedure (emergency renewal that allows
  41. // switching to a different server).
  42. "valid-lifetime": 4000,
  43. "renew-timer": 1000,
  44. "rebind-timer": 2000,
  45. // RFC6842 says that the server is supposed to echo back client-id option.
  46. // However, some older clients do not support this and are getting confused
  47. // when they get their own client-id. Kea can disable RFC6842 support.
  48. "echo-client-id": false,
  49. // Some clients don't use stable client identifier, but rather generate them
  50. // during each boot. This may cause a client that reboots frequently to get
  51. // multiple leases, which may not be desirable. As such, sometimes admins
  52. // prefer to tell their DHCPv4 server to ignore client-id value altogether
  53. // and rely exclusively on MAC address. This is a parameter that is defined
  54. // globally, but can be overridden on a subnet level.
  55. "match-client-id": true,
  56. // The following list defines subnets. Each subnet consists of at
  57. // least subnet and pool entries.
  58. "subnet4": [
  59. {
  60. "pools": [ { "pool": "192.0.2.1 - 192.0.2.200" } ],
  61. "subnet": "192.0.2.0/24"
  62. },
  63. {
  64. // This particular subnet has match-client-id value changed.
  65. // This causes Kea to ignore client-id values in this subnet
  66. // and rely exclusively on MAC addresses.
  67. "pools": [ { "pool": "192.0.3.100 - 192.0.3.200" } ],
  68. "subnet": "192.0.3.0/24",
  69. "match-client-id": false
  70. },
  71. {
  72. "pools": [ { "pool": "192.0.4.1 - 192.0.4.254" } ],
  73. "subnet": "192.0.4.0/24"
  74. }
  75. ]
  76. },
  77. // The following configures logging. It assumes that messages with at least
  78. // informational level (info, warn, error and fatal) should be logged to stdout.
  79. "Logging": {
  80. "loggers": [
  81. {
  82. "name": "kea-dhcp4",
  83. "output_options": [
  84. {
  85. "output": "stdout"
  86. }
  87. ],
  88. "severity": "INFO"
  89. }
  90. ]
  91. }
  92. }