dhcp6-srv.xml 164 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854
  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 DHCPv6 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>-d</command> - specifies whether the server
  26. logging should be switched to verbose mode. In verbose mode,
  27. the logging severity and debuglevel specified in the 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 on which the server will listen. This is only
  37. useful during testing, as a 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. <listitem>
  53. <simpara>
  54. <command>-W</command> - prints out Kea configuration report
  55. and exits.
  56. </simpara>
  57. </listitem>
  58. </itemizedlist>
  59. <para>
  60. The <command>-V</command> command returns the versions of the
  61. external libraries dynamically linked.
  62. </para>
  63. <para>
  64. The <command>-W</command> command describes the environment used
  65. to build Kea. This command displays a copy of the
  66. <filename>config.report</filename> file produced by
  67. <userinput>./configure</userinput> that is embedded in the
  68. executable binary.
  69. </para>
  70. <para>
  71. The <filename>config.report</filename> may also be accessed more
  72. directly. The following command may be used to extract this
  73. information. The binary <userinput>path</userinput> may be found
  74. in the install directory or in the <filename>.libs</filename>
  75. subdirectory in the source tree. For example
  76. <filename>kea/src/bin/dhcp6/.libs/kea-dhcp6</filename>.
  77. <screen>
  78. strings <userinput>path</userinput>/kea-dhcp6 | sed -n 's/;;;; //p'
  79. </screen>
  80. </para>
  81. <para>
  82. When running in a console, the server can be shut down by
  83. pressing ctrl-c. It detects the key combination and shuts
  84. down gracefully.
  85. </para>
  86. <para>
  87. On start-up, the server will detect available network interfaces
  88. and will attempt to open UDP sockets on all interfaces
  89. mentioned in the configuration file.
  90. </para>
  91. <para>
  92. Since the DHCPv6 server opens privileged ports, it requires root
  93. access. Make sure you run this daemon as root.
  94. </para>
  95. <para>
  96. During startup the server will attempt to create a PID file of the
  97. form: [localstatedir]/[conf name].kea-dhcp6.pid
  98. where:
  99. <itemizedlist>
  100. <listitem>
  101. <simpara><command>localstatedir</command>: The value as passed into the
  102. build configure script. It defaults to "/usr/local/var". Note
  103. that this value may be overridden at run time by setting the environment
  104. variable KEA_PIDFILE_DIR. This is intended primarily for testing purposes.
  105. </simpara>
  106. </listitem>
  107. <listitem>
  108. <simpara><command>conf name</command>: The configuration file name
  109. used to start the server, minus all preceding path and file extension.
  110. For example, given a pathname of "/usr/local/etc/kea/myconf.txt", the
  111. portion used would be "myconf".
  112. </simpara>
  113. </listitem>
  114. </itemizedlist>
  115. If the file already exists and contains the PID of a live process,
  116. the server will issue a DHCP6_ALREADY_RUNNING log message and exit. It
  117. is possible, though unlikely, that the file is a remnant of a system crash
  118. and the process to which the PID belongs is unrelated to Kea. In such a
  119. case it would be necessary to manually delete the PID file.
  120. </para>
  121. </section>
  122. <section id="dhcp6-configuration">
  123. <title>DHCPv6 Server Configuration</title>
  124. <section>
  125. <title>Introduction</title>
  126. <para>
  127. This section explains how to configure the DHCPv6 server using the
  128. Kea configuration backend. (Kea configuration using any other
  129. backends is outside of scope of this document.) Before DHCPv6
  130. is started, its configuration file has to be created. The
  131. basic configuration looks as follows:
  132. <screen>
  133. {
  134. # DHCPv6 configuration starts on the next line
  135. "Dhcp6": {
  136. # First we set up global values
  137. "renew-timer": 1000,
  138. "rebind-timer": 2000,
  139. "preferred-lifetime": 3000,
  140. "valid-lifetime": 4000,
  141. # Next we setup the interfaces to be used by the server.
  142. "interfaces-config": {
  143. "interfaces": [ "eth0" ]
  144. },
  145. # And we specify the type of a lease database
  146. "lease-database": {
  147. "type": "memfile",
  148. "persist": true,
  149. "name": "/var/kea/dhcp6.leases"
  150. },
  151. # Finally, we list the subnets from which we will be leasing addresses.
  152. "subnet6": [
  153. {
  154. "subnet": "2001:db8:1::/64",
  155. "pools": [
  156. {
  157. "pool": "2001:db8:1::1-2001:db8:1::ffff"
  158. }
  159. ]
  160. }
  161. ]
  162. # DHCPv6 configuration ends with the next line
  163. }
  164. } </screen>
  165. </para>
  166. <para>The following paragraphs provide a brief overview of the parameters in
  167. the above example and
  168. their format. Subsequent sections of this chapter go into much greater detail
  169. for these and other parameters.</para>
  170. <para>The lines starting with a hash (#) are comments and are ignored by
  171. the server; they do not impact its
  172. operation in any way.</para>
  173. <para>The configuration starts in the first line with the initial
  174. opening curly bracket (or brace). Each configuration consists of
  175. one or more objects. In this specific example, we have only one
  176. object called Dhcp6. This is a simplified configuration, as usually
  177. there will be additional objects, like <command>Logging</command> or
  178. <command>DhcpDns</command>, but we omit them now for clarity. The Dhcp6
  179. configuration starts with the <command>"Dhcp6": {</command> line
  180. and ends with the corresponding closing brace (in the above example,
  181. the brace after the last comment). Everything defined between those
  182. lines is considered to be the Dhcp6 configuration.</para>
  183. <para>In the general case, the order in which those parameters appear does not
  184. matter. There are two caveats here though. The first one is to remember that
  185. the configuration file must be well formed JSON. That means that parameters
  186. for any given scope must be separated by a comma and there must not be a comma
  187. after the last parameter. When reordering a configuration file, keep in mind that
  188. moving a parameter to or from the last position in a given scope may require
  189. moving the comma as well. The second caveat is that it is uncommon &mdash; although
  190. legal JSON &mdash; to
  191. repeat the same parameter multiple times. If that happens, the last occurrence of a
  192. given parameter in a given scope is used while all previous instances are
  193. ignored. This is unlikely to cause any confusion as there are no real life
  194. reasons to keep multiple copies of the same parameter in your configuration
  195. file.</para>
  196. <para>Moving onto the DHCPv6 configuration elements, the very first few elements
  197. define some global parameters. <command>valid-lifetime</command>
  198. defines for how long the addresses (leases) given out by the server are valid. If
  199. nothing changes, a client that got an address is allowed to use it for 4000
  200. seconds. (Note that integer numbers are specified as is, without any quotes
  201. around them.) The address will become deprecated in 3000 seconds (clients are
  202. allowed to keep old connections, but can't use this address for creating new
  203. connections). <command>renew-timer</command> and <command>
  204. rebind-timer</command> are values that define T1 and T2 timers that govern when
  205. the client will begin the renewal and rebind procedures.</para>
  206. <para>The <command>interfaces-config</command> map specifies the server
  207. configuration concerning the network interfaces, on which the server should
  208. listen to the DHCP messages. The <command>interfaces</command> parameter
  209. specifies a list of network interfaces on which the server should listen.
  210. Lists are opened and closed with square brackets, with elements separated
  211. by commas. Had we wanted to listen on two interfaces, the
  212. <command>interfaces-config</command> would look like this:
  213. <screen>
  214. "interfaces-config": {
  215. "interfaces": [ "eth0", "eth1" ]
  216. },
  217. </screen>
  218. </para>
  219. <para>The next couple of lines define the lease database, the place where the server
  220. stores its lease information. This particular example tells the server to use
  221. <command>memfile</command>, which is the simplest (and fastest) database
  222. backend. It uses an in-memory database and stores leases on disk in a CSV
  223. file. This is a very simple configuration. Usually, lease database configuration
  224. is more extensive and contains additional parameters. Note that
  225. <command>lease-database</command>
  226. is an object and opens up a new scope, using an opening brace.
  227. Its parameters (just one in this example -- <command>type</command>)
  228. follow. Had there been more than one, they would be separated by commas. This
  229. scope is closed with a closing brace. As more parameters follow, a trailing
  230. comma is present.</para>
  231. <para>Finally, we need to define a list of IPv6 subnets. This is the
  232. most important DHCPv6 configuration structure as the server uses that
  233. information to process clients' requests. It defines all subnets from
  234. which the server is expected to receive DHCP requests. The subnets are
  235. specified with the <command>subnet6</command> parameter. It is a list,
  236. so it starts and ends with square brackets. Each subnet definition in
  237. the list has several attributes associated with it, so it is a structure
  238. and is opened and closed with braces. At minimum, a subnet definition
  239. has to have at least two parameters: <command>subnet</command> (that
  240. defines the whole subnet) and <command>pool</command> (which is a list of
  241. dynamically allocated pools that are governed by the DHCP server).</para>
  242. <para>The example contains a single subnet. Had more than one been defined,
  243. additional elements
  244. in the <command>subnet6</command> parameter would be specified and
  245. separated by commas. For example, to define two subnets, the following
  246. syntax would be used:
  247. <screen>
  248. "subnet6": [
  249. {
  250. "pools": [
  251. {
  252. "pool": "2001:db8:1::/112"
  253. }
  254. ],
  255. "subnet": "2001:db8:1::/64"
  256. },
  257. {
  258. "pools": [ { "pool": "2001:db8:2::1-2001:db8:2::ffff" } ],
  259. "subnet": "2001:db8:2::/64",
  260. "interface": "eth0"
  261. }
  262. ]
  263. </screen>
  264. Note that indentation is optional and is used for esthetic purposes only.
  265. In some cases in may be preferable to use more compact notation.
  266. </para>
  267. <para>After all parameters are specified, we have two contexts open:
  268. global and Dhcp6, hence we need two closing curly brackets to close them.
  269. In a real life configuration file there most likely would be additional
  270. components defined such as Logging or DhcpDdns, so the closing brace would
  271. be followed by a comma and another object definition.</para>
  272. </section>
  273. <section>
  274. <title>Lease Storage</title>
  275. <para>All leases issued by the server are stored in the lease database.
  276. Currently there are four database backends available: memfile (which is the
  277. default backend), MySQL, PostgreSQL and CQL.</para>
  278. <section>
  279. <title>Memfile, Basic Storage for Leases</title>
  280. <para>The server is able to store lease data in different repositories. Larger
  281. deployments may elect to store leases in a database. <xref
  282. linkend="database-configuration6"/> describes this option. In typical
  283. smaller deployments though, the server will use a CSV file rather than a database to
  284. store lease information. As well as requiring less administration, an
  285. advantage of using a file for storage is that it
  286. eliminates a dependency on third-party database software.</para>
  287. <para>The configuration of the file backend (Memfile) is controlled through
  288. the Dhcp6/lease-database parameters. The <command>type</command> parameter
  289. is mandatory and it specifies which storage for leases the server should use.
  290. The value of <userinput>"memfile"</userinput> indicates that the file should
  291. be used as the storage. The following list presents the remaining, not mandatory
  292. parameters, which can be used to configure the Memfile backend.
  293. <itemizedlist>
  294. <listitem>
  295. <simpara><command>persist</command>: controls whether the new leases and
  296. updates to existing leases are written to the file. It is strongly
  297. recommended that the value of this parameter is set to
  298. <userinput>true</userinput> at all times, during the server's normal
  299. operation. Not writing leases to disk will mean that if a server is restarted
  300. (e.g. after a power failure), it will not know what addresses have been
  301. assigned. As a result, it may hand out addresses to new clients that are
  302. already in use. The value of <userinput>false</userinput> is mostly useful
  303. for performance testing purposes. The default value of the
  304. <command>persist</command> parameter is <userinput>true</userinput>,
  305. which enables writing lease updates
  306. to the lease file.
  307. </simpara>
  308. </listitem>
  309. <listitem>
  310. <simpara><command>name</command>: specifies an absolute location of the lease
  311. file in which new leases and lease updates will be recorded. The default value
  312. for this parameter is <userinput>"[kea-install-dir]/var/kea/kea-leases6.csv"
  313. </userinput>.</simpara>
  314. </listitem>
  315. <listitem>
  316. <simpara><command>lfc-interval</command>: specifies the interval in seconds, at
  317. which the server (Memfile backend) will perform a lease file cleanup (LFC),
  318. which removes the redundant (historical) information from the lease file
  319. and effectively reduces the lease file size. The cleanup process is described
  320. in more detailed fashion further in this section. The default value of the
  321. <command>lfc-interval</command> is <userinput>0</userinput>, which disables
  322. the LFC.</simpara>
  323. </listitem>
  324. </itemizedlist>
  325. </para>
  326. <para>The example configuration of the Memfile backend is presented below:
  327. <screen>
  328. "Dhcp6": {
  329. "lease-database": {
  330. <userinput>"type": "memfile"</userinput>,
  331. <userinput>"persist": true</userinput>,
  332. <userinput>"name": "/tmp/kea-leases6.csv"</userinput>,
  333. <userinput>"lfc-interval": 1800</userinput>
  334. }
  335. }
  336. </screen>
  337. </para>
  338. <para>It is important to know how the lease file contents are organized
  339. to understand why the periodic lease file cleanup is needed. Every time when
  340. the server updates a lease or creates a new lease for the client, the new
  341. lease information must be recorded in the lease file. For performance reasons,
  342. the server does not supersede the existing client's lease, as it would require
  343. the lookup of the specific lease entry, but simply appends the new lease
  344. information at the end of the lease file. The previous lease entries for the
  345. client are not removed. When the server loads leases from the lease file, e.g.
  346. at the server startup, it assumes that the latest lease entry for the client
  347. is the valid one. The previous entries are discarded. This means that the
  348. server can re-construct the accurate information about the leases even though
  349. there may be many lease entries for each client. However, storing many entries
  350. for each client results in bloated lease file and impairs the performance of
  351. the server's startup and reconfiguration, as it needs to process larger number
  352. of lease entries.
  353. </para>
  354. <para>The lease file cleanup removes all previous entries for each client and
  355. leaves only the latest ones. The interval at which the cleanup is performed
  356. is configurable, and it should be selected according to the frequency of lease
  357. renewals initiated by the clients. The more frequent renewals are, the lesser
  358. value of the <command>lfc-interval</command> should be. Note however, that the
  359. LFC takes time and thus it is possible (although unlikely) that new cleanup
  360. is started while the previous cleanup instance is still running, if the
  361. <command>lfc-interval</command> is too short. The server would recover from
  362. this by skipping the new cleanup when it detects that the previous cleanup
  363. is still in progress. But, this implies that the actual cleanups will be
  364. triggered more rarely than configured. Moreover, triggering a new cleanup
  365. adds an overhead to the server, which will not be able to respond to new
  366. requests for a short period of time when the new cleanup process is spawned.
  367. Therefore, it is recommended that the <command>lfc-interval</command> value
  368. is selected in a way that would allow for completing the cleanup before the
  369. new cleanup is triggered.
  370. </para>
  371. <para>The LFC is performed by a separate process (in background) to avoid
  372. performance impact on the server process. In order to avoid the conflicts
  373. between the two processes both using the same lease files, the LFC process
  374. operates on the copy of the original lease file, rather than on the lease
  375. file used by the server to record lease updates. There are also other files
  376. being created as a side effect of the lease file cleanup. The detailed
  377. description of the LFC is located on the Kea wiki:
  378. <ulink url="http://kea.isc.org/wiki/LFCDesign"/>.
  379. </para>
  380. </section>
  381. <section id="database-configuration6">
  382. <title>Lease Database Configuration</title>
  383. <note>
  384. <para>Lease database access information must be configured for the DHCPv6 server,
  385. even if it has already been configured for the DHCPv4 server. The servers
  386. store their information independently, so each server can use a separate
  387. database or both servers can use the same database.</para>
  388. </note>
  389. <para>Lease database configuration is controlled through the
  390. Dhcp6/lease-database parameters. The type of the database must be set to
  391. "memfile", "mysql", "postgresql" or "cql", e.g.
  392. <screen>
  393. "Dhcp6": { "lease-database": { <userinput>"type": "mysql"</userinput>, ... }, ... }
  394. </screen>
  395. Next, the name of the database is to hold the leases must be set: this is the
  396. name used when the lease database was created
  397. (see <xref linkend="mysql-database-create"/>,
  398. <xref linkend="pgsql-database-create"/>
  399. or <xref linkend="cql-database-create"/>).
  400. <screen>
  401. "Dhcp6": { "lease-database": { <userinput>"name": "<replaceable>database-name</replaceable>" </userinput>, ... }, ... }
  402. </screen>
  403. If the database is located on a different system than the DHCPv6 server, the
  404. database host name must also be specified (although it should be noted that this
  405. configuration may have a severe impact on server performance):
  406. <screen>
  407. "Dhcp6": { "lease-database": { <userinput>"host": <replaceable>remote-host-name</replaceable></userinput>, ... }, ... }
  408. </screen>
  409. The usual state of affairs will be to have the database on the same machine as
  410. the DHCPv6 server. In this case, set the value to the empty string:
  411. <screen>
  412. "Dhcp6": { "lease-database": { <userinput>"host" : ""</userinput>, ... }, ... }
  413. </screen>
  414. Should the database be located on a different system, you may need to specify a longer interval
  415. for the connection timeout:
  416. <screen>
  417. "Dhcp6": { "lease-database": { <userinput>"connect-timeout" : <replaceable>timeout-in-seconds</replaceable></userinput>, ... }, ... }
  418. </screen>
  419. The default value of five seconds should be more than adequate for local connections.
  420. If a timeout is given though, it should be an integer greater than zero.
  421. </para>
  422. <para>Finally, the credentials of the account under which the server will
  423. access the database should be set:
  424. <screen>
  425. "Dhcp6": { "lease-database": { <userinput>"user": "<replaceable>user-name</replaceable>"</userinput>,
  426. <userinput>"password": "<replaceable>password</replaceable>"</userinput>,
  427. ... },
  428. ... }
  429. </screen>
  430. If there is no password to the account, set the password to the empty string
  431. "". (This is also the default.)</para>
  432. </section>
  433. </section>
  434. <section id="hosts6-storage">
  435. <title>Hosts Storage</title>
  436. <para>Kea is also able to store information about host reservations in the
  437. database. Hosts database configuration uses the same syntax as lease
  438. database. In fact, Kea server opens independent connections for each
  439. purpose, be it lease or hosts information. This gives the solution most
  440. flexibility. Kea can be used to keep leases and host reservations
  441. separately, but can also point to the same database. Currently the only
  442. supported hosts database type is MySQL.</para>
  443. <para>Please note that usage of hosts storage is optional. User can define
  444. all host reservations in the configuration file. That is the recommended way
  445. if the number of reservations is small. However, with the number of
  446. reservations growing it's more convenient to use host storage. Please note
  447. that both storages (configuration file and MySQL) can be used together. If
  448. hosts are defined in both places, the definitions from configuration file
  449. are checked first and external storage is checked later, if
  450. necessary.</para>
  451. <para>All hosts leases issued by the server are stored in the hosts
  452. database. Currently there is only one available backend: MySQL. Other host
  453. backends will become available in future Kea versions.</para>
  454. <section id="hosts-database-configuration6">
  455. <title>IPv6 Hosts Database Configuration</title>
  456. <para>Hosts database configuration is controlled through the Dhcp6/hosts-database
  457. parameters. If enabled, the type of the database must be set to "mysql". Other
  458. hosts backends may be added in later Kea versions.
  459. <screen>
  460. "Dhcp6": { "hosts-database": { <userinput>"type": "mysql"</userinput>, ... }, ... }
  461. </screen>
  462. Next, the name of the database to hold the leases must be set: this is the
  463. name used when the lease database was created (see <xref linkend="mysql-database-create"/>).
  464. <screen>
  465. "Dhcp6": { "hosts-database": { <userinput>"name": "<replaceable>database-name</replaceable>" </userinput>, ... }, ... }
  466. </screen>
  467. If the database is located on a different system to the DHCPv6 server, the
  468. database host name must also be specified (although it should be noted that this
  469. configuration may have a severe impact on server performance):
  470. <screen>
  471. "Dhcp6": { "hosts-database": { <userinput>"host": <replaceable>remote-host-name</replaceable></userinput>, ... }, ... }
  472. </screen>
  473. The usual state of affairs will be to have the database on the same machine as
  474. the DHCPv6 server. In this case, set the value to the empty string:
  475. <screen>
  476. "Dhcp6": { "hosts-database": { <userinput>"host" : ""</userinput>, ... }, ... }
  477. </screen>
  478. </para>
  479. <para>Finally, the credentials of the account under which the server will
  480. access the database should be set:
  481. <screen>
  482. "Dhcp6": { "hosts-database": { <userinput>"user": "<replaceable>user-name</replaceable>"</userinput>,
  483. <userinput>"password": "<replaceable>password</replaceable>"</userinput>,
  484. ... },
  485. ... }
  486. </screen>
  487. If there is no password to the account, set the password to the empty string
  488. "". (This is also the default.)</para>
  489. </section>
  490. </section>
  491. -->
  492. <section id="dhcp6-interface-selection">
  493. <title>Interface selection</title>
  494. <para>The DHCPv6 server has to be configured to listen on specific network
  495. interfaces. The simplest network interface configuration instructs the server to
  496. listen on all available interfaces:
  497. <screen>
  498. "Dhcp6": {
  499. "interfaces-config": {
  500. "interfaces": [ <userinput>"*"</userinput> ]
  501. }
  502. ...
  503. }
  504. </screen>
  505. The asterisk plays the role of a wildcard and means "listen on all interfaces".
  506. However, it is usually a good idea to explicitly specify interface names:
  507. <screen>
  508. "Dhcp6": {
  509. "interfaces-config": {
  510. "interfaces": [ <userinput>"eth1", "eth3"</userinput> ]
  511. },
  512. ...
  513. }
  514. </screen>
  515. </para>
  516. <para>It is possible to use wildcard interface name (asterisk) concurrently
  517. with the actual interface names:
  518. <screen>
  519. "Dhcp6": {
  520. "interfaces-config": {
  521. "interfaces": [ <userinput>"eth1", "eth3", "*"</userinput> ]
  522. },
  523. ...
  524. }
  525. </screen>
  526. It is anticipated that this will form of usage only be used where it is desired to
  527. temporarily override a list of interface names and listen on all interfaces.
  528. </para>
  529. </section>
  530. <section id="ipv6-subnet-id">
  531. <title>IPv6 Subnet Identifier</title>
  532. <para>
  533. The subnet identifier is a unique number associated with a particular subnet.
  534. In principle, it is used to associate clients' leases with respective subnets.
  535. When the subnet identifier is not specified for a subnet being configured, it will
  536. be automatically assigned by the configuration mechanism. The identifiers
  537. are assigned from 1 and are monotonically increased for each subsequent
  538. subnet: 1, 2, 3 ....
  539. </para>
  540. <para>
  541. If there are multiple subnets configured with auto-generated identifiers and
  542. one of them is removed, the subnet identifiers may be renumbered. For example:
  543. if there are four subnets and the third is removed the last subnet will be assigned
  544. the identifier that the third subnet had before removal. As a result, the leases
  545. stored in the lease database for subnet 3 are now associated with
  546. subnet 4, which may have unexpected consequences. In the future it is planned
  547. to implement a mechanism to preserve auto-generated subnet ids upon removal
  548. of one of the subnets. Currently, the only remedy for this issue is to
  549. manually specify a unique subnet identifier for each subnet.
  550. </para>
  551. <para>
  552. The following configuration will assign the specified subnet
  553. identifier to the newly configured subnet:
  554. <screen>
  555. "Dhcp6": {
  556. "subnet6": [
  557. {
  558. "subnet": "2001:db8:1::/64",
  559. <userinput>"id": 1024</userinput>,
  560. ...
  561. }
  562. ]
  563. }
  564. </screen>
  565. This identifier will not change for this subnet unless the "id" parameter is
  566. removed or set to 0. The value of 0 forces auto-generation of the subnet
  567. identifier.
  568. </para>
  569. <!-- @todo: describe whether database needs to be updated after changing
  570. id -->
  571. </section>
  572. <section id="dhcp6-unicast">
  573. <title>Unicast traffic support</title>
  574. <para>
  575. When the DHCPv6 server starts, by default it listens to the DHCP traffic
  576. sent to multicast address ff02::1:2 on each interface that it is
  577. configured to listen on (see <xref linkend="dhcp6-interface-selection"/>).
  578. In some cases it is useful to configure a server to handle incoming
  579. traffic sent to the global unicast addresses as well. The most common
  580. reason for that is to have relays send their traffic to the server
  581. directly. To configure the server to listen on a specific unicast address, the
  582. notation to specify interfaces has been extended. An interface name can be
  583. optionally followed by a slash, followed by the global unicast address on which
  584. the server should listen. This will be done in addition to normal
  585. link-local binding + listening on ff02::1:2 address. The sample configuration
  586. below shows how to listen on 2001:db8::1 (a global address)
  587. configured on the eth1 interface.
  588. </para>
  589. <para>
  590. <screen>
  591. "Dhcp6": {
  592. "interfaces-config": {
  593. "interfaces": [ <userinput>"eth1/2001:db8::1"</userinput> ]
  594. },
  595. ...
  596. "option-data": [
  597. {
  598. "name": "unicast",
  599. "data": "2001:db8::1"
  600. } ],
  601. ...
  602. }
  603. </screen>
  604. This configuration will cause the server to listen on
  605. eth1 on link-local address, multicast group (ff02::1:2) and 2001:db8::1.
  606. </para>
  607. <para>
  608. Usually unicast support is associated with a server unicast option
  609. which allows clients to send unicast messages to the server.
  610. The example above contains a server unicast option specification
  611. which causes the client to send messages to the specified
  612. unicast address.
  613. </para>
  614. <para>
  615. It is possible to mix interface names, wildcards and interface name/addresses
  616. on the list of interfaces. It is not possible to specify more than one
  617. unicast address on a given interface.
  618. </para>
  619. <para>
  620. Care should be taken to specify proper unicast addresses. The server will
  621. attempt to bind to those addresses specified, without any additional checks.
  622. This approach is selected on purpose, so the software can be used to
  623. communicate over uncommon addresses if the administrator so desires.
  624. </para>
  625. </section>
  626. <section id="dhcp6-address-config">
  627. <title>Subnet and Address Pool</title>
  628. <para>
  629. The essential role of a DHCPv6 server is address assignment. For this,
  630. the server has to be configured with at least one subnet and one pool of dynamic
  631. addresses to be managed. For example, assume that the server
  632. is connected to a network segment that uses the 2001:db8:1::/64
  633. prefix. The Administrator of that network has decided that addresses from range
  634. 2001:db8:1::1 to 2001:db8:1::ffff are going to be managed by the Dhcp6
  635. server. Such a configuration can be achieved in the following way:
  636. <screen>
  637. "Dhcp6": {
  638. <userinput>"subnet6": [
  639. {
  640. "subnet": "2001:db8:1::/64",
  641. "pools": [
  642. {
  643. "pool": "2001:db8:1::1-2001:db8:1::ffff"
  644. }
  645. ],
  646. ...
  647. }
  648. ]</userinput>
  649. }</screen>
  650. Note that subnet is defined as a simple string, but the pool parameter
  651. is actually a list of pools: for this reason, the pool definition is
  652. enclosed in square brackets, even though only one range of addresses
  653. is specified.</para>
  654. <para>Each <command>pool</command> is a structure that contains the
  655. parameters that describe a single pool. Currently there is only one
  656. parameter, <command>pool</command>, which gives the range of addresses
  657. in the pool. Additional parameters will be added in future releases of
  658. Kea.</para>
  659. <para>It is possible to define more than one pool in a
  660. subnet: continuing the previous example, further assume that
  661. 2001:db8:1:0:5::/80 should also be managed by the server. It could be written as
  662. 2001:db8:1:0:5:: to 2001:db8:1::5:ffff:ffff:ffff, but typing so many 'f's
  663. is cumbersome. It can be expressed more simply as 2001:db8:1:0:5::/80. Both
  664. formats are supported by Dhcp6 and can be mixed in the pool list.
  665. For example, one could define the following pools:
  666. <screen>
  667. "Dhcp6": {
  668. <userinput>"subnet6": [
  669. {
  670. "subnet": "2001:db8:1::/64",
  671. "pools": [
  672. { "pool": "2001:db8:1::1-2001:db8:1::ffff" },
  673. { "pool": "2001:db8:1:05::/80" }
  674. ]</userinput>,
  675. ...
  676. }
  677. ]
  678. }</screen>
  679. The number of pools is not limited, but for performance reasons it is recommended to
  680. use as few as possible.
  681. </para>
  682. <para>
  683. The server may be configured to serve more than one subnet. To add a second subnet,
  684. use a command similar to the following:
  685. <screen>
  686. "Dhcp6": {
  687. <userinput>"subnet6": [
  688. {
  689. "subnet": "2001:db8:1::/64",
  690. "pools": [
  691. { "pool": "2001:db8:1::1-2001:db8:1::ffff" }
  692. ]
  693. },
  694. {
  695. "subnet": "2001:db8:2::/64",
  696. "pools": [
  697. { "pool": "2001:db8:2::/64" }
  698. ]
  699. },
  700. </userinput>
  701. ...
  702. ]
  703. }</screen>
  704. In this example, we allow the server to
  705. dynamically assign all addresses available in the whole subnet. Although
  706. rather wasteful, it is certainly a valid configuration to dedicate the
  707. whole /64 subnet for that purpose. Note that the Kea server does not preallocate
  708. the leases, so there is no danger in using gigantic address pools.
  709. </para>
  710. <para>
  711. When configuring a DHCPv6 server using prefix/length notation, please pay
  712. attention to the boundary values. When specifying that the server can use
  713. a given pool, it will also be able to allocate the first (typically network
  714. address) address from that pool. For example for pool 2001:db8:2::/64 the
  715. 2001:db8:2:: address may be assigned as well. If you want to avoid this,
  716. use the "min-max" notation.
  717. </para>
  718. </section>
  719. <section>
  720. <!-- @todo: add real meat to the prefix delegation config this is just place holder stuff -->
  721. <title>Subnet and Prefix Delegation Pools</title>
  722. <para>
  723. Subnets may also be configured to delegate prefixes, as defined in
  724. <ulink url="http://tools.ietf.org/html/rfc3633">RFC 3633</ulink>.
  725. A subnet may have one or more prefix delegation pools. Each pool has
  726. a prefixed address, which is specified as a prefix and a prefix length,
  727. as well as a delegated prefix length. <command>delegated-len</command>
  728. must not be shorter (that is it must be numerically greater or equal)
  729. than <command>prefix-len</command>.
  730. If both <command>delegated-len</command>
  731. and <command>prefix-len</command> are equal, the server will be able to
  732. delegate only one prefix. The delegated <command>prefix</command> does
  733. not have to match the <command>subnet</command> prefix.
  734. </para>
  735. <para> Below is a sample subnet configuration which enables prefix
  736. delegation for the subnet:
  737. <screen>
  738. "Dhcp6": {
  739. "subnet6": [
  740. {
  741. "subnet": "2001:d8b:1::/64",
  742. <userinput>"pd-pools": [
  743. {
  744. "prefix": "3000:1::",
  745. "prefix-len": 64,
  746. "delegated-len": 96
  747. }
  748. ]</userinput>
  749. }
  750. ],
  751. ...
  752. }</screen>
  753. </para>
  754. </section>
  755. <section id="dhcp6-std-options">
  756. <title>Standard DHCPv6 options</title>
  757. <para>
  758. One of the major features of a DHCPv6 server is to provide configuration
  759. options to clients. Although there are several options that require
  760. special behavior, most options are sent by the server only if the client
  761. explicitly requests them. The following example shows how to
  762. configure DNS servers, which is one of the most frequently used
  763. options. Numbers in the first column are added for easier reference and
  764. will not appear on screen. Options specified in this way are considered
  765. global and apply to all configured subnets.
  766. <screen>
  767. "Dhcp6": {
  768. "option-data": [
  769. {
  770. <userinput>"name": "dns-servers",
  771. "code": 23,
  772. "space": "dhcp6",
  773. "csv-format": true,
  774. "data": "2001:db8::cafe, 2001:db8::babe"</userinput>
  775. },
  776. ...
  777. ]
  778. }
  779. </screen>
  780. </para>
  781. <para>
  782. The <command>option-data></command> line creates a new entry in
  783. the option-data table. This table contains
  784. information on all global options that the server is supposed to configure
  785. in all subnets. The <command>name</command> line specifies the option name.
  786. (For a complete list
  787. of currently supported names, see <xref
  788. linkend="dhcp6-std-options-list"/>.) The next line specifies the option code,
  789. which must match one of the values from that list. The line beginning with
  790. <command>space</command> specifies the option space, which must always be set
  791. to "dhcp6" as these are standard DHCPv6 options. For other name spaces,
  792. including custom option spaces, see <xref
  793. linkend="dhcp6-option-spaces"/>. The next line specifies the format in
  794. which the data will be entered: use of CSV (comma separated values) is
  795. recommended. The <command>data</command> line gives the actual value to be sent to
  796. clients. Data is specified as normal text, with values separated by
  797. commas if more than one value is allowed.
  798. </para>
  799. <para>
  800. Options can also be configured as hexadecimal values. If "csv-format" is
  801. set to false, the option data must be specified as a string of hexadecimal
  802. numbers. The
  803. following commands configure the DNS-SERVERS option for all
  804. subnets with the following addresses: 2001:db8:1::cafe and
  805. 2001:db8:1::babe.
  806. <screen>
  807. "Dhcp6": {
  808. "option-data": [
  809. {
  810. <userinput>"name": "dns-servers",
  811. "code": 23,
  812. "space": "dhcp6",
  813. "csv-format": false,
  814. "data": "2001 0DB8 0001 0000 0000 0000 0000 CAFE
  815. 2001 0DB8 0001 0000 0000 0000 0000 BABE"</userinput>
  816. },
  817. ...
  818. ]
  819. }
  820. </screen>
  821. The value for the setting of the "data" element is split across two
  822. lines in this document for clarity: when entering the command, the
  823. whole string should be entered on the same line. Care should be taken
  824. to use proper encoding when using hexadecimal format as Kea's ability
  825. to validate data correctness in hexadecimal is limited.
  826. </para>
  827. <para>
  828. Most of the parameters in the "option-data" structure are optional and
  829. can be omitted in some circumstances as discussed in the
  830. <xref linkend="dhcp6-option-data-defaults"/>.
  831. </para>
  832. <para>
  833. It is possible to override options on a per-subnet basis. If
  834. clients connected to most of your subnets are expected to get the
  835. same values of a given option, you should use global options: you
  836. can then override specific values for a small number of subnets.
  837. On the other hand, if you use different values in each subnet,
  838. it does not make sense to specify global option values
  839. (Dhcp6/option-data), rather you should set only subnet-specific values
  840. (Dhcp6/subnet[X]/option-data[Y]).
  841. </para>
  842. <para>
  843. The following commands override the global
  844. DNS servers option for a particular subnet, setting a single DNS
  845. server with address 2001:db8:1::3.
  846. <screen>
  847. "Dhcp6": {
  848. "subnet6": [
  849. {
  850. <userinput>"option-data": [
  851. {
  852. "name": "dns-servers",
  853. "code": 23,
  854. "space": "dhcp6",
  855. "csv-format": true,
  856. "data": "2001:db8:1::3"
  857. },
  858. ...
  859. ]</userinput>,
  860. ...
  861. },
  862. ...
  863. ],
  864. ...
  865. }
  866. </screen>
  867. </para>
  868. <para>
  869. The currently supported standard DHCPv6 options are
  870. listed in <xref linkend="dhcp6-std-options-list"/>.
  871. The "Name" and "Code"
  872. are the values that should be used as a name in the option-data
  873. structures. "Type" designates the format of the data: the meanings of
  874. the various types is given in <xref linkend="dhcp-types"/>.
  875. </para>
  876. <para>
  877. Experimental options (like standard options but with a code
  878. which was not assigned by IANA) are listed in
  879. <xref linkend="dhcp6-exp-options-list"/>.
  880. </para>
  881. <para>
  882. Some options are designated as arrays, which means that more than one
  883. value is allowed in such an option. For example the option dns-servers
  884. allows the specification of more than one IPv6 address, allowing
  885. clients to obtain the addresses of multiple DNS servers.
  886. </para>
  887. <!-- @todo: describe record types -->
  888. <para>
  889. The <xref linkend="dhcp6-custom-options"/> describes the configuration
  890. syntax to create custom option definitions (formats). It is generally not
  891. allowed to create custom definitions for standard options, even if the
  892. definition being created matches the actual option format defined in the
  893. RFCs. There is an exception from this rule for standard options for which
  894. Kea does not provide a definition yet. In order to use such options,
  895. a server administrator must create a definition as described in
  896. <xref linkend="dhcp6-custom-options"/> in the 'dhcp6' option space. This
  897. definition should match the option format described in the relevant
  898. RFC but the configuration mechanism would allow any option format as it has
  899. no means to validate the format at the moment.
  900. </para>
  901. <para>
  902. <table frame="all" id="dhcp6-std-options-list">
  903. <title>List of standard DHCPv6 options</title>
  904. <tgroup cols='4'>
  905. <colspec colname='name'/>
  906. <colspec colname='code' align='center'/>
  907. <colspec colname='type' align='center'/>
  908. <colspec colname='array' align='center'/>
  909. <thead>
  910. <row><entry>Name</entry><entry>Code</entry><entry>Type</entry><entry>Array?</entry></row>
  911. </thead>
  912. <tbody>
  913. <!-- Our engine uses those options on its own, admin must not configure them on his own
  914. <row><entry>clientid</entry><entry>1</entry><entry>binary</entry><entry>false</entry></row>
  915. <row><entry>serverid</entry><entry>2</entry><entry>binary</entry><entry>false</entry></row>
  916. <row><entry>ia-na</entry><entry>3</entry><entry>record</entry><entry>false</entry></row>
  917. <row><entry>ia-ta</entry><entry>4</entry><entry>uint32</entry><entry>false</entry></row>
  918. <row><entry>iaaddr</entry><entry>5</entry><entry>record</entry><entry>false</entry></row>
  919. <row><entry>oro</entry><entry>6</entry><entry>uint16</entry><entry>true</entry></row> -->
  920. <row><entry>preference</entry><entry>7</entry><entry>uint8</entry><entry>false</entry></row>
  921. <!-- Our engine uses those options on its own, admin must not configure them on his own
  922. <row><entry>elapsed-time</entry><entry>8</entry><entry>uint16</entry><entry>false</entry></row>
  923. <row><entry>relay-msg</entry><entry>9</entry><entry>binary</entry><entry>false</entry></row>
  924. <row><entry>auth</entry><entry>11</entry><entry>binary</entry><entry>false</entry></row>
  925. -->
  926. <row><entry>unicast</entry><entry>12</entry><entry>ipv6-address</entry><entry>false</entry></row>
  927. <!--
  928. <row><entry>status-code</entry><entry>13</entry><entry>record</entry><entry>false</entry></row>
  929. <row><entry>rapid-commit</entry><entry>14</entry><entry>empty</entry><entry>false</entry></row>
  930. <row><entry>user-class</entry><entry>15</entry><entry>binary</entry><entry>false</entry></row>
  931. <row><entry>vendor-class</entry><entry>16</entry><entry>record</entry><entry>false</entry></row>
  932. -->
  933. <!-- Vendor-specific Information is configurable by the administrator -->
  934. <row><entry>vendor-opts</entry><entry>17</entry><entry>uint32</entry><entry>false</entry></row>
  935. <!--
  936. <row><entry>interface-id</entry><entry>18</entry><entry>binary</entry><entry>false</entry></row>
  937. <row><entry>reconf-msg</entry><entry>19</entry><entry>uint8</entry><entry>false</entry></row>
  938. <row><entry>reconf-accept</entry><entry>20</entry><entry>empty</entry><entry>false</entry></row> -->
  939. -->
  940. <row><entry>sip-server-dns</entry><entry>21</entry><entry>fqdn</entry><entry>true</entry></row>
  941. <row><entry>sip-server-addr</entry><entry>22</entry><entry>ipv6-address</entry><entry>true</entry></row>
  942. <row><entry>dns-servers</entry><entry>23</entry><entry>ipv6-address</entry><entry>true</entry></row>
  943. <row><entry>domain-search</entry><entry>24</entry><entry>fqdn</entry><entry>true</entry></row>
  944. <!-- <row><entry>ia-pd</entry><entry>25</entry><entry>record</entry><entry>false</entry></row> -->
  945. <!-- <row><entry>iaprefix</entry><entry>26</entry><entry>record</entry><entry>false</entry></row> -->
  946. <row><entry>nis-servers</entry><entry>27</entry><entry>ipv6-address</entry><entry>true</entry></row>
  947. <row><entry>nisp-servers</entry><entry>28</entry><entry>ipv6-address</entry><entry>true</entry></row>
  948. <row><entry>nis-domain-name</entry><entry>29</entry><entry>fqdn</entry><entry>true</entry></row>
  949. <row><entry>nisp-domain-name</entry><entry>30</entry><entry>fqdn</entry><entry>true</entry></row>
  950. <row><entry>sntp-servers</entry><entry>31</entry><entry>ipv6-address</entry><entry>true</entry></row>
  951. <row><entry>information-refresh-time</entry><entry>32</entry><entry>uint32</entry><entry>false</entry></row>
  952. <row><entry>bcmcs-server-dns</entry><entry>33</entry><entry>fqdn</entry><entry>true</entry></row>
  953. <row><entry>bcmcs-server-addr</entry><entry>34</entry><entry>ipv6-address</entry><entry>true</entry></row>
  954. <row><entry>geoconf-civic</entry><entry>36</entry><entry>record (uint8, uint16, binary)</entry><entry>false</entry></row>
  955. <row><entry>remote-id</entry><entry>37</entry><entry>record (uint32, binary)</entry><entry>false</entry></row>
  956. <row><entry>subscriber-id</entry><entry>38</entry><entry>binary</entry><entry>false</entry></row>
  957. <row><entry>client-fqdn</entry><entry>39</entry><entry>record (uint8, fqdn)</entry><entry>false</entry></row>
  958. <row><entry>pana-agent</entry><entry>40</entry><entry>ipv6-address</entry><entry>true</entry></row>
  959. <row><entry>new-posix-timezone</entry><entry>41</entry><entry>string</entry><entry>false</entry></row>
  960. <row><entry>new-tzdb-timezone</entry><entry>42</entry><entry>string</entry><entry>false</entry></row>
  961. <row><entry>ero</entry><entry>43</entry><entry>uint16</entry><entry>true</entry></row>
  962. <row><entry>lq-query</entry><entry>44</entry><entry>record (uint8, ipv6-address)</entry><entry>false</entry></row>
  963. <row><entry>client-data</entry><entry>45</entry><entry>empty</entry><entry>false</entry></row>
  964. <row><entry>clt-time</entry><entry>46</entry><entry>uint32</entry><entry>false</entry></row>
  965. <row><entry>lq-relay-data</entry><entry>47</entry><entry>record (ipv6-address, binary)</entry><entry>false</entry></row>
  966. <row><entry>lq-client-link</entry><entry>48</entry><entry>ipv6-address</entry><entry>true</entry></row>
  967. <row><entry>bootfile-url</entry><entry>59</entry><entry>string</entry><entry>false</entry></row>
  968. <row><entry>bootfile-param</entry><entry>60</entry><entry>binary</entry><entry>false</entry></row>
  969. <row><entry>client-arch-type</entry><entry>61</entry><entry>uint16</entry><entry>true</entry></row>
  970. <row><entry>nii</entry><entry>62</entry><entry>record (uint8, uint8, uint8)</entry><entry>false</entry></row>
  971. <row><entry>erp-local-domain-name</entry><entry>65</entry><entry>fqdn</entry><entry>false</entry></row>
  972. <row><entry>rsoo</entry><entry>66</entry><entry>empty</entry><entry>false</entry></row>
  973. <row><entry>client-linklayer-addr</entry><entry>79</entry><entry>binary</entry><entry>false</entry></row>
  974. <!-- <row><entry>dhcpv4-message</entry><entry>87</entry><entry>binary</entry><entry>false</entry></row> -->
  975. <row><entry>dhcp4o6-server-addr</entry><entry>88</entry><entry>ipv6-address</entry><entry>true</entry></row>
  976. </tbody>
  977. </tgroup>
  978. </table>
  979. </para>
  980. <para>
  981. <table frame="all" id="dhcp6-exp-options-list">
  982. <title>List of experimental DHCPv6 options</title>
  983. <tgroup cols='4'>
  984. <colspec colname='name'/>
  985. <colspec colname='code' align='center'/>
  986. <colspec colname='type' align='center'/>
  987. <colspec colname='array' align='center'/>
  988. <thead>
  989. <row><entry>Name</entry><entry>Code</entry><entry>Type</entry><entry>Array?</entry></row>
  990. </thead>
  991. <tbody>
  992. <row><entry>public-key</entry><entry>701</entry><entry>binary</entry><entry>false</entry></row>
  993. <row><entry>certificate</entry><entry>702</entry><entry>binary</entry><entry>false</entry></row>
  994. <row><entry>signature</entry><entry>703</entry><entry>record (uint8, uint8, binary)</entry><entry>false</entry></row>
  995. <row><entry>timestamp</entry><entry>704</entry><entry>binary</entry><entry>false</entry></row>
  996. </tbody>
  997. </tgroup>
  998. </table>
  999. </para>
  1000. </section>
  1001. <section id="dhcp6-custom-options">
  1002. <title>Custom DHCPv6 options</title>
  1003. <para>It is also possible to define options other than the standard ones.
  1004. Assume that we want to define a new DHCPv6 option called "foo" which will have
  1005. code 100 and will convey a single unsigned 32 bit integer value. We can define
  1006. such an option by using the following commands:
  1007. <screen>
  1008. "Dhcp6": {
  1009. "option-def": [
  1010. {
  1011. <userinput>"name": "foo",
  1012. "code": 100,
  1013. "type": "uint32",
  1014. "array": false,
  1015. "record-types": "",
  1016. "space": "dhcp6",
  1017. "encapsulate": ""</userinput>
  1018. }, ...
  1019. ],
  1020. ...
  1021. }
  1022. </screen>
  1023. The "false" value of the "array" parameter determines that the option does
  1024. NOT comprise an array of "uint32" values but rather a single value. Two
  1025. other parameters have been left blank: "record-types" and "encapsulate".
  1026. The former specifies the comma separated list of option data fields if the
  1027. option comprises a record of data fields. The "record-fields" value should
  1028. be non-empty if the "type" is set to "record". Otherwise it must be left
  1029. blank. The latter parameter specifies the name of the option space being
  1030. encapsulated by the particular option. If the particular option does not
  1031. encapsulate any option space it should be left blank. Note that the above
  1032. set of comments define the format of the new option and do not set its
  1033. values.
  1034. </para>
  1035. <para>The <command>name</command>, <command>code</command> and
  1036. <command>type</command> parameters are required, all others are
  1037. optional. The <command>array</command> default value is
  1038. <command>false</command>. The <command>record-types</command>
  1039. and <command>encapsulate</command> default values are blank
  1040. (i.e. ""). The default <command>space</command> is "dhcp6".
  1041. </para>
  1042. <para>Once the new option format is defined, its value is set
  1043. in the same way as for a standard option. For example the following
  1044. commands set a global value that applies to all subnets.
  1045. <screen>
  1046. "Dhcp6": {
  1047. "option-data": [
  1048. {
  1049. <userinput>"name": "foo",
  1050. "code": 100,
  1051. "space": "dhcp6",
  1052. "csv-format": true,
  1053. "data": "12345"</userinput>
  1054. }, ...
  1055. ],
  1056. ...
  1057. }
  1058. </screen>
  1059. </para>
  1060. <para>New options can take more complex forms than simple use of
  1061. primitives (uint8, string, ipv6-address etc): it is possible to
  1062. define an option comprising a number of existing primitives.
  1063. </para>
  1064. <para>
  1065. Assume we want to define a new option that will consist of an IPv6
  1066. address, followed by an unsigned 16 bit integer, followed by a
  1067. boolean value, followed by a text string. Such an option could
  1068. be defined in the following way:
  1069. <screen>
  1070. "Dhcp6": {
  1071. "option-def": [
  1072. {
  1073. <userinput>"name": "bar",
  1074. "code": 101,
  1075. "space": "dhcp6",
  1076. "type": "record",
  1077. "array": false,
  1078. "record-types": "ipv6-address, uint16, boolean, string",
  1079. "encapsulate": ""</userinput>
  1080. }, ...
  1081. ],
  1082. ...
  1083. }
  1084. </screen>
  1085. The "type" is set to "record" to indicate that the option contains
  1086. multiple values of different types. These types are given as a comma-separated
  1087. list in the "record-types" field and should be those listed in <xref linkend="dhcp-types"/>.
  1088. </para>
  1089. <para>
  1090. The values of the option are set as follows:
  1091. <screen>
  1092. "Dhcp6": {
  1093. "option-data": [
  1094. {
  1095. <userinput>"name": "bar",
  1096. "space": "dhcp6",
  1097. "code": 101,
  1098. "csv-format": true,
  1099. "data": "2001:db8:1::10, 123, false, Hello World"</userinput>
  1100. }
  1101. ],
  1102. ...
  1103. }</screen>
  1104. <command>csv-format</command> is set <command>true</command> to indicate
  1105. that the <command>data</command> field comprises a command-separated list
  1106. of values. The values in the "data" must correspond to the types set in
  1107. the "record-types" field of the option definition.
  1108. </para>
  1109. <note>
  1110. <para>In the general case, boolean values are specified as <command>true</command> or
  1111. <command>false</command>, without quotes. Some specific boolean parameters may
  1112. accept also <command>"true"</command>, <command>"false"</command>,
  1113. <command>0</command>, <command>1</command>, <command>"0"</command> and
  1114. <command>"1"</command>. Future Kea versions will accept all those values
  1115. for all boolean parameters.</para>
  1116. </note>
  1117. </section>
  1118. <section id="dhcp6-vendor-opts">
  1119. <title>DHCPv6 vendor specific options</title>
  1120. <para>
  1121. Currently there are two option spaces defined for the DHCPv6
  1122. daemon: "dhcp6" (for top level DHCPv6 options) and "vendor-opts-space",
  1123. which is empty by default, but options can be defined in it.
  1124. Those options will be carried in the Vendor-specific
  1125. Information option (code 17). The following examples show how to
  1126. define an option "foo" with code 1 that consists of an IPv6 address,
  1127. an unsigned 16 bit integer and a string. The "foo" option is
  1128. conveyed in a Vendor-specific Information option. This option
  1129. comprises a single uint32 value that is set to "12345".
  1130. The sub-option "foo" follows the data field holding this value.
  1131. <screen>
  1132. "Dhcp6": {
  1133. "option-def": [
  1134. {
  1135. <userinput>"name": "foo",
  1136. "code": 1,
  1137. "space": "vendor-opts-space",
  1138. "type": "record",
  1139. "array": false,
  1140. "record-types": "ipv6-address, uint16, string",
  1141. "encapsulate": ""</userinput>
  1142. }
  1143. ],
  1144. ...
  1145. }</screen>
  1146. (Note that the option space is set to <command>vendor-opts-space</command>.)
  1147. Once the option format is defined, the next step is to define actual values
  1148. for that option:
  1149. <screen>
  1150. "Dhcp6": {
  1151. "option-data": [
  1152. {
  1153. <userinput>"name": "foo",
  1154. "space": "vendor-opts-space",
  1155. "data": "2001:db8:1::10, 123, Hello World"</userinput>
  1156. },
  1157. ...
  1158. ],
  1159. ...
  1160. }</screen>
  1161. We should also define a value (enterprise-number) for the
  1162. Vendor-specific Information option, that conveys our option "foo".
  1163. <screen>
  1164. "Dhcp6": {
  1165. "option-data": [
  1166. ...,
  1167. {
  1168. <userinput>"name": "vendor-opts",
  1169. "data": "12345"</userinput>
  1170. }
  1171. ],
  1172. ...
  1173. }</screen>
  1174. Alternatively, the option can be specified using its code.
  1175. <screen>
  1176. "Dhcp6": {
  1177. "option-data": [
  1178. ...,
  1179. {
  1180. <userinput>"code": 17,
  1181. "data": "12345"</userinput>
  1182. }
  1183. ],
  1184. ...
  1185. }</screen>
  1186. </para>
  1187. </section>
  1188. <section id="dhcp6-option-spaces">
  1189. <title>Nested DHCPv6 options (custom option spaces)</title>
  1190. <para>It is sometimes useful to define completely new option
  1191. spaces. This is useful if the user wants his new option to
  1192. convey sub-options that use a separate numbering scheme, for
  1193. example sub-options with codes 1 and 2. Those option codes
  1194. conflict with standard DHCPv6 options, so a separate option
  1195. space must be defined.
  1196. </para>
  1197. <para>Note that it is not required to create a new option space when
  1198. defining sub-options for a standard option because it is
  1199. created by default if the standard option is meant to convey
  1200. any sub-options (see <xref linkend="dhcp6-vendor-opts"/>).
  1201. </para>
  1202. <para>
  1203. Assume that we want to have a DHCPv6 option called "container"
  1204. with code 102 that conveys two sub-options with codes 1 and 2.
  1205. First we need to define the new sub-options:
  1206. <screen>
  1207. "Dhcp6": {
  1208. "option-def": [
  1209. {
  1210. <userinput>"name": "subopt1",
  1211. "code": 1,
  1212. "space": "isc",
  1213. "type": "ipv6-address",
  1214. "record-types": "",
  1215. "array": false,
  1216. "encapsulate": ""</userinput>
  1217. },
  1218. {
  1219. <userinput>"name": "subopt2",
  1220. "code": 2,
  1221. "space": "isc",
  1222. "type": "string",
  1223. "record-types": "",
  1224. "array": false
  1225. "encapsulate": ""</userinput>
  1226. }
  1227. ],
  1228. ...
  1229. }</screen>
  1230. Note that we have defined the options to belong to a new option space
  1231. (in this case, "isc").
  1232. </para>
  1233. <para>
  1234. The next step is to define a regular DHCPv6 option and specify that it
  1235. should include options from the isc option space:
  1236. <screen>
  1237. "Dhcp6": {
  1238. "option-def": [
  1239. ...,
  1240. {
  1241. <userinput>"name": "container",
  1242. "code": 102,
  1243. "space": "dhcp6",
  1244. "type": "empty",
  1245. "array": false,
  1246. "record-types": "",
  1247. "encapsulate": "isc"</userinput>
  1248. }
  1249. ],
  1250. ...
  1251. }</screen>
  1252. The name of the option space in which the sub-options are defined is set in
  1253. the <command>encapsulate</command> field. The <command>type</command> field
  1254. is set to <command>empty</command> which limits this option to only carrying
  1255. data in sub-options.
  1256. </para>
  1257. <para>
  1258. Finally, we can set values for the new options:
  1259. <screen>
  1260. "Dhcp6": {
  1261. "option-data": [
  1262. {
  1263. <userinput>"name": "subopt1",
  1264. "code": 1,
  1265. "space": "isc",
  1266. "data": "2001:db8::abcd"</userinput>
  1267. },
  1268. }
  1269. <userinput>"name": "subopt2",
  1270. "code": 2,
  1271. "space": "isc",
  1272. "data": "Hello world"</userinput>
  1273. },
  1274. {
  1275. <userinput>"name": "container",
  1276. "code": 102,
  1277. "space": "dhcp6"</userinput>
  1278. }
  1279. ],
  1280. ...
  1281. }
  1282. </screen>
  1283. </para>
  1284. <para>Note that it is possible to create an option which carries some data
  1285. in addition to the sub-options defined in the encapsulated option space.
  1286. For example, if the "container" option from the previous example was
  1287. required to carry an uint16 value as well as the sub-options, the "type"
  1288. value would have to be set to "uint16" in the option definition. (Such an
  1289. option would then have the following data structure: DHCP header, uint16
  1290. value, sub-options.) The value specified with the "data" parameter &mdash; which
  1291. should be a valid integer enclosed in quotes, e.g. "123" &mdash; would then be
  1292. assigned to the uint16 field in the "container" option.
  1293. </para>
  1294. </section>
  1295. <section id="dhcp6-option-data-defaults">
  1296. <title>Unspecified parameters for DHCPv6 option configuration</title>
  1297. <para>In many cases it is not required to specify all parameters for
  1298. an option configuration and the default values can be used. However, it is
  1299. important to understand the implications of not specifying some of them
  1300. as it may result in configuration errors. The list below explains
  1301. the behavior of the server when a particular parameter is not explicitly
  1302. specified:
  1303. <itemizedlist>
  1304. <listitem>
  1305. <simpara><command>name</command> - the server requires an option name or
  1306. option code to identify an option. If this parameter is unspecified, the
  1307. option code must be specified.
  1308. </simpara>
  1309. </listitem>
  1310. <listitem>
  1311. <simpara><command>code</command> - the server requires an option name or
  1312. option code to identify an option. This parameter may be left unspecified if
  1313. the <command>name</command> parameter is specified. However, this also
  1314. requires that the particular option has its definition (it is either a
  1315. standard option or an administrator created a definition for the option
  1316. using an 'option-def' structure), as the option definition associates an
  1317. option with a particular name. It is possible to configure an option
  1318. for which there is no definition (unspecified option format).
  1319. Configuration of such options requires the use of option code.
  1320. </simpara>
  1321. </listitem>
  1322. <listitem>
  1323. <simpara><command>space</command> - if the option space is unspecified it
  1324. will default to 'dhcp6' which is an option space holding DHCPv6 standard
  1325. options.
  1326. </simpara>
  1327. </listitem>
  1328. <listitem>
  1329. <simpara><command>data</command> - if the option data is unspecified it
  1330. defaults to an empty value. The empty value is mostly used for the
  1331. options which have no payload (boolean options), but it is legal to specify
  1332. empty values for some options which carry variable length data and which
  1333. spec allows for the length of 0. For such options, the data parameter
  1334. may be omitted in the configuration.</simpara>
  1335. </listitem>
  1336. <listitem>
  1337. <simpara><command>csv-format</command> - if this value is not specified
  1338. and the definition for the particular option exists, the server will assume
  1339. that the option data is specified as a list of comma separated values to be
  1340. assigned to individual fields of the DHCP option. If the definition
  1341. does not exist for this option, the server will assume that the data
  1342. parameter contains the option payload in the binary format (represented
  1343. as a string of hexadecimal digits). Note that not specifying this
  1344. parameter doesn't imply that it defaults to a fixed value, but
  1345. the configuration data interpretation also depends on the presence
  1346. of the option definition. An administrator must be aware if the
  1347. definition for the particular option exists when this parameter
  1348. is not specified. It is generally recommended to not specify this
  1349. parameter only for the options for which the definition exists, e.g.
  1350. standard options. Setting <command>csv-format</command> to an explicit
  1351. value will cause the server to strictly check the format of the option
  1352. data specified.
  1353. </simpara>
  1354. </listitem>
  1355. </itemizedlist>
  1356. </para>
  1357. </section>
  1358. <section id="dhcp6-config-subnets">
  1359. <title>IPv6 Subnet Selection</title>
  1360. <para>
  1361. The DHCPv6 server may receive requests from local (connected to the
  1362. same subnet as the server) and remote (connecting via relays) clients.
  1363. As the server may have many subnet configurations defined, it must select
  1364. an appropriate subnet for a given request.
  1365. </para>
  1366. <para>
  1367. The server can not assume which of the configured subnets are local. In IPv4
  1368. it is possible as there is a reasonable expectation that the
  1369. server will have a (global) IPv4 address configured on the interface,
  1370. and can use that information to detect whether a subnet is local or
  1371. not. That assumption is not true in IPv6, the DHCPv6 server must be able
  1372. to operate while only having link-local addresses. Therefore an optional
  1373. &quot;interface&quot; parameter is available within a subnet definition
  1374. to designate that a given subnet is local, i.e. reachable directly over
  1375. the specified interface. For example the server that is intended to serve
  1376. a local subnet over eth0 may be configured as follows:
  1377. <screen>
  1378. "Dhcp6": {
  1379. "subnet6": [
  1380. {
  1381. "subnet": "2001:db8:beef::/48",
  1382. "pools": [
  1383. {
  1384. "pool": "2001:db8:beef::/48"
  1385. }
  1386. ],
  1387. <userinput>"interface": "eth0"</userinput>
  1388. }
  1389. ],
  1390. ...
  1391. }
  1392. </screen>
  1393. </para>
  1394. </section>
  1395. <section id="dhcp6-rapid-commit">
  1396. <title>Rapid Commit</title>
  1397. <para>The Rapid Commit option, described in
  1398. <ulink url="http://tools.ietf.org/html/rfc3315">RFC 3315</ulink>, is supported
  1399. by the Kea DHCPv6 server. However, support is disabled by default for
  1400. all subnets. It can be enabled for a particular subnet using the
  1401. <command>rapid-commit</command> parameter as shown below:
  1402. <screen>
  1403. "Dhcp6": {
  1404. "subnet6": [
  1405. {
  1406. "subnet": "2001:db8:beef::/48",
  1407. <userinput>"rapid-commit": true</userinput>,
  1408. "pools": [
  1409. {
  1410. "pool": "2001:db8:beef::1-2001:db8:beef::10"
  1411. }
  1412. ],
  1413. }
  1414. ],
  1415. ...
  1416. }
  1417. </screen>
  1418. </para>
  1419. <para>
  1420. This setting only affects the subnet for which the
  1421. <command>rapid-commit</command> is set to <command>true</command>.
  1422. For clients connected to other subnets, the server will ignore the
  1423. Rapid Commit option sent by the client and will follow the 4-way
  1424. exchange procedure, i.e. respond with the Advertise for the Solicit
  1425. containing Rapid Commit option.
  1426. </para>
  1427. </section>
  1428. <section id="dhcp6-relays">
  1429. <title>DHCPv6 Relays</title>
  1430. <para>
  1431. A DHCPv6 server with multiple subnets defined must select the
  1432. appropriate subnet when it receives a request from a client. For clients
  1433. connected via relays, two mechanisms are used:
  1434. </para>
  1435. <para>
  1436. The first uses the linkaddr field in the RELAY_FORW message. The name
  1437. of this field is somewhat misleading in that it does not contain a link-layer
  1438. address: instead, it holds an address (typically a global address) that is
  1439. used to identify a link. The DHCPv6 server checks if the address belongs
  1440. to a defined subnet and, if it does, that subnet is selected for the client's
  1441. request.
  1442. </para>
  1443. <para>
  1444. The second mechanism is based on interface-id options. While forwarding a client's
  1445. message, relays may insert an interface-id option into the message that
  1446. identifies the interface on the relay that received the message. (Some
  1447. relays allow configuration of that parameter, but it is sometimes
  1448. hardcoded and may range from the very simple (e.g. "vlan100") to the very cryptic:
  1449. one example seen on real hardware was "ISAM144|299|ipv6|nt:vp:1:110"). The
  1450. server can use this information to select the appropriate subnet.
  1451. The information is also returned to the relay which then knows the
  1452. interface to use to transmit the response to the client. In order for
  1453. this to work successfully, the relay interface IDs must be unique within
  1454. the network and the server configuration must match those values.
  1455. </para>
  1456. <para>
  1457. When configuring the DHCPv6 server, it should be noted that two
  1458. similarly-named parameters can be configured for a subnet:
  1459. <itemizedlist>
  1460. <listitem><simpara>
  1461. "interface" defines which local network interface can be used
  1462. to access a given subnet.
  1463. </simpara></listitem>
  1464. <listitem><simpara>
  1465. "interface-id" specifies the content of the interface-id option
  1466. used by relays to identify the interface on the relay to which
  1467. the response packet is sent.
  1468. </simpara></listitem>
  1469. </itemizedlist>
  1470. The two are mutually exclusive: a subnet cannot be both reachable locally
  1471. (direct traffic) and via relays (remote traffic). Specifying both is a
  1472. configuration error and the DHCPv6 server will refuse such a configuration.
  1473. </para>
  1474. <para>
  1475. To specify interface-id with value "vlan123", the following commands can
  1476. be used:
  1477. <screen>
  1478. "Dhcp6": {
  1479. "subnet6": [
  1480. {
  1481. "subnet": "2001:db8:beef::/48",
  1482. "pools": [
  1483. {
  1484. "pool": "2001:db8:beef::/48"
  1485. }
  1486. ],
  1487. <userinput>"interface-id": "vlan123"</userinput>
  1488. }
  1489. ],
  1490. ...
  1491. }
  1492. </screen>
  1493. </para>
  1494. </section>
  1495. <section id="dhcp6-rsoo">
  1496. <title>Relay-Supplied Options</title>
  1497. <para><ulink url="http://tools.ietf.org/html/rfc6422">RFC 6422</ulink>
  1498. defines a mechanism called Relay-Supplied DHCP Options. In certain cases relay
  1499. agents are the only entities that may have specific information. They can
  1500. insert options when relaying messages from the client to the server. The
  1501. server will then do certain checks and copy those options to the response
  1502. that will be sent to the client.</para>
  1503. <para>There are certain conditions that must be met for the option to be
  1504. included. First, the server must not provide the option by itself. In
  1505. other words, if both relay and server provide an option, the server always
  1506. takes precedence. Second, the option must be RSOO-enabled. IANA maintains a
  1507. list of RSOO-enabled options <ulink url="http://www.iana.org/assignments/dhcpv6-parameters/dhcpv6-parameters.xhtml#options-relay-supplied">here</ulink>.
  1508. However, there may be cases when system administrators want to echo other
  1509. options. Kea can be instructed to treat other options as RSOO-enabled.
  1510. For example, to mark options 110, 120 and 130 as RSOO-enabled, the following
  1511. syntax should be used:
  1512. <screen>
  1513. "Dhcp6": {
  1514. <userinput>"relay-supplied-options": [ "110", "120", "130" ],</userinput>
  1515. ...
  1516. }
  1517. </screen>
  1518. </para>
  1519. <para>As of March 2015, only option 65 is RSOO-enabled by IANA. This
  1520. option will always be treated as such and there's no need to explicitly
  1521. mark it. Also, when enabling standard options, it is possible to use their
  1522. names, rather than option code, e.g. (e.g. use
  1523. <command>dns-servers</command> instead of <command>23</command>). See
  1524. <xref linkend="dhcp6-std-options-list" /> for the names. In certain cases
  1525. it could also work for custom options, but due to the nature of the parser
  1526. code this may be unreliable and should be avoided.
  1527. </para>
  1528. </section>
  1529. <section id="dhcp6-client-classifier">
  1530. <title>Client Classification in DHCPv6</title>
  1531. <para>
  1532. The DHCPv6 server includes support for client classification. At the
  1533. current time the capabilities of the classification process are limited
  1534. but it is expected they will be expanded in the future. For a deeper
  1535. discussion of the classification process see <xref linkend="classify"/>.
  1536. </para>
  1537. <para>
  1538. In certain cases it is useful to differentiate between different types
  1539. of clients and treat them accordingly. It is envisaged that client
  1540. classification will be used for changing the behavior of almost any part of
  1541. the DHCP message processing, including the assignment of leases from different
  1542. pools, the assignment of different options (or different values of the same
  1543. options) etc. In the current release of the software however, there are
  1544. only two mechanisms that take advantage of client classification:
  1545. subnet selection and assignment of different options.
  1546. </para>
  1547. <para>
  1548. Kea can be instructed to limit access to given subnets based on class information.
  1549. This is particularly useful for cases where two types of devices share the
  1550. same link and are expected to be served from two different subnets. The
  1551. primary use case for such a scenario is cable networks. There are two
  1552. classes of devices: the cable modem itself, which should be handed a lease
  1553. from subnet A and all other devices behind the modem that should get a lease
  1554. from subnet B. That segregation is essential to prevent overly curious
  1555. users from playing with their cable modems. For details on how to set up
  1556. class restrictions on subnets, see <xref linkend="classification-subnets"/>.
  1557. </para>
  1558. <para>
  1559. The process of doing classification is conducted in three steps. The first step
  1560. is to assess an incoming packet and assign it to zero or more classes. The
  1561. second step is to choose a subnet, possibly based on the class information.
  1562. The third step is to assign options again possibly based on the class
  1563. information.
  1564. </para>
  1565. <para>
  1566. There are two methods of doing classification. The first is automatic and relies
  1567. on examining the values in the vendor class options. Information from these
  1568. options is extracted and a class name is constructed from it and added to
  1569. the class list for the packet. The second allows you to specify an expression
  1570. that is evaluated for each packet. If the result is true the packet is
  1571. a member of the class.
  1572. </para>
  1573. <note><para>
  1574. Care should be taken with client classification as it is easy for
  1575. clients that do not meet class criteria to be denied any service altogether.
  1576. </para></note>
  1577. <section>
  1578. <title>Defining and Using Custom Classes</title>
  1579. <para>
  1580. The following example shows how to configure a class using an expression
  1581. and a subnet making use of that class. This configuration defines the
  1582. class named &quot;Client_enterprise&quot;. It is comprised
  1583. of all clients who's client identifiers start with the given hex string (which
  1584. would indicate a DUID based on an enterprise id of 0xAABBCCDD).
  1585. They will be given an address from 2001:db8:1::0 to 2001:db8:1::FFFF and
  1586. 2001:db8:0::1 and 2001:db8:2::1 for their domain name servers. For a deeper
  1587. discussion of the classification process see <xref linkend="classify"/>.
  1588. <screen>
  1589. "Dhcp6": {
  1590. "client-classes": [
  1591. {<userinput>
  1592. "name": "Client_enterprise",
  1593. "test": "substring(option[1].hex,0,6) == 0x0002AABBCCDD'",
  1594. "option-data": [
  1595. {
  1596. "name": "dns-servers",
  1597. "code": 23,
  1598. "space": "dhcp6",
  1599. "csv-format": true,
  1600. "data": "2001:db8:0::1, 2001:db8:2::1"
  1601. }
  1602. ]</userinput>
  1603. },
  1604. ...
  1605. ],
  1606. "subnet6": [
  1607. {
  1608. "subnet": "2001:db8:1::/64",
  1609. "pools": [ { "pool": "2001:db8:1::-2001:db8:1::ffff" } ],
  1610. <userinput>"client-class": "Client_enterprise"</userinput>
  1611. }
  1612. ],
  1613. ...
  1614. }</screen>
  1615. </para>
  1616. <para>
  1617. This example shows a configuration using an automatically generated
  1618. "VENDOR_CLASS_" class. The Administrator of the network has
  1619. decided that addresses from range 2001:db8:1::1 to 2001:db8:1::ffff are
  1620. going to be managed by the Dhcp6 server and only clients belonging to the
  1621. eRouter1.0 client class are allowed to use that pool.
  1622. <screen>
  1623. "Dhcp6": {
  1624. "subnet6": [
  1625. {
  1626. "subnet": "2001:db8:1::/64",
  1627. "pools": [
  1628. {
  1629. "pool": "2001:db8:1::-2001:db8:1::ffff"
  1630. }
  1631. ],
  1632. <userinput>"client-class": "VENDOR_CLASS_eRouter1.0"</userinput>
  1633. }
  1634. ],
  1635. ...
  1636. }
  1637. </screen>
  1638. </para>
  1639. </section>
  1640. </section>
  1641. <section id="dhcp6-ddns-config">
  1642. <title>DDNS for DHCPv6</title>
  1643. <para>
  1644. As mentioned earlier, kea-dhcp6 can be configured to generate requests to
  1645. the DHCP-DDNS server (referred to here as "D2") to update
  1646. DNS entries. These requests are known as NameChangeRequests or NCRs.
  1647. Each NCR contains the following information:
  1648. <orderedlist>
  1649. <listitem><para>
  1650. Whether it is a request to add (update) or remove DNS entries
  1651. </para></listitem>
  1652. <listitem><para>
  1653. Whether the change requests forward DNS updates (AAAA records), reverse
  1654. DNS updates (PTR records), or both.
  1655. </para></listitem>
  1656. <listitem><para>
  1657. The FQDN, lease address, and DHCID
  1658. </para></listitem>
  1659. </orderedlist>
  1660. The parameters controlling the generation of NCRs for submission to D2
  1661. are contained in the "dhcp-ddns" section of kea-dhcp6
  1662. configuration. The mandatory parameters for the DHCP DDNS configuration
  1663. are <command>enable-updates</command> which is unconditionally
  1664. required, and <command>qualifying-suffix</command> which has no
  1665. default value and is required when <command>enable-updates</command>
  1666. is set to <command>true</command>.
  1667. The two (disabled and enabled) minimal DHCP DDNS configurations are:
  1668. <screen>
  1669. "Dhcp6": {
  1670. "dhcp-ddns": {
  1671. <userinput>"enable-updates": false</userinput>
  1672. },
  1673. ...
  1674. }
  1675. </screen>
  1676. and for example:
  1677. <screen>
  1678. "Dhcp6": {
  1679. "dhcp-ddns": {
  1680. <userinput>"enable-updates": true,
  1681. "qualifying-suffix": "example."</userinput>
  1682. },
  1683. ...
  1684. }
  1685. </screen>
  1686. The default values for the "dhcp-ddns" section are as follows:
  1687. <itemizedlist>
  1688. <listitem><simpara>
  1689. <command>"server-ip": "127.0.0.1"</command>
  1690. </simpara></listitem>
  1691. <listitem><simpara>
  1692. <command>"server-port": 53001</command>
  1693. </simpara></listitem>
  1694. <listitem><simpara>
  1695. <command>"sender-ip": ""</command>
  1696. </simpara></listitem>
  1697. <listitem><simpara>
  1698. <command>"sender-port": 0</command>
  1699. </simpara></listitem>
  1700. <listitem><simpara>
  1701. <command>"max-queue-size": 1024</command>
  1702. </simpara></listitem>
  1703. <listitem><simpara>
  1704. <command>"ncr-protocol": "UDP"</command>
  1705. </simpara></listitem>
  1706. <listitem><simpara>
  1707. <command>"ncr-format": "JSON"</command>
  1708. </simpara></listitem>
  1709. <listitem><simpara>
  1710. <command>"override-no-update": false</command>
  1711. </simpara></listitem>
  1712. <listitem><simpara>
  1713. <command>"override-client-update": false</command>
  1714. </simpara></listitem>
  1715. <listitem><simpara>
  1716. <command>"replace-client-name": "never"</command>
  1717. </simpara></listitem>
  1718. <listitem><simpara>
  1719. <command>"generated-prefix": "myhost"</command>
  1720. </simpara></listitem>
  1721. </itemizedlist>
  1722. </para>
  1723. <section id="dhcpv6-d2-io-config">
  1724. <title>DHCP-DDNS Server Connectivity</title>
  1725. <para>
  1726. In order for NCRs to reach the D2 server, kea-dhcp6 must be able
  1727. to communicate with it. kea-dhcp6 uses the following configuration
  1728. parameters to control how it communications with D2:
  1729. <itemizedlist>
  1730. <listitem><simpara>
  1731. <command>enable-updates</command> - determines whether or not kea-dhcp6 will
  1732. generate NCRs. If missing, this value is assumed to be false hence DDNS updates
  1733. are disabled. To enable DDNS updates set this value to true:
  1734. </simpara></listitem>
  1735. <listitem><simpara>
  1736. <command>server-ip</command> - IP address on which D2 listens for requests. The default is
  1737. the local loopback interface at address 127.0.0.1. You may specify
  1738. either an IPv4 or IPv6 address.
  1739. </simpara></listitem>
  1740. <listitem><simpara>
  1741. <command>server-port</command> - port on which D2 listens for requests. The default value
  1742. is 53001.
  1743. </simpara></listitem>
  1744. <listitem><simpara>
  1745. <command>sender-ip</command> - IP address which kea-dhcp6 should use to send requests to D2.
  1746. The default value is blank which instructs kea-dhcp6 to select a suitable
  1747. address.
  1748. </simpara></listitem>
  1749. <listitem><simpara>
  1750. <command>sender-port</command> - port which kea-dhcp6 should use to send requests to D2. The
  1751. default value of 0 instructs kea-dhcp6 to select a suitable port.
  1752. </simpara></listitem>
  1753. <listitem><simpara>
  1754. <command>max-queue-size</command> - maximum number of requests allowed to queue waiting to
  1755. be sent to D2. This value guards against requests accumulating
  1756. uncontrollably if they are being generated faster than they can be
  1757. delivered. If the number of requests queued for transmission reaches
  1758. this value, DDNS updating will be turned off until the queue backlog has
  1759. been sufficiently reduced. The intent is to allow kea-dhcp6 to
  1760. continue lease operations. The default value is 1024.
  1761. </simpara></listitem>
  1762. <listitem><simpara>
  1763. <command>ncr-protocol</command> - Socket protocol use when sending requests to D2. Currently
  1764. only UDP is supported. TCP may be available in an upcoming release.
  1765. </simpara></listitem>
  1766. <listitem><simpara>
  1767. <command>ncr-format</command> - Packet format to use when sending requests to D2.
  1768. Currently only JSON format is supported. Other formats may be available
  1769. in future releases.
  1770. </simpara></listitem>
  1771. </itemizedlist>
  1772. By default, kea-dhcp-ddns is assumed to running on the same machine as kea-dhcp6, and
  1773. all of the default values mentioned above should be sufficient.
  1774. If, however, D2 has been configured to listen on a different address or
  1775. port, these values must altered accordingly. For example, if D2 has been
  1776. configured to listen on 2001:db8::5 port 900, the following commands
  1777. would be required:
  1778. <screen>
  1779. "Dhcp6": {
  1780. "dhcp-ddns": {
  1781. <userinput>"server-ip": "2001:db8::5",
  1782. "server-port": 900</userinput>,
  1783. ...
  1784. },
  1785. ...
  1786. }
  1787. </screen>
  1788. </para>
  1789. </section>
  1790. <section id="dhcpv6-d2-rules-config">
  1791. <title>When does kea-dhcp6 generate DDNS request</title>
  1792. <para>kea-dhcp6 follows the behavior prescribed for DHCP servers in
  1793. <ulink url="http://tools.ietf.org/html/rfc4704">RFC 4704</ulink>.
  1794. It is important to keep in mind that kea-dhcp6 provides the initial
  1795. decision making of when and what to update and forwards that
  1796. information to D2 in the form of NCRs. Carrying out the actual
  1797. DNS updates and dealing with such things as conflict resolution
  1798. are the purview of D2 (<xref linkend="dhcp-ddns-server"/>).</para>
  1799. <para>
  1800. This section describes when kea-dhcp6 will generate NCRs and the
  1801. configuration parameters that can be used to influence this decision.
  1802. It assumes that the "enable-updates" parameter is true.
  1803. </para>
  1804. <note>
  1805. <para>
  1806. Currently the interface between kea-dhcp6 and D2 only supports requests
  1807. which update DNS entries for a single IP address. If a lease grants
  1808. more than one address, kea-dhcp6 will create the DDNS update request for
  1809. only the first of these addresses. Support for multiple address
  1810. mappings may be provided in a future release.
  1811. </para>
  1812. </note>
  1813. <para>
  1814. In general, kea-dhcp6 will generate DDNS update requests when:
  1815. <orderedlist>
  1816. <listitem><para>
  1817. A new lease is granted in response to a REQUEST
  1818. </para></listitem>
  1819. <listitem><para>
  1820. An existing lease is renewed but the FQDN associated with it has
  1821. changed.
  1822. </para></listitem>
  1823. <listitem><para>
  1824. An existing lease is released in response to a RELEASE
  1825. </para></listitem>
  1826. </orderedlist>
  1827. In the second case, lease renewal, two DDNS requests will be issued: one
  1828. request to remove entries for the previous FQDN and a second request to
  1829. add entries for the new FQDN. In the last case, a lease release, a
  1830. single DDNS request to remove its entries will be made. The decision
  1831. making involved when granting a new lease is more involved and is
  1832. discussed next.
  1833. </para>
  1834. <para>
  1835. kea-dhcp6 will generate a DDNS update request only if the REQUEST
  1836. contains the FQDN option (code 39). By default kea-dhcp6 will
  1837. respect the FQDN N and S flags specified by the client as shown in the
  1838. following table:
  1839. </para>
  1840. <table id="dhcp6-fqdn-flag-table">
  1841. <title>Default FQDN Flag Behavior</title>
  1842. <tgroup cols='4' align='left'>
  1843. <colspec colname='cflags'/>
  1844. <colspec colname='meaning'/>
  1845. <colspec colname='response'/>
  1846. <colspec colname='sflags'/>
  1847. <thead>
  1848. <row>
  1849. <entry>Client Flags:N-S</entry>
  1850. <entry>Client Intent</entry>
  1851. <entry>Server Response</entry>
  1852. <entry>Server Flags:N-S-O</entry>
  1853. </row>
  1854. </thead>
  1855. <tbody>
  1856. <row>
  1857. <entry>0-0</entry>
  1858. <entry>
  1859. Client wants to do forward updates, server should do reverse updates
  1860. </entry>
  1861. <entry>Server generates reverse-only request</entry>
  1862. <entry>1-0-0</entry>
  1863. </row>
  1864. <row>
  1865. <entry>0-1</entry>
  1866. <entry>Server should do both forward and reverse updates</entry>
  1867. <entry>Server generates request to update both directions</entry>
  1868. <entry>0-1-0</entry>
  1869. </row>
  1870. <row>
  1871. <entry>1-0</entry>
  1872. <entry>Client wants no updates done</entry>
  1873. <entry>Server does not generate a request</entry>
  1874. <entry>1-0-0</entry>
  1875. </row>
  1876. </tbody>
  1877. </tgroup>
  1878. </table>
  1879. <para>
  1880. The first row in the table above represents "client delegation". Here
  1881. the DHCP client states that it intends to do the forward DNS updates and
  1882. the server should do the reverse updates. By default, kea-dhcp6 will honor
  1883. the client's wishes and generate a DDNS request to D2 to update only
  1884. reverse DNS data. The parameter, "override-client-update", can be used
  1885. to instruct the server to override client delegation requests. When
  1886. this parameter is true, kea-dhcp6 will disregard requests for client
  1887. delegation and generate a DDNS request to update both forward and
  1888. reverse DNS data. In this case, the N-S-O flags in the server's
  1889. response to the client will be 0-1-1 respectively.
  1890. </para>
  1891. <para>
  1892. (Note that the flag combination N=1, S=1 is prohibited according to
  1893. RFC 4702. If such a combination is received from the client, the packet
  1894. will be dropped by kea-dhcp6.)
  1895. </para>
  1896. <para>
  1897. To override client delegation, issue the following commands:
  1898. </para>
  1899. <screen>
  1900. "Dhcp6": {
  1901. "dhcp-ddns": {
  1902. <userinput>"override-client-update": true</userinput>,
  1903. ...
  1904. },
  1905. ...
  1906. }
  1907. </screen>
  1908. <para>
  1909. The third row in the table above describes the case in which the client
  1910. requests that no DNS updates be done. The parameter, "override-no-update",
  1911. can be used to instruct the server to disregard the client's wishes. When
  1912. this parameter is true, kea-dhcp6 will generate DDNS update requests to
  1913. kea-dhcp-ddns even if the client requests no updates be done. The N-S-O
  1914. flags in the server's response to the client will be 0-1-1.
  1915. </para>
  1916. <para>
  1917. To override client delegation, issue the following commands:
  1918. </para>
  1919. <screen>
  1920. "Dhcp6": {
  1921. "dhcp-ddns": {
  1922. <userinput>"override-no-update": true</userinput>,
  1923. ...
  1924. },
  1925. ...
  1926. }
  1927. </screen>
  1928. </section>
  1929. <section id="dhcpv6-fqdn-name-generation">
  1930. <title>kea-dhcp6 name generation for DDNS update requests</title>
  1931. <para>Each NameChangeRequest must of course include the fully qualified
  1932. domain name whose DNS entries are to be affected. kea-dhcp6 can be
  1933. configured to supply a portion or all of that name based upon what it
  1934. receives from the client.</para>
  1935. <para>
  1936. The default rules for constructing the FQDN that will be used for DNS
  1937. entries are:
  1938. <orderedlist>
  1939. <listitem><para>
  1940. If the DHCPREQUEST contains the client FQDN option, the candidate name
  1941. is taken from there.
  1942. </para></listitem>
  1943. <listitem><para>
  1944. If the candidate name is a partial (i.e. unqualified) name then add a
  1945. configurable suffix to the name and use the result as the FQDN.
  1946. </para></listitem>
  1947. <listitem><para>
  1948. If the candidate name provided is empty, generate a FQDN using a
  1949. configurable prefix and suffix.
  1950. </para></listitem>
  1951. <listitem><para>
  1952. If the client provided neither option, then no DNS action will be taken.
  1953. </para></listitem>
  1954. </orderedlist>
  1955. These rules can amended by setting the
  1956. <command>replace-client-name</command> parameter which provides the
  1957. following modes of behavior:
  1958. <itemizedlist>
  1959. <listitem><para>
  1960. <command>never</command> - Use the name the client sent. If the client
  1961. sent no name, do not generate one. This is the default mode.
  1962. </para></listitem>
  1963. <listitem><para>
  1964. <command>always</command> - Replace the name the client sent. If the
  1965. client sent no name, generate one for the client.
  1966. </para></listitem>
  1967. <listitem><para>
  1968. <command>when-present</command> - Replace the name the client sent.
  1969. If the client sent no name, do not generate one.
  1970. </para></listitem>
  1971. <listitem><para>
  1972. <command>when-not-present</command> - Use the name the client sent.
  1973. If the client sent no name, generate one for the client.
  1974. </para></listitem>
  1975. </itemizedlist>
  1976. <note>
  1977. Note that formerly, this parameter was a boolean and permitted only values
  1978. of <command>true</command> and <command>false</command>. Boolean values
  1979. will still be accepted but may eventually be deprecated. A value of
  1980. <command>true</command> equates to <command>when-present</command>,
  1981. <command>false</command> equates to <command>never</command>.
  1982. </note>
  1983. For example, To instruct kea-dhcp6 to always generate the FQDN for a
  1984. client, set the parameter <command>replace-client-name</command> to
  1985. <command>always</command> as follows:
  1986. </para>
  1987. <screen>
  1988. "Dhcp6": {
  1989. "dhcp-ddns": {
  1990. <userinput>"replace-client-name": "always"</userinput>,
  1991. ...
  1992. },
  1993. ...
  1994. }
  1995. </screen>
  1996. <para>
  1997. The prefix used when generating a FQDN is specified by the
  1998. "generated-prefix" parameter. The default value is "myhost". To alter
  1999. its value, simply set it to the desired string:
  2000. </para>
  2001. <screen>
  2002. "Dhcp6": {
  2003. "dhcp-ddns": {
  2004. <userinput>"generated-prefix": "another.host"</userinput>,
  2005. ...
  2006. },
  2007. ...
  2008. }
  2009. </screen>
  2010. <para>
  2011. The suffix used when generating a FQDN or when qualifying a
  2012. partial name is specified by
  2013. the <command>qualifying-suffix</command> parameter. This
  2014. parameter has no default value, thus it is mandatory when
  2015. DDNS updates are enabled.
  2016. To set its value simply set it to the desired string:
  2017. </para>
  2018. <screen>
  2019. "Dhcp6": {
  2020. "dhcp-ddns": {
  2021. <userinput>"qualifying-suffix": "foo.example.org"</userinput>,
  2022. ...
  2023. },
  2024. ...
  2025. }
  2026. </screen>
  2027. </section>
  2028. <para>
  2029. When qualifying a partial name, kea-dhcp6 will construct a name with the
  2030. format:
  2031. </para>
  2032. <para>
  2033. [candidate-name].[qualifying-suffix].
  2034. </para>
  2035. <para>
  2036. where candidate-name is the partial name supplied in the REQUEST.
  2037. For example, if FQDN domain name value was "some-computer" and
  2038. qualifying-suffix "example.com", the generated FQDN would be:
  2039. </para>
  2040. <para>
  2041. some-computer.example.com.
  2042. </para>
  2043. <para>
  2044. When generating the entire name, kea-dhcp6 will construct name of the
  2045. format:
  2046. </para>
  2047. <para>
  2048. [generated-prefix]-[address-text].[qualifying-suffix].
  2049. </para>
  2050. <para>
  2051. where address-text is simply the lease IP address converted to a
  2052. hyphenated string. For example, if lease address is 3001:1::70E,
  2053. the qualifying suffix "example.com", and the default value is used for
  2054. <command>generated-prefix</command>, the generated FQDN would be:
  2055. </para>
  2056. <para>
  2057. myhost-3001-1--70E.example.com.
  2058. </para>
  2059. </section>
  2060. <section id="dhcp6-dhcp4o6-config">
  2061. <title>DHCPv4-over-DHCPv6 DHCPv6 side</title>
  2062. <para>
  2063. The support of DHCPv4-over-DHCPv6 transport
  2064. <ulink url="http://tools.ietf.org/html/rfc7341">RFC 7341</ulink>
  2065. is implemented using cooperating DHCPv4 and DHCPv6 servers.
  2066. This section is about the configuration of the DHCPv6 side
  2067. (the DHCPv4 side is described in <xref linkend="dhcp4-dhcp4o6-config"/>).
  2068. </para>
  2069. <note>
  2070. DHCPv4-over-DHCPv6 support is experimental and the details of
  2071. the inter-process communication can change: DHCPv4 and DHCPv6
  2072. should run the same version of Kea.
  2073. </note>
  2074. <para>
  2075. There is only one specific parameter for the DHCPv6 side:
  2076. <command>dhcp4o6-port</command> which specifies the first of the
  2077. two consecutive ports of the UDP sockets used for the communication
  2078. between the DHCPv6 and DHCPv4 servers (the DHCPv6 server is bound
  2079. to ::1 on <command>port</command> and connected to ::1 on
  2080. <command>port</command> + 1).
  2081. </para>
  2082. <para>
  2083. Two other configuration entries are in general required: unicast traffic
  2084. support (see <xref linkend="dhcp6-unicast"/>) and DHCP 4o6 server
  2085. address option (name "dhcp4o6-server-addr", code 88).
  2086. </para>
  2087. <para>
  2088. The following configuration was used during some tests:
  2089. <screen>
  2090. {
  2091. # DHCPv6 conf
  2092. "Dhcp6": {
  2093. "interfaces-config": {
  2094. "interfaces": [ "eno33554984/2001:db8:1:1::1" ]
  2095. },
  2096. "lease-database": {
  2097. "type": "memfile",
  2098. "name": "leases6"
  2099. },
  2100. "preferred-lifetime": 3000,
  2101. "valid-lifetime": 4000,
  2102. "renew-timer": 1000,
  2103. "rebind-timer": 2000,
  2104. "subnet6": [ {
  2105. "subnet": "2001:db8:1:1::/64",
  2106. "interface": "eno33554984",
  2107. "pools": [ { "pool": "2001:db8:1:1::1:0/112" } ]
  2108. } ],
  2109. <userinput>"dhcp4o6-port": 6767,
  2110. "option-data": [ {
  2111. "name": "dhcp4o6-server-addr",
  2112. "code": 88,
  2113. "space": "dhcp6",
  2114. "csv-format": true,
  2115. "data": "2001:db8:1:1::1"
  2116. } ]
  2117. </userinput>
  2118. },
  2119. "Logging": {
  2120. "loggers": [ {
  2121. "name": "kea-dhcp6",
  2122. "output_options": [ {
  2123. "output": "/tmp/kea-dhcp6.log"
  2124. } ],
  2125. "severity": "DEBUG",
  2126. "debuglevel": 0
  2127. } ]
  2128. }
  2129. }
  2130. </screen>
  2131. </para>
  2132. <note>
  2133. Relayed DHCPv4-QUERY DHCPv6 messages are not yet supported.
  2134. </note>
  2135. </section>
  2136. </section>
  2137. <!-- Host reservation is a large topic. There will be many subsections,
  2138. so it should be a section on its own. -->
  2139. <section id="host-reservation-v6">
  2140. <title>Host reservation in DHCPv6</title>
  2141. <para>There are many cases where it is useful to provide a configuration on
  2142. a per host basis. The most obvious one is to reserve specific, static IPv6
  2143. address or/and prefix for exclusive use by a given client (host) &dash; returning
  2144. client will get the same address or/and prefix every time and other clients will
  2145. never get that address. Note that there may be cases when the
  2146. new reservation has been made for the client for the address or prefix being
  2147. currently in use by another client. We call this situation a "conflict". The
  2148. conflicts get resolved automatically over time as described in the subsequent
  2149. sections. Once conflict is resolved, the client will keep receiving the reserved
  2150. configuration when it renews.</para>
  2151. <para>Another example when the host reservations are applicable is when a host
  2152. that has specific requirements, e.g. a printer that needs additional DHCP options
  2153. or a cable modem needs specific parameters. Yet another possible use case for
  2154. host reservation is to define unique names for hosts. Although not all of
  2155. the presented use cases are implemented yet, Kea software will support them
  2156. in the near future.</para>
  2157. <para>Hosts reservations are defined as parameters for each subnet. Each host
  2158. can be identified by either DUID or its hardware/MAC address. See
  2159. <xref linkend="mac-in-dhcpv6"/> for details. There is an optional
  2160. <command>reservations</command> array in the
  2161. <command>Subnet6</command> structure. Each element in that array
  2162. is a structure, that holds information about a single host. In
  2163. particular, such a structure has to have an identifier that
  2164. uniquely identifies a host. In DHCPv6 context, such an identifier
  2165. is a hardware (MAC) address or a DUID. Also, either one or more
  2166. addresses or prefixes should be specified. It is possible to
  2167. specify a hostname. Additional capabilities are planned.</para>
  2168. <para>The following example shows how to reserve addresses and prefixes
  2169. for specific hosts:
  2170. <screen>
  2171. "subnet6": [
  2172. {
  2173. "subnet": "2001:db8:1::/48",
  2174. "pools": [ { "pool": "2001:db8:1::/80" } ],
  2175. "pd-pools": [
  2176. {
  2177. "prefix": "2001:db8:1:8000::",
  2178. "prefix-len": 56,
  2179. "delegated-len": 64
  2180. }
  2181. ],
  2182. <userinput>"reservations": [
  2183. {
  2184. "duid": "01:02:03:04:05:0A:0B:0C:0D:0E",
  2185. "ip-addresses": [ "2001:db8:1::100" ]
  2186. },
  2187. {
  2188. "hw-address": "00:01:02:03:04:05",
  2189. "ip-addresses": [ "2001:db8:1::101" ]
  2190. },
  2191. {
  2192. "duid": "01:02:03:04:05:06:07:08:09:0A",
  2193. "ip-addresses": [ "2001:db8:1::102" ],
  2194. "prefixes": [ "2001:db8:2:abcd::/64" ],
  2195. "hostname": "foo.example.com"
  2196. }
  2197. ]</userinput>
  2198. }
  2199. ]
  2200. </screen>
  2201. This example makes 3 reservations. The first one reserves 2001:db8:1::100 address
  2202. for the client using DUID 01:02:03:04:05:0A:0B:0C:0D:0E. The second one
  2203. also reserves an address, but does so using MAC or hardware address, rather than
  2204. DUID. The third example is most advanced. It reserves an address, a prefix and
  2205. a hostname at the same time.
  2206. </para>
  2207. <para>Note that DHCPv6 allows for a single client to lease multiple addresses
  2208. and multiple prefixes at the same time. In the upcoming Kea releases, it will
  2209. be possible to have multiple addresses and prefixes reserved for a single
  2210. host. Therefore <command>ip-addresses</command> and <command>prefixes</command>
  2211. are plural and are actually arrays. As of 0.9.1 having more than one IPv6
  2212. address or prefix is only partially supported.</para>
  2213. <para>Making a reservation for a mobile host that may visit multiple subnets
  2214. requires a separate host definition in each subnet it is expected to visit.
  2215. It is not allowed to define multiple host definitions with the same hardware
  2216. address in a single subnet. It is a valid configuration, if such definitions
  2217. are specified in different subnets, though. The reservation for a given host
  2218. should include only one identifier, either DUID or hardware address. Defining
  2219. both for the same host is considered a configuration error, but as of 0.9.1
  2220. beta, it is not rejected.
  2221. </para>
  2222. <para>Adding host reservation incurs a performance penalty. In principle,
  2223. when the server that does not support host reservation responds to a query,
  2224. it needs to check whether there is a lease for a given address being
  2225. considered for allocation or renewal. The server that also supports host
  2226. reservation, has to perform additional checks: not only if the address is
  2227. currently used (if there is a lease for it), but also whether the address
  2228. could be used by someone else (if there is a reservation for it). That
  2229. additional check incurs performance penalty.</para>
  2230. <section id="reservation6-types">
  2231. <title>Address/prefix reservation types</title>
  2232. <para>In a typical scenario there's an IPv6 subnet defined with a certain
  2233. part of it dedicated for dynamic address allocation by the DHCPv6
  2234. server. There may be an additional address space defined for prefix
  2235. delegation. Those dynamic parts are referred to as dynamic pools, address
  2236. and prefix pools or simply pools. In principle, the host reservation can
  2237. reserve any address or prefix that belongs to the subnet. The reservations
  2238. that specify an address that belongs to configured pools are called
  2239. <command>in-pool reservations</command>. In contrast, those that do not
  2240. belong to dynamic pools are called <command>out-of-pool
  2241. reservations</command>. There is no formal difference in the reservation
  2242. syntax. As of 0.9.1, both reservation types are handled
  2243. uniformly. However, upcoming releases may offer improved performance if
  2244. there are only out-of-pool reservations as the server will be able to skip
  2245. reservation checks when dealing with existing leases. Therefore, system
  2246. administrators are encouraged to use out-of-pool reservations, if
  2247. possible.</para>
  2248. </section>
  2249. <section id="reservation6-conflict">
  2250. <title>Conflicts in DHCPv6 reservations</title>
  2251. <para>As reservations and lease information are stored in different places,
  2252. conflicts may arise. Consider the following series of events. The server
  2253. has configured the dynamic pool of addresses from the range of 2001:db8::10
  2254. to 2001:db8::20. Host A requests an address and gets 2001:db8::10. Now the
  2255. system administrator decides to reserve an address for host B. He decides
  2256. to reserve 2001:db8::10 for that purpose. In general, reserving an address
  2257. that is currently assigned to someone else is not recommended, but there
  2258. are valid use cases where such an operation is warranted.</para>
  2259. <para>The server now has a conflict to resolve. Let's analyze the
  2260. situation here. If host B boots up and request an address, the server is
  2261. not able to assign the reserved address 2001:db8::10. A naive approach
  2262. would to be immediately remove the lease for host A and create a new one
  2263. for host B. That would not solve the problem, though, because as soon as
  2264. host B get the address, it will detect that the address is already in use
  2265. by someone else (host A) and would send Decline. Therefore in this
  2266. situation, the server has to temporarily assign a different address from the
  2267. dynamic pool (not matching what has been reserved) to host B.</para>
  2268. <para>When the host A renews its address, the server will discover that
  2269. the address being renewed is now reserved for someone else (host
  2270. B). Therefore the server will remove the lease for 2001:db8::10 and select
  2271. a new address and will create a new lease for it. It will send two
  2272. addresses in its response: the old address with lifetimes set to 0 to
  2273. explicitly indicate that it is no longer valid and a new address with
  2274. non-zero lifetimes. When the host B renews its temporarily assigned
  2275. address, the server will detect that the existing lease does not match
  2276. reservation, so it will release the current address host B has and will
  2277. create a new lease matching the reservation. Similar as before, the server
  2278. will send two addresses: the temporarily assigned one with zeroed
  2279. lifetimes, and the new one that matches reservation with proper lifetimes
  2280. set.</para>
  2281. <para>This recovery will succeed, even if other hosts will attempt to get
  2282. the reserved address. Had the host C requested address 2001:db8::10 after
  2283. the reservation was made, the server will propose a different address.</para>
  2284. <para>This recovery mechanism allows the server to fully recover from a
  2285. case where reservations conflict with existing leases. This procedure
  2286. takes time and will roughly take as long as renew-timer value specified.
  2287. The best way to avoid such recovery is to not define new reservations that
  2288. conflict with existing leases. Another recommendation is to use
  2289. out-of-pool reservations. If the reserved address does not belong to a
  2290. pool, there is no way that other clients could get this address (note that
  2291. having multiple reservations for the same address is not allowed).
  2292. </para>
  2293. </section>
  2294. <section id="reservation6-hostname">
  2295. <title>Reserving a hostname</title>
  2296. <para>When the reservation for the client includes the <command>hostname
  2297. </command>, the server will assign this hostname to the client and send
  2298. it back in the Client FQDN, if the client sent the FQDN option to the
  2299. server. The reserved hostname always takes precedence over the hostname
  2300. supplied by the client (via the FQDN option) or the autogenerated
  2301. (from the IPv6 address) hostname.</para>
  2302. <para>The server qualifies the reserved hostname with the value
  2303. of the <command>qualifying-suffix</command> parameter. For example, the
  2304. following subnet configuration:
  2305. <screen>
  2306. "subnet6": [
  2307. {
  2308. "subnet": "2001:db8:1::/48",
  2309. "pools": [ { "pool": "2001:db8:1::/80" } ],
  2310. "reservations": [
  2311. {
  2312. "duid": "01:02:03:04:05:0A:0B:0C:0D:0E",
  2313. "ip-addresses": [ "2001:db8:1::100" ]
  2314. "hostname": "alice-laptop"
  2315. }
  2316. ]
  2317. }
  2318. ],
  2319. "dhcp-ddns": {
  2320. "enable-updates": true,
  2321. "qualifying-suffix": "example.isc.org."
  2322. }
  2323. </screen>
  2324. will result in assigning the "alice-laptop.example.isc.org." hostname to the
  2325. client using the DUID "01:02:03:04:05:0A:0B:0C:0D:0E". If the <command>qualifying-suffix
  2326. </command> is not specified, the default (empty) value will be used, and
  2327. in this case the value specified as a <command>hostname</command> will
  2328. be treated as fully qualified name. Thus, by leaving the
  2329. <command>qualifying-suffix</command> empty it is possible to qualify
  2330. hostnames for the different clients with different domain names:
  2331. <screen>
  2332. "subnet6": [
  2333. {
  2334. "subnet": "2001:db8:1::/48",
  2335. "pools": [ { "pool": "2001:db8:1::/80" } ],
  2336. "reservations": [
  2337. {
  2338. "duid": "01:02:03:04:05:0A:0B:0C:0D:0E",
  2339. "ip-addresses": [ "2001:db8:1::100" ]
  2340. "hostname": "mark-desktop.example.org."
  2341. }
  2342. ]
  2343. }
  2344. ],
  2345. "dhcp-ddns": {
  2346. "enable-updates": true,
  2347. }
  2348. </screen>
  2349. will result in assigning the "mark-desktop.example.org." hostname to the
  2350. client using the DUID "01:02:03:04:05:0A:0B:0C:0D:0E".
  2351. </para>
  2352. </section>
  2353. <section id="reservation6-options">
  2354. <title>Including specific DHCPv6 options in reservations</title>
  2355. <para>Kea 1.1.0 introduced the ability to specify options on a
  2356. per host basis. The options follow the same rules as any other
  2357. options. These can be standard options (see <xref
  2358. linkend="dhcp6-std-options" />), custom options (see <xref
  2359. linkend="dhcp6-custom-options"/>) or vendor specific options
  2360. (see <xref linkend="dhcp6-vendor-opts" />). The following
  2361. example showcases how standard options can be defined.</para>
  2362. <screen>
  2363. "reservations": [
  2364. {
  2365. "duid": "01:02:03:05:06:07:08",
  2366. "ip-addresses": [ "2001:db8:1::2" ],
  2367. <userinput>"option-data": [
  2368. {
  2369. "option-data": [ {
  2370. "name": "dns-servers",
  2371. "data": "3000:1::234"
  2372. },
  2373. {
  2374. "name": "nis-servers",
  2375. "data": "3000:1::234"
  2376. }
  2377. } ]</userinput>
  2378. } ]</screen>
  2379. <para>Vendor specific options can be reserved in a similar manner:</para>
  2380. <screen>
  2381. "reservations": [
  2382. {
  2383. "duid": "aa:bb:cc:dd:ee:ff",
  2384. "ip-addresses": [ "2001:db8::1" ],
  2385. <userinput>"option-data": [
  2386. {
  2387. "name": "vendor-opts",
  2388. "data": 4491"
  2389. },
  2390. {
  2391. "name": "tftp-servers",
  2392. "space": "vendor-4491",
  2393. "data": "3000:1::234"
  2394. } ]</userinput>
  2395. } ]</screen>
  2396. <para>
  2397. Options defined on host level have the highest priority. In other words,
  2398. if there are options defined with the same type on global, subnet, class and
  2399. host level, the host specific values will be used.
  2400. </para>
  2401. </section>
  2402. <section id="reservations6-mysql">
  2403. <title>Storing host reservations in MySQL</title>
  2404. <para>
  2405. It is possible to store host reservations in MySQL. See <xref
  2406. linkend="hosts6-storage" /> for information how to configure Kea to use
  2407. reservations stored in MySQL. Kea does not provide any dedicated tools
  2408. for managing MySQL reservations. See Kea wiki <ulink
  2409. url="http://kea.isc.org/wiki/HostReservationsHowTo" /> for detailed
  2410. information and examples of how reservations can be inserted into the
  2411. database.
  2412. </para>
  2413. </section>
  2414. <section id="reservations6-pgsql">
  2415. <title>Storing host reservations in PostgreSQL</title>
  2416. <para>Kea currently does not support storing reservations in
  2417. PostgreSQL, but this feature is planned for Kea 1.1.0.</para>
  2418. </section>
  2419. <section id="reservations6-cql">
  2420. <title>Storing host reservations in CQL (Cassandra)</title>
  2421. <para>Kea currently does not support storing reservations in
  2422. Cassandra (CQL).</para>
  2423. </section>
  2424. <section id="reservations6-tuning">
  2425. <title>Fine Tuning IPv6 Host Reservation</title>
  2426. <para>Host reservation capability introduces additional restrictions for the
  2427. allocation engine during lease selection and renewal. In particular, three
  2428. major checks are necessary. First, when selecting a new lease, it is not
  2429. sufficient for a candidate lease to not be used by another DHCP client. It
  2430. also must not be reserved for another client. Second, when renewing a lease,
  2431. additional check must be performed whether the address being renewed is not
  2432. reserved for another client. Finally, when a host renews an address or a
  2433. prefix, the server has to check whether there's a reservation for this host,
  2434. so the existing (dynamically allocated) address should be revoked and the
  2435. reserved one be used instead.</para>
  2436. <para>Some of those checks may be unnecessary in certain deployments. Not
  2437. performing them may improve performance. The Kea server provides the
  2438. <command>reservation-mode</command> configuration parameter to select the
  2439. types of reservations allowed for the particular subnet. Each reservation
  2440. type has different constraints for the checks to be performed by the
  2441. server when allocating or renewing a lease for the client.
  2442. Allowed values are:
  2443. <itemizedlist>
  2444. <listitem><simpara> <command>all</command> - enables all host reservation
  2445. types. This is the default value. This setting is the safest and the most
  2446. flexible. It allows in-pool and out-of-pool reservations. As all checks
  2447. are conducted, it is also the slowest.
  2448. </simpara></listitem>
  2449. <listitem><simpara> <command>out-of-pool</command> - allows only out of
  2450. pool host reservations. With this setting in place, the server may assume
  2451. that all host reservations are for addresses that do not belong to the
  2452. dynamic pool. Therefore it can skip the reservation checks when dealing
  2453. with in-pool addresses, thus improving performance. Do not use this mode
  2454. if any of your reservations use in-pool address. Caution is advised when
  2455. using this setting. Kea 0.9.1 does not sanity check the reservations against
  2456. <command>reservation-mode</command>. Misconfiguration may cause problems.
  2457. </simpara></listitem>
  2458. <listitem><simpara>
  2459. <command>disabled</command> - host reservation support is disabled. As there
  2460. are no reservations, the server will skip all checks. Any reservations defined
  2461. will be completely ignored. As the checks are skipped, the server may
  2462. operate faster in this mode.
  2463. </simpara></listitem>
  2464. </itemizedlist>
  2465. </para>
  2466. <para>
  2467. An example configuration that disables reservation looks like follows:
  2468. <screen>
  2469. "Dhcp6": {
  2470. "subnet6": [
  2471. {
  2472. "subnet": "2001:db8:1::/64",
  2473. <userinput>"reservation-mode": "disabled"</userinput>,
  2474. ...
  2475. }
  2476. ]
  2477. }
  2478. </screen>
  2479. </para>
  2480. <para>Another aspect of the host reservations are different types of
  2481. identifiers. Currently (June 2016) Kea supports two types of identifiers
  2482. in DHCPv6: hw-address and duid, but more identifier types
  2483. are likely to be added in the future. This is beneficial from a
  2484. usability perspective. However, there is a drawback. For each incoming
  2485. packet Kea has to to extract each identifier type and then query the
  2486. database to see if there's a reservation done by this particular
  2487. identifier. If there is not, the next identifier is extracted and next
  2488. query is issued. This process continues until either a reservation is
  2489. found or all identifier types have been checked. Over time with an increasing
  2490. number of supported identifier types, Kea would become slower and
  2491. slower.</para>
  2492. <para>To address this problem, a parameter called
  2493. <command>host-reservation-identifiers</command> has been introduced. It
  2494. takes a list of identifier types as a parameter. Kea will check only those
  2495. identifier types enumerated in host-reservation-identifiers. From the
  2496. performance perspective the number of identifier types should be kept to
  2497. minimum, ideally limited to one. If your deployment uses several
  2498. reservation types, please enumerate them from most to least frequently
  2499. used as this increases the chances of Kea finding the reservation using the
  2500. fewest number of queries. An example of host reservation identifiers looks
  2501. as follows:
  2502. <screen>
  2503. <userinput>"host-reservation-identifiers": [ "duid", "hw-address" ],</userinput>
  2504. "subnet6": [
  2505. {
  2506. "subnet": "2001:db8:1::/64",
  2507. ...
  2508. }
  2509. ]</screen>
  2510. </para>
  2511. <para>
  2512. If not specified, the default value is:
  2513. <screen>
  2514. <userinput>"host-reservation-identifiers": [ "hw-address", "duid" ]</userinput>
  2515. </screen>
  2516. </para>
  2517. <!-- see CfgHostOperations::createConfig6() in
  2518. src/lib/dhcpsrv/cfg_host_operations.cc -->
  2519. </section>
  2520. <!-- @todo: add support for per IA reservation (that specifies IAID in
  2521. the ip-addresses and prefixes) -->
  2522. </section>
  2523. <!-- end of host reservations section -->
  2524. <section id="dhcp6-serverid">
  2525. <title>Server Identifier in DHCPv6</title>
  2526. <para>The DHCPv6 protocol uses a "server identifier" (also known
  2527. as a DUID) for clients to be able to discriminate between several
  2528. servers present on the same link.
  2529. <ulink url="http://tools.ietf.org/html/rfc3315">RFC 3315</ulink>
  2530. defines three DUID types: DUID-LLT, DUID-EN and DUID-LL.
  2531. <ulink url="http://tools.ietf.org/html/rfc6355">RFC 6355</ulink>
  2532. also defines DUID-UUID. Future specifications may introduce new
  2533. DUID types.</para>
  2534. <para>Kea DHCPv6 server generates a server identifier once, upon
  2535. the first startup, and stores it in a file. This identifier isn't
  2536. modified across restarts of the server (stable identifier).</para>
  2537. <para>Kea follows recommendation from
  2538. <ulink url="http://tools.ietf.org/html/rfc3315">RFC 3315</ulink>
  2539. to use DUID-LLT as a default server identifier. However, we have
  2540. received reports that some deployments require different DUID
  2541. types, and there is a need to administratively select both DUID
  2542. type and/or its contents.</para>
  2543. <para>The server identifier can be configured using parameters
  2544. within the <command>server-id</command> map element in the global
  2545. scope of the Kea configuration file. The following example
  2546. demonstrates how to select DUID-EN as a server identifier:
  2547. <screen>
  2548. "Dhcp6": {
  2549. "server-id": {
  2550. "type": "EN"
  2551. },
  2552. ...
  2553. }
  2554. </screen>
  2555. </para>
  2556. <para>Currently supported values for <command>type</command>
  2557. parameter are: "LLT", "EN" and "LL", for DUID-LLT, DUID-EN and
  2558. DUID-LL respectively.</para>
  2559. <para>When a new DUID type is selected the server will generate its
  2560. value and replace any existing DUID in the file. The server will
  2561. use the new server identifier in all future interactions with the
  2562. clients.</para>
  2563. <note><para>If the new server identifier is created after some clients
  2564. have obtained their leases, the clients using old identifier will not
  2565. be able to renew the leases. The server will ignore messages
  2566. containing the old server identifier. Clients will continue sending
  2567. Renew until they transition to rebinding state. In this state they
  2568. will start sending Rebind messages to multicast address and without
  2569. a server identifier. The server will respond to the Rebind messages
  2570. with a new server identifier and the clients will associate the
  2571. new server identifier with their leases. Although the clients will
  2572. be able to keep their leases and will eventually learn the new server
  2573. identifier, this will be at the cost of increased number of renewals
  2574. and multicast traffic due to a need to rebind. Therefore it is
  2575. recommended to avoid modification of the server identifier type
  2576. and its value if the server has already assigned leases and these
  2577. leases are still valid.</para></note>
  2578. <para>There are cases when an administrator needs to explicitly
  2579. specify a DUID value, rather than allow the server to generate it.
  2580. The following example demonstrates how to explicitly set all
  2581. components of a DUID-LLT.
  2582. <screen>
  2583. "Dhcp6": {
  2584. "server-id": {
  2585. "type": "LLT",
  2586. "htype": 8,
  2587. "identifier": "A65DC7410F05",
  2588. "time": 2518920166
  2589. },
  2590. ...
  2591. }
  2592. </screen>
  2593. where:
  2594. <itemizedlist>
  2595. <listitem><simpara><command>htype</command> is a 16-bit unsigned value
  2596. specifying hardware type,</simpara></listitem>
  2597. <listitem><simpara><command>identifier</command> is a link layer
  2598. address, specified as a string of hexadecimal digits,</simpara>
  2599. </listitem>
  2600. <listitem><simpara><command>time</command> is a 32-bit unsigned
  2601. time value.</simpara></listitem>
  2602. </itemizedlist>
  2603. </para>
  2604. <para>The hexadecimal representation of the DUID generated as a result
  2605. of the configuration specified above will be:
  2606. <screen>
  2607. 00:01:00:08:96:23:AB:E6:A6:5D:C7:41:0F:05
  2608. ------------------------------------------
  2609. |type|htype| time | identifier |
  2610. </screen>
  2611. </para>
  2612. <para>It is allowed to use special value of 0 for "htype" and "time",
  2613. which indicates that the server should use ANY value for these
  2614. components. If the server already uses a DUID-LLT it will use the
  2615. values from this DUID. If the server uses a DUID of a different type
  2616. or doesn't use any DUID yet, it will generate these values.
  2617. Similarly, if the "identifier" is assigned an empty string, the
  2618. value of the identifier will be generated. Omitting any of these
  2619. parameters is equivalent to setting them to those special values.
  2620. </para>
  2621. <para>For example, the following configuration:
  2622. <screen>
  2623. "Dhcp6": {
  2624. "server-id": {
  2625. "type": "LLT",
  2626. "htype": 0,
  2627. "identifier": "",
  2628. "time": 2518920166
  2629. },
  2630. ...
  2631. }
  2632. </screen>
  2633. indicates that the server should use ANY link layer address and
  2634. hardware type. If the server is already using DUID-LLT it will
  2635. use link layer address and hardware type from the existing DUID.
  2636. If the server is not using any DUID yet, it will use link layer
  2637. address and hardware type from one of the available network
  2638. interfaces. The server will use explicit value of time. If it
  2639. is different than a time value present in the currently used
  2640. DUID, this value will be replaced. This will effectively cause
  2641. modification of the current server identifier.
  2642. </para>
  2643. <para>
  2644. The following example demonstrates an explicit configuration of
  2645. a DUID-EN:
  2646. <screen>
  2647. "Dhcp6": {
  2648. "server-id": {
  2649. "type": "EN",
  2650. "enterprise-id": 2495,
  2651. "identifier": "87ABEF7A5BB545"
  2652. },
  2653. ...
  2654. }
  2655. </screen>
  2656. where:
  2657. <itemizedlist>
  2658. <listitem><simpara><command>enterprise-id</command> is a 32-bit
  2659. unsigned value holding enterprise number,</simpara></listitem>
  2660. <listitem><simpara><command>identifier</command> is a variable
  2661. length identifier within DUID-EN.</simpara></listitem>
  2662. </itemizedlist>
  2663. </para>
  2664. <para>
  2665. The hexadecimal representation of the DUID-EN created according to
  2666. the configuration above is:
  2667. <screen>
  2668. 00:02:00:00:09:BF:87:AB:EF:7A:5B:B5:45
  2669. --------------------------------------
  2670. |type| ent-id | identifier |
  2671. </screen>
  2672. </para>
  2673. <para>As in the case of the DUID-LLT, special values can be used for the
  2674. configuration of the DUID-EN. If the "enterprise-id" is 0, the server
  2675. will use a value from the existing DUID-EN. If the server is not using
  2676. any DUID or the existing DUID has a different type, the ISC enterprise
  2677. id will be used. When an empty string is used for "identifier", the
  2678. identifier from the existing DUID-EN will be used. If the server is
  2679. not using any DUID-EN the new 6-bytes long identifier will be generated.
  2680. </para>
  2681. <para>DUID-LL is configured in the same way as DUID-LLT with an exception
  2682. that the <command>time</command> parameter has no effect for DUID-LL,
  2683. because this DUID type only comprises a hardware type and link layer
  2684. address. The following example demonstrates how to configure DUID-LL:
  2685. <screen>
  2686. "Dhcp6": {
  2687. "server-id": {
  2688. "type": "LL",
  2689. "htype": 8,
  2690. "identifier": "A65DC7410F05"
  2691. },
  2692. ...
  2693. }
  2694. </screen>
  2695. </para>
  2696. <para>
  2697. which will result in the following server identifier:
  2698. <screen>
  2699. 00:03:00:08:A6:5D:C7:41:0F:05
  2700. ------------------------------
  2701. |type|htype| identifier |
  2702. </screen>
  2703. </para>
  2704. <para>Server stores a generated server identifier in the following
  2705. location: <userinput>[kea-install-dir]/var/kea/kea-dhcp6-serverid
  2706. </userinput>.
  2707. </para>
  2708. <para>In some uncommon deployments where no stable storage is
  2709. available, it is desired to configure the server to not try to
  2710. store the server identifier on the stable storage. It is controlled
  2711. by the value of <command>persist</command> boolean parameter:
  2712. <screen>
  2713. "Dhcp6": {
  2714. "server-id": {
  2715. "type": "EN",
  2716. "enterprise-id": 2495,
  2717. "identifier": "87ABEF7A5BB545",
  2718. "persist": false
  2719. },
  2720. ...
  2721. }
  2722. </screen>
  2723. </para>
  2724. <para>The default value of the "persist" parameter is
  2725. <command>true</command> which configures the server to store the
  2726. server identifier on a disk.</para>
  2727. <para>In the example above, the server is configured to not store
  2728. the generated server identifier on a disk. But, if the server
  2729. identifier is not modified in the configuration the same value
  2730. will be used after server restart, because entire server
  2731. identifier is explicitly specified in a configuration.</para>
  2732. </section>
  2733. <section id="stateless-dhcp6">
  2734. <title>Stateless DHCPv6 (Information-Request Message)</title>
  2735. <para>Typically DHCPv6 is used to assign both addresses and options. These
  2736. assignments (leases) have state that changes over time, hence
  2737. their name, stateful. DHCPv6 also supports a stateless mode,
  2738. where clients request configuration options only. This mode is
  2739. considered lightweight from the server perspective, as it does not require
  2740. any state tracking; hence its name.</para>
  2741. <para>The Kea server supports stateless mode. Clients can send
  2742. Information-Request messages and the server will send back
  2743. answers with the requested options (providing the options are
  2744. available in the server configuration). The server will attempt to
  2745. use per-subnet options first. If that fails - for whatever reason - it
  2746. will then try to provide options defined in the global scope.</para>
  2747. <para>Stateless and stateful mode can be used together. No special
  2748. configuration directives are required to handle this. Simply use the
  2749. configuration for stateful clients and the stateless clients will get
  2750. just options they requested.</para>
  2751. <para>This usage of global options allows for an interesting case.
  2752. It is possible to run a server that provides just options and no
  2753. addresses or prefixes. If the options have the same value in each
  2754. subnet, the configuration can define required options in the global
  2755. scope and skip subnet definitions altogether. Here's a simple example of
  2756. such a configuration:
  2757. <screen>
  2758. "Dhcp6": {
  2759. "interfaces-config": {
  2760. "interfaces": [ "ethX" ]
  2761. },
  2762. <userinput>"option-data": [ {
  2763. "name": "dns-servers",
  2764. "data": "2001:db8::1, 2001:db8::2"
  2765. } ]</userinput>,
  2766. "lease-database": { "type": "memfile" }
  2767. }
  2768. </screen>
  2769. This very simple configuration will provide DNS server information
  2770. to all clients in the network, regardless of their location. Note the
  2771. specification of the memfile lease database: this is required since,
  2772. as of version 0.9.1, Kea requires a lease database to be specified
  2773. even if it is not used.</para>
  2774. </section>
  2775. <section id="dhcp6-rfc7550">
  2776. <title>Support for RFC 7550</title>
  2777. <para>The <ulink url="http://tools.ietf.org/html/rfc7550">RFC 7550</ulink>
  2778. has introduced some changes to the DHCPv6 protocol to resolve a few issues
  2779. with the coexistence of multiple stateful options in the messages sent
  2780. between the clients and servers.</para>
  2781. <para>The typical example is when the client, such as a requesting
  2782. router, requests an allocation of both addresses and prefixes when
  2783. it performs the 4-way (SARR) exchange with the server. If the
  2784. server is not configured to allocate any prefixes but it can allocate
  2785. some addresses, it will respond with the IA_NA(s) containing allocated
  2786. addresses and the IA_PD(s) containing the NoPrefixAvail status code. If
  2787. the client can operate without prefixes it may transition to the
  2788. 'bound' state when it sends Renew/Rebind messages to the server,
  2789. according to the T1 and T2 times, to extend the lifetimes of the
  2790. allocated addresses. If the client is still interested in obtaining
  2791. prefixes from the server it may also include IA_PD in the Renew/Rebind
  2792. to request allocation of the prefixes. If the server still cannot
  2793. allocate the prefixes, it will respond with the IA_PD(s) containing
  2794. NoPrefixAvail status code. However, if the server can now allocate
  2795. the prefixes it will do so, and send them in the IA_PD(s) to the client.
  2796. Allocation of leases during the Renew/Rebind was not supported in the
  2797. <ulink url="http://tools.ietf.org/html/rfc3315">RFC 3315</ulink>
  2798. and <ulink url="http://tools.ietf.org/html/rfc3633">RFC 3633</ulink>,
  2799. and has been introduced in
  2800. <ulink url="http://tools.ietf.org/html/rfc7550">RFC 7550</ulink>.
  2801. Kea supports this new behavior and it doesn't provide any configuration
  2802. mechanisms to disable it.
  2803. </para>
  2804. <para>
  2805. The following are the other behaviors specified in the
  2806. <ulink url="http://tools.ietf.org/html/rfc7550">RFC 7550</ulink>
  2807. supported by the Kea DHCPv6 server:
  2808. <itemizedlist>
  2809. <listitem><simpara>set T1/T2 timers to the same value for all
  2810. stateful (IA_NA and IA_PD) options to facilitate renewal of all
  2811. client's leases at the same time (in a single message exchange),
  2812. </simpara></listitem>
  2813. <listitem><simpara>NoAddrsAvail and NoPrefixAvail status codes
  2814. are placed in the IA_NA and IA_PD options in the Advertise message,
  2815. rather than as the top level options.</simpara></listitem>
  2816. </itemizedlist>
  2817. </para>
  2818. </section>
  2819. <section id="dhcp6-relay-override">
  2820. <title>Using specific relay agent for a subnet</title>
  2821. <para>
  2822. The relay has to have an interface connected to the link on which
  2823. the clients are being configured. Typically the relay has a global IPv6
  2824. address configured on the interface that belongs to the subnet from which
  2825. the server will assign addresses. In the typical case, the
  2826. server is able to use the IPv6 address inserted by the relay (in the link-addr
  2827. field in RELAY-FORW message) to select the appropriate subnet.
  2828. </para>
  2829. <para>
  2830. However, that is not always the case. The relay
  2831. address may not match the subnet in certain deployments. This
  2832. usually means that there is more than one subnet allocated for a given
  2833. link. The two most common examples where this is the case are long lasting
  2834. network renumbering (where both old and new address space is still being
  2835. used) and a cable network. In a cable network both cable modems and the
  2836. devices behind them are physically connected to the same link, yet
  2837. they use distinct addressing. In such case, the DHCPv6 server needs
  2838. additional information (like the value of interface-id option or IPv6
  2839. address inserted in the link-addr field in RELAY-FORW message) to
  2840. properly select an appropriate subnet.
  2841. </para>
  2842. <para>
  2843. The following example assumes that there is a subnet 2001:db8:1::/64
  2844. that is accessible via relay that uses 3000::1 as its IPv6 address.
  2845. The server will be able to select this subnet for any incoming packets
  2846. that came from a relay that has an address in 2001:db8:1::/64 subnet.
  2847. It will also select that subnet for a relay with address 3000::1.
  2848. <screen>
  2849. "Dhcp6": {
  2850. "subnet6": [
  2851. {
  2852. "subnet": "2001:db8:1::/64",
  2853. "pools": [
  2854. {
  2855. "pool": "2001:db8:1::1-2001:db8:1::ffff"
  2856. }
  2857. ],
  2858. <userinput>"relay": {
  2859. "ip-address": "3000::1"
  2860. }</userinput>
  2861. }
  2862. ]
  2863. }
  2864. </screen>
  2865. </para>
  2866. </section>
  2867. <section id="dhcp6-client-class-relay">
  2868. <title>Segregating IPv6 clients in a cable network</title>
  2869. <para>
  2870. In certain cases, it is useful to mix relay address information,
  2871. introduced in <xref linkend="dhcp6-relay-override"/> with client
  2872. classification, explained in <xref linkend="classify"/>.
  2873. One specific example is a cable network, where typically modems
  2874. get addresses from a different subnet than all devices connected
  2875. behind them.
  2876. </para>
  2877. <para>
  2878. Let's assume that there is one CMTS (Cable Modem Termination System)
  2879. with one CM MAC (a physical link that modems are connected to).
  2880. We want the modems to get addresses from the 3000::/64 subnet,
  2881. while everything connected behind modems should get addresses from
  2882. another subnet (2001:db8:1::/64). The CMTS that acts as a relay
  2883. an uses address 3000::1. The following configuration can serve
  2884. that configuration:
  2885. <screen>
  2886. "Dhcp6": {
  2887. "subnet6": [
  2888. {
  2889. "subnet": "3000::/64",
  2890. "pools": [
  2891. { "pool": "3000::2 - 3000::ffff" }
  2892. ],
  2893. <userinput>"client-class": "VENDOR_CLASS_docsis3.0",
  2894. "relay": {
  2895. "ip-address": "3000::1"
  2896. }</userinput>
  2897. },
  2898. {
  2899. "subnet": "2001:db8:1::/64",
  2900. "pools": [
  2901. {
  2902. "pool": "2001:db8:1::1-2001:db8:1::ffff"
  2903. }
  2904. ],
  2905. <userinput>"relay": {
  2906. "ip-address": "3000::1"
  2907. }</userinput>
  2908. }
  2909. ]
  2910. }
  2911. </screen>
  2912. </para>
  2913. </section>
  2914. <section id="mac-in-dhcpv6">
  2915. <title>MAC/Hardware addresses in DHCPv6</title>
  2916. <para>MAC/hardware addresses are available in DHCPv4 messages
  2917. from the clients and administrators
  2918. frequently use that information to perform certain tasks, like per host
  2919. configuration, address reservation for specific MAC addresses and other.
  2920. Unfortunately, the DHCPv6 protocol does not provide any completely reliable way
  2921. to retrieve that information. To mitigate that issue a number of mechanisms
  2922. have been implemented in Kea that attempt to gather that information. Each
  2923. of those mechanisms works in certain cases, but may fail in other cases.
  2924. Whether the mechanism works or not in the particular deployment is
  2925. somewhat dependent on the network topology and the technologies used.</para>
  2926. <para>Kea allows for configuration which of the supported methods should be
  2927. used and in which order. This configuration may be considered a fine tuning
  2928. of the DHCP deployment. In a typical deployment the default
  2929. value of <command>"any"</command> is sufficient and there is no
  2930. need to select specific methods. Changing the value of this parameter
  2931. is the most useful in cases when an administrator wants to disable
  2932. certain method, e.g. if the administrator trusts the network infrastructure
  2933. more than the information provided by the clients themselves, the
  2934. administrator may prefer information provided by the relays over that
  2935. provided by the clients. The format of this parameter is as follows:
  2936. <screen>
  2937. "Dhcp6": {
  2938. <userinput>"mac-sources": [ "method1", "method2", "method3", ... ]</userinput>,
  2939. "subnet6": [ ... ],
  2940. ...
  2941. }
  2942. </screen>
  2943. When not specified, a special value of <emphasis>any</emphasis> is used, which
  2944. instructs the server to attempt to use all the methods in sequence and use
  2945. value returned by the first one that succeeds.</para>
  2946. <para>Supported methods are:
  2947. <itemizedlist>
  2948. <listitem>
  2949. <simpara><command>any</command> - not an actual method, just a keyword that
  2950. instructs Kea to try all other methods and use the first one that succeeds.
  2951. This is the default operation if no <command>mac-sources</command> are defined.
  2952. </simpara>
  2953. </listitem>
  2954. <listitem>
  2955. <simpara><command>raw</command> - In principle, a DHCPv6 server could use raw
  2956. sockets to receive incoming traffic and extract MAC/hardware address
  2957. information. This is currently not implemented for DHCPv6 and this value has
  2958. no effect.
  2959. </simpara>
  2960. </listitem>
  2961. <listitem>
  2962. <simpara><command>duid</command> - DHCPv6 uses DUID identifiers instead of
  2963. MAC addresses. There are currently four DUID types defined, with two of them
  2964. (DUID-LLT, which is the default one and DUID-LL) convey MAC address information.
  2965. Although RFC 3315 forbids it, it is possible to parse those DUIDs and extract
  2966. necessary information from them. This method is not completely reliable, as
  2967. clients may use other DUID types, namely DUID-EN or DUID-UUID.
  2968. </simpara>
  2969. </listitem>
  2970. <listitem>
  2971. <simpara><command>ipv6-link-local</command> - Another possible acquisition
  2972. method comes from the source IPv6 address. In typical usage, clients are
  2973. sending their packets from IPv6 link-local addresses. There's a good chance
  2974. that those addresses are based on EUI-64, which contains MAC address. This
  2975. method is not completely reliable, as clients may use other link-local address
  2976. types. In particular, privacy extensions, defined in RFC 4941, do not use
  2977. MAC addresses. Also note that successful extraction requires that the
  2978. address's u-bit must be set to 1 and its g-bit set to 0, indicating that it
  2979. is an interface identifier as per
  2980. <ulink url="http://tools.ietf.org/html/rfc2373#section-2.5.1">
  2981. RFC 2373, section 2.5.1</ulink>.
  2982. </simpara>
  2983. </listitem>
  2984. <listitem>
  2985. <simpara><command>client-link-addr-option</command> - One extension defined
  2986. to alleviate missing MAC issues is client link-layer address option, defined
  2987. in <ulink url="http://tools.ietf.org/html/rfc6939">RFC 6939</ulink>. This is
  2988. an option that is inserted by a relay and contains information about client's
  2989. MAC address. This method requires a relay agent that supports the option and
  2990. is configured to insert it. This method is useless for directly connected
  2991. clients. This parameter can also be specified as <command>rfc6939</command>,
  2992. which is an alias for <command>client-link-addr-option</command>.
  2993. </simpara>
  2994. </listitem>
  2995. <listitem>
  2996. <simpara><command>remote-id</command> - <ulink
  2997. url="http://tools.ietf.org/html/rfc4649">RFC 4649</ulink>
  2998. defines remote-id option that is inserted by a relay agent. Depending
  2999. on the relay agent configuration, the inserted option may convey client's
  3000. MAC address information. This parameter can also be specified as
  3001. <command>rfc4649</command>, which is an alias for <command>remote-id</command>.
  3002. </simpara>
  3003. </listitem>
  3004. <listitem>
  3005. <simpara><command>subscriber-id</command> - Another option
  3006. that is somewhat similar to the previous one is subscriber-id,
  3007. defined in <ulink url="http://tools.ietf.org/html/rfc4580">RFC
  3008. 4580</ulink>. It is, too, inserted by a relay agent that is
  3009. configured to insert it. This parameter can also be specified
  3010. as <command>rfc4580</command>, which is an alias for
  3011. <command>subscriber-id</command>. This method is currently not
  3012. implemented.
  3013. </simpara>
  3014. </listitem>
  3015. <listitem>
  3016. <simpara><command>docsis-cmts</command> - Yet another possible source of MAC
  3017. address information are DOCSIS options inserted by a CMTS that acts
  3018. as a DHCPv6 relay agent in cable networks. This method attempts to extract
  3019. MAC address information from suboption 1026 (cm mac) of the vendor specific option
  3020. with vendor-id=4491. This vendor option is extracted from the relay-forward message,
  3021. not the original client's message.
  3022. </simpara>
  3023. </listitem>
  3024. <listitem>
  3025. <simpara><command>docsis-modem</command> - Yet another possible source of MAC
  3026. address information are DOCSIS options inserted by the cable modem itself.
  3027. This method attempts to extract MAC address information from suboption 36 (device id)
  3028. of the vendor specific option with vendor-id=4491. This vendor option is extracted from
  3029. the original client's message, not from any relay options.
  3030. </simpara>
  3031. </listitem>
  3032. </itemizedlist>
  3033. </para>
  3034. </section>
  3035. <section id="dhcp6-decline">
  3036. <title>Duplicate Addresses (DECLINE support)</title>
  3037. <para>The DHCPv6 server is configured with a certain pool of
  3038. addresses that it is expected to hand out to the DHCPv6 clients.
  3039. It is assumed that the server is authoritative and has complete
  3040. jurisdiction over those addresses. However, due to various
  3041. reasons, such as misconfiguration or a faulty client implementation
  3042. that retains its address beyond the valid lifetime, there may be
  3043. devices connected that use those addresses without the server's
  3044. approval or knowledge.</para>
  3045. <para>Such an unwelcome event can be detected
  3046. by legitimate clients (using Duplicate Address Detection) and
  3047. reported to the DHCPv6 server using a DECLINE message. The server
  3048. will do a sanity check (if the client declining an address really
  3049. was supposed to use it), then will a conduct clean up operation
  3050. and confirm it by sending back a REPLY message. Any DNS entries
  3051. related to that address will be removed, the fact will be logged
  3052. and hooks will be triggered. After that is done, the address
  3053. will be marked as declined (which indicates that it is used by
  3054. an unknown entity and thus not available for assignment to
  3055. anyone) and a probation time will be set on it. Unless otherwise
  3056. configured, the probation period lasts 24 hours. After that
  3057. period, the server will recover the lease, i.e. put it back into
  3058. the available state. The address will be available for assignment
  3059. again. It should be noted that if the underlying issue of a
  3060. misconfigured device is not resolved, the duplicate address
  3061. scenario will repeat. On the other hand, it provides an
  3062. opportunity to recover from such an event automatically, without
  3063. any sysadmin intervention.</para>
  3064. <para>To configure the decline probation period to a value different
  3065. than the default, the following syntax can be used:
  3066. <screen>
  3067. "Dhcp6": {
  3068. <userinput>"decline-probation-period": 3600</userinput>,
  3069. "subnet6": [ ... ],
  3070. ...
  3071. }
  3072. </screen>
  3073. The parameter is expressed in seconds, so the example above will instruct
  3074. the server to recycle declined leases after an hour.</para>
  3075. <para>There are several statistics and hook points associated with the
  3076. Decline handling procedure. The lease6_decline hook is triggered after the
  3077. incoming Decline message has been sanitized and the server is about to decline
  3078. the lease. The declined-addresses statistic is increased after the hook
  3079. returns (both global and subnet specific variants).</para>
  3080. <para>Once the probation time elapses, the declined lease is recovered
  3081. using the standard expired lease reclamation procedure, with several
  3082. additional steps. In particular, both declined-addresses statistics
  3083. (global and subnet specific) are decreased. At the same time,
  3084. reclaimed-declined-addresses statistics (again in two variants, global and
  3085. subnet specific) are increased.</para>
  3086. <para>Note about statistics: The server does not decrease
  3087. assigned-addresses statistics when a DECLINE message is received and
  3088. processed successfully. While technically a declined address is no longer
  3089. assigned, the primary usage of the assigned-addresses statistic is to
  3090. monitor pool utilization. Most people would forget to include
  3091. declined-addresses in the calculation, and simply do
  3092. assigned-addresses/total-addresses. This would have a bias towards
  3093. under-representing pool utilization. As this has a potential for major
  3094. issues, we decided not to decrease assigned addresses immediately after
  3095. receiving Decline, but to do it later when we recover the address back to
  3096. the available pool.</para>
  3097. </section>
  3098. <section id="dhcp6-stats">
  3099. <title>Statistics in DHCPv6 server</title>
  3100. <note>
  3101. <para>This section describes DHCPv6-specific statistics. For a general
  3102. overview and usage of statistics, see <xref linkend="stats" />.</para>
  3103. </note>
  3104. <para>
  3105. The DHCPv6 server supports the following statistics:
  3106. </para>
  3107. <table frame="all" id="dhcp6-statistics">
  3108. <title>DHCPv6 Statistics</title>
  3109. <tgroup cols='3'>
  3110. <colspec colname='statistic' align='center'/>
  3111. <colspec colname='type' align='center'/>
  3112. <colspec colname='description' align='left'/>
  3113. <thead>
  3114. <row>
  3115. <entry>Statistic</entry>
  3116. <entry>Data Type</entry>
  3117. <entry>Description</entry>
  3118. </row>
  3119. </thead>
  3120. <tbody>
  3121. <row>
  3122. <entry>pkt6-received</entry>
  3123. <entry>integer</entry>
  3124. <entry>Number of DHCPv6 packets received. This includes all packets:
  3125. valid, bogus, corrupted, rejected etc. This statistic is expected
  3126. to grow rapidly.</entry>
  3127. </row>
  3128. <row>
  3129. <entry>pkt6-receive-drop</entry>
  3130. <entry>integer</entry>
  3131. <entry>Number of incoming packets that were dropped. Exact reason
  3132. for dropping packets is logged, but the most common reasons may
  3133. be: an unacceptable or not supported packet type, direct responses
  3134. are forbidden, the server-id sent by the client does not match the
  3135. server's server-id or the packet is malformed.</entry>
  3136. </row>
  3137. <row>
  3138. <entry>pkt6-parse-failed</entry>
  3139. <entry>integer</entry>
  3140. <entry>Number of incoming packets that could not be parsed.
  3141. A non-zero value of this statistic indicates that the server
  3142. received a malformed or truncated packet. This may indicate problems
  3143. in your network, faulty clients, faulty relay agents or server
  3144. code bug.</entry>
  3145. </row>
  3146. <row>
  3147. <entry>pkt6-solicit-received</entry>
  3148. <entry>integer</entry>
  3149. <entry>
  3150. Number of SOLICIT packets received. This statistic is expected
  3151. to grow. Its increase means that clients that just booted
  3152. started their configuration process and their initial packets
  3153. reached your server.
  3154. </entry>
  3155. </row>
  3156. <row>
  3157. <entry>pkt6-advertise-received</entry>
  3158. <entry>integer</entry>
  3159. <entry>
  3160. Number of ADVERTISE packets received. Advertise packets are sent
  3161. by the server and the server is never expected to receive them. A non-zero
  3162. value of this statistic indicates an error occurring in the network.
  3163. One likely cause would be a misbehaving relay agent that incorrectly
  3164. forwards ADVERTISE messages towards the server, rather back to the
  3165. clients.
  3166. </entry>
  3167. </row>
  3168. <row>
  3169. <entry>pkt6-request-received</entry>
  3170. <entry>integer</entry>
  3171. <entry>Number of REQUEST packets received. This statistic
  3172. is expected to grow. Its increase means that clients that just booted
  3173. received the server's response (ADVERTISE), accepted it and are now
  3174. requesting an address (REQUEST).
  3175. </entry>
  3176. </row>
  3177. <row>
  3178. <entry>pkt6-reply-received</entry>
  3179. <entry>integer</entry>
  3180. <entry>Number of REPLY packets received. This statistic is
  3181. expected to remain zero at all times, as REPLY packets are sent by
  3182. the server and the server is never expected to receive
  3183. them. A non-zero value indicates an error. One likely cause would be
  3184. a misbehaving relay agent that incorrectly forwards REPLY messages
  3185. towards the server, rather back to the clients.
  3186. </entry>
  3187. </row>
  3188. <row>
  3189. <entry>pkt6-renew-received</entry>
  3190. <entry>integer</entry>
  3191. <entry>Number of RENEW packets received. This statistic
  3192. is expected to grow. Its increase means that clients received their
  3193. addresses and prefixes and are trying to renew them.
  3194. </entry>
  3195. </row>
  3196. <row>
  3197. <entry>pkt6-rebind-received</entry>
  3198. <entry>integer</entry>
  3199. <entry>Number of REBIND packets received. A non-zero value
  3200. indicates that clients didn't receive responses to their RENEW messages
  3201. (regular lease renewal mechanism) and are attempting to find any server
  3202. that is able to take over their leases. It may mean that some server's
  3203. REPLY messages never reached the clients.
  3204. </entry>
  3205. </row>
  3206. <row>
  3207. <entry>pkt6-release-received</entry>
  3208. <entry>integer</entry>
  3209. <entry>Number of RELEASE packets received. This statistic is expected
  3210. to grow when a device is being shut down in the network. It
  3211. indicates that the address or prefix assigned is reported as no longer
  3212. needed. Note that many devices, especially wireless, do not send RELEASE,
  3213. because of design choice or due to moving out of range.
  3214. </entry>
  3215. </row>
  3216. <row>
  3217. <entry>pkt6-decline-received</entry>
  3218. <entry>integer</entry>
  3219. <entry>
  3220. Number of DECLINE packets received. This statistic is expected to
  3221. remain close to zero. Its increase means that a client leased an
  3222. address, but discovered that the address is currently used by an
  3223. unknown device in your network. If this statistic is growing, it
  3224. may indicate misconfigured server or devices that have statically
  3225. assigned conflicting addresses.
  3226. </entry>
  3227. </row>
  3228. <row>
  3229. <entry>pkt6-infrequest-received</entry>
  3230. <entry>integer</entry>
  3231. <entry>
  3232. Number of INFORMATION-REQUEST packets received. This statistic
  3233. is expected to grow if there are devices that are using
  3234. stateless DHCPv6. INFORMATION-REQUEST messages are used by
  3235. clients that request stateless configuration, i.e. options
  3236. and parameters other than addresses or prefixes.
  3237. </entry>
  3238. </row>
  3239. <row>
  3240. <entry>pkt6-dhcpv4-query-received</entry>
  3241. <entry>integer</entry>
  3242. <entry>
  3243. Number of DHCPv4-QUERY packets received. This
  3244. statistic is expected to grow if there are devices
  3245. that are using DHCPv4-over-DHCPv6. DHCPv4-QUERY
  3246. messages are used by DHCPv4 clients on an IPv6 only
  3247. line so that encapsulate requests over DHCPv6.
  3248. </entry>
  3249. </row>
  3250. <row>
  3251. <entry>pkt6-dhcpv4-response-received</entry>
  3252. <entry>integer</entry>
  3253. <entry>
  3254. Number of DHCPv4-RESPONSE packets received. This
  3255. statistic is expected to remain zero at all times, as
  3256. DHCPv4-RESPONSE packets are sent by the server and the
  3257. server is never expected to receive them. A non-zero
  3258. value indicates an error. One likely cause would be a
  3259. misbehaving relay agent that incorrectly forwards
  3260. DHCPv4-RESPONSE message towards the server, rather
  3261. back to the clients.
  3262. </entry>
  3263. </row>
  3264. <row>
  3265. <entry>pkt6-unknown-received</entry>
  3266. <entry>integer</entry>
  3267. <entry>Number of packets received of an unknown type. Non-zero
  3268. value of this statistic indicates that the server received a
  3269. packet that it wasn't able to recognize: either with unsupported
  3270. type or possibly malformed.</entry>
  3271. </row>
  3272. <row>
  3273. <entry>pkt6-sent</entry>
  3274. <entry>integer</entry>
  3275. <entry>Number of DHCPv6 packets sent. This statistic is expected
  3276. to grow every time the server transmits a packet. In general, it
  3277. should roughly match pkt6-received, as most incoming packets cause
  3278. the server to respond. There are exceptions (e.g. server receiving a
  3279. REQUEST with server-id matching other server), so do not worry, if
  3280. it is lesser than pkt6-received.</entry>
  3281. </row>
  3282. <row>
  3283. <entry>pkt6-advertise-sent</entry>
  3284. <entry>integer</entry>
  3285. <entry>Number of ADVERTISE packets sent. This statistic is
  3286. expected to grow in most cases after a SOLICIT is processed. There
  3287. are certain uncommon, but valid cases where incoming SOLICIT is
  3288. dropped, but in general this statistic is expected to be close to
  3289. pkt6-solicit-received.</entry>
  3290. </row>
  3291. <row>
  3292. <entry>pkt6-reply-sent</entry>
  3293. <entry>integer</entry>
  3294. <entry>Number of REPLY packets sent. This statistic is expected to
  3295. grow in most cases after a SOLICIT (with rapid-commit), REQUEST,
  3296. RENEW, REBIND, RELEASE, DECLINE or INFORMATION-REQUEST is
  3297. processed. There are certain cases where there is no response.
  3298. </entry>
  3299. </row>
  3300. <row>
  3301. <entry>pkt6-dhcpv4-response-sent</entry>
  3302. <entry>integer</entry>
  3303. <entry>Number of DHCPv4-RESPONSE packets sent. This
  3304. statistic is expected to grow in most cases after a
  3305. DHCPv4-QUERY is processed. There are certain cases where
  3306. there is no response.
  3307. </entry>
  3308. </row>
  3309. <row>
  3310. <entry>subnet[id].total-nas</entry>
  3311. <entry>integer</entry>
  3312. <entry>
  3313. This statistic shows the total number of NA addresses available for
  3314. DHCPv6 management for a given subnet. In other words, this is the sum
  3315. of all addresses in all configured pools. This statistic changes only
  3316. during configuration changes. Note it does not take into account any
  3317. addresses that may be reserved due to host reservation. The
  3318. <emphasis>id</emphasis> is the subnet-id of a given subnet. This
  3319. statistic is exposed for each subnet separately. This statistic is
  3320. reset during a reconfiguration event.
  3321. </entry>
  3322. </row>
  3323. <row>
  3324. <entry>subnet[id].assigned-nas</entry>
  3325. <entry>integer</entry>
  3326. <entry>
  3327. This statistic shows the number of NA addresses in a given subnet that
  3328. are assigned. This statistic increases every time a new lease is allocated
  3329. (as a result of receiving a REQUEST message) and is decreased every time a
  3330. lease is released (a RELEASE message is received) or expires. The
  3331. <emphasis>id</emphasis> is the subnet-id of a given subnet. This
  3332. statistic is exposed for each subnet separately. This statistic is
  3333. reset during a reconfiguration event.
  3334. </entry>
  3335. </row>
  3336. <row>
  3337. <entry>subnet[id].total-pds</entry>
  3338. <entry>integer</entry>
  3339. <entry>
  3340. This statistic shows the total number of PD prefixes available for
  3341. DHCPv6 management for a given subnet. In other words, this is the sum
  3342. of all prefixes in all configured pools. This statistic changes only
  3343. during configuration changes. Note it does not take into account any
  3344. prefixes that may be reserved due to host reservation. The
  3345. <emphasis>id</emphasis> is the subnet-id of a given subnet. This
  3346. statistic is exposed for each subnet separately. This statistic is
  3347. reset during a reconfiguration event.
  3348. </entry>
  3349. </row>
  3350. <row>
  3351. <entry>subnet[id].assigned-pds</entry>
  3352. <entry>integer</entry>
  3353. <entry>
  3354. This statistic shows the number of PD prefixes in a given subnet that
  3355. are assigned. This statistic increases every time a new lease is allocated
  3356. (as a result of receiving a REQUEST message) and is decreased every time a
  3357. lease is released (a RELEASE message is received) or expires. The
  3358. <emphasis>id</emphasis> is the subnet-id of a given subnet. This statistic
  3359. is exposed for each subnet separately. This statistic is reset during a
  3360. reconfiguration event.
  3361. </entry>
  3362. </row>
  3363. <row>
  3364. <entry>declined-addresses</entry>
  3365. <entry>integer</entry>
  3366. <entry>
  3367. This statistic shows the number of IPv6 addresses that are
  3368. currently declined. This statistic counts the number of leases
  3369. currently unavailable. Once a lease is recovered, this
  3370. statistic will be decreased. Ideally, this statistic should be
  3371. zero. If this statistic is non-zero (or worse increasing),
  3372. a network administrator should investigate if there is
  3373. a misbehaving device in his network. This is a global statistic
  3374. that covers all subnets.
  3375. </entry>
  3376. </row>
  3377. <row>
  3378. <entry>subnet[id].declined-addresses</entry>
  3379. <entry>integer</entry>
  3380. <entry>
  3381. This statistic shows the number of IPv6 addresses that are
  3382. currently declined in a given subnet. This statistic counts the
  3383. number of leases currently unavailable. Once a lease is
  3384. recovered, this statistic will be decreased. Ideally, this
  3385. statistic should be zero. If this statistic is
  3386. non-zero (or worse increasing), a network administrator should
  3387. investigate if there is a misbehaving device in his network. The
  3388. <emphasis>id</emphasis> is the subnet-id of a given subnet. This
  3389. statistic is exposed for each subnet separately.
  3390. </entry>
  3391. </row>
  3392. <row>
  3393. <entry>reclaimed-declined-addresses</entry>
  3394. <entry>integer</entry>
  3395. <entry>
  3396. This statistic shows the number of IPv6 addresses that were
  3397. declined, but have now been recovered. Unlike
  3398. declined-addresses, this statistic never decreases. It can be used
  3399. as a long term indicator of how many actual valid Declines were
  3400. processed and recovered from. This is a global statistic that
  3401. covers all subnets.
  3402. </entry>
  3403. </row>
  3404. <row>
  3405. <entry>subnet[id].reclaimed-declined-addresses</entry>
  3406. <entry>integer</entry>
  3407. <entry>
  3408. This statistic shows the number of IPv6 addresses that were
  3409. declined, but have now been recovered. Unlike
  3410. declined-addresses, this statistic never decreases. It can be used
  3411. as a long term indicator of how many actual valid Declines were
  3412. processed and recovered from. The
  3413. <emphasis>id</emphasis> is the subnet-id of a given subnet. This
  3414. statistic is exposed for each subnet separately.
  3415. </entry>
  3416. </row>
  3417. </tbody>
  3418. </tgroup>
  3419. </table>
  3420. </section>
  3421. <section id="dhcp6-ctrl-channel">
  3422. <title>Management API for the DHCPv6 server</title>
  3423. <para>
  3424. Management API has been introduced in Kea 0.9.2-beta. It allows issuing specific
  3425. management commands, like statistics retrieval, reconfiguration or shutdown.
  3426. For more details, see <xref linkend="ctrl-channel" />. Currently the only
  3427. supported communication channel type is UNIX stream socket. By default there
  3428. are no sockets open. To instruct Kea to open a socket, the following entry
  3429. in the configuration file can be used:
  3430. <screen>
  3431. "Dhcp6": {
  3432. "control-socket": {
  3433. "socket-type": "unix",
  3434. "socket-name": <userinput>"/path/to/the/unix/socket"</userinput>
  3435. },
  3436. "subnet6": [
  3437. ...
  3438. ],
  3439. ...
  3440. }
  3441. </screen>
  3442. </para>
  3443. <para>
  3444. The length of the path specified by the <command>socket-name</command>
  3445. parameter is restricted by the maximum length for the unix socket name
  3446. on your operating system, i.e. the size of the <command>sun_path</command>
  3447. field in the <command>sockaddr_un</command> structure, decreased by 1.
  3448. This value varies on different operating systems between 91 and 107
  3449. characters. The typical values are 107 on Linux and 103 on FreeBSD.
  3450. </para>
  3451. <para>
  3452. Communication over control channel is conducted using JSON structures.
  3453. See the Control Channel section in the Kea Developer's Guide for more details.
  3454. </para>
  3455. <para>DHCPv6 server supports <command>statistic-get</command>,
  3456. <command>statistic-reset</command>, <command>statistic-remove</command>,
  3457. <command>statistic-get-all</command>, <command>statistic-reset-all</command>
  3458. and <command>statistic-remove-all</command>, specified in
  3459. <xref linkend="command-stats"/>. It also supports
  3460. <command>list-commands</command> and <command>shutdown</command>,
  3461. specified in <xref linkend="command-list-commands" /> and
  3462. <xref linkend="command-shutdown" />, respectively.</para>
  3463. </section>
  3464. <section id="dhcp6-std">
  3465. <title>Supported DHCPv6 Standards</title>
  3466. <para>The following standards are currently
  3467. supported:</para>
  3468. <itemizedlist>
  3469. <listitem>
  3470. <simpara><emphasis>Dynamic Host Configuration Protocol for IPv6</emphasis>,
  3471. <ulink url="http://tools.ietf.org/html/rfc3315">RFC 3315</ulink>:
  3472. Supported messages are SOLICIT,
  3473. ADVERTISE, REQUEST, RELEASE, RENEW, REBIND, INFORMATION-REQUEST,
  3474. CONFIRM and REPLY.</simpara>
  3475. </listitem>
  3476. <listitem>
  3477. <simpara><emphasis>IPv6 Prefix Options for
  3478. Dynamic Host Configuration Protocol (DHCP) version 6</emphasis>,
  3479. <ulink url="http://tools.ietf.org/html/rfc3633">RFC 3633</ulink>:
  3480. Supported options are IA_PD and
  3481. IA_PREFIX. Also supported is the status code NoPrefixAvail.</simpara>
  3482. </listitem>
  3483. <listitem>
  3484. <simpara><emphasis>DNS Configuration options for Dynamic Host
  3485. Configuration Protocol for IPv6 (DHCPv6)</emphasis>,
  3486. <ulink url="http://tools.ietf.org/html/rfc3646">RFC 3646</ulink>:
  3487. Supported option is DNS_SERVERS.</simpara>
  3488. </listitem>
  3489. <listitem>
  3490. <simpara><emphasis>The Dynamic Host Configuration Protocol for IPv6 (DHCPv6)
  3491. Relay Agent Remote-ID Option</emphasis>,
  3492. <ulink url="http://tools.ietf.org/html/rfc4649">RFC 4649</ulink>:
  3493. REMOTE-ID option is supported.</simpara>
  3494. </listitem>
  3495. <listitem>
  3496. <simpara><emphasis>The Dynamic Host Configuration Protocol for IPv6 (DHCPv6) Client
  3497. Fully Qualified Domain Name (FQDN) Option</emphasis>,
  3498. <ulink url="http://tools.ietf.org/html/rfc4704">RFC 4704</ulink>:
  3499. Supported option is CLIENT_FQDN.</simpara>
  3500. </listitem>
  3501. <listitem>
  3502. <simpara><emphasis>Relay-Supplied DHCP Options</emphasis>,
  3503. <ulink url="http://tools.ietf.org/html/rfc6422">RFC 6422</ulink>:
  3504. Full functionality is supported: OPTION_RSOO, ability of the server
  3505. to echo back the options, checks whether an option is RSOO-enabled,
  3506. ability to mark additional options as RSOO-enabled.</simpara>
  3507. </listitem>
  3508. <listitem>
  3509. <simpara><emphasis>Client Link-Layer Address Option in
  3510. DHCPv6</emphasis>,
  3511. <ulink url="http://tools.ietf.org/html/rfc6939">RFC
  3512. 6939</ulink>: Supported option is client link-layer
  3513. address option.</simpara>
  3514. </listitem>
  3515. <listitem>
  3516. <simpara><emphasis>Issues and Recommendations with Multiple
  3517. Stateful DHCPv6 Options</emphasis>,
  3518. <ulink url="http://tools.ietf.org/html/rfc7550">RFC
  3519. 7550</ulink>: All recommendations related to the DHCPv6 server
  3520. operation are supported.</simpara>
  3521. </listitem>
  3522. </itemizedlist>
  3523. </section>
  3524. <section id="dhcp6-limit">
  3525. <title>DHCPv6 Server Limitations</title>
  3526. <para> These are the current limitations and known problems
  3527. with the DHCPv6 server
  3528. software. Most of them are reflections of the early stage of
  3529. development and should be treated as <quote>not implemented
  3530. yet</quote>, rather than actual limitations.</para>
  3531. <itemizedlist>
  3532. <listitem> <!-- see tickets #3234, #3281 -->
  3533. <para>
  3534. On-line configuration has some limitations. Adding new subnets or
  3535. modifying existing ones work, as is removing the last subnet from
  3536. the list. However, removing non-last (e.g. removing subnet 1,2 or 3 if
  3537. there are 4 subnets configured) will cause issues. The problem is
  3538. caused by simplistic subnet-id assignment. The subnets are always
  3539. numbered, starting from 1. That subnet-id is then used in leases
  3540. that are stored in the lease database. Removing non-last subnet will
  3541. cause the configuration information to mismatch data in the lease
  3542. database. It is possible to manually update subnet-id fields in
  3543. MySQL, PostgreSQL or CQL database, but it is awkward and
  3544. error prone process. A better reconfiguration support is planned.
  3545. </para>
  3546. </listitem>
  3547. <listitem>
  3548. <simpara>
  3549. The server will allocate, renew or rebind a maximum of one lease
  3550. for a particular IA option (IA_NA or IA_PD) sent by a client.
  3551. <ulink url="http://tools.ietf.org/html/rfc3315">RFC 3315</ulink> and
  3552. <ulink url="http://tools.ietf.org/html/rfc3633">RFC 3633</ulink> allow
  3553. for multiple addresses or prefixes to be allocated for a single IA.
  3554. </simpara>
  3555. </listitem>
  3556. <listitem>
  3557. <simpara>Temporary addresses are not supported.</simpara>
  3558. </listitem>
  3559. <listitem>
  3560. <simpara>
  3561. Client reconfiguration (RECONFIGURE) is not yet supported.
  3562. </simpara>
  3563. </listitem>
  3564. </itemizedlist>
  3565. </section>
  3566. <!--
  3567. <section id="dhcp6-srv-examples">
  3568. <title>Kea DHCPv6 server examples</title>
  3569. <para>
  3570. This section provides easy to use example. Each example can be read
  3571. separately. It is not intended to be read sequentially as there will
  3572. be many repetitions between examples. They are expected to serve as
  3573. easy to use copy-paste solutions to many common deployments.
  3574. </para>
  3575. @todo: add simple configuration for direct clients
  3576. @todo: add configuration for relayed clients
  3577. @todo: add client classification example
  3578. </section> -->
  3579. </chapter>