dhcp6-srv.xml 80 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
  3. "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
  4. <!ENTITY mdash "&#x2014;" >
  5. ]>
  6. <chapter id="dhcp6">
  7. <title>The DHCPv6 Server</title>
  8. <section id="dhcp6-start-stop">
  9. <title>Starting and Stopping the DHCPv6 Server</title>
  10. <para>
  11. It is recommended that the Kea DHCPv4 server be started and stopped
  12. using <command>keactrl</command> (described in <xref linkend="keactrl"/>).
  13. However, it is also possible to run the server directly: it accepts
  14. the following command-line switches:
  15. </para>
  16. <itemizedlist>
  17. <listitem>
  18. <simpara>
  19. <command>-c <replaceable>file</replaceable></command> -
  20. specifies the configuration file. This is the only mandatory
  21. switch.</simpara>
  22. </listitem>
  23. <listitem>
  24. <simpara>
  25. <command>-v</command> - specifies whether the server
  26. logging should be switched to verbose mode. In verbose mode,
  27. the logging severity and debuglevel specified in a configuration
  28. file are ignored and "debug" severity and the maximum debuglevel
  29. (99) are assumed. The flag is convenient, for temporarily
  30. switching the server into maximum verbosity, e.g. when
  31. debugging.</simpara>
  32. </listitem>
  33. <listitem>
  34. <simpara>
  35. <command>-p <replaceable>port</replaceable></command> -
  36. specifies UDP port the server will listen on. This is only
  37. useful during testing, as the DHCPv6 server listening on
  38. ports other than default DHCPv6 ports will not be able to
  39. handle regular DHCPv6 queries.</simpara>
  40. </listitem>
  41. <listitem>
  42. <simpara>
  43. <command>-v</command> - prints out Kea version and exits.
  44. </simpara>
  45. </listitem>
  46. <listitem>
  47. <simpara>
  48. <command>-V</command> - prints out Kea extended version with
  49. additional parameters and exits.
  50. </simpara>
  51. </listitem>
  52. </itemizedlist>
  53. <para>
  54. When running in a console, the server can be shut down by
  55. pressing ctrl-c. It detects the key combination and shuts
  56. down gracefully.
  57. </para>
  58. <para>
  59. On start-up, the server will detect available network interfaces
  60. and will attempt to open UDP sockets on all interfaces
  61. mentioned in the configuration file.
  62. </para>
  63. <para>
  64. Since the DHCPv6 server opens privileged ports, it requires root
  65. access. Make sure you run this daemon as root.
  66. </para>
  67. </section>
  68. <section id="dhcp6-configuration">
  69. <title>DHCPv6 Server Configuration</title>
  70. <section>
  71. <title>Introduction</title>
  72. <para>
  73. This section explains how to configure the DHCPv6 server using the
  74. Kea configuration backend. (Kea configuration using any other
  75. backends is outside of scope of this document.) Before DHCPv6
  76. is started, its configuration file has to be created. The
  77. basic configuration looks as follows:
  78. <screen>
  79. {
  80. # DHCPv6 configuration starts on the next line
  81. "Dhcp6": {
  82. # First we set up global values
  83. "interfaces": [ "eth0" ],
  84. "renew-timer": 1000,
  85. "rebind-timer": 2000,
  86. "preferred-lifetime": 3000,
  87. "valid-lifetime": 4000,
  88. # Next we specify the type of lease database
  89. "lease-database": {
  90. "type": "memfile",
  91. "persist": true,
  92. "name": "/var/kea/dhcp6.leases"
  93. },
  94. # Finally, we list the subnets from which we will be leasing addresses.
  95. "subnet6": [
  96. {
  97. "subnet": "2001:db8:1::/64",
  98. "pools": [
  99. {
  100. "pool": "2001:db8:1::1-2001:db8:1::ffff"
  101. }
  102. ]
  103. }
  104. ]
  105. # DHCPv6 configuration ends with the next line
  106. }
  107. } </screen>
  108. </para>
  109. <para>The following paragraphs provide a brief overview of the parameters in
  110. the above example and
  111. their format. Subsequent sections of this chapter go into much greater detail
  112. for these and other parameters.</para>
  113. <para>The lines starting with a hash (#) are comments and are ignored by
  114. the server; they do not impact its
  115. operation in any way.</para>
  116. <para>The configuration starts in the first line with the initial
  117. opening curly bracket (or brace). Each configuration consists of
  118. one or more objects. In this specific example, we have only one
  119. object called Dhcp6. This is a simplified configuration, as usually
  120. there will be additional objects, like <command>Logging</command> or
  121. <command>DhcpDns</command>, but we omit them now for clarity. The Dhcp6
  122. configuration starts with the <command>"Dhcp6": {</command> line
  123. and ends with the corresponding closing brace (in the above example,
  124. the brace after the last comment). Everything defined between those
  125. lines is considered to be the Dhcp6 configuration.</para>
  126. <para>In general case, the order in which those parameters appear does not
  127. matter. There are two caveats here though. The first one is to remember that
  128. the configuration file must be a well formed JSON. That means that parameters
  129. for any given scope must be separate by a comma and there must not be a comma
  130. after the last parameter. When reordering configuration file, keep in mind that
  131. moving a parameter to or from the last position in a given scope may require
  132. moving the comma as well. The second caveat is that it is uncommon &mdash; although
  133. legal JSON &mdash; to
  134. repeat the same parameter multiple times. If that happens, the last occurrence of a
  135. given parameter in a given scope is used while all previous instances are
  136. ignored. This is unlikely to cause any confusion as there are no real life
  137. reasons to keep multiple copies of the same parameter in your configuration
  138. file.</para>
  139. <para>Moving onto the DHCPv6 configuration elements,
  140. the line defining <command>interfaces</command> parameter specifies a list
  141. of network interfaces on which the server should listen.
  142. Lists are opened and closed with square brackets, with elements
  143. separated by commas. Had we wanted to listen on two interfaces, the line could
  144. look like this:
  145. <screen>
  146. "interfaces": [ "eth0", "eth1" ],
  147. </screen>
  148. As "<command>interfaces</command>" is not the last parameter in the
  149. configuration, a trailing comma is required.</para>
  150. <para>A number of other parameters follow. <command>valid-lifetime</command>
  151. defines how long the addresses (leases) given out by the server are valid. If
  152. nothing changes, client that got the address is allowed to use it for 4000
  153. seconds. (Note that integer numbers are specified as is, without any quotes
  154. around them.) The address will become deprecated in 3000 seconds (clients are
  155. allowed to keep old connections, but can't use this address for creating new
  156. connections). <command>renew-timer</command> and <command>
  157. rebind-timer</command> are values that define T1 and T2 timers that govern when
  158. the client will begin renewal and rebind procedures.</para>
  159. <para>The next couple lines define the lease database, the place where the server
  160. stores its lease information. This particular example tells the server to use
  161. <command>memfile</command>, which is the simplest (and fastest) database
  162. backend. It uses in-memory database and stores leases on disk in a CSV
  163. file. This is a very simple configuration. Usually, lease database configuration
  164. is more extensive and contains additional parameters. Note that
  165. <command>lease-database</command>
  166. is an object and opens up a new scope, using an opening brace.
  167. Its parameters (just one in this example -- <command>type</command>)
  168. follow. Had there been more than one, they would be separated by commas. This
  169. scope is closed with a closing brace. As more parameters follow, a trailing
  170. comma is present.</para>
  171. <para>Finally, we need to define a list of IPv6 subnets. This is the
  172. most important DHCPv6 configuration structure as the server uses that
  173. information to process clients' requests. It defines all subnets that
  174. the server is expected to receive DHCP requests from. The subnets are
  175. specified with the <command>subnet6</command> parameter. It is a list,
  176. so it starts and ends with square brackets. Each subnet definition in
  177. the list has several attributes associated with it, so is a structure
  178. and is opened and closed with braces. At minimum, a subnet definition
  179. has to have at least two parameters: <command>subnet</command> (that
  180. defines the whole subnet) and <command>pool</command> (which is a list of
  181. dynamically allocated pools that are governed by the DHCP server).</para>
  182. <para>The example contains a single subnet. Had more than one been defined,
  183. additional elements
  184. in the <command>subnet6</command> parameter would be specified and
  185. separated by commas. For example, to define two subnets, the following
  186. syntax would be used:
  187. <screen>
  188. "subnet6": [
  189. {
  190. "pools": [
  191. {
  192. "pool": "2001:db8:1::/112"
  193. }
  194. ],
  195. "subnet": "2001:db8:1::/64"
  196. },
  197. {
  198. "pools": [ { "pool": "2001:db8:2::1-2001:db8:2::ffff" } ],
  199. "subnet": "2001:db8:2::/64",
  200. "interface": "eth0"
  201. }
  202. ]
  203. </screen>
  204. Note that indentation is optional and is used for aesthetic purposes only.
  205. In some cases in may be preferable to use more compact notation.
  206. </para>
  207. <para>After all parameters are specified, we have two contexts open:
  208. global and Dhcp6, hence we need two closing curly brackets to close them.
  209. In a real life configuration file there most likely would be additional
  210. components defined such as Logging or DhcpDdns, so the closing brace would
  211. be followed by a comma and another object definition.</para>
  212. <para>Kea 0.9 does not have configuration syntax validation
  213. implemented yet. Such a feature is planned for the near future. For
  214. the time being, it is convenient to use on-line JSON validators and/or
  215. viewers to check whether the syntax is correct. One example of such a
  216. JSON validator is available at <ulink url="http://jsonviewer.stack.hu/"/>.
  217. </para>
  218. </section>
  219. <section>
  220. <title>Lease Storage</title>
  221. <para>All leases issued by the server are stored in the lease database.
  222. Currently there are three database backends available:
  223. memfile (which is the default backend), MySQL and PostgreSQL.</para>
  224. <section>
  225. <title>Memfile - Basic Storage for Leases</title>
  226. <para>The server is able to store lease data in different repositories. Larger
  227. deployments may elect to store leases in a database. <xref
  228. linkend="database-configuration6"/> describes this option. In typical
  229. smaller deployments though, the server will use a CSV file rather than a database to
  230. store lease information. As well as requiring less administration, an
  231. advantage of using a file for storage is that it
  232. eliminates a dependency on third-party database software.</para>
  233. <para>The configuration of the file backend (Memfile) is controlled through
  234. the Dhcp6/lease-database parameters. <!-- @todo: we don't have default
  235. parameters. Let's comment this out When default parameters are used, the
  236. Memfile backend will write leases to a disk in the
  237. [kea-install-dir]/var/kea/kea-leases4.csv. -->
  238. The following configuration sets the name of the lease file to
  239. <filename>/tmp/kea-leases6.csv</filename>:
  240. <screen>
  241. "Dhcp6": {
  242. "lease-database": {
  243. <userinput>"type": "memfile"</userinput>,
  244. <userinput>"persist": true</userinput>,
  245. <userinput>"name": "/tmp/kea-leases6.csv"</userinput>
  246. }
  247. ...
  248. }
  249. </screen>
  250. </para>
  251. <para>The "persist" parameter controls whether the leases are written to disk.
  252. It is strongly recommended that this parameter is set to true at all times
  253. during the normal operation of the server. (Not writing leases to disk will
  254. mean that if a server is restarted (e.g. after a power failure), it will not
  255. know what addresses have been assigned. As a result, it may hand out addresses
  256. to new clients that are already in use.)
  257. </para>
  258. </section>
  259. <section id="database-configuration6">
  260. <title>Database Configuration</title>
  261. <note>
  262. <para>Database access information must be configured for the DHCPv6 server,
  263. even if it has already been configured for the DHCPv4 server. The servers
  264. store their information independently, so each server can use a separate
  265. database or both servers can use the same database.</para>
  266. </note>
  267. <para>Database configuration is controlled through the Dhcp6/lease-database
  268. parameters. The type of the database must be set to "mysql" or "postgresql",
  269. e.g.
  270. <screen>
  271. "Dhcp6": { "lease-database": { <userinput>"type": "mysql"</userinput>, ... }, ... }
  272. </screen>
  273. Next, the name of the database is to hold the leases must be set: this is the
  274. name used when the lease database was created (see <xref linkend="dhcp-mysql-database-create"/>
  275. or <xref linkend="dhcp-pgsql-database-create"/>).
  276. <screen>
  277. "Dhcp6": { "lease-database": { <userinput>"name": "<replaceable>database-name</replaceable>" </userinput>, ... }, ... }
  278. </screen>
  279. If the database is located on a different system than the DHCPv6 server, the
  280. database host name must also be specified (although it should be noted that this
  281. configuration may have a severe impact on server performance):
  282. <screen>
  283. "Dhcp6": { "lease-database": { <userinput>"host": <replaceable>remote-host-name</replaceable>"</userinput>, ... }, ... }
  284. </screen>
  285. The usual state of affairs will be to have the database on the same machine as
  286. the DHCPv6 server. In this case, set the value to the empty string:
  287. <screen>
  288. "Dhcp6": { "lease-database": { <userinput>"host" : ""</userinput>, ... }, ... }
  289. </screen>
  290. </para>
  291. <para>Finally, the credentials of the account under which the server will
  292. access the database should be set:
  293. <screen>
  294. "Dhcp6": { "lease-database": { <userinput>"user": "<replaceable>user-name</replaceable>"</userinput>,
  295. <userinput>"password" "<replaceable>password</replaceable>"</userinput>,
  296. ... },
  297. ... }
  298. </screen>
  299. If there is no password to the account, set the password to the empty string
  300. "". (This is also the default.)</para>
  301. </section>
  302. </section>
  303. <section id="dhcp6-interface-selection">
  304. <title>Interface selection</title>
  305. <para>The DHCPv6 server has to be configured to listen on specific network
  306. interfaces. The simplest network interface configuration tells the server to
  307. listen on all available interfaces:
  308. <screen>
  309. "Dhcp6": { <userinput>"interfaces": ["*"]</userinput>, ... }</screen>
  310. The asterisk plays the role of a wildcard and means "listen on all interfaces".
  311. However, it is usually a good idea to explicitly specify interface names:
  312. <screen>
  313. "Dhcp6": { <userinput>"interfaces": [ "eth1", "eth3" ]</userinput>, ... }</screen>
  314. </para>
  315. <para>It is possible to use wildcard interface name (asterisk) concurrently
  316. with explicit interface names:
  317. <screen>
  318. "Dhcp6": { <userinput>"interfaces": [ "eth1", "eth3", "*" ]</userinput>, ... }</screen>
  319. It is anticipated that this will form of usage only be used where it is desired to
  320. temporarily override a list of interface names and listen on all interfaces.
  321. </para>
  322. </section>
  323. <section id="ipv6-subnet-id">
  324. <title>IPv6 Subnet Identifier</title>
  325. <para>
  326. Subnet identifier is a unique number associated with a particular subnet.
  327. In principle, it is used to associate clients' leases with respective subnets.
  328. When the subnet identifier is not specified for a subnet being configured, it will
  329. be automatically assigned by the configuration mechanism. The identifiers
  330. are assigned from 1 and are monotonically increased for each subsequent
  331. subnet: 1, 2, 3 ....
  332. </para>
  333. <para>
  334. If there are multiple subnets configured with auto-generated identifiers and
  335. one of them is removed, the subnet identifiers may be renumbered. For example:
  336. if there are 4 subnets and 3rd is removed the last subnet will be assigned
  337. identifier that the 3rd subnet had before removal. As a result, the leases
  338. stored in the lease database for subnet 3 are now associated with the
  339. subnet 4, which may have unexpected consequences. In the future it is planned
  340. to implement the mechanism to preserve auto-generated subnet ids upon removal
  341. of one of the subnets. Currently, the only remedy for this issue is to
  342. manually specify the unique subnet identifier for each subnet.
  343. </para>
  344. <para>
  345. The following configuration will assign the arbitrary subnet
  346. identifier to the newly configured subnet:
  347. <screen>
  348. "Dhcp6": {
  349. "subnet6": [
  350. "subnet": "2001:db8:1::/64",
  351. <userinput>"id": 1024</userinput>,
  352. ...
  353. ]
  354. }
  355. </screen>
  356. This identifier will not change for this subnet unless the "id" parameter is
  357. removed or set to 0. The value of 0 forces auto-generation of the subnet
  358. identifier.
  359. </para>
  360. <!-- @todo: describe whether database needs to be updated after changing
  361. id -->
  362. </section>
  363. <section id="dhcp6-unicast">
  364. <title>Unicast traffic support</title>
  365. <para>
  366. When DHCPv6 server starts up, by default it listens to the DHCP traffic
  367. sent to multicast address ff02::1:2 on each interface that it is
  368. configured to listen on (see <xref linkend="dhcp6-interface-selection"/>).
  369. In some cases it is useful to configure a server to handle incoming
  370. traffic sent to the global unicast addresses as well. The most common
  371. reason for that is to have relays send their traffic to the server
  372. directly. To configure server to listen on specific unicast address, a
  373. notation to specify interfaces has been extended. Interface name can be
  374. optionally followed by a slash, followed by global unicast address that
  375. server should listen on. That will be done in addition to normal
  376. link-local binding + listening on ff02::1:2 address. The sample commands
  377. listed below show how to listen on 2001:db8::1 (a global address)
  378. configured on the eth1 interface.
  379. </para>
  380. <para>
  381. <screen>
  382. "Dhcp6": {
  383. <userinput>"interfaces": [ "eth1/2001:db8::1"],</userinput>
  384. ...
  385. }</screen>
  386. When configuration gets committed, the server will start to listen on
  387. eth1 on link-local address, multicast group (ff02::1:2) and 2001:db8::1.
  388. </para>
  389. <para>
  390. It is possible to mix interface names, wildcards and interface name/addresses
  391. on the Dhcp6/interface list. It is not possible to specify more than one
  392. unicast address on a given interface.
  393. </para>
  394. <para>
  395. Care should be taken to specify proper unicast addresses. The server will
  396. attempt to bind to those addresses specified, without any additional checks.
  397. That approach is selected on purpose, so in the software can be used to
  398. communicate over uncommon addresses if the administrator desires so.
  399. </para>
  400. </section>
  401. <section id="dhcp6-address-config">
  402. <title>Subnet and Address Pool</title>
  403. <para>
  404. The essential role of a DHCPv6 server is address assignment. For this,
  405. the server has to be configured with at least one subnet and one pool of dynamic
  406. addresses to be managed. For example, assume that the server
  407. is connected to a network segment that uses the 2001:db8:1::/64
  408. prefix. The Administrator of that network has decided that addresses from range
  409. 2001:db8:1::1 to 2001:db8:1::ffff are going to be managed by the Dhcp6
  410. server. Such a configuration can be achieved in the following way:
  411. <screen>
  412. "Dhcp6": {
  413. <userinput>"subnet6": [
  414. {
  415. "subnet": "2001:db8:1::/64",
  416. "pools": [
  417. {
  418. "pool": "2001:db8:1::1-2001:db8:1::ffff"
  419. }
  420. ],
  421. ...
  422. }
  423. ]</userinput>
  424. }</screen>
  425. Note that subnet is defined as a simple string, but the pool parameter
  426. is actually a list of pools: for this reason, the pool definition is
  427. enclosed in square brackets, even though only one range of addresses
  428. is specified.</para>
  429. <para>Each <command>pool</command> is a structure that contains the
  430. parameters th describe a single pool. Currently there is only one
  431. parameter, <command>pool</command>, which gives the range of addresses
  432. in the pool. Additional parameters will be added in future releases of
  433. Kea.</para>
  434. <para>It is possible to define more than one pool in a
  435. subnet: continuing the previous example, further assume that
  436. 2001:db8:1:0:5::/80 should be also be managed by the server. It could be written as
  437. 2001:db8:1:0:5:: to 2001:db8:1::5:ffff:ffff:ffff, but typing so many 'f's
  438. is cumbersome. It can be expressed more simply as 2001:db8:1:0:5::/80. Both
  439. formats are supported by Dhcp6 and can be mixed in the pool list.
  440. For example, one could define the following pools:
  441. <screen>
  442. "Dhcp6": {
  443. <userinput>"subnet6": [
  444. {
  445. "subnet": "2001:db8:1::/64",
  446. "pools": [
  447. { "pool": "2001:db8:1::1-2001:db8:1::ffff" },
  448. { "pool": "2001:db8:1:05::/80" }
  449. ]</userinput>,
  450. ...
  451. }
  452. ]
  453. }</screen>
  454. The number of pools is not limited, but for performance reasons it is recommended to
  455. use as few as possible.
  456. </para>
  457. <para>
  458. The server may be configured to serve more than one subnet. To add a second subnet,
  459. use a command similar to the following:
  460. <screen>
  461. "Dhcp6": {
  462. <userinput>"subnet6": [
  463. {
  464. "subnet": "2001:db8:1::/64",
  465. "pools": [
  466. { "pool": "2001:db8:1::1-2001:db8:1::ffff" }
  467. ]
  468. },
  469. {
  470. "subnet": "2001:db8:2::/64",
  471. "pools": [
  472. { "pool": "2001:db8:2::/64" }
  473. ]
  474. },
  475. </userinput>
  476. ...
  477. ]
  478. }</screen>
  479. In this example, we allow server to
  480. dynamically assign all addresses available in the whole subnet. Although
  481. rather wasteful, it is certainly a valid configuration to dedicate the
  482. whole /64 subnet for that purpose. Note that the Kea server does not preallocate
  483. the leases, so there is no danger of using gigantic address pools.
  484. </para>
  485. <para>
  486. When configuring a DHCPv6 server using prefix/length notation, please pay
  487. attention to the boundary values. When specifying that the server should use
  488. a given pool, it will be able to allocate also first (typically network
  489. address) address from that pool. For example for pool 2001:db8:2::/64 the
  490. 2001:db8:2:: address may be assigned as well. If you want to avoid this,
  491. use the "min-max" notation.
  492. </para>
  493. </section>
  494. <section>
  495. <!-- @todo: add real meat to the prefix delegation config this is just place holder stuff -->
  496. <title>Subnet and Prefix Delegation Pools</title>
  497. <para>
  498. Subnets may also be configured to delegate prefixes, as defined in
  499. <ulink url="http://tools.ietf.org/html/rfc3633">RFC 3633</ulink>.
  500. A subnet may have one or more prefix delegation pools. Each pool has
  501. a prefixed address, which is specified as a prefix and a prefix length,
  502. as well as a delegated prefix length. <command>delegated-len</command>
  503. must not be shorter (numerically greater) than
  504. <command>prefix-len</command>. If both <command>delegated-len</command>
  505. and <command>prefix-len</command> are equal, the server will be able to
  506. delegate only one prefix. A sample configuration is shown below:
  507. <screen>
  508. "Dhcp6": {
  509. "subnet6": [
  510. {
  511. "subnet": "2001:d8b:1::/64",
  512. <userinput>"pd-pools": [
  513. {
  514. "prefix": "2001:db8:1::",
  515. "prefix-len": 64,
  516. "delegated-len": 96
  517. }
  518. ]</userinput>
  519. }
  520. ],
  521. ...
  522. }</screen>
  523. </para>
  524. </section>
  525. <section id="dhcp6-std-options">
  526. <title>Standard DHCPv6 options</title>
  527. <para>
  528. One of the major features of DHCPv6 server is to provide configuration
  529. options to clients. Although there are several options that require
  530. special behavior, most options are sent by the server only if the client
  531. explicitly requested them. The following example shows how to
  532. configure DNS servers, which is one of the most frequently used
  533. options. Numbers in the first column are added for easier reference and
  534. will not appear on screen. Options specified in this way are considered
  535. global and apply to all configured subnets.
  536. <screen>
  537. "Dhcp6": {
  538. "option-data": [
  539. {
  540. <userinput>"name": "dns-servers",
  541. "code": 23,
  542. "space": "dhcp6",
  543. "csv-format": true,
  544. "data": "2001:db8::cafe, 2001:db8::babe"</userinput>
  545. },
  546. ...
  547. ]
  548. }
  549. </screen>
  550. </para>
  551. <para>
  552. The first line creates new entry in option-data table. It contains
  553. information on all global options that the server is supposed to configure
  554. in all subnets. The second line specifies option name. For a complete list
  555. of currently supported names, see <xref
  556. linkend="dhcp6-std-options-list"/>. The third line specifies option code,
  557. which must match one of the values from that list. Line beginning with
  558. <command>space</command> specifies option space, which must always be set
  559. to "dhcp6" as these are standard DHCPv6 options. For other name spaces,
  560. including custom option spaces, see <xref
  561. linkend="dhcp6-option-spaces"/>. The fifth line specifies the format in
  562. which the data will be entered: use of CSV (comma separated values) is
  563. recommended. The sixth line gives the actual value to be sent to
  564. clients. Data is specified as a normal text, with values separated by
  565. commas if more than one value is allowed.
  566. </para>
  567. <para>
  568. Options can also be configured as hexadecimal values. If csv-format is
  569. set to false, the option data must be specified as a string of hexadecimal
  570. numbers. The
  571. following commands configure the DNS-SERVERS option for all
  572. subnets with the following addresses: 2001:db8:1::cafe and
  573. 2001:db8:1::babe.
  574. <screen>
  575. "Dhcp6": {
  576. "option-data": [
  577. {
  578. <userinput>"name": "dns-servers",
  579. "code": 23,
  580. "space": "dhcp6",
  581. "csv-format": false,
  582. "data": "2001 0DB8 0001 0000 0000 0000 0000 CAFE
  583. 2001 0DB8 0001 0000 0000 0000 0000 BABE"</userinput>
  584. },
  585. ...
  586. ]
  587. }
  588. </screen>
  589. The value for the setting of the "data" element is split across two
  590. lines in this document for clarity: when entering the command, the
  591. whole string should be entered on the same line. Care should be taken
  592. to use proper encoding when using hexadecimal format as Kea's ability
  593. to validate data correctness in hexadecimal is limited.
  594. </para>
  595. <para>
  596. Most of the parameters in the "option-data" structure are optional and
  597. can be omitted in some circumstances as discussed in the
  598. <xref linkend="dhcp6-option-data-defaults"/>.
  599. </para>
  600. <para>
  601. It is possible to override options on a per-subnet basis. If
  602. clients connected to most of your subnets are expected to get the
  603. same values of a given option, you should use global options: you
  604. can then override specific values for a small number of subnets.
  605. On the other hand, if you use different values in each subnet,
  606. it does not make sense to specify global option values
  607. (Dhcp6/option-data), rather you should set only subnet-specific values
  608. (Dhcp6/subnet[X]/option-data[Y]).
  609. </para>
  610. <para>
  611. The following commands override the global
  612. DNS servers option for a particular subnet, setting a single DNS
  613. server with address 2001:db8:1::3.
  614. <screen>
  615. "Dhcp6": {
  616. "subnet6": [
  617. {
  618. <userinput>"option-data": [
  619. {
  620. "name": "dns-servers",
  621. "code": 23,
  622. "space": "dhcp6",
  623. "csv-format": true,
  624. "data": "2001:db8:1::3"
  625. },
  626. ...
  627. ]</userinput>,
  628. ...
  629. },
  630. ...
  631. ],
  632. ...
  633. }
  634. </screen>
  635. </para>
  636. <para>
  637. The currently supported standard DHCPv6 options are
  638. listed in <xref linkend="dhcp6-std-options-list"/>.
  639. The "Name" and "Code"
  640. are the values that should be used as a name in the option-data
  641. structures. "Type" designates the format of the data: the meanings of
  642. the various types is given in <xref linkend="dhcp-types"/>.
  643. </para>
  644. <para>
  645. Some options are designated as arrays, which means that more than one
  646. value is allowed in such an option. For example the option dns-servers
  647. allows the specification of more than one IPv6 address, so allowing
  648. clients to obtain the addresses of multiple DNS servers.
  649. </para>
  650. <!-- @todo: describe record types -->
  651. <para>
  652. The <xref linkend="dhcp6-custom-options"/> describes the configuration
  653. syntax to create custom option definitions (formats). It is generally not
  654. allowed to create custom definitions for standard options, even if the
  655. definition being created matches the actual option format defined in the
  656. RFCs. There is an exception from this rule for standard options for which
  657. Kea does not provide a definition yet. In order to use such options,
  658. a server administrator must create a definition as described in
  659. <xref linkend="dhcp6-custom-options"/> in the 'dhcp6' option space. This
  660. definition should match the option format described in the relevant
  661. RFC but configuration mechanism would allow any option format as it has
  662. no means to validate it at the moment.
  663. </para>
  664. <para>
  665. <table frame="all" id="dhcp6-std-options-list">
  666. <title>List of standard DHCPv6 options</title>
  667. <tgroup cols='4'>
  668. <colspec colname='name'/>
  669. <colspec colname='code' align='center'/>
  670. <colspec colname='type' align='center'/>
  671. <colspec colname='array' align='center'/>
  672. <thead>
  673. <row><entry>Name</entry><entry>Code</entry><entry>Type</entry><entry>Array?</entry></row>
  674. </thead>
  675. <tbody>
  676. <!-- Our engine uses those options on its own, admin must not configure them on his own
  677. <row><entry>clientid</entry><entry>1</entry><entry>binary</entry><entry>false</entry></row>
  678. <row><entry>serverid</entry><entry>2</entry><entry>binary</entry><entry>false</entry></row>
  679. <row><entry>ia-na</entry><entry>3</entry><entry>record</entry><entry>false</entry></row>
  680. <row><entry>ia-ta</entry><entry>4</entry><entry>uint32</entry><entry>false</entry></row>
  681. <row><entry>iaaddr</entry><entry>5</entry><entry>record</entry><entry>false</entry></row>
  682. <row><entry>oro</entry><entry>6</entry><entry>uint16</entry><entry>true</entry></row> -->
  683. <row><entry>preference</entry><entry>7</entry><entry>uint8</entry><entry>false</entry></row>
  684. <!-- Our engine uses those options on its own, admin must not configure them on his own
  685. <row><entry>elapsed-time</entry><entry>8</entry><entry>uint16</entry><entry>false</entry></row>
  686. <row><entry>relay-msg</entry><entry>9</entry><entry>binary</entry><entry>false</entry></row>
  687. <row><entry>auth</entry><entry>11</entry><entry>binary</entry><entry>false</entry></row>
  688. <row><entry>unicast</entry><entry>12</entry><entry>ipv6-address</entry><entry>false</entry></row>
  689. <row><entry>status-code</entry><entry>13</entry><entry>record</entry><entry>false</entry></row>
  690. <row><entry>rapid-commit</entry><entry>14</entry><entry>empty</entry><entry>false</entry></row>
  691. <row><entry>user-class</entry><entry>15</entry><entry>binary</entry><entry>false</entry></row>
  692. <row><entry>vendor-class</entry><entry>16</entry><entry>record</entry><entry>false</entry></row>
  693. <row><entry>vendor-opts</entry><entry>17</entry><entry>uint32</entry><entry>false</entry></row>
  694. <row><entry>interface-id</entry><entry>18</entry><entry>binary</entry><entry>false</entry></row>
  695. <row><entry>reconf-msg</entry><entry>19</entry><entry>uint8</entry><entry>false</entry></row>
  696. <row><entry>reconf-accept</entry><entry>20</entry><entry>empty</entry><entry>false</entry></row> -->
  697. <row><entry>sip-server-dns</entry><entry>21</entry><entry>fqdn</entry><entry>true</entry></row>
  698. <row><entry>sip-server-addr</entry><entry>22</entry><entry>ipv6-address</entry><entry>true</entry></row>
  699. <row><entry>dns-servers</entry><entry>23</entry><entry>ipv6-address</entry><entry>true</entry></row>
  700. <row><entry>domain-search</entry><entry>24</entry><entry>fqdn</entry><entry>true</entry></row>
  701. <!-- <row><entry>ia-pd</entry><entry>25</entry><entry>record</entry><entry>false</entry></row> -->
  702. <!-- <row><entry>iaprefix</entry><entry>26</entry><entry>record</entry><entry>false</entry></row> -->
  703. <row><entry>nis-servers</entry><entry>27</entry><entry>ipv6-address</entry><entry>true</entry></row>
  704. <row><entry>nisp-servers</entry><entry>28</entry><entry>ipv6-address</entry><entry>true</entry></row>
  705. <row><entry>nis-domain-name</entry><entry>29</entry><entry>fqdn</entry><entry>true</entry></row>
  706. <row><entry>nisp-domain-name</entry><entry>30</entry><entry>fqdn</entry><entry>true</entry></row>
  707. <row><entry>sntp-servers</entry><entry>31</entry><entry>ipv6-address</entry><entry>true</entry></row>
  708. <row><entry>information-refresh-time</entry><entry>32</entry><entry>uint32</entry><entry>false</entry></row>
  709. <row><entry>bcmcs-server-dns</entry><entry>33</entry><entry>fqdn</entry><entry>true</entry></row>
  710. <row><entry>bcmcs-server-addr</entry><entry>34</entry><entry>ipv6-address</entry><entry>true</entry></row>
  711. <row><entry>geoconf-civic</entry><entry>36</entry><entry>record</entry><entry>false</entry></row>
  712. <row><entry>remote-id</entry><entry>37</entry><entry>record</entry><entry>false</entry></row>
  713. <row><entry>subscriber-id</entry><entry>38</entry><entry>binary</entry><entry>false</entry></row>
  714. <row><entry>client-fqdn</entry><entry>39</entry><entry>record</entry><entry>false</entry></row>
  715. <row><entry>pana-agent</entry><entry>40</entry><entry>ipv6-address</entry><entry>true</entry></row>
  716. <row><entry>new-posix-timezone</entry><entry>41</entry><entry>string</entry><entry>false</entry></row>
  717. <row><entry>new-tzdb-timezone</entry><entry>42</entry><entry>string</entry><entry>false</entry></row>
  718. <row><entry>ero</entry><entry>43</entry><entry>uint16</entry><entry>true</entry></row>
  719. <row><entry>lq-query</entry><entry>44</entry><entry>record</entry><entry>false</entry></row>
  720. <row><entry>client-data</entry><entry>45</entry><entry>empty</entry><entry>false</entry></row>
  721. <row><entry>clt-time</entry><entry>46</entry><entry>uint32</entry><entry>false</entry></row>
  722. <row><entry>lq-relay-data</entry><entry>47</entry><entry>record</entry><entry>false</entry></row>
  723. <row><entry>lq-client-link</entry><entry>48</entry><entry>ipv6-address</entry><entry>true</entry></row>
  724. </tbody>
  725. </tgroup>
  726. </table>
  727. </para>
  728. </section>
  729. <section id="dhcp6-custom-options">
  730. <title>Custom DHCPv6 options</title>
  731. <para>It is also possible to define options other than the standard ones.
  732. Assume that we want to define a new DHCPv6 option called "foo" which will have
  733. code 100 and will convey a single unsigned 32 bit integer value. We can define
  734. such an option by using the following commands:
  735. <screen>
  736. "Dhcp6": {
  737. "option-def": [
  738. {
  739. <userinput>"name": "foo",
  740. "code": 100,
  741. "type": "uint32",
  742. "array": false,
  743. "record-types": "",
  744. "space": "dhcp6",
  745. "encapsulate": ""</userinput>
  746. }, ...
  747. ],
  748. ...
  749. }
  750. </screen>
  751. The "false" value of the "array" parameter determines that the option does
  752. NOT comprise an array of "uint32" values but rather a single value. Two
  753. other parameters have been left blank: "record-types" and "encapsulate".
  754. The former specifies the comma separated list of option data fields if the
  755. option comprises a record of data fields. The "record-fields" value should
  756. be non-empty if the "type" is set to "record". Otherwise it must be left
  757. blank. The latter parameter specifies the name of the option space being
  758. encapsulated by the particular option. If the particular option does not
  759. encapsulate any option space it should be left blank. Note that the above
  760. set of comments define the format of the new option and do not set its
  761. values.
  762. </para>
  763. <para>Once the new option format is defined, its value is set
  764. in the same way as for a standard option. For example the following
  765. commands set a global value that applies to all subnets.
  766. <screen>
  767. "Dhcp6": {
  768. "option-data": [
  769. {
  770. <userinput>name "foo",
  771. "code": 100,
  772. "space": "dhcp6",
  773. "csv-format": true,
  774. "data": "12345"</userinput>
  775. }, ...
  776. ],
  777. ...
  778. }
  779. </screen>
  780. </para>
  781. <para>New options can take more complex forms than simple use of
  782. primitives (uint8, string, ipv6-address etc): it is possible to
  783. define an option comprising a number of existing primitives.
  784. </para>
  785. <para>
  786. Assume we want to define a new option that will consist of an IPv6
  787. address, followed by an unsigned 16 bit integer, followed by a
  788. boolean value, followed by a text string. Such an option could
  789. be defined in the following way:
  790. <screen>
  791. "Dhcp6": {
  792. "option-def": [
  793. {
  794. <userinput>"name": "bar",
  795. "code": 101,
  796. "space": "dhcp6",
  797. "type": "record",
  798. "array": false,
  799. "record-types": "ipv4-address, uint16, boolean, string",
  800. "encapsulate": ""</userinput>
  801. }, ...
  802. ],
  803. ...
  804. }
  805. </screen>
  806. The "type" is set to "record" to indicate that the option contains
  807. multiple values of different types. These types are given as a comma-separated
  808. list in the "record-types" field and should be those listed in <xref linkend="dhcp-types"/>.
  809. </para>
  810. <para>
  811. The values of the option are set as follows:
  812. <screen>
  813. "Dhcp6": {
  814. "option-data": [
  815. {
  816. <userinput>"name": "bar",
  817. "space": "dhcp6",
  818. "code": 101,
  819. "csv-format": true,
  820. "data": "2001:db8:1::10, 123, false, Hello World"</userinput>
  821. }
  822. ],
  823. ...
  824. }</screen>
  825. <command>csv-format</command> is set <command>true</command> to indicate
  826. that the <command>data</command> field comprises a command-separated list
  827. of values. The values in the "data" must correspond to the types set in
  828. the "record-types" field of the option definition.
  829. </para>
  830. <note>
  831. <para>In general case, boolean values are specified as <command>true</command> or
  832. <command>false</command>, without quotes. Some specific boolean parameters may
  833. accept also <command>"true"</command>, <command>"false"</command>,
  834. <command>0</command>, <command>1</command>, <command>"0"</command> and
  835. <command>"1"</command>. Future Kea versions will accept all those values
  836. for all boolean parameters.</para>
  837. </note>
  838. </section>
  839. <section id="dhcp6-vendor-opts">
  840. <title>DHCPv6 vendor specific options</title>
  841. <para>
  842. Currently there are three option spaces defined: dhcp4 (to be used
  843. in DHCPv4 daemon) and dhcp6 (for the DHCPv6 daemon); there is also
  844. vendor-opts-space, which is empty by default, but options can be
  845. defined in it. Those options are called vendor-specific information
  846. options. The following examples show how to define an option "foo"
  847. with code 1 that consists of an IPv6 address, an unsigned 16 bit integer
  848. and a string. The "foo" option is conveyed in a vendor specific
  849. information option. This option comprises a single uint32 value
  850. that is set to "12345". The sub-option "foo" follows the data
  851. field holding this value.
  852. <screen>
  853. "Dhcp6": {
  854. "option-def": [
  855. {
  856. <userinput>"name": "foo",
  857. "code": 1,
  858. "space": "vendor-encapsulated-options-space",
  859. "type": "record",
  860. "array": false,
  861. "record-types": "ipv6-address, uint16, string",
  862. "encapsulates": ""</userinput>
  863. }
  864. ],
  865. ...
  866. }</screen>
  867. (Note that the option space is set to <command>vendor-opts-space</command>.)
  868. Once the option format is defined, the next step is to define actual values
  869. for that option:
  870. <screen>
  871. "Dhcp6": {
  872. "option-data": [
  873. {
  874. <userinput>"name": "foo"
  875. "space": "vendor-encapsulated-options-space",
  876. "code": 1,
  877. "csv-format": true,
  878. "data": "2001:db8:1::10, 123, Hello World"</userinput>
  879. },
  880. ...
  881. ],
  882. ...
  883. }</screen>
  884. We should also define values for the vendor-opts, that will convey our
  885. option foo.
  886. <screen>
  887. "Dhcp6": {
  888. "option-data": [
  889. ...,
  890. {
  891. <userinput>"name": "vendor-encapsulated-options"
  892. "space": "dhcp6",
  893. "code": 17,
  894. "csv-format": true,
  895. "data": "12345"</userinput>
  896. }
  897. ],
  898. ...
  899. }</screen>
  900. </para>
  901. </section>
  902. <section id="dhcp6-option-spaces">
  903. <title>Nested DHCPv6 options (custom option spaces)</title>
  904. <para>It is sometimes useful to define completely new option
  905. spaces. This is useful if the user wants his new option to
  906. convey sub-options that use separate numbering scheme, for
  907. example sub-options with codes 1 and 2. Those option codes
  908. conflict with standard DHCPv6 options, so a separate option
  909. space must be defined.
  910. </para>
  911. <para>Note that it is not required to create new option space when
  912. defining sub-options for a standard option because it is by
  913. default created if the standard option is meant to convey
  914. any sub-options (see <xref linkend="dhcp6-vendor-opts"/>).
  915. </para>
  916. <para>
  917. Assume that we want to have a DHCPv6 option called "container"
  918. with code 102 that conveys two sub-options with codes 1 and 2.
  919. First we need to define the new sub-options:
  920. <screen>
  921. "Dhcp6": {
  922. "option-def": [
  923. {
  924. <userinput>"name": "subopt1",
  925. "code": 1,
  926. "space": "isc",
  927. "type": "ipv6-address".
  928. "record-types": "",
  929. "array": false,
  930. "encapsulate ""
  931. },
  932. {
  933. "name": "subopt2",
  934. "code": 2,
  935. "space": "isc",
  936. "type": "string",
  937. "record-types": "",
  938. "array": false
  939. "encapsulate": ""</userinput>
  940. }
  941. ],
  942. ...
  943. }</screen>
  944. Note that we have defined the options to belong to a new option space
  945. (in this case, "isc").
  946. </para>
  947. <para>
  948. The next step is to define a regular DHCPv6 option and specify that it
  949. should include options from the isc option space:
  950. <screen>
  951. "Dhcp6": {
  952. "option-def": [
  953. ...,
  954. {
  955. <userinput>"name": "container",
  956. "code": 102,
  957. "space": "dhcp6",
  958. "type": "empty",
  959. "array": false,
  960. "record-types": "",
  961. "encapsulate": "isc"</userinput>
  962. }
  963. ],
  964. ...
  965. }</screen>
  966. The name of the option space in which the sub-options are defined is set in
  967. the <command>encapsulate</command> field. The <command>type</command> field
  968. is set to <command>empty</command> which imposes that this option does not
  969. carry any data other than sub-options.
  970. </para>
  971. <para>
  972. Finally, we can set values for the new options:
  973. <screen>
  974. "Dhcp6": {
  975. "option-data": [
  976. {
  977. <userinput>"name": "subopt1",
  978. "space": "isc",
  979. "code": 1,
  980. "csv-format": true,
  981. "data": "2001:db8::abcd"</userinput>
  982. },
  983. }
  984. <userinput>"name": "subopt2",
  985. "space": "isc",
  986. "code": 2,
  987. "csv-format": true,
  988. "data": "Hello world"</userinput>
  989. },
  990. {
  991. <userinput>"name": "container",
  992. "space": "dhcp6",
  993. "code": 102,
  994. "csv-format": true,
  995. "data": ""</userinput>
  996. }
  997. ],
  998. ...
  999. }
  1000. </screen>
  1001. Even though the "container" option does not carry any data except
  1002. sub-options, the "data" field must be explicitly set to an empty value.
  1003. This is required because in the current version of Kea, the default
  1004. configuration values are not propagated to the configuration parsers: if the
  1005. "data" is not set the parser will assume that this parameter is not
  1006. specified and an error will be reported.
  1007. </para>
  1008. <para>Note that it is possible to create an option which carries some data
  1009. in addition to the sub-options defined in the encapsulated option space.
  1010. For example, if the "container" option from the previous example was
  1011. required to carry an uint16 value as well as the sub-options, the "type"
  1012. value would have to be set to "uint16" in the option definition. (Such an
  1013. option would then have the following data structure: DHCP header, uint16
  1014. value, sub-options.) The value specified with the "data" parameter &mdash; which
  1015. should be a valid integer enclosed in quotes, e.g. "123" &mdash; would then be
  1016. assigned to the uint16 field in the "container" option.
  1017. </para>
  1018. </section>
  1019. <section id="dhcp6-option-data-defaults">
  1020. <title>Unspecified parameters for DHCPv6 option configuration</title>
  1021. <para>In many cases it is not required to specify all parameters for
  1022. an option configuration and the default values can be used. However, it is
  1023. important to understand the implications of not specifing some of them
  1024. as it may result in configuration errors. The list below explains
  1025. the behavior of the server when a particular parameter is not explicitly
  1026. specified:
  1027. <itemizedlist>
  1028. <listitem>
  1029. <simpara><command>name</command> - the server requires an option name or
  1030. option code to identify an option. If this parameter is unspecified, the
  1031. option code must be specified.
  1032. </simpara>
  1033. </listitem>
  1034. <listitem>
  1035. <simpara><command>code</command> - the server requires an option name or
  1036. option code to identify an option. This parameter may be left unspecified if
  1037. the <command>name</command> parameter is specified. However, this also
  1038. requires that the particular option has its definition (it is either a
  1039. standard option or an administrator created a definition for the option
  1040. using an 'option-def' structure), as the option definition associates an
  1041. option with a particular name. It is possible to configure an option
  1042. for which there is no definition (unspecified option format).
  1043. Configuration of such options requires the use of option code.
  1044. </simpara>
  1045. </listitem>
  1046. <listitem>
  1047. <simpara><command>space</command> - if the option space is unspecified it
  1048. will default to 'dhcp6' which is an option space holding DHCPv6 standard
  1049. options.
  1050. </simpara>
  1051. </listitem>
  1052. <listitem>
  1053. <simpara><command>data</command> - if the option data is unspecified it
  1054. defaults to an empty value. The empty value is mostly used for the
  1055. options which have no payload (boolean options), but it is legal to specify
  1056. empty values for some options which carry variable length data and which
  1057. spec allows for the length of 0. For such options, the data parameter
  1058. may be omitted in the configuration.</simpara>
  1059. </listitem>
  1060. <listitem>
  1061. <simpara><command>csv-format</command> - if this value is not specified
  1062. and the definition for the particular option exists, the server will assume
  1063. that the option data is specified as a list of comma separated values to be
  1064. assigned to individual fields of the DHCP option. If the definition
  1065. does not exist for this option, the server will assume that the data
  1066. parameter contains the option payload in the binary format (represented
  1067. as a string of hexadecimal digits). Note that not specifying this
  1068. parameter doesn't imply that it defaults to a fixed value, but
  1069. the configuration data interpretation also depends on the presence
  1070. of the option definition. An administrator must be aware if the
  1071. definition for the particular option exists when this parameter
  1072. is not specified. It is generally recommended to not specify this
  1073. parameter only for the options for which the definition exists, e.g.
  1074. standard options. Setting <command>csv-format</command> to an explicit
  1075. value will cause the server to strictly check the format of the option
  1076. data specified.
  1077. </simpara>
  1078. </listitem>
  1079. </itemizedlist>
  1080. </para>
  1081. </section>
  1082. <section id="dhcp6-config-subnets">
  1083. <title>IPv6 Subnet Selection</title>
  1084. <para>
  1085. The DHCPv6 server may receive requests from local (connected to the
  1086. same subnet as the server) and remote (connecting via relays) clients.
  1087. As server may have many subnet configurations defined, it must select
  1088. appropriate subnet for a given request.
  1089. </para>
  1090. <para>
  1091. The server can not assume which of configured subnets are local. It is
  1092. possible in IPv4, where there is reasonable expectation that the
  1093. server will have a (global) IPv4 address configured on the interface,
  1094. and can use that information to detect whether a subnet is local or
  1095. not. That assumption is not true in IPv6, as the DHCPv6 must be able
  1096. to operate with having link-local addresses only. Therefore an optional
  1097. &quot;interface&quot; parameter is available within a subnet definition
  1098. to designate that a given subnet is local, i.e. reachable directly over
  1099. specified interface. For example the server that is intended to serve
  1100. a local subnet over eth0 may be configured as follows:
  1101. <screen>
  1102. "Dhcp6": {
  1103. "subnet6": [
  1104. {
  1105. "subnet": "2001:db8:beef::/48",
  1106. "pools": [
  1107. {
  1108. "pool": "2001:db8:beef::/48"
  1109. }
  1110. ],
  1111. <userinput>"interface": "eth0"</userinput>
  1112. }
  1113. ],
  1114. ...
  1115. }
  1116. </screen>
  1117. </para>
  1118. </section>
  1119. <section id="dhcp6-relays">
  1120. <title>DHCPv6 Relays</title>
  1121. <para>
  1122. A DHCPv6 server with multiple subnets defined must select the
  1123. appropriate subnet when it receives a request from client. For clients
  1124. connected via relays, two mechanisms are used:
  1125. </para>
  1126. <para>
  1127. The first uses the linkaddr field in the RELAY_FORW message. The name
  1128. of this field is somewhat misleading in that it does not contain a link-layer
  1129. address: instead, it holds an address (typically a global address) that is
  1130. used to identify a link. The DHCPv6 server checks if the address belongs
  1131. to a defined subnet and, if it does, that subnet is selected for the client's
  1132. request.
  1133. </para>
  1134. <para>
  1135. The second mechanism is based on interface-id options. While forwarding a client's
  1136. message, relays may insert an interface-id option into the message that
  1137. identifies the interface on the relay that received the message. (Some
  1138. relays allow configuration of that parameter, but it is sometimes
  1139. hardcoded and may range from the very simple (e.g. "vlan100") to the very cryptic:
  1140. one example seen on real hardware was "ISAM144|299|ipv6|nt:vp:1:110"). The
  1141. server can use this information to select the appropriate subnet.
  1142. The information is also returned to the relay which then knows the
  1143. interface to use to transmit the response to the client. In order for
  1144. this to work successfully, the relay interface IDs must be unique within
  1145. the network and the server configuration must match those values.
  1146. </para>
  1147. <para>
  1148. When configuring the DHCPv6 server, it should be noted that two
  1149. similarly-named parameters can be configured for a subnet:
  1150. <itemizedlist>
  1151. <listitem><simpara>
  1152. "interface" defines which local network interface can be used
  1153. to access a given subnet.
  1154. </simpara></listitem>
  1155. <listitem><simpara>
  1156. "interface-id" specifies the content of the interface-id option
  1157. used by relays to identify the interface on the relay to which
  1158. the response packet is sent.
  1159. </simpara></listitem>
  1160. </itemizedlist>
  1161. The two are mutually exclusive: a subnet cannot be both reachable locally
  1162. (direct traffic) and via relays (remote traffic). Specifying both is a
  1163. configuration error and the DHCPv6 server will refuse such a configuration.
  1164. </para>
  1165. <para>
  1166. To specify interface-id with value "vlan123", the following commands can
  1167. be used:
  1168. <screen>
  1169. "Dhcp6": {
  1170. "subnet6": [
  1171. {
  1172. "subnet": "2001:db8:beef::/48",
  1173. "pools": [
  1174. {
  1175. "pool": "2001:db8:beef::/48"
  1176. }
  1177. ],
  1178. <userinput>"interface-id": "vlan123"</userinput>
  1179. }
  1180. ],
  1181. ...
  1182. }
  1183. </screen>
  1184. </para>
  1185. </section>
  1186. <section id="dhcp6-client-classifier">
  1187. <title>Client Classification in DHCPv6</title>
  1188. <note>
  1189. <para>
  1190. DHCPv6 server has been extended to support limited client classification.
  1191. Although the current capability is modest, it is expected to be expanded
  1192. in the future. It is envisaged that the majority of client classification
  1193. extensions will be using hooks extensions.
  1194. </para>
  1195. </note>
  1196. <para>In certain cases it is useful to differentiate between different types
  1197. of clients and treat them differently. The process of doing classification
  1198. is conducted in two steps. The first step is to assess incoming packet and
  1199. assign it to zero or more classes. This classification is currently simple,
  1200. but is expected to grow in capability soon. Currently the server checks whether
  1201. incoming packet has vendor class option (16). If it has, content
  1202. of that option is prepended with &quot;VENDOR_CLASS_&quot; interpreted as a
  1203. class. For example, modern cable modems will send this option with value
  1204. &quot;docsis3.0&quot; and as a result the packet will belong to class
  1205. &quot;VENDOR_CLASS_docsis3.0&quot;.
  1206. </para>
  1207. <para>It is envisaged that the client classification will be used for changing
  1208. behavior of almost any part of the DHCP engine processing, including assigning
  1209. leases from different pools, assigning different option (or different values of
  1210. the same options) etc. For now, there is only one mechanism that is taking
  1211. advantage of client classification: subnet selection.</para>
  1212. <para>
  1213. Kea can be instructed to limit access to given subnets based on class information.
  1214. This is particularly useful for cases where two types of devices share the
  1215. same link and are expected to be served from two different subnets. The
  1216. primary use case for such a scenario are cable networks. There are two
  1217. classes of devices: cable modem itself, which should be handled a lease
  1218. from subnet A and all other devices behind modems that should get a lease
  1219. from subnet B. That segregation is essential to prevent overly curious
  1220. users from playing with their cable modems. For details on how to set up
  1221. class restrictions on subnets, see <xref linkend="dhcp6-subnet-class"/>.
  1222. </para>
  1223. </section>
  1224. <section id="dhcp6-subnet-class">
  1225. <title>Limiting access to IPv6 subnet to certain classes</title>
  1226. <para>
  1227. In certain cases it beneficial to restrict access to certain subnets
  1228. only to clients that belong to a given subnet. For details on client
  1229. classes, see <xref linkend="dhcp6-client-classifier"/>. This is an
  1230. extension of a previous example from <xref linkend="dhcp6-address-config"/>.
  1231. Let's assume that the server is connected to a network segment that uses
  1232. the 2001:db8:1::/64 prefix. The Administrator of that network has
  1233. decided that addresses from range 2001:db8:1::1 to 2001:db8:1::ffff are
  1234. going to be managed by the Dhcp6 server. Only clients belonging to the
  1235. eRouter1.0 client class are allowed to use that pool. Such a
  1236. configuration can be achieved in the following way:
  1237. <screen>
  1238. "Dhcp6": {
  1239. "subnet6": [
  1240. {
  1241. "subnet": "2001:db8:1::/64",
  1242. "pools": [
  1243. {
  1244. "pool": "2001:db8:1::-2001:db8:1::ffff"
  1245. }
  1246. ],
  1247. <userinput>"client-class": "VENDOR_CLASS_eRouter1.0"</userinput>
  1248. }
  1249. ],
  1250. ...
  1251. }
  1252. </screen>
  1253. </para>
  1254. <para>
  1255. Care should be taken with client classification as it is easy to prevent
  1256. clients that do not meet class criteria to be denied any service altogether.
  1257. </para>
  1258. </section>
  1259. <section id="dhcp6-ddns-config">
  1260. <title>Configuring DHCPv6 for DDNS</title>
  1261. <para>
  1262. As mentioned earlier, kea-dhcp6 can be configured to generate requests to
  1263. the DHCP-DDNS server (referred to here as the "D2" server) to update
  1264. DNS entries. These requests are known as NameChangeRequests or NCRs.
  1265. Each NCR contains the following information:
  1266. <orderedlist>
  1267. <listitem><para>
  1268. Whether it is a request to add (update) or remove DNS entries
  1269. </para></listitem>
  1270. <listitem><para>
  1271. Whether the change requests forward DNS updates (AAAA records), reverse
  1272. DNS updates (PTR records), or both.
  1273. </para></listitem>
  1274. <listitem><para>
  1275. The FQDN, lease address, and DHCID
  1276. </para></listitem>
  1277. </orderedlist>
  1278. The parameters controlling the generation of NCRs for submission to D2
  1279. are contained in the "dhcp-ddns" section of kea-dhcp6
  1280. configuration. The default values for this section appears as follows:
  1281. <screen>
  1282. "Dhcp6": {
  1283. "dhcp-ddns": {
  1284. <userinput>"enable-updates": true,
  1285. "server-ip": "127.0.0.1",
  1286. "server-port": 53001,
  1287. "sender-ip": "",
  1288. "sender-port": 0,
  1289. "max-queue-size": 1024,
  1290. "ncr-protocol": "UDP",
  1291. "ncr-format": "JSON",
  1292. "override-no-update": false,
  1293. "override-client-update": false,
  1294. "replace-client-name": false,
  1295. "generated-prefix": "myhost",
  1296. "qualifying-suffix": "example.com"</userinput>
  1297. },
  1298. ...
  1299. }
  1300. </screen>
  1301. </para>
  1302. <section id="dhcpv6-d2-io-config">
  1303. <title>DHCP-DDNS Server Connectivity</title>
  1304. <para>
  1305. In order for NCRs to reach the D2 server, kea-dhcp6 must be able
  1306. to communicate with it. kea-dhcp6 uses the following configuration
  1307. parameters to control how it communications with D2:
  1308. <itemizedlist>
  1309. <listitem><simpara>
  1310. <command>enable-updates</command> - determines whether or not kea-dhcp6 will
  1311. generate NCRs. If missing, this value is assumed to be false hence DDNS updates
  1312. are disabled. To enable DDNS updates set this value to true:
  1313. </simpara></listitem>
  1314. <listitem><simpara>
  1315. <command>server-ip</command> - IP address on which D2 listens for requests. The default is
  1316. the local loopback interface at address 127.0.0.1. You may specify
  1317. either an IPv4 or IPv6 address.
  1318. </simpara></listitem>
  1319. <listitem><simpara>
  1320. <command>server-port</command> - port on which D2 listens for requests. The default value
  1321. is 53001.
  1322. </simpara></listitem>
  1323. <listitem><simpara>
  1324. <command>sender-ip</command> - IP address which kea-dhcp6 should use to send requests to D2.
  1325. The default value is blank which instructs kea-dhcp6 to select a suitable
  1326. address.
  1327. </simpara></listitem>
  1328. <listitem><simpara>
  1329. <command>sender-port</command> - port which kea-dhcp6 should use to send requests to D2. The
  1330. default value of 0 instructs kea-dhcp6 to select suitable port.
  1331. </simpara></listitem>
  1332. <listitem><simpara>
  1333. <command>max-queue-size</command> - maximum number of requests allowed to queue waiting to
  1334. be sent to D2. This value guards against requests accumulating
  1335. uncontrollably if they are being generated faster than they can be
  1336. delivered. If the number of requests queued for transmission reaches
  1337. this value, DDNS updating will be turned off until the queue backlog has
  1338. been sufficiently reduced. The intent is allow kea-dhcp6 to
  1339. continue lease operations. The default value is 1024.
  1340. </simpara></listitem>
  1341. <listitem><simpara>
  1342. <command>ncr-format</command> - Socket protocol use when sending requests to D2. Currently
  1343. only UDP is supported. TCP may be available in an upcoming release.
  1344. </simpara></listitem>
  1345. <listitem><simpara>
  1346. <command>ncr-protocol</command> - Packet format to use when sending requests to D2.
  1347. Currently only JSON format is supported. Other formats may be available
  1348. in future releases.
  1349. </simpara></listitem>
  1350. </itemizedlist>
  1351. By default, D2 is assumed to running on the same machine as kea-dhcp6, and
  1352. all of the default values mentioned above should be sufficient.
  1353. If, however, D2 has been configured to listen on a different address or
  1354. port, these values must altered accordingly. For example, if D2 has been
  1355. configured to listen on 2001:db8::5 port 900, the following commands
  1356. would be required:
  1357. <screen>
  1358. "Dhcp6": {
  1359. "dhcp-ddns": {
  1360. <userinput>"server-ip": "2001:db8::5",
  1361. "server-port": 900</userinput>,
  1362. ...
  1363. },
  1364. ...
  1365. }
  1366. </screen>
  1367. </para>
  1368. </section>
  1369. <section id="dhcpv6-d2-rules-config">
  1370. <title>When does kea-dhcp6 generate DDNS request</title>
  1371. <para>kea-dhcp6 follows the behavior prescribed for DHCP servers in
  1372. <ulink url="http://tools.ietf.org/html/rfc4704">RFC 4704</ulink>.
  1373. It is important to keep in mind that kea-dhcp6 provides the initial
  1374. decision making of when and what to update and forwards that
  1375. information to D2 in the form of NCRs. Carrying out the actual
  1376. DNS updates and dealing with such things as conflict resolution
  1377. are the purview of D2 (<xref linkend="dhcp-ddns-server"/>).</para>
  1378. <para>
  1379. This section describes when kea-dhcp6 will generate NCRs and the
  1380. configuration parameters that can be used to influence this decision.
  1381. It assumes that the "enable-updates" parameter is true.
  1382. </para>
  1383. <note>
  1384. <para>
  1385. Currently the interface between kea-dhcp6 and D2 only supports requests
  1386. which update DNS entries for a single IP address. If a lease grants
  1387. more than one address, kea-dhcp6 will create the DDNS update request for
  1388. only the first of these addresses. Support for multiple address
  1389. mappings may be provided in a future release.
  1390. </para>
  1391. </note>
  1392. <para>
  1393. In general, kea-dhcp6 will generate DDNS update requests when:
  1394. <orderedlist>
  1395. <listitem><para>
  1396. A new lease is granted in response to a DHCP REQUEST
  1397. </para></listitem>
  1398. <listitem><para>
  1399. An existing lease is renewed but the FQDN associated with it has
  1400. changed.
  1401. </para></listitem>
  1402. <listitem><para>
  1403. An existing lease is released in response to a DHCP RELEASE
  1404. </para></listitem>
  1405. </orderedlist>
  1406. In the second case, lease renewal, two DDNS requests will be issued: one
  1407. request to remove entries for the previous FQDN and a second request to
  1408. add entries for the new FQDN. In the last case, a lease release, a
  1409. single DDNS request to remove its entries will be made. The decision
  1410. making involved when granting a new lease is more involved and is
  1411. discussed next.
  1412. </para>
  1413. <para>
  1414. kea-dhcp6 will generate a DDNS update request only if the DHCP REQUEST
  1415. contains the FQDN option (code 39). By default kea-dhcp6 will
  1416. respect the FQDN N and S flags specified by the client as shown in the
  1417. following table:
  1418. </para>
  1419. <table id="dhcp6-fqdn-flag-table">
  1420. <title>Default FQDN Flag Behavior</title>
  1421. <tgroup cols='4' align='left'>
  1422. <colspec colname='cflags'/>
  1423. <colspec colname='meaning'/>
  1424. <colspec colname='response'/>
  1425. <colspec colname='sflags'/>
  1426. <thead>
  1427. <row>
  1428. <entry>Client Flags:N-S</entry>
  1429. <entry>Client Intent</entry>
  1430. <entry>Server Response</entry>
  1431. <entry>Server Flags:N-S-O</entry>
  1432. </row>
  1433. </thead>
  1434. <tbody>
  1435. <row>
  1436. <entry>0-0</entry>
  1437. <entry>
  1438. Client wants to do forward updates, server should do reverse updates
  1439. </entry>
  1440. <entry>Server generates reverse-only request</entry>
  1441. <entry>1-0-0</entry>
  1442. </row>
  1443. <row>
  1444. <entry>0-1</entry>
  1445. <entry>Server should do both forward and reverse updates</entry>
  1446. <entry>Server generates request to update both directions</entry>
  1447. <entry>0-1-0</entry>
  1448. </row>
  1449. <row>
  1450. <entry>1-0</entry>
  1451. <entry>Client wants no updates done</entry>
  1452. <entry>Server does not generate a request</entry>
  1453. <entry>1-0-0</entry>
  1454. </row>
  1455. </tbody>
  1456. </tgroup>
  1457. </table>
  1458. <para>
  1459. The first row in the table above represents "client delegation". Here
  1460. the DHCP client states that it intends to do the forward DNS updates and
  1461. the server should do the reverse updates. By default, kea-dhcp6 will honor
  1462. the client's wishes and generate a DDNS request to D2 to update only
  1463. reverse DNS data. The parameter, "override-client-update", can be used
  1464. to instruct the server to override client delegation requests. When
  1465. this parameter is true, kea-dhcp6 will disregard requests for client
  1466. delegation and generate a DDNS request to update both forward and
  1467. reverse DNS data. In this case, the N-S-O flags in the server's
  1468. response to the client will be 0-1-1 respectively.
  1469. </para>
  1470. <para>
  1471. (Note that the flag combination N=1, S=1 is prohibited according to
  1472. RFC 4702. If such a combination is received from the client, the packet
  1473. will be dropped by kea-dhcp6.)
  1474. </para>
  1475. <para>
  1476. To override client delegation, issue the following commands:
  1477. </para>
  1478. <screen>
  1479. "Dhcp6": {
  1480. "dhcp-ddns": {
  1481. <userinput>"override-client-update": true</userinput>,
  1482. ...
  1483. },
  1484. ...
  1485. }
  1486. </screen>
  1487. <para>
  1488. The third row in the table above describes the case in which the client
  1489. requests that no DNS updates be done. The parameter, "override-no-update",
  1490. can be used to instruct the server to disregard the client's wishes. When
  1491. this parameter is true, kea-dhcp6 will generate DDNS update request to D2
  1492. even if the client requests no updates be done. The N-S-O flags in the
  1493. server's response to the client will be 0-1-1.
  1494. </para>
  1495. <para>
  1496. To override client delegation, issue the following commands:
  1497. </para>
  1498. <screen>
  1499. "Dhcp6": {
  1500. "dhcp-ddns": {
  1501. <userinput>"override-no-update": true</userinput>,
  1502. ...
  1503. },
  1504. ...
  1505. }
  1506. </screen>
  1507. </section>
  1508. <section id="dhcpv6-fqdn-name-generation">
  1509. <title>kea-dhcp6 name generation for DDNS update requests</title>
  1510. <para>Each NameChangeRequest must of course include the fully qualified domain
  1511. name whose DNS entries are to be affected. kea-dhcp6 can be configured to
  1512. supply a portion or all of that name based upon what it receives from
  1513. the client in the DHCP REQUEST.</para>
  1514. <para>The rules for determining the FQDN option are as follows:
  1515. <orderedlist>
  1516. <listitem><para>
  1517. If configured to do so ignore the REQUEST contents and generate a
  1518. FQDN using a configurable prefix and suffix.
  1519. </para></listitem>
  1520. <listitem><para>
  1521. Otherwise, using is the domain name value from the client FQDN option as
  1522. the candidate name:
  1523. <orderedlist>
  1524. <listitem><para>
  1525. If the candidate name is a fully qualified domain name then use it.
  1526. </para></listitem>
  1527. <listitem><para>
  1528. If the candidate name is a partial (i.e. unqualified) name then
  1529. add a configurable suffix to the name and use the result as the FQDN.
  1530. </para></listitem>
  1531. <listitem><para>
  1532. If the candidate name is a empty then generate a FQDN using a
  1533. configurable prefix and suffix.
  1534. </para></listitem>
  1535. </orderedlist>
  1536. </para></listitem>
  1537. </orderedlist>
  1538. To instruct kea-dhcp6 to always generate a FQDN, set the parameter
  1539. "replace-client-name" to true:
  1540. </para>
  1541. <screen>
  1542. "Dhcp6": {
  1543. "dhcp-ddns": {
  1544. <userinput>"replace-client-name": true</userinput>,
  1545. ...
  1546. },
  1547. ...
  1548. }
  1549. </screen>
  1550. <para>
  1551. The prefix used when generating a FQDN is specified by the
  1552. "generated-prefix" parameter. The default value is "myhost". To alter
  1553. its value, simply set it to the desired string:
  1554. </para>
  1555. <screen>
  1556. "Dhcp6": {
  1557. "dhcp-ddns": {
  1558. <userinput>"generated-prefix": "another.host"</userinput>,
  1559. ...
  1560. },
  1561. ...
  1562. }
  1563. </screen>
  1564. <para>
  1565. The suffix used when generating a FQDN or when qualifying a partial name
  1566. is specified by the <command>qualifying-suffix</command> parameter. There
  1567. is no default value. To set its value simply set it to the desired string:
  1568. </para>
  1569. <screen>
  1570. "Dhcp6": {
  1571. "dhcp-ddns": {
  1572. <userinput>"qualifying-suffix": "foo.example.org"</userinput>,
  1573. ...
  1574. },
  1575. ...
  1576. }
  1577. </screen>
  1578. </section>
  1579. <para>
  1580. When qualifying a partial name, kea-dhcp6 will construct a name with the
  1581. format:
  1582. </para>
  1583. <para>
  1584. [candidate-name].[qualifying-suffix].
  1585. </para>
  1586. <para>
  1587. where candidate-name is the partial name supplied in the REQUEST.
  1588. For example, if FQDN domain name value was "some-computer" and assuming
  1589. the default value for qualifying-suffix, the generated FQDN would be:
  1590. </para>
  1591. <para>
  1592. some-computer.example.com.
  1593. </para>
  1594. <para>
  1595. When generating a the entire name, kea-dhcp6 will construct name of the
  1596. format:
  1597. </para>
  1598. <para>
  1599. [generated-prefix]-[address-text].[qualifying-suffix].
  1600. </para>
  1601. <para>
  1602. where address-text is simply the lease IP address converted to a
  1603. hyphenated string. For example, if lease address is 3001:1::70E and
  1604. assuming default values for generated-prefix and qualifying-suffix, the
  1605. generated FQDN would be:
  1606. </para>
  1607. <para>
  1608. myhost-3001-1--70E.example.com.
  1609. </para>
  1610. </section>
  1611. </section>
  1612. <section id="dhcp6-serverid">
  1613. <title>Server Identifier in DHCPv6</title>
  1614. <para>The DHCPv6 protocol uses a "server identifier" (also known
  1615. as a DUID) for clients to be able to discriminate between several
  1616. servers present on the same link. There are several types of
  1617. DUIDs defined, but <ulink url="http://tools.ietf.org/html/rfc3315">RFC 3315</ulink> instructs servers to use DUID-LLT if
  1618. possible. This format consists of a link-layer (MAC) address and a
  1619. timestamp. When started for the first time, the DHCPv6 server will
  1620. automatically generate such a DUID and store the chosen value to
  1621. a file. That file is read by the server
  1622. and the contained value used whenever the server is subsequently started.
  1623. </para>
  1624. <para>
  1625. It is unlikely that this parameter should ever need to be changed.
  1626. However, if such a need arises, stop the server, edit the file and restart
  1627. the server. (The file is named kea-dhcp6-serverid and by default is
  1628. stored in the "var" subdirectory of the directory in which Kea is installed.
  1629. This can be changed when Kea is built by using "--localstatedir"
  1630. on the "configure" command line.) The file is a text file that contains
  1631. double digit hexadecimal values
  1632. separated by colons. This format is similar to typical MAC address
  1633. format. Spaces are ignored. No extra characters are allowed in this
  1634. file.
  1635. </para>
  1636. </section>
  1637. <section id="dhcp6-relay-override">
  1638. <title>Using specific relay agent for a subnet</title>
  1639. <para>
  1640. The relay has to have an interface connected to the link on which
  1641. the clients are being configured. Typically the relay has a global IPv6
  1642. address configured on that interface that belongs to the subnet that
  1643. the server will assign addresses from. In such typical case, the
  1644. server is able to use IPv6 address inserted by the relay (in link-addr
  1645. field in RELAY-FORW message) to select appropriate subnet.
  1646. </para>
  1647. <para>
  1648. However, that is not always the case. The relay
  1649. address may not match the subnet in certain deployments. This
  1650. usually means that there is more than one subnet allocated for a given
  1651. link. Two most common examples where this is the case are long lasting
  1652. network renumbering (where both old and new address space is still being
  1653. used) and a cable network. In a cable network both cable modems and the
  1654. devices behind them are physically connected to the same link, yet
  1655. they use distinct addressing. In such case, the DHCPv6 server needs
  1656. additional information (like the value of interface-id option or IPv6
  1657. address inserted in the link-addr field in RELAY-FORW message) to
  1658. properly select an appropriate subnet.
  1659. </para>
  1660. <para>
  1661. The following example assumes that there is a subnet 2001:db8:1::/64
  1662. that is accessible via relay that uses 3000::1 as its IPv6 address.
  1663. The server will be able to select this subnet for any incoming packets
  1664. that came from a relay that has an address in 2001:db8:1::/64 subnet.
  1665. It will also select that subnet for a relay with address 3000::1.
  1666. <screen>
  1667. "Dhcp6": {
  1668. "subnet6": [
  1669. {
  1670. "subnet": "2001:db8:1::/64",
  1671. "pools": [
  1672. {
  1673. "pool": "2001:db8:1::1-2001:db8:1::ffff"
  1674. }
  1675. ],
  1676. <userinput>"relay": {
  1677. "ip-address": "3000::1"
  1678. }</userinput>
  1679. }
  1680. ]
  1681. }
  1682. </screen>
  1683. </para>
  1684. </section>
  1685. <section id="dhcp6-client-class-relay">
  1686. <title>Segregating IPv6 clients in a cable network</title>
  1687. <para>
  1688. In certain cases, it is useful to mix relay address information,
  1689. introduced in <xref linkend="dhcp6-relay-override"/> with client
  1690. classification, explained in <xref linkend="dhcp6-subnet-class"/>.
  1691. One specific example is cable network, where typically modems
  1692. get addresses from a different subnet than all devices connected
  1693. behind them.
  1694. </para>
  1695. <para>
  1696. Let's assume that there is one CMTS (Cable Modem Termination System)
  1697. with one CM MAC (a physical link that modems are connected to).
  1698. We want the modems to get addresses from the 3000::/64 subnet,
  1699. while everything connected behind modems should get addresses from
  1700. another subnet (2001:db8:1::/64). The CMTS that acts as a relay
  1701. an uses address 3000::1. The following configuration can serve
  1702. that configuration:
  1703. <screen>
  1704. "Dhcp6": {
  1705. "subnet6": [
  1706. {
  1707. "subnet": "3000::/64",
  1708. "pools": [
  1709. { "pool": "3000::2 - 3000::ffff" }
  1710. ],
  1711. <userinput>"client-class": "VENDOR_CLASS_docsis3.0",
  1712. "relay": {
  1713. "ip-address": "3000::1"
  1714. }</userinput>
  1715. },
  1716. {
  1717. "subnet": "2001:db8:1::/64",
  1718. "pools": [
  1719. {
  1720. "pool": "2001:db8:1::1-2001:db8:1::ffff"
  1721. }
  1722. ],
  1723. <userinput>"relay": {
  1724. "ip-address": "3000::1"
  1725. }</userinput>
  1726. }
  1727. ]
  1728. }
  1729. </screen>
  1730. </para>
  1731. </section>
  1732. <section id="dhcp6-std">
  1733. <title>Supported DHCPv6 Standards</title>
  1734. <para>The following standards are currently
  1735. supported:</para>
  1736. <itemizedlist>
  1737. <listitem>
  1738. <simpara><emphasis>Dynamic Host Configuration Protocol for IPv6</emphasis>,
  1739. <ulink url="http://tools.ietf.org/html/rfc3315">RFC 3315</ulink>:
  1740. Supported messages are SOLICIT,
  1741. ADVERTISE, REQUEST, RELEASE, RENEW, REBIND, CONFIRM and REPLY.</simpara>
  1742. </listitem>
  1743. <listitem>
  1744. <simpara><emphasis>IPv6 Prefix Options for
  1745. Dynamic Host Configuration Protocol (DHCP) version 6</emphasis>,
  1746. <ulink url="http://tools.ietf.org/html/rfc3633">RFC 3633</ulink>:
  1747. Supported options are IA_PD and
  1748. IA_PREFIX. Also supported is the status code NoPrefixAvail.</simpara>
  1749. </listitem>
  1750. <listitem>
  1751. <simpara><emphasis>DNS Configuration options for Dynamic Host
  1752. Configuration Protocol for IPv6 (DHCPv6)</emphasis>,
  1753. <ulink url="http://tools.ietf.org/html/rfc3646">RFC 3646</ulink>:
  1754. Supported option is DNS_SERVERS.</simpara>
  1755. </listitem>
  1756. <listitem>
  1757. <simpara><emphasis>The Dynamic Host Configuration Protocol for IPv6 (DHCPv6) Client
  1758. Fully Qualified Domain Name (FQDN) Option</emphasis>,
  1759. <ulink url="http://tools.ietf.org/html/rfc4704">RFC 4704</ulink>:
  1760. Supported option is CLIENT_FQDN.</simpara>
  1761. </listitem>
  1762. </itemizedlist>
  1763. </section>
  1764. <section id="dhcp6-limit">
  1765. <title>DHCPv6 Server Limitations</title>
  1766. <para> These are the current limitations and known problems
  1767. with the DHCPv6 server
  1768. software. Most of them are reflections of the early stage of
  1769. development and should be treated as <quote>not implemented
  1770. yet</quote>, rather than actual limitations.</para>
  1771. <itemizedlist>
  1772. <listitem> <!-- see tickets #3234, #3281 -->
  1773. <para>
  1774. On-line configuration has some limitations. Adding new subnets or
  1775. modifying existing ones work, as is removing the last subnet from
  1776. the list. However, removing non-last (e.g. removing subnet 1,2 or 3 if
  1777. there are 4 subnets configured) will cause issues. The problem is
  1778. caused by simplistic subnet-id assignment. The subnets are always
  1779. numbered, starting from 1. That subnet-id is then used in leases
  1780. that are stored in the lease database. Removing non-last subnet will
  1781. cause the configuration information to mismatch data in the lease
  1782. database. It is possible to manually update subnet-id fields in
  1783. MySQL or PostgreSQL database, but it is awkward and error prone
  1784. process. A better reconfiguration support is planned.
  1785. </para>
  1786. </listitem>
  1787. <listitem>
  1788. <simpara>
  1789. The server will allocate, renew or rebind a maximum of one lease
  1790. for a particular IA option (IA_NA or IA_PD) sent by a client.
  1791. <ulink url="http://tools.ietf.org/html/rfc3315">RFC 3315</ulink> and
  1792. <ulink url="http://tools.ietf.org/html/rfc3633">RFC 3633</ulink> allow
  1793. for multiple addresses or prefixes to be allocated for a single IA.
  1794. </simpara>
  1795. </listitem>
  1796. <listitem>
  1797. <simpara>Temporary addresses are not supported.</simpara>
  1798. </listitem>
  1799. <listitem>
  1800. <simpara>
  1801. Duplication report (DECLINE), stateless configuration
  1802. (INFORMATION-REQUEST) and client reconfiguration (RECONFIGURE) are
  1803. not yet supported.
  1804. </simpara>
  1805. </listitem>
  1806. <listitem>
  1807. <simpara>
  1808. The server doesn't act upon expired leases. In particular,
  1809. when a lease expires, the server doesn't request removal of
  1810. the DNS records associated with it.
  1811. </simpara>
  1812. </listitem>
  1813. </itemizedlist>
  1814. </section>
  1815. <!--
  1816. <section id="dhcp6-srv-examples">
  1817. <title>Kea DHCPv6 server examples</title>
  1818. <para>
  1819. This section provides easy to use example. Each example can be read
  1820. separately. It is not intended to be read sequentially as there will
  1821. be many repetitions between examples. They are expected to serve as
  1822. easy to use copy-paste solutions to many common deployments.
  1823. </para>
  1824. @todo: add simple configuration for direct clients
  1825. @todo: add configuration for relayed clients
  1826. @todo: add client classification example
  1827. </section> -->
  1828. </chapter>