dhcp6-srv.xml 168 KB

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