multiple-options.json 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. # This is an example configuration file for the DHCPv4 server in Kea.
  2. # It demonstrates simple configuration of the options for a subnet.
  3. { "Dhcp4":
  4. {
  5. # Kea is told to listen on ethX interface only.
  6. "interfaces-config": {
  7. "interfaces": [ "ethX" ]
  8. },
  9. # We need to specify the the database used to store leases. As of
  10. # September 2016, four database backends are supported: MySQL,
  11. # PostgreSQL, Cassandra, and the in-memory database, Memfile.
  12. # We'll use memfile because it doesn't require any prior set up.
  13. "lease-database": {
  14. "type": "memfile"
  15. },
  16. # Addresses will be assigned with a lifetime of 4000 seconds.
  17. "valid-lifetime": 4000,
  18. # Renew and rebind timers are commented out. This implies that options
  19. # 58 and 59 will not be sent to the client. In this case it is up to
  20. # the client to pick the timer values according to RFC2131. Uncomment the
  21. # timers to send these options to the client.
  22. # "renew-timer": 1000,
  23. # "rebind-timer": 2000,
  24. // Defining a subnet. There are 3 DHCP options returned to the
  25. // clients connected to this subnet. The first and third options are
  26. // identified by the name. The third option is identified by the
  27. // option code.
  28. "subnet4": [
  29. {
  30. "pools": [ { "pool": "192.0.2.10 - 192.0.2.200" } ],
  31. "subnet": "192.0.2.0/24",
  32. "interface": "ethX",
  33. "option-data": [
  34. {
  35. "name": "domain-name-servers",
  36. "data": "192.0.2.1, 192.0.2.2"
  37. },
  38. {
  39. "name": "routers",
  40. "data": "192.0.2.1"
  41. },
  42. {
  43. // String options that have a comma in their values need to have
  44. // it escaped (i.e. each comma is predeced by two backslashes).
  45. // That's because commas are reserved for separating fields in
  46. // compound options. At the same time, we need to be conformant
  47. // with JSON spec, that does not allow "\,". Therefore the
  48. // slightly uncommon double backslashes notation is needed.
  49. "name": "boot-file-name",
  50. "data": "EST5EDT4\\,M3.2.0/02:00\\,M11.1.0/02:00"
  51. // Legal JSON escapes are \ followed by "\/bfnrt character
  52. // or \u followed by 4 hexa-decimal numbers (currently Kea
  53. // supports only \u0000 to \u00ff code points).
  54. // CSV processing translates '\\' into '\' and '\,' into ','
  55. // only so for instance '\x' is translated into '\x'. But
  56. // as it works on a JSON string value each of these '\'
  57. // characters must be doubled on JSON input.
  58. }
  59. ]
  60. }
  61. ]
  62. },
  63. # The following configures logging. It assumes that messages with at least
  64. # informational level (info, warn, error and fatal) should be logged to stdout.
  65. "Logging": {
  66. "loggers": [
  67. {
  68. "name": "kea-dhcp4",
  69. "output_options": [
  70. {
  71. "output": "stdout"
  72. }
  73. ],
  74. "severity": "INFO"
  75. }
  76. ]
  77. }
  78. }