dhcp6-srv.xml 164 KB

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