kea-dhcp6.conf.pre 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414
  1. // This is a basic configuration for the Kea DHCPv6 server. Subnet declarations
  2. // are mostly commented out and no interfaces are listed. Therefore, the servers
  3. // will not listen or respond to any queries.
  4. // The basic configuration must be extended to specify interfaces on which
  5. // the servers should listen. There are a number of example options defined.
  6. // These probably don't make any sense in your network. Make sure you at least
  7. // update the following, before running this example in your network:
  8. // - change the network interface names
  9. // - change the subnets to match your actual network
  10. // - change the option values to match your network
  11. //
  12. // This is just a very basic configuration. Kea comes with large suite (over 30)
  13. // of configuration examples and extensive Kea User's Guide. Please refer to
  14. // those materials to get better understanding of what this software is able to
  15. // do. Comments in this configuration file sometimes refer to sections for more
  16. // details. These are section numbers in Kea User's Guide. The version matching
  17. // your software should come with your Kea package, but it is also available
  18. // on Kea web page (http://kea.isc.org, click User's Guide, direct link for
  19. // stable version is http://kea.isc.org/docs/kea-guide.html).
  20. {
  21. // DHCPv6 configuration starts here. This section will be read by DHCPv6 server
  22. // and will be ignored by other components.
  23. "Dhcp6": {
  24. // Add names of your network interfaces to listen on.
  25. "interfaces-config": {
  26. // You typically want to put specific interface names here, e.g. eth0
  27. // but you can also specify unicast addresses (e.g. eth0/2001:db8::1) if
  28. // you want your server to handle unicast traffic in addition to
  29. // multicast. (DHCPv6 is a multicast based protocol).
  30. "interfaces": [ ]
  31. },
  32. // Kea support control channel, which is a way to receive management commands
  33. // while the server is running. This is a Unix domain socket that receives
  34. // commands formatted in JSON, e.g. config-set (which sets new configuration),
  35. // config-reload (which tells Kea to reload its configuration from file),
  36. // statistic-get (to retrieve statistics) and many more. For detailed
  37. // description, see Sections 9.12, 16 and 15.
  38. "control-socket": {
  39. "socket-type": "unix",
  40. "socket-name": "/tmp/kea-dhcp6-ctrl.sock"
  41. },
  42. // Use Memfile lease database backend to store leases in a CSV file.
  43. // Depending on how Kea was compiled, it may also support SQL databases
  44. // (MySQL and/or PostgreSQL) and even Cassandra. Those database backends
  45. // require more parameters, like name, host and possibly user and password.
  46. // There are dedicated examples for each backend. See Section 8.2.2 "Lease
  47. // Storage" for details.
  48. "lease-database": {
  49. "type": "memfile"
  50. },
  51. // Kea allows storing host reservations in a database. If your network is
  52. // small or you have few reservations, it's probably easier to keep them
  53. // in the configuration file. If your network is large, it's usually better
  54. // to use database for it. To enable it, uncomment the following:
  55. // "hosts-database": {
  56. // "type": "mysql",
  57. // "name": "kea",
  58. // "user": "kea",
  59. // "password": "kea",
  60. // "host": "localhost",
  61. // "port": 3306
  62. // },
  63. // See Section 8.2.3 "Hosts storage" for details.
  64. // Setup reclamation of the expired leases and leases affinity.
  65. // Expired leases will be reclaimed every 10 seconds. Every 25
  66. // seconds reclaimed leases, which have expired more than 3600
  67. // seconds ago, will be removed. The limits for leases reclamation
  68. // are 100 leases or 250 ms for a single cycle. A warning message
  69. // will be logged if there are still expired leases in the
  70. // database after 5 consecutive reclamation cycles.
  71. "expired-leases-processing": {
  72. "reclaim-timer-wait-time": 10,
  73. "flush-reclaimed-timer-wait-time": 25,
  74. "hold-reclaimed-time": 3600,
  75. "max-reclaim-leases": 100,
  76. "max-reclaim-time": 250,
  77. "unwarned-reclaim-cycles": 5
  78. },
  79. // These parameters govern global timers. Addresses will be assigned with
  80. // preferred and valid lifetimes being 3000 and 4000, respectively. Client
  81. // is told to start renewing after 1000 seconds. If the server does not
  82. // respond after 2000 seconds since the lease was granted, a client is
  83. // supposed to start REBIND procedure (emergency renewal that allows
  84. // switching to a different server).
  85. "renew-timer": 1000,
  86. "rebind-timer": 2000,
  87. "preferred-lifetime": 3000,
  88. "valid-lifetime": 4000,
  89. // These are global options. They are going to be sent when a client requests
  90. // them, unless overwritten with values in more specific scopes. The scope
  91. // hierarchy is:
  92. // - global
  93. // - subnet
  94. // - class
  95. // - host
  96. //
  97. // Not all of those options make sense. Please configure only those that
  98. // are actually useful in your network.
  99. //
  100. // For a complete list of options currently supported by Kea, see
  101. // Section 8.2.9 "Standard DHCPv6 Options". Kea also supports
  102. // vendor options (see Section 7.2.10) and allows users to define their
  103. // own custom options (see Section 7.2.9).
  104. "option-data": [
  105. // When specifying options, you typically need to specify
  106. // one of (name or code) and data. The full option specification
  107. // covers name, code, space, csv-format and data.
  108. // space defaults to "dhcp6" which is usually correct, unless you
  109. // use encapsulate options. csv-format defaults to "true", so
  110. // this is also correct, unless you want to specify the whole
  111. // option value as long hex string. For example, to specify
  112. // domain-name-servers you could do this:
  113. // {
  114. // "name": "dns-servers",
  115. // "code": 23,
  116. // "csv-format": "true",
  117. // "space": "dhcp6",
  118. // "data": "2001:db8:2::45, 2001:db8:2::100"
  119. // }
  120. // but it's a lot of writing, so it's easier to do this instead:
  121. {
  122. "name": "dns-servers",
  123. "data": "2001:db8:2::45, 2001:db8:2::100"
  124. },
  125. // Typically people prefer to refer to options by their names, so they
  126. // don't need to remember the code names. However, some people like
  127. // to use numerical values. For example, DHCPv6 can optionally use
  128. // server unicast communication, if extra option is present. Option
  129. // "unicast" uses option code 12, so you can reference to it either
  130. // by "name": "unicast" or "code": 12. If you enable this option,
  131. // you really should also tell the server to listen on that address
  132. // (see interfaces-config/interfaces list above).
  133. {
  134. "code": 12,
  135. "data": "2001:db8::1"
  136. },
  137. // String options that have a comma in their values need to have
  138. // it escaped (i.e. each comma is preceded by two backslashes).
  139. // That's because commas are reserved for separating fields in
  140. // compound options. At the same time, we need to be conformant
  141. // with JSON spec, that does not allow "\,". Therefore the
  142. // slightly uncommon double backslashes notation is needed.
  143. // Legal JSON escapes are \ followed by "\/bfnrt character
  144. // or \u followed by 4 hexadecimal numbers (currently Kea
  145. // supports only \u0000 to \u00ff code points).
  146. // CSV processing translates '\\' into '\' and '\,' into ','
  147. // only so for instance '\x' is translated into '\x'. But
  148. // as it works on a JSON string value each of these '\'
  149. // characters must be doubled on JSON input.
  150. {
  151. "name": "new-posix-timezone",
  152. "data": "EST5EDT4\\,M3.2.0/02:00\\,M11.1.0/02:00"
  153. },
  154. // Options that take integer values can either be specified in
  155. // dec or hex format. Hex format could be either plain (e.g. abcd)
  156. // or prefixed with 0x (e.g. 0xabcd).
  157. {
  158. "name": "preference",
  159. "data": "0xf0"
  160. },
  161. // A few options are encoded in (length, string) tuples
  162. // which can be defined using only strings as the CSV
  163. // processing computes lengths.
  164. {
  165. "name": "bootfile-param",
  166. "data": "root=/dev/sda2, quiet, splash"
  167. }
  168. ],
  169. // Below an example of a simple IPv6 subnet declaration. Uncomment to enable
  170. // it. This is a list, denoted with [ ], of structures, each denoted with
  171. // { }. Each structure describes a single subnet and may have several
  172. // parameters. One of those parameters is "pools" that is also a list of
  173. // structures.
  174. "subnet6": [
  175. {
  176. // This defines the whole subnet. Kea will use this information to
  177. // determine where the clients are connected. This is the whole
  178. // subnet in your network. This is mandatory parameter for each
  179. // subnet.
  180. "subnet": "2001:db8:1::/64",
  181. // Pools define the actual part of your subnet that is governed
  182. // by Kea. Technically this is optional parameter, but it's
  183. // almost always needed for DHCP to do its job. If you omit it,
  184. // clients won't be able to get addresses, unless there are
  185. // host reservations defined for them.
  186. "pools": [ { "pool": "2001:db8:1::/80" } ],
  187. // Kea supports prefix delegation (PD). This mechanism delegates
  188. // whole prefixes, instead of single addresses. You need to specify
  189. // a prefix and then size of the delegated prefixes that it will
  190. // be split into. This example below tells Kea to use
  191. // 2001:db8:1::/56 prefix as pool and split it into /64 prefixes.
  192. // This will give you 256 (2^(64-56)) prefixes.
  193. "pd-pools": [
  194. {
  195. "prefix": "2001:db8:8::",
  196. "prefix-len": 56,
  197. "delegated-len": 64
  198. // Kea also supports excluded prefixes. This advanced option
  199. // is explained in Section 9.2.9. Please make sure your
  200. // excluded prefix matches the pool it is defined in.
  201. // "excluded-prefix": "2001:db8:8:0:80::",
  202. // "excluded-prefix-len": 72
  203. }
  204. ],
  205. "option-data": [
  206. // You can specify additional options here that are subnet
  207. // specific. Also, you can override global options here.
  208. {
  209. "name": "dns-servers",
  210. "data": "2001:db8:2::dead:beef, 2001:db8:2::cafe:babe"
  211. }
  212. ],
  213. // Host reservations can be defined for each subnet.
  214. //
  215. // Note that reservations are subnet-specific in Kea. This is
  216. // different than ISC DHCP. Keep that in mind when migrating
  217. // your configurations.
  218. "reservations": [
  219. // This is a simple host reservation. The host with DUID matching
  220. // the specified value will get an address of 2001:db8:1::100.
  221. {
  222. "duid": "01:02:03:04:05:0A:0B:0C:0D:0E",
  223. "ip-addresses": [ "2001:db8:1::100" ]
  224. },
  225. // This is similar to the previous one, but this time the
  226. // reservation is done based on hardware/MAC address. The server
  227. // will do its best to extract the hardware/MAC address from
  228. // received packets (see 'mac-sources' directive for
  229. // details). This particular reservation also specifies two
  230. // extra options to be available for this client. If there are
  231. // options with the same code specified in a global, subnet or
  232. // class scope, the values defined at host level take
  233. // precedence.
  234. {
  235. "hw-address": "00:01:02:03:04:05",
  236. "ip-addresses": [ "2001:db8:1::101" ],
  237. "option-data": [
  238. {
  239. "name": "dns-servers",
  240. "data": "3000:1::234"
  241. },
  242. {
  243. "name": "nis-servers",
  244. "data": "3000:1::234"
  245. }],
  246. // This client will be automatically added to certain
  247. // classes.
  248. "client-classes": [ "special_snowflake", "office" ]
  249. },
  250. // This is a bit more advanced reservation. The client with the
  251. // specified DUID will get a reserved address, a reserved prefix
  252. // and a hostname. This reservation is for an address that it
  253. // not within the dynamic pool. Finally, this reservation
  254. // features vendor specific options for CableLabs, which happen
  255. // to use enterprise-id 4491. Those particular values will be
  256. // returned only to the client that has a DUID matching this
  257. // reservation.
  258. {
  259. "duid": "01:02:03:04:05:06:07:08:09:0A",
  260. "ip-addresses": [ "2001:db8:1:cafe::1" ],
  261. "prefixes": [ "2001:db8:2:abcd::/64" ],
  262. "hostname": "foo.example.com",
  263. "option-data": [
  264. {
  265. "name": "vendor-opts",
  266. "data": "4491"
  267. },
  268. {
  269. "name": "tftp-servers",
  270. "space": "vendor-4491",
  271. "data": "3000:1::234"
  272. }
  273. ]
  274. },
  275. // This reservation is using flexible identifier. Instead of
  276. // relying on specific field, sysadmin can define an expression
  277. // similar to what is used for client classification,
  278. // e.g. substring(relay[0].option[17],0,6). Then, based on the
  279. // value of that expression for incoming packet, the reservation
  280. // is matched. Expression can be specified either as hex or
  281. // plain text using single quotes.
  282. // Note: flexible identifier requires flex_id hook library to be
  283. // loaded to work.
  284. {
  285. "flex-id": "'somevalue'",
  286. "ip-addresses": [ "2001:db8:1:cafe::2" ]
  287. }
  288. ]
  289. }
  290. // More subnets can be defined here.
  291. // {
  292. // "subnet": "2001:db8:2::/64",
  293. // "pools": [ { "pool": "2001:db8:2::/80" } ]
  294. // },
  295. // {
  296. // "subnet": "2001:db8:3::/64",
  297. // "pools": [ { "pool": "2001:db8:3::/80" } ]
  298. // },
  299. // {
  300. // "subnet": "2001:db8:4::/64",
  301. // "pools": [ { "pool": "2001:db8:4::/80" } ]
  302. // }
  303. ]
  304. // Client-classes can be defined here. See "client-classes" in Dhcp4 for
  305. // an example.
  306. // Hook libraries can be defined here. See "hooks-libraries" example in
  307. // Dhcp4.
  308. // DDNS information (how the DHCPv6 component can reach a DDNS daemon)
  309. },
  310. // Logging configuration starts here. Kea uses different loggers to log various
  311. // activities. For details (e.g. names of loggers), see Chapter 18.
  312. "Logging":
  313. {
  314. "loggers": [
  315. {
  316. // This section affects kea-dhcp4, which is the base logger for DHCPv4
  317. // component. It tells DHCPv4 server to write all log messages (on
  318. // severity INFO or more) to a file.
  319. "name": "kea-dhcp4",
  320. "output_options": [
  321. {
  322. // Specifies the output file. There are several special values
  323. // supported:
  324. // - stdout (prints on standard output)
  325. // - stderr (prints on standard error)
  326. // - syslog (logs to syslog)
  327. // - syslog:name (logs to syslog using specified name)
  328. // Any other value is considered a name of a time
  329. "output": "@localstatedir@/log/kea-dhcp4.log"
  330. // This governs whether the log output is flushed to disk after
  331. // every write.
  332. // "flush": false,
  333. // This specifies the maximum size of the file before it is
  334. // rotated.
  335. // "maxsize": 1048576,
  336. // This specifies the maximum number of rotated files to keep.
  337. // "maxver": 8
  338. }
  339. ],
  340. // This specifies the severity of log messages to keep. Supported values
  341. // are: FATAL, ERROR, WARN, INFO, DEBUG
  342. "severity": "INFO",
  343. // If DEBUG level is specified, this value is used. 0 is least verbose,
  344. // 99 is most verbose. Be cautious, Kea can generate lots and lots
  345. // of logs if told to do so.
  346. "debuglevel": 0
  347. },
  348. {
  349. // This specifies the logging for kea-dhcp6 logger, i.e. all logs
  350. // generated by Kea DHCPv6 server.
  351. "name": "kea-dhcp6",
  352. "output_options": [
  353. {
  354. "output": "@localstatedir@/log/kea-dhcp6.log"
  355. }
  356. ],
  357. "severity": "INFO",
  358. "debuglevel": 0
  359. },
  360. {
  361. // This specifies the logging for D2 (DHCP-DDNS) daemon.
  362. "name": "kea-dhcp-ddns",
  363. "output_options": [
  364. {
  365. "output": "@localstatedir@/log/kea-ddns.log"
  366. }
  367. ],
  368. "severity": "INFO",
  369. "debuglevel": 0
  370. },
  371. {
  372. "name": "kea-ctrl-agent",
  373. "output_options": [
  374. {
  375. "output": "@localstatedir@/log/kea-ctrl-agent.log"
  376. }
  377. ],
  378. "severity": "INFO",
  379. "debuglevel": 0
  380. }
  381. ]
  382. }
  383. }