dhcp6-srv.xml 172 KB

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