multiple-options.json 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. // This is an example configuration file for DHCPv6 server in Kea.
  2. // It demonstrates simple configuration of the options for a subnet.
  3. { "Dhcp6":
  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 preferred and valid lifetimes
  17. // being 3000 and 4000, respectively. Client is told to start
  18. // renewing after 1000 seconds. If the server does not respond
  19. // after 2000 seconds since the lease was granted, client is supposed
  20. // to start REBIND procedure (emergency renewal that allows switching
  21. // to a different server).
  22. "preferred-lifetime": 3000,
  23. "valid-lifetime": 4000,
  24. "renew-timer": 1000,
  25. "rebind-timer": 2000,
  26. // Defining a subnet. There are some DHCP options returned to the
  27. // clients connected to this subnet. The first option is identified
  28. // by the name. The second option is identified by the code.
  29. // There are two address pools defined within this subnet. Pool
  30. // specific value for option 12 is defined for the pool:
  31. // 2001:db8:1::1 - 2001:db8:1::100. Clients obtaining an address
  32. // from this pool will be assigned option 12 with a value of
  33. // 3001:cafe::21. Clients belonging to this subnet but obtaining
  34. // addresses from the other pool, or the clients obtaining
  35. // stateless configuration will be assigned subnet specific value
  36. // of option 12, i.e. 2001:db8:1:0:ff00::1.
  37. // For DHCPv6 subnets can have prefix delegation pools too so
  38. // a pd-pools with an option-data is defined too.
  39. "subnet6": [
  40. {
  41. // This is how option values are defined for this particular subnet.
  42. "option-data": [
  43. // When specifying options, you typically need to specify
  44. // one of (name or code) and data. The full option specification
  45. // covers name, code, space, csv-format and data.
  46. // space defaults to "dhcp6" which is usually correct, unless you
  47. // use encapsulate options. csv-format defaults to "true", so
  48. // this is also correct, unless you want to specify the whole
  49. // option value as long hex string. For example, to specify
  50. // domain-name-servers you could do this:
  51. // {
  52. // "name": "dns-servers",
  53. // "code": 23,
  54. // "csv-format": "true",
  55. // "space": "dhcp6",
  56. // "data": "2001:db8:2::45, 2001:db8:2::100"
  57. // }
  58. // but it's a lot of writing, so it's easier to do this instead:
  59. {
  60. "name": "dns-servers",
  61. "data": "2001:db8:2::45, 2001:db8:2::100"
  62. },
  63. // Typically people prefer to refer to options by their
  64. // names, so they don't need to remember the code
  65. // names. However, some people like to use numerical
  66. // values. For example, DHCPv6 can optionally use server
  67. // unicast communication, if extra option is present. Option
  68. // "unicast" uses option code 12, so you can reference to it
  69. // either by "name": "unicast" or "code": 12.
  70. {
  71. "code": 12,
  72. "data": "2001:db8:1:0:ff00::1"
  73. },
  74. // String options that have a comma in their values need to have
  75. // it escaped (i.e. each comma is predeced by two backslashes).
  76. // That's because commas are reserved for separating fields in
  77. // compound options. At the same time, we need to be conformant
  78. // with JSON spec, that does not allow "\,". Therefore the
  79. // slightly uncommon double backslashes notation is needed.
  80. // Legal JSON escapes are \ followed by "\/bfnrt character
  81. // or \u followed by 4 hexa-decimal numbers (currently Kea
  82. // supports only \u0000 to \u00ff code points).
  83. // CSV processing translates '\\' into '\' and '\,' into ','
  84. // only so for instance '\x' is translated into '\x'. But
  85. // as it works on a JSON string value each of these '\'
  86. // characters must be doubled on JSON input.
  87. {
  88. "name": "new-posix-timezone",
  89. "data": "EST5EDT4\\,M3.2.0/02:00\\,M11.1.0/02:00"
  90. },
  91. // Options that take integer values can either be specified in
  92. // dec or hex format. Hex format could be either plain (e.g. abcd)
  93. // or prefixed with 0x (e.g. 0xabcd).
  94. {
  95. "name": "preference",
  96. "data": "0xf0"
  97. },
  98. // A few options are encoded in (length, string) tuples
  99. // which can be defined using only strings as the CSV
  100. // processing computes lengths.
  101. {
  102. "name": "bootfile-param",
  103. "data": "root=/dev/sda2, quiet, splash"
  104. }
  105. ],
  106. "pools": [
  107. {
  108. "pool": "2001:db8:1::1 - 2001:db8:1::100",
  109. "option-data": [
  110. {
  111. "code": 12,
  112. "data": "3001:cafe::21"
  113. }
  114. ]
  115. },
  116. {
  117. "pool": "2001:db8:1::500 - 2001:db8:1::1000"
  118. }
  119. ],
  120. "pd-pools": [
  121. {
  122. "prefix": "2001:2b8:2::",
  123. "prefix-len": 56,
  124. "delegated-len": 64,
  125. "option-data": [
  126. {
  127. "code": 12,
  128. "data": "3001:cafe::12:"
  129. }
  130. ]
  131. }
  132. ],
  133. "subnet": "2001:db8:1::/64",
  134. "interface": "ethX"
  135. }
  136. ]
  137. },
  138. // The following configures logging. It assumes that messages with at
  139. // least informational level (info, warn, error and fatal) should be
  140. // logged to stdout.
  141. "Logging": {
  142. "loggers": [
  143. {
  144. "name": "kea-dhcp6",
  145. "output_options": [
  146. {
  147. "output": "stdout"
  148. }
  149. ],
  150. "debuglevel": 0,
  151. "severity": "INFO"
  152. }
  153. ]
  154. }
  155. }