dhcp6-srv.xml 156 KB

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