dhcp6-srv.xml 158 KB

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