dhcp6-srv.xml 155 KB

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