dhcp6-srv.xml 130 KB

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