dhcp6-srv.xml 130 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016
  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. -->
  820. <!-- Vendor-specific Information is configurable by the administrator -->
  821. <row><entry>vendor-opts</entry><entry>17</entry><entry>uint32</entry><entry>false</entry></row>
  822. <!--
  823. <row><entry>interface-id</entry><entry>18</entry><entry>binary</entry><entry>false</entry></row>
  824. <row><entry>reconf-msg</entry><entry>19</entry><entry>uint8</entry><entry>false</entry></row>
  825. <row><entry>reconf-accept</entry><entry>20</entry><entry>empty</entry><entry>false</entry></row> -->
  826. -->
  827. <row><entry>sip-server-dns</entry><entry>21</entry><entry>fqdn</entry><entry>true</entry></row>
  828. <row><entry>sip-server-addr</entry><entry>22</entry><entry>ipv6-address</entry><entry>true</entry></row>
  829. <row><entry>dns-servers</entry><entry>23</entry><entry>ipv6-address</entry><entry>true</entry></row>
  830. <row><entry>domain-search</entry><entry>24</entry><entry>fqdn</entry><entry>true</entry></row>
  831. <!-- <row><entry>ia-pd</entry><entry>25</entry><entry>record</entry><entry>false</entry></row> -->
  832. <!-- <row><entry>iaprefix</entry><entry>26</entry><entry>record</entry><entry>false</entry></row> -->
  833. <row><entry>nis-servers</entry><entry>27</entry><entry>ipv6-address</entry><entry>true</entry></row>
  834. <row><entry>nisp-servers</entry><entry>28</entry><entry>ipv6-address</entry><entry>true</entry></row>
  835. <row><entry>nis-domain-name</entry><entry>29</entry><entry>fqdn</entry><entry>true</entry></row>
  836. <row><entry>nisp-domain-name</entry><entry>30</entry><entry>fqdn</entry><entry>true</entry></row>
  837. <row><entry>sntp-servers</entry><entry>31</entry><entry>ipv6-address</entry><entry>true</entry></row>
  838. <row><entry>information-refresh-time</entry><entry>32</entry><entry>uint32</entry><entry>false</entry></row>
  839. <row><entry>bcmcs-server-dns</entry><entry>33</entry><entry>fqdn</entry><entry>true</entry></row>
  840. <row><entry>bcmcs-server-addr</entry><entry>34</entry><entry>ipv6-address</entry><entry>true</entry></row>
  841. <row><entry>geoconf-civic</entry><entry>36</entry><entry>record</entry><entry>false</entry></row>
  842. <row><entry>remote-id</entry><entry>37</entry><entry>record</entry><entry>false</entry></row>
  843. <row><entry>subscriber-id</entry><entry>38</entry><entry>binary</entry><entry>false</entry></row>
  844. <row><entry>client-fqdn</entry><entry>39</entry><entry>record</entry><entry>false</entry></row>
  845. <row><entry>pana-agent</entry><entry>40</entry><entry>ipv6-address</entry><entry>true</entry></row>
  846. <row><entry>new-posix-timezone</entry><entry>41</entry><entry>string</entry><entry>false</entry></row>
  847. <row><entry>new-tzdb-timezone</entry><entry>42</entry><entry>string</entry><entry>false</entry></row>
  848. <row><entry>ero</entry><entry>43</entry><entry>uint16</entry><entry>true</entry></row>
  849. <row><entry>lq-query</entry><entry>44</entry><entry>record</entry><entry>false</entry></row>
  850. <row><entry>client-data</entry><entry>45</entry><entry>empty</entry><entry>false</entry></row>
  851. <row><entry>clt-time</entry><entry>46</entry><entry>uint32</entry><entry>false</entry></row>
  852. <row><entry>lq-relay-data</entry><entry>47</entry><entry>record</entry><entry>false</entry></row>
  853. <row><entry>lq-client-link</entry><entry>48</entry><entry>ipv6-address</entry><entry>true</entry></row>
  854. <row><entry>erp-local-domain-name</entry><entry>65</entry><entry>fqdn</entry><entry>false</entry></row>
  855. <row><entry>rsoo</entry><entry>66</entry><entry>empty</entry><entry>false</entry></row>
  856. <row><entry>client-linklayer-addr</entry><entry>79</entry><entry>binary</entry><entry>false</entry></row>
  857. </tbody>
  858. </tgroup>
  859. </table>
  860. </para>
  861. </section>
  862. <section id="dhcp6-custom-options">
  863. <title>Custom DHCPv6 options</title>
  864. <para>It is also possible to define options other than the standard ones.
  865. Assume that we want to define a new DHCPv6 option called "foo" which will have
  866. code 100 and will convey a single unsigned 32 bit integer value. We can define
  867. such an option by using the following commands:
  868. <screen>
  869. "Dhcp6": {
  870. "option-def": [
  871. {
  872. <userinput>"name": "foo",
  873. "code": 100,
  874. "type": "uint32",
  875. "array": false,
  876. "record-types": "",
  877. "space": "dhcp6",
  878. "encapsulate": ""</userinput>
  879. }, ...
  880. ],
  881. ...
  882. }
  883. </screen>
  884. The "false" value of the "array" parameter determines that the option does
  885. NOT comprise an array of "uint32" values but rather a single value. Two
  886. other parameters have been left blank: "record-types" and "encapsulate".
  887. The former specifies the comma separated list of option data fields if the
  888. option comprises a record of data fields. The "record-fields" value should
  889. be non-empty if the "type" is set to "record". Otherwise it must be left
  890. blank. The latter parameter specifies the name of the option space being
  891. encapsulated by the particular option. If the particular option does not
  892. encapsulate any option space it should be left blank. Note that the above
  893. set of comments define the format of the new option and do not set its
  894. values.
  895. </para>
  896. <para>Once the new option format is defined, its value is set
  897. in the same way as for a standard option. For example the following
  898. commands set a global value that applies to all subnets.
  899. <screen>
  900. "Dhcp6": {
  901. "option-data": [
  902. {
  903. <userinput>"name": "foo",
  904. "code": 100,
  905. "space": "dhcp6",
  906. "csv-format": true,
  907. "data": "12345"</userinput>
  908. }, ...
  909. ],
  910. ...
  911. }
  912. </screen>
  913. </para>
  914. <para>New options can take more complex forms than simple use of
  915. primitives (uint8, string, ipv6-address etc): it is possible to
  916. define an option comprising a number of existing primitives.
  917. </para>
  918. <para>
  919. Assume we want to define a new option that will consist of an IPv6
  920. address, followed by an unsigned 16 bit integer, followed by a
  921. boolean value, followed by a text string. Such an option could
  922. be defined in the following way:
  923. <screen>
  924. "Dhcp6": {
  925. "option-def": [
  926. {
  927. <userinput>"name": "bar",
  928. "code": 101,
  929. "space": "dhcp6",
  930. "type": "record",
  931. "array": false,
  932. "record-types": "ipv4-address, uint16, boolean, string",
  933. "encapsulate": ""</userinput>
  934. }, ...
  935. ],
  936. ...
  937. }
  938. </screen>
  939. The "type" is set to "record" to indicate that the option contains
  940. multiple values of different types. These types are given as a comma-separated
  941. list in the "record-types" field and should be those listed in <xref linkend="dhcp-types"/>.
  942. </para>
  943. <para>
  944. The values of the option are set as follows:
  945. <screen>
  946. "Dhcp6": {
  947. "option-data": [
  948. {
  949. <userinput>"name": "bar",
  950. "space": "dhcp6",
  951. "code": 101,
  952. "csv-format": true,
  953. "data": "2001:db8:1::10, 123, false, Hello World"</userinput>
  954. }
  955. ],
  956. ...
  957. }</screen>
  958. <command>csv-format</command> is set <command>true</command> to indicate
  959. that the <command>data</command> field comprises a command-separated list
  960. of values. The values in the "data" must correspond to the types set in
  961. the "record-types" field of the option definition.
  962. </para>
  963. <note>
  964. <para>In the general case, boolean values are specified as <command>true</command> or
  965. <command>false</command>, without quotes. Some specific boolean parameters may
  966. accept also <command>"true"</command>, <command>"false"</command>,
  967. <command>0</command>, <command>1</command>, <command>"0"</command> and
  968. <command>"1"</command>. Future Kea versions will accept all those values
  969. for all boolean parameters.</para>
  970. </note>
  971. </section>
  972. <section id="dhcp6-vendor-opts">
  973. <title>DHCPv6 vendor specific options</title>
  974. <para>
  975. Currently there are two option spaces defined for the DHCPv6
  976. daemon: "dhcp6" (for top level DHCPv6 options) and "vendor-opts-space",
  977. which is empty by default, but options can be defined in it.
  978. Those options will be carried in the Vendor-specific
  979. Information option (code 17). The following examples show how to
  980. define an option "foo" with code 1 that consists of an IPv6 address,
  981. an unsigned 16 bit integer and a string. The "foo" option is
  982. conveyed in a Vendor-specific Information option. This option
  983. comprises a single uint32 value that is set to "12345".
  984. The sub-option "foo" follows the data field holding this value.
  985. <screen>
  986. "Dhcp6": {
  987. "option-def": [
  988. {
  989. <userinput>"name": "foo",
  990. "code": 1,
  991. "space": "vendor-opts-space",
  992. "type": "record",
  993. "array": false,
  994. "record-types": "ipv6-address, uint16, string",
  995. "encapsulate": ""</userinput>
  996. }
  997. ],
  998. ...
  999. }</screen>
  1000. (Note that the option space is set to <command>vendor-opts-space</command>.)
  1001. Once the option format is defined, the next step is to define actual values
  1002. for that option:
  1003. <screen>
  1004. "Dhcp6": {
  1005. "option-data": [
  1006. {
  1007. <userinput>"name": "foo",
  1008. "space": "vendor-opts-space",
  1009. "data": "2001:db8:1::10, 123, Hello World"</userinput>
  1010. },
  1011. ...
  1012. ],
  1013. ...
  1014. }</screen>
  1015. We should also define a value (enterprise-number) for the
  1016. Vendor-specific Information option, that conveys our option "foo".
  1017. <screen>
  1018. "Dhcp6": {
  1019. "option-data": [
  1020. ...,
  1021. {
  1022. <userinput>"name": "vendor-opts",
  1023. "data": "12345"</userinput>
  1024. }
  1025. ],
  1026. ...
  1027. }</screen>
  1028. Alternatively, the option can be specified using its code.
  1029. <screen>
  1030. "Dhcp6": {
  1031. "option-data": [
  1032. ...,
  1033. {
  1034. <userinput>"code": 17,
  1035. "data": "12345"</userinput>
  1036. }
  1037. ],
  1038. ...
  1039. }</screen>
  1040. </para>
  1041. </section>
  1042. <section id="dhcp6-option-spaces">
  1043. <title>Nested DHCPv6 options (custom option spaces)</title>
  1044. <para>It is sometimes useful to define completely new option
  1045. spaces. This is useful if the user wants his new option to
  1046. convey sub-options that use a separate numbering scheme, for
  1047. example sub-options with codes 1 and 2. Those option codes
  1048. conflict with standard DHCPv6 options, so a separate option
  1049. space must be defined.
  1050. </para>
  1051. <para>Note that it is not required to create a new option space when
  1052. defining sub-options for a standard option because it is
  1053. created by default if the standard option is meant to convey
  1054. any sub-options (see <xref linkend="dhcp6-vendor-opts"/>).
  1055. </para>
  1056. <para>
  1057. Assume that we want to have a DHCPv6 option called "container"
  1058. with code 102 that conveys two sub-options with codes 1 and 2.
  1059. First we need to define the new sub-options:
  1060. <screen>
  1061. "Dhcp6": {
  1062. "option-def": [
  1063. {
  1064. <userinput>"name": "subopt1",
  1065. "code": 1,
  1066. "space": "isc",
  1067. "type": "ipv6-address",
  1068. "record-types": "",
  1069. "array": false,
  1070. "encapsulate": ""</userinput>
  1071. },
  1072. {
  1073. <userinput>"name": "subopt2",
  1074. "code": 2,
  1075. "space": "isc",
  1076. "type": "string",
  1077. "record-types": "",
  1078. "array": false
  1079. "encapsulate": ""</userinput>
  1080. }
  1081. ],
  1082. ...
  1083. }</screen>
  1084. Note that we have defined the options to belong to a new option space
  1085. (in this case, "isc").
  1086. </para>
  1087. <para>
  1088. The next step is to define a regular DHCPv6 option and specify that it
  1089. should include options from the isc option space:
  1090. <screen>
  1091. "Dhcp6": {
  1092. "option-def": [
  1093. ...,
  1094. {
  1095. <userinput>"name": "container",
  1096. "code": 102,
  1097. "space": "dhcp6",
  1098. "type": "empty",
  1099. "array": false,
  1100. "record-types": "",
  1101. "encapsulate": "isc"</userinput>
  1102. }
  1103. ],
  1104. ...
  1105. }</screen>
  1106. The name of the option space in which the sub-options are defined is set in
  1107. the <command>encapsulate</command> field. The <command>type</command> field
  1108. is set to <command>empty</command> which limits this option to only carrying
  1109. data in sub-options.
  1110. </para>
  1111. <para>
  1112. Finally, we can set values for the new options:
  1113. <screen>
  1114. "Dhcp6": {
  1115. "option-data": [
  1116. {
  1117. <userinput>"name": "subopt1",
  1118. "code": 1,
  1119. "space": "isc",
  1120. "data": "2001:db8::abcd"</userinput>
  1121. },
  1122. }
  1123. <userinput>"name": "subopt2",
  1124. "code": 2,
  1125. "space": "isc",
  1126. "data": "Hello world"</userinput>
  1127. },
  1128. {
  1129. <userinput>"name": "container",
  1130. "code": 102,
  1131. "space": "dhcp6"</userinput>
  1132. }
  1133. ],
  1134. ...
  1135. }
  1136. </screen>
  1137. </para>
  1138. <para>Note that it is possible to create an option which carries some data
  1139. in addition to the sub-options defined in the encapsulated option space.
  1140. For example, if the "container" option from the previous example was
  1141. required to carry an uint16 value as well as the sub-options, the "type"
  1142. value would have to be set to "uint16" in the option definition. (Such an
  1143. option would then have the following data structure: DHCP header, uint16
  1144. value, sub-options.) The value specified with the "data" parameter &mdash; which
  1145. should be a valid integer enclosed in quotes, e.g. "123" &mdash; would then be
  1146. assigned to the uint16 field in the "container" option.
  1147. </para>
  1148. </section>
  1149. <section id="dhcp6-option-data-defaults">
  1150. <title>Unspecified parameters for DHCPv6 option configuration</title>
  1151. <para>In many cases it is not required to specify all parameters for
  1152. an option configuration and the default values can be used. However, it is
  1153. important to understand the implications of not specifing some of them
  1154. as it may result in configuration errors. The list below explains
  1155. the behavior of the server when a particular parameter is not explicitly
  1156. specified:
  1157. <itemizedlist>
  1158. <listitem>
  1159. <simpara><command>name</command> - the server requires an option name or
  1160. option code to identify an option. If this parameter is unspecified, the
  1161. option code must be specified.
  1162. </simpara>
  1163. </listitem>
  1164. <listitem>
  1165. <simpara><command>code</command> - the server requires an option name or
  1166. option code to identify an option. This parameter may be left unspecified if
  1167. the <command>name</command> parameter is specified. However, this also
  1168. requires that the particular option has its definition (it is either a
  1169. standard option or an administrator created a definition for the option
  1170. using an 'option-def' structure), as the option definition associates an
  1171. option with a particular name. It is possible to configure an option
  1172. for which there is no definition (unspecified option format).
  1173. Configuration of such options requires the use of option code.
  1174. </simpara>
  1175. </listitem>
  1176. <listitem>
  1177. <simpara><command>space</command> - if the option space is unspecified it
  1178. will default to 'dhcp6' which is an option space holding DHCPv6 standard
  1179. options.
  1180. </simpara>
  1181. </listitem>
  1182. <listitem>
  1183. <simpara><command>data</command> - if the option data is unspecified it
  1184. defaults to an empty value. The empty value is mostly used for the
  1185. options which have no payload (boolean options), but it is legal to specify
  1186. empty values for some options which carry variable length data and which
  1187. spec allows for the length of 0. For such options, the data parameter
  1188. may be omitted in the configuration.</simpara>
  1189. </listitem>
  1190. <listitem>
  1191. <simpara><command>csv-format</command> - if this value is not specified
  1192. and the definition for the particular option exists, the server will assume
  1193. that the option data is specified as a list of comma separated values to be
  1194. assigned to individual fields of the DHCP option. If the definition
  1195. does not exist for this option, the server will assume that the data
  1196. parameter contains the option payload in the binary format (represented
  1197. as a string of hexadecimal digits). Note that not specifying this
  1198. parameter doesn't imply that it defaults to a fixed value, but
  1199. the configuration data interpretation also depends on the presence
  1200. of the option definition. An administrator must be aware if the
  1201. definition for the particular option exists when this parameter
  1202. is not specified. It is generally recommended to not specify this
  1203. parameter only for the options for which the definition exists, e.g.
  1204. standard options. Setting <command>csv-format</command> to an explicit
  1205. value will cause the server to strictly check the format of the option
  1206. data specified.
  1207. </simpara>
  1208. </listitem>
  1209. </itemizedlist>
  1210. </para>
  1211. </section>
  1212. <section id="dhcp6-config-subnets">
  1213. <title>IPv6 Subnet Selection</title>
  1214. <para>
  1215. The DHCPv6 server may receive requests from local (connected to the
  1216. same subnet as the server) and remote (connecting via relays) clients.
  1217. As the server may have many subnet configurations defined, it must select
  1218. an appropriate subnet for a given request.
  1219. </para>
  1220. <para>
  1221. The server can not assume which of the configured subnets are local. In IPv4
  1222. it is possible as there is a reasonable expectation that the
  1223. server will have a (global) IPv4 address configured on the interface,
  1224. and can use that information to detect whether a subnet is local or
  1225. not. That assumption is not true in IPv6, the DHCPv6 server must be able
  1226. to operate while only having link-local addresses. Therefore an optional
  1227. &quot;interface&quot; parameter is available within a subnet definition
  1228. to designate that a given subnet is local, i.e. reachable directly over
  1229. the specified interface. For example the server that is intended to serve
  1230. a local subnet over eth0 may be configured as follows:
  1231. <screen>
  1232. "Dhcp6": {
  1233. "subnet6": [
  1234. {
  1235. "subnet": "2001:db8:beef::/48",
  1236. "pools": [
  1237. {
  1238. "pool": "2001:db8:beef::/48"
  1239. }
  1240. ],
  1241. <userinput>"interface": "eth0"</userinput>
  1242. }
  1243. ],
  1244. ...
  1245. }
  1246. </screen>
  1247. </para>
  1248. </section>
  1249. <section id="dhcp6-rapid-commit">
  1250. <title>Rapid Commit</title>
  1251. <para>The Rapid Commit option, described in
  1252. <ulink url="http://tools.ietf.org/html/rfc3315">RFC 3315</ulink>, is supported
  1253. by the Kea DHCPv6 server. However, support is disabled by default for
  1254. all subnets. It can be enabled for a particular subnet using the
  1255. <command>rapid-commit</command> parameter as shown below:
  1256. <screen>
  1257. "Dhcp6": {
  1258. "subnet6": [
  1259. {
  1260. "subnet": "2001:db8:beef::/48",
  1261. <userinput>"rapid-commit": true</userinput>,
  1262. "pools": [
  1263. {
  1264. "pool": "2001:db8:beef::1-2001:db8:beef::10"
  1265. }
  1266. ],
  1267. }
  1268. ],
  1269. ...
  1270. }
  1271. </screen>
  1272. </para>
  1273. <para>
  1274. This setting only affects the subnet for which the
  1275. <command>rapid-commit</command> is set to <command>true</command>.
  1276. For clients connected to other subnets, the server will ignore the
  1277. Rapid Commit option sent by the client and will follow the 4-way
  1278. exchange procedure, i.e. respond with the Advertise for the Solicit
  1279. containing Rapid Commit option.
  1280. </para>
  1281. </section>
  1282. <section id="dhcp6-relays">
  1283. <title>DHCPv6 Relays</title>
  1284. <para>
  1285. A DHCPv6 server with multiple subnets defined must select the
  1286. appropriate subnet when it receives a request from a client. For clients
  1287. connected via relays, two mechanisms are used:
  1288. </para>
  1289. <para>
  1290. The first uses the linkaddr field in the RELAY_FORW message. The name
  1291. of this field is somewhat misleading in that it does not contain a link-layer
  1292. address: instead, it holds an address (typically a global address) that is
  1293. used to identify a link. The DHCPv6 server checks if the address belongs
  1294. to a defined subnet and, if it does, that subnet is selected for the client's
  1295. request.
  1296. </para>
  1297. <para>
  1298. The second mechanism is based on interface-id options. While forwarding a client's
  1299. message, relays may insert an interface-id option into the message that
  1300. identifies the interface on the relay that received the message. (Some
  1301. relays allow configuration of that parameter, but it is sometimes
  1302. hardcoded and may range from the very simple (e.g. "vlan100") to the very cryptic:
  1303. one example seen on real hardware was "ISAM144|299|ipv6|nt:vp:1:110"). The
  1304. server can use this information to select the appropriate subnet.
  1305. The information is also returned to the relay which then knows the
  1306. interface to use to transmit the response to the client. In order for
  1307. this to work successfully, the relay interface IDs must be unique within
  1308. the network and the server configuration must match those values.
  1309. </para>
  1310. <para>
  1311. When configuring the DHCPv6 server, it should be noted that two
  1312. similarly-named parameters can be configured for a subnet:
  1313. <itemizedlist>
  1314. <listitem><simpara>
  1315. "interface" defines which local network interface can be used
  1316. to access a given subnet.
  1317. </simpara></listitem>
  1318. <listitem><simpara>
  1319. "interface-id" specifies the content of the interface-id option
  1320. used by relays to identify the interface on the relay to which
  1321. the response packet is sent.
  1322. </simpara></listitem>
  1323. </itemizedlist>
  1324. The two are mutually exclusive: a subnet cannot be both reachable locally
  1325. (direct traffic) and via relays (remote traffic). Specifying both is a
  1326. configuration error and the DHCPv6 server will refuse such a configuration.
  1327. </para>
  1328. <para>
  1329. To specify interface-id with value "vlan123", the following commands can
  1330. be used:
  1331. <screen>
  1332. "Dhcp6": {
  1333. "subnet6": [
  1334. {
  1335. "subnet": "2001:db8:beef::/48",
  1336. "pools": [
  1337. {
  1338. "pool": "2001:db8:beef::/48"
  1339. }
  1340. ],
  1341. <userinput>"interface-id": "vlan123"</userinput>
  1342. }
  1343. ],
  1344. ...
  1345. }
  1346. </screen>
  1347. </para>
  1348. </section>
  1349. <section id="dhcp6-rsoo">
  1350. <title>Relay-Supplied Options</title>
  1351. <para><ulink url="http://tools.ietf.org/html/rfc6422">RFC 6422</ulink>
  1352. defines a mechanism called Relay-Supplied DHCP Options. In certain cases relay
  1353. agents are the only entities that may have specific information. They can
  1354. insert options when relaying messages from the client to the server. The
  1355. server will then do certain checks and copy those options to the response
  1356. that will be sent to the client.</para>
  1357. <para>There are certain conditions that must be met for the option to be
  1358. included. First, the server must not provide the option by itself. In
  1359. other words, if both relay and server provide an option, the server always
  1360. takes precedence. Second, the option must be RSOO-enabled. IANA mantains a
  1361. list of RSOO-enabled options <ulink url="http://www.iana.org/assignments/dhcpv6-parameters/dhcpv6-parameters.xhtml#options-relay-supplied">here</ulink>.
  1362. However, there may be cases when system administrators want to echo other
  1363. options. Kea can be instructed to treat other options as RSOO-enabled.
  1364. For example, to mark options 110, 120 and 130 as RSOO-enabled, the following
  1365. syntax should be used:
  1366. <screen>
  1367. "Dhcp6": {
  1368. <userinput>"relay-supplied-options": [ "110", "120", "130" ],</userinput>
  1369. ...
  1370. }
  1371. </screen>
  1372. </para>
  1373. <para>As of March 2015, only option 65 is RSOO-enabled by IANA. This
  1374. option will always be treated as such and there's no need to explicitly
  1375. mark it. Also, when enabling standard options, it is possible to use their
  1376. names, rather than option code, e.g. (e.g. use
  1377. <command>dns-servers</command> instead of <command>23</command>). See
  1378. <xref linkend="dhcp6-std-options-list" /> for the names. In certain cases
  1379. it could also work for custom options, but due to the nature of the parser
  1380. code this may be unreliable and should be avoided.
  1381. </para>
  1382. </section>
  1383. <section id="dhcp6-client-classifier">
  1384. <title>Client Classification in DHCPv6</title>
  1385. <note>
  1386. <para>
  1387. DHCPv6 server has been extended to support limited client classification.
  1388. Although the current capability is modest, it is expected to be expanded
  1389. in the future. It is envisaged that the majority of client classification
  1390. extensions will be using hooks extensions.
  1391. </para>
  1392. </note>
  1393. <para>In certain cases it is useful to differentiate between different types
  1394. of clients and treat them differently. The process of doing classification
  1395. is conducted in two steps. The first step is to assess an incoming packet and
  1396. assign it to zero or more classes. This classification is currently simple,
  1397. but is expected to grow in capability soon. Currently the server checks whether
  1398. the incoming packet includes vendor class option (16). If it has, the content
  1399. of that option is prepended with &quot;VENDOR_CLASS_&quot; then it is interpreted as a
  1400. class. For example, modern cable modems will send this option with value
  1401. &quot;docsis3.0&quot; and as a result the packet will belong to class
  1402. &quot;VENDOR_CLASS_docsis3.0&quot;.
  1403. </para>
  1404. <para>It is envisaged that the client classification will be used for changing
  1405. behavior of almost any part of the DHCP engine processing, including assigning
  1406. leases from different pools, assigning different option (or different values of
  1407. the same options) etc. For now, there is only one mechanism that is taking
  1408. advantage of client classification: subnet selection.</para>
  1409. <para>
  1410. Kea can be instructed to limit access to given subnets based on class information.
  1411. This is particularly useful for cases where two types of devices share the
  1412. same link and are expected to be served from two different subnets. The
  1413. primary use case for such a scenario are cable networks. There are two
  1414. classes of devices: the cable modem itself, which should be handed a lease
  1415. from subnet A and all other devices behind modems that should get a lease
  1416. from subnet B. That segregation is essential to prevent overly curious
  1417. users from playing with their cable modems. For details on how to set up
  1418. class restrictions on subnets, see <xref linkend="dhcp6-subnet-class"/>.
  1419. </para>
  1420. </section>
  1421. <section id="dhcp6-subnet-class">
  1422. <title>Limiting access to IPv6 subnet to certain classes</title>
  1423. <para>
  1424. In certain cases it beneficial to restrict access to certain subnets
  1425. only to clients that belong to a given class. For details on client
  1426. classes, see <xref linkend="dhcp6-client-classifier"/>. This is an
  1427. extension of a previous example from <xref linkend="dhcp6-address-config"/>.
  1428. Let's assume that the server is connected to a network segment that uses
  1429. the 2001:db8:1::/64 prefix. The Administrator of that network has
  1430. decided that addresses from range 2001:db8:1::1 to 2001:db8:1::ffff are
  1431. going to be managed by the Dhcp6 server. Only clients belonging to the
  1432. eRouter1.0 client class are allowed to use that pool. Such a
  1433. configuration can be achieved in the following way:
  1434. <screen>
  1435. "Dhcp6": {
  1436. "subnet6": [
  1437. {
  1438. "subnet": "2001:db8:1::/64",
  1439. "pools": [
  1440. {
  1441. "pool": "2001:db8:1::-2001:db8:1::ffff"
  1442. }
  1443. ],
  1444. <userinput>"client-class": "VENDOR_CLASS_eRouter1.0"</userinput>
  1445. }
  1446. ],
  1447. ...
  1448. }
  1449. </screen>
  1450. </para>
  1451. <para>
  1452. Care should be taken with client classification as it is easy for
  1453. clients that do not meet class criteria to be denied any service altogether.
  1454. </para>
  1455. </section>
  1456. <section id="dhcp6-ddns-config">
  1457. <title>Configuring DHCPv6 for DDNS</title>
  1458. <para>
  1459. As mentioned earlier, kea-dhcp6 can be configured to generate requests to
  1460. the DHCP-DDNS server (referred to here as "D2") to update
  1461. DNS entries. These requests are known as NameChangeRequests or NCRs.
  1462. Each NCR contains the following information:
  1463. <orderedlist>
  1464. <listitem><para>
  1465. Whether it is a request to add (update) or remove DNS entries
  1466. </para></listitem>
  1467. <listitem><para>
  1468. Whether the change requests forward DNS updates (AAAA records), reverse
  1469. DNS updates (PTR records), or both.
  1470. </para></listitem>
  1471. <listitem><para>
  1472. The FQDN, lease address, and DHCID
  1473. </para></listitem>
  1474. </orderedlist>
  1475. The parameters controlling the generation of NCRs for submission to D2
  1476. are contained in the "dhcp-ddns" section of kea-dhcp6
  1477. configuration. The mandatory parameters for the DHCP DDNS configuration
  1478. are <command>enable-updates</command> which is unconditionally
  1479. required, and <command>qualifying-suffix</command> which has no
  1480. default value and is required when <command>enable-updates</command>
  1481. is set to <command>true</command>.
  1482. The two (disabled and enabled) minimal DHCP DDNS configurations are:
  1483. <screen>
  1484. "Dhcp6": {
  1485. "dhcp-ddns": {
  1486. <userinput>"enable-updates": false</userinput>
  1487. },
  1488. ...
  1489. }
  1490. </screen>
  1491. and for example:
  1492. <screen>
  1493. "Dhcp6": {
  1494. "dhcp-ddns": {
  1495. <userinput>"enable-updates": true,
  1496. "qualifying-suffix": "example."</userinput>
  1497. },
  1498. ...
  1499. }
  1500. </screen>
  1501. The default values for the "dhcp-ddns" section are as follows:
  1502. <itemizedlist>
  1503. <listitem><simpara>
  1504. <command>"server-ip": "127.0.0.1"</command>
  1505. </simpara></listitem>
  1506. <listitem><simpara>
  1507. <command>"server-port": 53001</command>
  1508. </simpara></listitem>
  1509. <listitem><simpara>
  1510. <command>"sender-ip": ""</command>
  1511. </simpara></listitem>
  1512. <listitem><simpara>
  1513. <command>"sender-port": 0</command>
  1514. </simpara></listitem>
  1515. <listitem><simpara>
  1516. <command>"max-queue-size": 1024</command>
  1517. </simpara></listitem>
  1518. <listitem><simpara>
  1519. <command>"ncr-protocol": "UDP"</command>
  1520. </simpara></listitem>
  1521. <listitem><simpara>
  1522. <command>"ncr-format": "JSON"</command>
  1523. </simpara></listitem>
  1524. <listitem><simpara>
  1525. <command>"override-no-update": false</command>
  1526. </simpara></listitem>
  1527. <listitem><simpara>
  1528. <command>"override-client-update": false</command>
  1529. </simpara></listitem>
  1530. <listitem><simpara>
  1531. <command>"replace-client-name": false</command>
  1532. </simpara></listitem>
  1533. <listitem><simpara>
  1534. <command>"generated-prefix": "myhost"</command>
  1535. </simpara></listitem>
  1536. </itemizedlist>
  1537. </para>
  1538. <section id="dhcpv6-d2-io-config">
  1539. <title>DHCP-DDNS Server Connectivity</title>
  1540. <para>
  1541. In order for NCRs to reach the D2 server, kea-dhcp6 must be able
  1542. to communicate with it. kea-dhcp6 uses the following configuration
  1543. parameters to control how it communications with D2:
  1544. <itemizedlist>
  1545. <listitem><simpara>
  1546. <command>enable-updates</command> - determines whether or not kea-dhcp6 will
  1547. generate NCRs. If missing, this value is assumed to be false hence DDNS updates
  1548. are disabled. To enable DDNS updates set this value to true:
  1549. </simpara></listitem>
  1550. <listitem><simpara>
  1551. <command>server-ip</command> - IP address on which D2 listens for requests. The default is
  1552. the local loopback interface at address 127.0.0.1. You may specify
  1553. either an IPv4 or IPv6 address.
  1554. </simpara></listitem>
  1555. <listitem><simpara>
  1556. <command>server-port</command> - port on which D2 listens for requests. The default value
  1557. is 53001.
  1558. </simpara></listitem>
  1559. <listitem><simpara>
  1560. <command>sender-ip</command> - IP address which kea-dhcp6 should use to send requests to D2.
  1561. The default value is blank which instructs kea-dhcp6 to select a suitable
  1562. address.
  1563. </simpara></listitem>
  1564. <listitem><simpara>
  1565. <command>sender-port</command> - port which kea-dhcp6 should use to send requests to D2. The
  1566. default value of 0 instructs kea-dhcp6 to select a suitable port.
  1567. </simpara></listitem>
  1568. <listitem><simpara>
  1569. <command>max-queue-size</command> - maximum number of requests allowed to queue waiting to
  1570. be sent to D2. This value guards against requests accumulating
  1571. uncontrollably if they are being generated faster than they can be
  1572. delivered. If the number of requests queued for transmission reaches
  1573. this value, DDNS updating will be turned off until the queue backlog has
  1574. been sufficiently reduced. The intent is to allow kea-dhcp6 to
  1575. continue lease operations. The default value is 1024.
  1576. </simpara></listitem>
  1577. <listitem><simpara>
  1578. <command>ncr-format</command> - Socket protocol use when sending requests to D2. Currently
  1579. only UDP is supported. TCP may be available in an upcoming release.
  1580. </simpara></listitem>
  1581. <listitem><simpara>
  1582. <command>ncr-protocol</command> - Packet format to use when sending requests to D2.
  1583. Currently only JSON format is supported. Other formats may be available
  1584. in future releases.
  1585. </simpara></listitem>
  1586. </itemizedlist>
  1587. By default, kea-dhcp-ddns is assumed to running on the same machine as kea-dhcp6, and
  1588. all of the default values mentioned above should be sufficient.
  1589. If, however, D2 has been configured to listen on a different address or
  1590. port, these values must altered accordingly. For example, if D2 has been
  1591. configured to listen on 2001:db8::5 port 900, the following commands
  1592. would be required:
  1593. <screen>
  1594. "Dhcp6": {
  1595. "dhcp-ddns": {
  1596. <userinput>"server-ip": "2001:db8::5",
  1597. "server-port": 900</userinput>,
  1598. ...
  1599. },
  1600. ...
  1601. }
  1602. </screen>
  1603. </para>
  1604. </section>
  1605. <section id="dhcpv6-d2-rules-config">
  1606. <title>When does kea-dhcp6 generate DDNS request</title>
  1607. <para>kea-dhcp6 follows the behavior prescribed for DHCP servers in
  1608. <ulink url="http://tools.ietf.org/html/rfc4704">RFC 4704</ulink>.
  1609. It is important to keep in mind that kea-dhcp6 provides the initial
  1610. decision making of when and what to update and forwards that
  1611. information to D2 in the form of NCRs. Carrying out the actual
  1612. DNS updates and dealing with such things as conflict resolution
  1613. are the purview of D2 (<xref linkend="dhcp-ddns-server"/>).</para>
  1614. <para>
  1615. This section describes when kea-dhcp6 will generate NCRs and the
  1616. configuration parameters that can be used to influence this decision.
  1617. It assumes that the "enable-updates" parameter is true.
  1618. </para>
  1619. <note>
  1620. <para>
  1621. Currently the interface between kea-dhcp6 and D2 only supports requests
  1622. which update DNS entries for a single IP address. If a lease grants
  1623. more than one address, kea-dhcp6 will create the DDNS update request for
  1624. only the first of these addresses. Support for multiple address
  1625. mappings may be provided in a future release.
  1626. </para>
  1627. </note>
  1628. <para>
  1629. In general, kea-dhcp6 will generate DDNS update requests when:
  1630. <orderedlist>
  1631. <listitem><para>
  1632. A new lease is granted in response to a DHCP REQUEST
  1633. </para></listitem>
  1634. <listitem><para>
  1635. An existing lease is renewed but the FQDN associated with it has
  1636. changed.
  1637. </para></listitem>
  1638. <listitem><para>
  1639. An existing lease is released in response to a DHCP RELEASE
  1640. </para></listitem>
  1641. </orderedlist>
  1642. In the second case, lease renewal, two DDNS requests will be issued: one
  1643. request to remove entries for the previous FQDN and a second request to
  1644. add entries for the new FQDN. In the last case, a lease release, a
  1645. single DDNS request to remove its entries will be made. The decision
  1646. making involved when granting a new lease is more involved and is
  1647. discussed next.
  1648. </para>
  1649. <para>
  1650. kea-dhcp6 will generate a DDNS update request only if the DHCP REQUEST
  1651. contains the FQDN option (code 39). By default kea-dhcp6 will
  1652. respect the FQDN N and S flags specified by the client as shown in the
  1653. following table:
  1654. </para>
  1655. <table id="dhcp6-fqdn-flag-table">
  1656. <title>Default FQDN Flag Behavior</title>
  1657. <tgroup cols='4' align='left'>
  1658. <colspec colname='cflags'/>
  1659. <colspec colname='meaning'/>
  1660. <colspec colname='response'/>
  1661. <colspec colname='sflags'/>
  1662. <thead>
  1663. <row>
  1664. <entry>Client Flags:N-S</entry>
  1665. <entry>Client Intent</entry>
  1666. <entry>Server Response</entry>
  1667. <entry>Server Flags:N-S-O</entry>
  1668. </row>
  1669. </thead>
  1670. <tbody>
  1671. <row>
  1672. <entry>0-0</entry>
  1673. <entry>
  1674. Client wants to do forward updates, server should do reverse updates
  1675. </entry>
  1676. <entry>Server generates reverse-only request</entry>
  1677. <entry>1-0-0</entry>
  1678. </row>
  1679. <row>
  1680. <entry>0-1</entry>
  1681. <entry>Server should do both forward and reverse updates</entry>
  1682. <entry>Server generates request to update both directions</entry>
  1683. <entry>0-1-0</entry>
  1684. </row>
  1685. <row>
  1686. <entry>1-0</entry>
  1687. <entry>Client wants no updates done</entry>
  1688. <entry>Server does not generate a request</entry>
  1689. <entry>1-0-0</entry>
  1690. </row>
  1691. </tbody>
  1692. </tgroup>
  1693. </table>
  1694. <para>
  1695. The first row in the table above represents "client delegation". Here
  1696. the DHCP client states that it intends to do the forward DNS updates and
  1697. the server should do the reverse updates. By default, kea-dhcp6 will honor
  1698. the client's wishes and generate a DDNS request to D2 to update only
  1699. reverse DNS data. The parameter, "override-client-update", can be used
  1700. to instruct the server to override client delegation requests. When
  1701. this parameter is true, kea-dhcp6 will disregard requests for client
  1702. delegation and generate a DDNS request to update both forward and
  1703. reverse DNS data. In this case, the N-S-O flags in the server's
  1704. response to the client will be 0-1-1 respectively.
  1705. </para>
  1706. <para>
  1707. (Note that the flag combination N=1, S=1 is prohibited according to
  1708. RFC 4702. If such a combination is received from the client, the packet
  1709. will be dropped by kea-dhcp6.)
  1710. </para>
  1711. <para>
  1712. To override client delegation, issue the following commands:
  1713. </para>
  1714. <screen>
  1715. "Dhcp6": {
  1716. "dhcp-ddns": {
  1717. <userinput>"override-client-update": true</userinput>,
  1718. ...
  1719. },
  1720. ...
  1721. }
  1722. </screen>
  1723. <para>
  1724. The third row in the table above describes the case in which the client
  1725. requests that no DNS updates be done. The parameter, "override-no-update",
  1726. can be used to instruct the server to disregard the client's wishes. When
  1727. this parameter is true, kea-dhcp6 will generate DDNS update requests to
  1728. kea-dhcp-ddns even if the client requests no updates be done. The N-S-O
  1729. flags in the server's response to the client will be 0-1-1.
  1730. </para>
  1731. <para>
  1732. To override client delegation, issue the following commands:
  1733. </para>
  1734. <screen>
  1735. "Dhcp6": {
  1736. "dhcp-ddns": {
  1737. <userinput>"override-no-update": true</userinput>,
  1738. ...
  1739. },
  1740. ...
  1741. }
  1742. </screen>
  1743. </section>
  1744. <section id="dhcpv6-fqdn-name-generation">
  1745. <title>kea-dhcp6 name generation for DDNS update requests</title>
  1746. <para>Each NameChangeRequest must of course include the fully qualified domain
  1747. name whose DNS entries are to be affected. kea-dhcp6 can be configured to
  1748. supply a portion or all of that name based upon what it receives from
  1749. the client in the DHCP REQUEST.</para>
  1750. <para>The rules for determining the FQDN option are as follows:
  1751. <orderedlist>
  1752. <listitem><para>
  1753. If configured to do so ignore the REQUEST contents and generate a
  1754. FQDN using a configurable prefix and suffix.
  1755. </para></listitem>
  1756. <listitem><para>
  1757. Otherwise, using the domain name value from the client FQDN option as
  1758. the candidate name:
  1759. <orderedlist>
  1760. <listitem><para>
  1761. If the candidate name is a fully qualified domain name then use it.
  1762. </para></listitem>
  1763. <listitem><para>
  1764. If the candidate name is a partial (i.e. unqualified) name then
  1765. add a configurable suffix to the name and use the result as the FQDN.
  1766. </para></listitem>
  1767. <listitem><para>
  1768. If the candidate name is a empty then generate a FQDN using a
  1769. configurable prefix and suffix.
  1770. </para></listitem>
  1771. </orderedlist>
  1772. </para></listitem>
  1773. </orderedlist>
  1774. To instruct kea-dhcp6 to always generate a FQDN, set the parameter
  1775. "replace-client-name" to true:
  1776. </para>
  1777. <screen>
  1778. "Dhcp6": {
  1779. "dhcp-ddns": {
  1780. <userinput>"replace-client-name": true</userinput>,
  1781. ...
  1782. },
  1783. ...
  1784. }
  1785. </screen>
  1786. <para>
  1787. The prefix used when generating a FQDN is specified by the
  1788. "generated-prefix" parameter. The default value is "myhost". To alter
  1789. its value, simply set it to the desired string:
  1790. </para>
  1791. <screen>
  1792. "Dhcp6": {
  1793. "dhcp-ddns": {
  1794. <userinput>"generated-prefix": "another.host"</userinput>,
  1795. ...
  1796. },
  1797. ...
  1798. }
  1799. </screen>
  1800. <para>
  1801. The suffix used when generating a FQDN or when qualifying a
  1802. partial name is specified by
  1803. the <command>qualifying-suffix</command> parameter. This
  1804. parameter has no default value, thus it is mandatory when
  1805. DDNS updates are enabled.
  1806. To set its value simply set it to the desired string:
  1807. </para>
  1808. <screen>
  1809. "Dhcp6": {
  1810. "dhcp-ddns": {
  1811. <userinput>"qualifying-suffix": "foo.example.org"</userinput>,
  1812. ...
  1813. },
  1814. ...
  1815. }
  1816. </screen>
  1817. </section>
  1818. <para>
  1819. When qualifying a partial name, kea-dhcp6 will construct a name with the
  1820. format:
  1821. </para>
  1822. <para>
  1823. [candidate-name].[qualifying-suffix].
  1824. </para>
  1825. <para>
  1826. where candidate-name is the partial name supplied in the REQUEST.
  1827. For example, if FQDN domain name value was "some-computer" and
  1828. qualifying-suffix "example.com", the generated FQDN would be:
  1829. </para>
  1830. <para>
  1831. some-computer.example.com.
  1832. </para>
  1833. <para>
  1834. When generating the entire name, kea-dhcp6 will construct name of the
  1835. format:
  1836. </para>
  1837. <para>
  1838. [generated-prefix]-[address-text].[qualifying-suffix].
  1839. </para>
  1840. <para>
  1841. where address-text is simply the lease IP address converted to a
  1842. hyphenated string. For example, if lease address is 3001:1::70E,
  1843. the qualifying suffix "example.com", and the default value is used for
  1844. <command>generated-prefix</command>, the generated FQDN would be:
  1845. </para>
  1846. <para>
  1847. myhost-3001-1--70E.example.com.
  1848. </para>
  1849. </section>
  1850. </section>
  1851. <!-- Host reservation is a large topic. There will be many subsections,
  1852. so it should be a section on its own. -->
  1853. <section id="host-reservation-v6">
  1854. <title>Host reservation in DHCPv6</title>
  1855. <para>There are many cases where it is useful to provide a configuration on
  1856. a per host basis. The most obvious one is to reserve specific, static IPv6
  1857. address or/and prefix for exclusive use by a given client (host) &dash; returning
  1858. client will get the same address or/and prefix every time and other clients will
  1859. never get that address. Note that there may be cases when the
  1860. new reservation has been made for the client for the address or prefix being
  1861. currently in use by another client. We call this situation a "conflict". The
  1862. conflicts get resolved automatically over time as described in the subsequent
  1863. sections. Once conflict is resolved, the client will keep receiving the reserved
  1864. configuration when it renews.</para>
  1865. <para>Another example when the host reservations are applicable is when a host
  1866. that has specific requirements, e.g. a printer that needs additional DHCP options
  1867. or a cable modem needs specific parameters. Yet another possible use case for
  1868. host reservation is to define unique names for hosts. Although not all of
  1869. the presented use cases are are implemented yet, Kea software will support them
  1870. in the near future.</para>
  1871. <para>Hosts reservations are defined as parameters for each subnet. Each host
  1872. can be identified by either DUID or its hardware/MAC address. See
  1873. <xref linkend="mac-in-dhcpv6"/> for details. There is an optional
  1874. <command>reservations</command> array in the
  1875. <command>Subnet6</command> structure. Each element in that array
  1876. is a structure, that holds information about a single host. In
  1877. particular, such a structure has to have an indentifer that
  1878. uniquely identifies a host. In DHCPv6 context, such an identifier
  1879. is a hardware (MAC) address or a DUID. Also, either one or more
  1880. addresses or prefixes should be specified. It is possible to
  1881. specify a hostname. Additional capabilities are planned.</para>
  1882. <para>The following example shows how to reserve addresses and prefixes
  1883. for specific hosts:
  1884. <screen>
  1885. "subnet6": [
  1886. {
  1887. "subnet": "2001:db8:1::/48",
  1888. "pools": [ { "pool": "2001:db8:1::/80" } ],
  1889. "pd-pools": [
  1890. {
  1891. "prefix": "2001:db8:1:8000::",
  1892. "prefix-len": 56,
  1893. "delegated-len": 64
  1894. }
  1895. ],
  1896. <userinput>"reservations": [
  1897. {
  1898. "duid": "01:02:03:04:05:0A:0B:0C:0D:0E",
  1899. "ip-addresses": [ "2001:db8:1::100" ]
  1900. },
  1901. {
  1902. "hw-address": "00:01:02:03:04:05",
  1903. "ip-addresses": [ "2001:db8:1::101" ]
  1904. },
  1905. {
  1906. "duid": "01:02:03:04:05:06:07:08:09:0A",
  1907. "ip-addresses": [ "2001:db8:1::102" ],
  1908. "prefixes": [ "2001:db8:2:abcd::/64" ],
  1909. "hostname": "foo.example.com"
  1910. }
  1911. ]</userinput>
  1912. }
  1913. ]
  1914. </screen>
  1915. This example makes 3 reservations. The first one reserves 2001:db8:1::100 address
  1916. for the client using DUID 01:02:03:04:05:0A:0B:0C:0D:0E. The second one
  1917. also reserves an address, but does so using MAC or hardware address, rather than
  1918. DUID. The third example is most advanced. It reserves an address, a prefix and
  1919. a hostname at the same time.
  1920. </para>
  1921. <para>Note that DHCPv6 allows for a single client to lease multiple addresses
  1922. and multiple prefixes at the same time. In the upcoming Kea releases, it will
  1923. be possible to have multiple addresses and prefixes reserved for a single
  1924. host. Therefore <command>ip-addresses</command> and <command>prefixes</command>
  1925. are plural and are actually arrays. As of 0.9.1 having more than one IPv6
  1926. address or prefix is only partially supported.</para>
  1927. <para>Making a reservation for a mobile host that may visit multiple subnets
  1928. requires a separate host definition in each subnet it is expected to visit.
  1929. It is not allowed to define multiple host definitions with the same hardware
  1930. address in a single subnet. It is a valid configuration, if such definitions
  1931. are specified in different subnets, though. The reservation for a given host
  1932. should include only one identifier, either DUID or hwardware address. Defining
  1933. both for the same host is considered a configuration error, but as of 0.9.1
  1934. beta, it is not rejected.
  1935. </para>
  1936. <para>Adding host reservation incurs a performance penalty. In principle,
  1937. when the server that does not support host reservation responds to a query,
  1938. it needs to check whether there is a lease for a given address being
  1939. considered for allocation or renewal. The server that also supports host
  1940. reservation, has to perform additional checks: not only if the address is
  1941. currently used (if there is a lease for it), but also whether the address
  1942. could be used by someone else (if there is a reservation for it). That
  1943. additional check incurs performance penalty.</para>
  1944. <section id="reservation6-types">
  1945. <title>Address/prefix reservation types</title>
  1946. <para>In a typical scenario there's an IPv6 subnet defined with a certain
  1947. part of it dedicated for dynamic address allocation by the DHCPv6
  1948. server. There may be an additional address space defined for prefix
  1949. delegation. Those dynamic parts are referred to as dynamic pools, address
  1950. and prefix pools or simply pools. In principle, the host reservation can
  1951. reserve any address or prefix that belongs to the subnet. The reservations
  1952. that specify an address that belongs to configured pools are called
  1953. <command>in-pool reservations</command>. In contrast, those that do not
  1954. belong to dynamic pools are called <command>out-of-pool
  1955. reservations</command>. There is no formal difference in the reservation
  1956. syntax. As of 0.9.1, both reservation types are handled
  1957. uniformly. However, upcoming releases may offer improved performance if
  1958. there are only out-of-pool reservations as the server will be able to skip
  1959. reservation checks when dealing with existing leases. Therefore, system
  1960. administrators are encouraged to use out-of-pool reservations, if
  1961. possible.</para>
  1962. </section>
  1963. <section id="reservation6-conflict">
  1964. <title>Conflicts in DHCPv6 reservations</title>
  1965. <para>As reservations and lease information are stored in different places,
  1966. conflicts may arrise. Consider the following series of events. The server
  1967. has configured the dynamic pool of addresses from the range of 2001:db8::10
  1968. to 2001:db8::20. Host A requests an address and gets 2001:db8::10. Now the
  1969. system administrator decides to reserve an address for host B. He decides
  1970. to reserve 2001:db8::10 for that purpose. In general, reserving an address
  1971. that is currently assigned to someone else is not recommended, but there
  1972. are valid use cases where such an operation is warranted.</para>
  1973. <para>The server now has a conflict to resolve. Let's analyze the
  1974. situation here. If host B boots up and request an address, the server is
  1975. not able to assign the reserved address 2001:db8::10. A naive approach
  1976. would to be immediately remove the lease for host A and create a new one
  1977. for host B. That would not solve the problem, though, because as soon as
  1978. host B get the address, it will detect that the address is already in use
  1979. by someone else (host A) and would send Decline. Therefore in this
  1980. situation, the server has to temporarily assign a different address from the
  1981. dynamic pool (not matching what has been reserved) to host B.</para>
  1982. <para>When the host A renews its address, the server will discover that
  1983. the address being renewed is now reserved for someone else (host
  1984. B). Therefore the server will remove the lease for 2001:db8::10 and select
  1985. a new address and will create a new lease for it. It will send two
  1986. addresses in its response: the old address with lifetimes set to 0 to
  1987. explicitly indicate that it is no longer valid and a new address with
  1988. non-zero lifetimes. When the host B renews its temporarily assigned
  1989. address, the server will detect that the existing lease does not match
  1990. reservation, so it will release the current address host B has and will
  1991. create a new lease matching the reservation. Similar as before, the server
  1992. will send two addresses: the temporarily assigned one with zeroed
  1993. lifetimes, and the new one that matches reservation with proper lifetimes
  1994. set.</para>
  1995. <para>This recovery will succeed, even if other hosts will attempt to get
  1996. the reserved address. Had the host C requested address 2001:db8::10 after
  1997. the reservation was made, the server will propose a different address.</para>
  1998. <para>This recovery mechanism allows the server to fully recover from a
  1999. case where reservations conflict with existing leases. This procedure
  2000. takes time and will roughly take as long as renew-timer value specified.
  2001. The best way to avoid such recovery is to not define new reservations that
  2002. conflict with existing leases. Another recommendation is to use
  2003. out-of-pool reservations. If the reserved address does not belong to a
  2004. pool, there is no way that other clients could get this address (note that
  2005. having multiple reservations for the same address is not allowed).
  2006. </para>
  2007. </section>
  2008. <section id="reservation6-hostname">
  2009. <title>Reserving a hostname</title>
  2010. <para>When the reservation for the client includes the <command>hostname
  2011. </command>, the server will assign this hostname to the client and send
  2012. it back in the Client FQDN, if the client sent the FQDN option to the
  2013. the server. The reserved hostname always takes precedence over the hostname
  2014. supplied by the client (via the FQDN option) or the autogenerated
  2015. (from the IPv6 address) hostname.</para>
  2016. <para>The server qualifies the reserved hostname with the value
  2017. of the <command>qualifying-suffix</command> parameter. For example, the
  2018. following subnet configuration:
  2019. <screen>
  2020. "subnet6": [
  2021. {
  2022. "subnet": "2001:db8:1::/48",
  2023. "pools": [ { "pool": "2001:db8:1::/80" } ],
  2024. "reservations": [
  2025. {
  2026. "duid": "01:02:03:04:05:0A:0B:0C:0D:0E",
  2027. "ip-addresses": [ "2001:db8:1::100" ]
  2028. "hostname": "alice-laptop"
  2029. }
  2030. ]
  2031. }
  2032. ],
  2033. "dhcp-ddns": {
  2034. "enable-updates": true,
  2035. "qualifying-suffix": "example.isc.org."
  2036. }
  2037. </screen>
  2038. will result in assigning the "alice-laptop.example.isc.org." hostname to the
  2039. client using the DUID "01:02:03:04:05:0A:0B:0C:0D:0E". If the <command>qualifying-suffix
  2040. </command> is not specified, the default (empty) value will be used, and
  2041. in this case the value specified as a <command>hostname</command> will
  2042. be treated as fully qualified name. Thus, by leaving the
  2043. <command>qualifying-suffix</command> empty it is possible to qualify
  2044. hostnames for the different clients with different domain names:
  2045. <screen>
  2046. "subnet6": [
  2047. {
  2048. "subnet": "2001:db8:1::/48",
  2049. "pools": [ { "pool": "2001:db8:1::/80" } ],
  2050. "reservations": [
  2051. {
  2052. "duid": "01:02:03:04:05:0A:0B:0C:0D:0E",
  2053. "ip-addresses": [ "2001:db8:1::100" ]
  2054. "hostname": "mark-desktop.example.org."
  2055. }
  2056. ]
  2057. }
  2058. ],
  2059. "dhcp-ddns": {
  2060. "enable-updates": true,
  2061. }
  2062. </screen>
  2063. will result in assigning the "mark-desktop.example.org." hostname to the
  2064. client using the DUID "01:02:03:04:05:0A:0B:0C:0D:0E".
  2065. </para>
  2066. </section>
  2067. <section id="reservation6-options">
  2068. <title>Reserving specific options</title>
  2069. <!-- @todo: replace this with the actual text once #3573 is implemented -->
  2070. <para>Currently it is not possible to specify options in host
  2071. reservation. Such a feature will be added in the upcoming Kea
  2072. releases.</para>
  2073. </section>
  2074. <section id="reservation6-mode">
  2075. <title>Fine Tuning IPv6 Host Reservation</title>
  2076. <note>
  2077. <para><command>reservation-mode</command> in the DHCPv6 server is
  2078. implemented in Kea 0.9.1 beta, but has not been tested and is
  2079. considered experimental.</para>
  2080. </note>
  2081. <para>Host reservation capability introduces additional restrictions for the
  2082. allocation engine during lease selection and renewal. In particular, three
  2083. major checks are necessary. First, when selecting a new lease, it is not
  2084. sufficient for a candidate lease to be not used by another DHCP client. It
  2085. also must not be reserved for another client. Second, when renewing a lease,
  2086. additional check must be performed whether the address being renewed is not
  2087. reserved for another client. Finally, when a host renews an address or a
  2088. prefix, the server has to check whether there's a reservation for this host,
  2089. so the existing (dynamically allocated) address should be revoked and the
  2090. reserved one be used instead.</para>
  2091. <para>Some of those checks may be unnecessary in certain deployments. Not
  2092. performing them may improve performance. The Kea server provides the
  2093. <command>reservation-mode</command> configuration parameter to select the
  2094. types of reservations allowed for the particular subnet. Each reservation
  2095. type has different constraints for the checks to be performed by the
  2096. server when allocating or renewing a lease for the client.
  2097. Allowed values are:
  2098. <itemizedlist>
  2099. <listitem><simpara> <command>all</command> - enables all host reservation
  2100. types. This is the default value. This setting is the safest and the most
  2101. flexible. It allows in-pool and out-of-pool reservations. As all checks
  2102. are conducted, it is also the slowest.
  2103. </simpara></listitem>
  2104. <listitem><simpara> <command>out-of-pool</command> - allows only out of
  2105. pool host reservations. With this setting in place, the server may assume
  2106. that all host reservations are for addresses that do not belong to the
  2107. dynamic pool. Therefore it can skip the reservation checks when dealing
  2108. with in-pool addresses, thus improving performance. Do not use this mode
  2109. if any of your reservations use in-pool address. Caution is advised when
  2110. using this setting. Kea 0.9.1 does not sanity check the reservations against
  2111. <command>reservation-mode</command>. Misconfiguration may cause problems.
  2112. </simpara></listitem>
  2113. <listitem><simpara>
  2114. <command>disabled</command> - host reservation support is disabled. As there
  2115. are no reservations, the server will skip all checks. Any reservations defined
  2116. will be completely ignored. As the checks are skipped, the server may
  2117. operate faster in this mode.
  2118. </simpara></listitem>
  2119. </itemizedlist>
  2120. </para>
  2121. <para>
  2122. An example configuration that disables reservation looks like follows:
  2123. <screen>
  2124. "Dhcp6": {
  2125. "subnet6": [
  2126. {
  2127. "subnet": "2001:db8:1::/64",
  2128. <userinput>"reservation-mode": "disabled"</userinput>,
  2129. ...
  2130. }
  2131. ]
  2132. }
  2133. </screen>
  2134. </para>
  2135. </section>
  2136. <!-- @todo: add support for per IA reservation (that specifies IAID in
  2137. the ip-addresses and prefixes) -->
  2138. </section>
  2139. <!-- end of host reservations section -->
  2140. <section id="dhcp6-serverid">
  2141. <title>Server Identifier in DHCPv6</title>
  2142. <para>The DHCPv6 protocol uses a "server identifier" (also known
  2143. as a DUID) for clients to be able to discriminate between several
  2144. servers present on the same link. There are several types of
  2145. DUIDs defined, but <ulink url="http://tools.ietf.org/html/rfc3315">RFC 3315</ulink> instructs servers to use DUID-LLT if
  2146. possible. This format consists of a link-layer (MAC) address and a
  2147. timestamp. When started for the first time, the DHCPv6 server will
  2148. automatically generate such a DUID and store the chosen value to
  2149. a file. That file is read by the server
  2150. and the contained value used whenever the server is subsequently started.
  2151. </para>
  2152. <para>
  2153. It is unlikely that this parameter should ever need to be changed.
  2154. However, if such a need arises, stop the server, edit the file and restart
  2155. the server. (The file is named kea-dhcp6-serverid and by default is
  2156. stored in the "var" subdirectory of the directory in which Kea is installed.
  2157. This can be changed when Kea is built by using "--localstatedir"
  2158. on the "configure" command line.) The file is a text file that contains
  2159. double digit hexadecimal values
  2160. separated by colons. This format is similar to typical MAC address
  2161. format. Spaces are ignored. No extra characters are allowed in this
  2162. file.
  2163. </para>
  2164. </section>
  2165. <section id="stateless-dhcp6">
  2166. <title>Stateless DHCPv6 (Information-Request Message)</title>
  2167. <para>Typically DHCPv6 is used to assign both addresses and options. These
  2168. assignments (leases) have state that changes over time, hence
  2169. their name, stateful. DHCPv6 also supports a stateless mode,
  2170. where clients request configuration options only. This mode is
  2171. considered lightweight from the server perspective, as it does not require
  2172. any state tracking; hence its name.</para>
  2173. <para>The Kea server supports stateless mode. Clients can send
  2174. Information-Request messages and the server will send back
  2175. answers with the requested options (providing the options are
  2176. available in the server configuration). The server will attempt to
  2177. use per-subnet options first. If that fails - for whatever reason - it
  2178. will then try to provide options defined in the global scope.</para>
  2179. <para>Stateless and stateful mode can be used together. No special
  2180. configuration directives are required to handle this. Simply use the
  2181. configuration for stateful clients and the stateless clients will get
  2182. just options they requested.</para>
  2183. <para>This usage of global options allows for an interesting case.
  2184. It is possible to run a server that provides just options and no
  2185. addresses or prefixes. If the options have the same value in each
  2186. subnet, the configuration can define required options in the global
  2187. scope and skip subnet definitions altogether. Here's a simple example of
  2188. such a configuration:
  2189. <screen>
  2190. "Dhcp6": {
  2191. "interfaces-config": {
  2192. "interfaces": [ "ethX" ]
  2193. },
  2194. <userinput>"option-data": [ {
  2195. "name": "dns-servers",
  2196. "data": "2001:db8::1, 2001:db8::2"
  2197. } ]</userinput>,
  2198. "lease-database": { "type": "memfile" }
  2199. }
  2200. </screen>
  2201. This very simple configuration will provide DNS server information
  2202. to all clients in the network, regardless of their location. Note the
  2203. specification of the memfile lease database: this is required since,
  2204. as of version 0.9.1, Kea requires a lease database to be specified
  2205. even if it is not used.</para>
  2206. </section>
  2207. <section id="dhcp6-relay-override">
  2208. <title>Using specific relay agent for a subnet</title>
  2209. <para>
  2210. The relay has to have an interface connected to the link on which
  2211. the clients are being configured. Typically the relay has a global IPv6
  2212. address configured on the interface that belongs to the subnet from which
  2213. the server will assign addresses. In the typical case, the
  2214. server is able to use the IPv6 address inserted by the relay (in the link-addr
  2215. field in RELAY-FORW message) to select the appropriate subnet.
  2216. </para>
  2217. <para>
  2218. However, that is not always the case. The relay
  2219. address may not match the subnet in certain deployments. This
  2220. usually means that there is more than one subnet allocated for a given
  2221. link. The two most common examples where this is the case are long lasting
  2222. network renumbering (where both old and new address space is still being
  2223. used) and a cable network. In a cable network both cable modems and the
  2224. devices behind them are physically connected to the same link, yet
  2225. they use distinct addressing. In such case, the DHCPv6 server needs
  2226. additional information (like the value of interface-id option or IPv6
  2227. address inserted in the link-addr field in RELAY-FORW message) to
  2228. properly select an appropriate subnet.
  2229. </para>
  2230. <para>
  2231. The following example assumes that there is a subnet 2001:db8:1::/64
  2232. that is accessible via relay that uses 3000::1 as its IPv6 address.
  2233. The server will be able to select this subnet for any incoming packets
  2234. that came from a relay that has an address in 2001:db8:1::/64 subnet.
  2235. It will also select that subnet for a relay with address 3000::1.
  2236. <screen>
  2237. "Dhcp6": {
  2238. "subnet6": [
  2239. {
  2240. "subnet": "2001:db8:1::/64",
  2241. "pools": [
  2242. {
  2243. "pool": "2001:db8:1::1-2001:db8:1::ffff"
  2244. }
  2245. ],
  2246. <userinput>"relay": {
  2247. "ip-address": "3000::1"
  2248. }</userinput>
  2249. }
  2250. ]
  2251. }
  2252. </screen>
  2253. </para>
  2254. </section>
  2255. <section id="dhcp6-client-class-relay">
  2256. <title>Segregating IPv6 clients in a cable network</title>
  2257. <para>
  2258. In certain cases, it is useful to mix relay address information,
  2259. introduced in <xref linkend="dhcp6-relay-override"/> with client
  2260. classification, explained in <xref linkend="dhcp6-subnet-class"/>.
  2261. One specific example is a cable network, where typically modems
  2262. get addresses from a different subnet than all devices connected
  2263. behind them.
  2264. </para>
  2265. <para>
  2266. Let's assume that there is one CMTS (Cable Modem Termination System)
  2267. with one CM MAC (a physical link that modems are connected to).
  2268. We want the modems to get addresses from the 3000::/64 subnet,
  2269. while everything connected behind modems should get addresses from
  2270. another subnet (2001:db8:1::/64). The CMTS that acts as a relay
  2271. an uses address 3000::1. The following configuration can serve
  2272. that configuration:
  2273. <screen>
  2274. "Dhcp6": {
  2275. "subnet6": [
  2276. {
  2277. "subnet": "3000::/64",
  2278. "pools": [
  2279. { "pool": "3000::2 - 3000::ffff" }
  2280. ],
  2281. <userinput>"client-class": "VENDOR_CLASS_docsis3.0",
  2282. "relay": {
  2283. "ip-address": "3000::1"
  2284. }</userinput>
  2285. },
  2286. {
  2287. "subnet": "2001:db8:1::/64",
  2288. "pools": [
  2289. {
  2290. "pool": "2001:db8:1::1-2001:db8:1::ffff"
  2291. }
  2292. ],
  2293. <userinput>"relay": {
  2294. "ip-address": "3000::1"
  2295. }</userinput>
  2296. }
  2297. ]
  2298. }
  2299. </screen>
  2300. </para>
  2301. </section>
  2302. <section id="mac-in-dhcpv6">
  2303. <title>MAC/Hardware addresses in DHCPv6</title>
  2304. <para>MAC/hardware addesses are available in DHCPv4 messages
  2305. from the clients and administrators
  2306. frequently use that information to perform certain tasks, like per host
  2307. configuration, address reserveration for specific MAC addresses and other.
  2308. Unfortunately, DHCPv6 protocol does not provide any completely reliable way
  2309. to retrieve that information. To mitigate that issue a number of mechanisms
  2310. have been implemented in Kea that attempt to gather that information. Each
  2311. of those mechanisms works in certain cases, but may fail in other cases.
  2312. Whether the mechanism works or not in the particular deployment is
  2313. somewhat dependent on the network topology and the technologies used.</para>
  2314. <para>Kea allows for configuration which of the supported methods should be
  2315. used and in which order. This configuration may be considered a fine tuning
  2316. of the DHCP deployment. In a typical deployment the default
  2317. value of <command>"any"</command> is sufficient and there is no
  2318. need to select specific methods. Changing the value of this parameter
  2319. is the most useful in cases when an administrator wants to disable
  2320. certain method, e.g. if the administrator trusts the network infrastructure
  2321. more than the information provided by the clients themselves, the
  2322. administrator may prefer information provided by the relays over that
  2323. provided by the clients. The format of this parameter is as follows:
  2324. <screen>
  2325. "Dhcp6": {
  2326. <userinput>"mac-sources": [ "method1", "method2", "method3", ... ]</userinput>,
  2327. "subnet6": [ ... ],
  2328. ...
  2329. }
  2330. </screen>
  2331. When not specified, a special value of <emphasis>any</emphasis> is used, which
  2332. instructs the server to attempt to use all the methods in sequence and use
  2333. value returned by the first one that succeeds.</para>
  2334. <para>Supported methods are:
  2335. <itemizedlist>
  2336. <listitem>
  2337. <simpara><command>any</command> - not an actual method, just a keyword that
  2338. instructs Kea to try all other methods and use the first one that succeeds.
  2339. This is the default operation if no <command>mac-sources</command> are defined.
  2340. </simpara>
  2341. </listitem>
  2342. <listitem>
  2343. <simpara><command>raw</command> - In principle, a DHCPv6 server could use raw
  2344. sockets to receive incoming traffic and extract MAC/hardware address
  2345. information. This is currently not implemented for DHCPv6 and this value has
  2346. no effect.
  2347. </simpara>
  2348. </listitem>
  2349. <listitem>
  2350. <simpara><command>duid</command> - DHCPv6 uses DUID identifiers instead of
  2351. MAC addresses. There are currently four DUID types defined, with two of them
  2352. (DUID-LLT, which is the default one and DUID-LL) convey MAC address information.
  2353. Although RFC3315 forbids it, it is possible to parse those DUIDs and extract
  2354. necessary information from them. This method is not completely reliable, as
  2355. clients may use other DUID types, namely DUID-EN or DUID-UUID.
  2356. </simpara>
  2357. </listitem>
  2358. <listitem>
  2359. <simpara><command>ipv6-link-local</command> - Another possible aquisition
  2360. method comes from the source IPv6 address. In typical usage, clients are
  2361. sending their packets from IPv6 link-local addresses. There's a good chance
  2362. that those addresses are based on EUI-64, which contains MAC address. This
  2363. method is not completely reliable, as clients may use other link-local address
  2364. types. In particular, privacy extensions, defined in RFC4941, do not use
  2365. MAC addresses. Also note that successful extraction requires that the
  2366. address's u-bit must be set to 1 and its g-bit set to 0, indicating that it
  2367. is an interface identifier as per
  2368. <ulink url="http://tools.ietf.org/html/rfc2373#section-2.5.1">
  2369. RFC 2373, section 2.5.1</ulink>.
  2370. </simpara>
  2371. </listitem>
  2372. <listitem>
  2373. <simpara><command>client-link-addr-option</command> - One extension defined
  2374. to alleviate missing MAC issues is client link-layer address option, defined
  2375. in <ulink url="http://tools.ietf.org/html/rfc6939">RFC 6939</ulink>. This is
  2376. an option that is inserted by a relay and contains information about client's
  2377. MAC address. This method requires a relay agent that supports the option and
  2378. is configured to insert it. This method is useless for directly connected
  2379. clients. This parameter can also be specified as <command>rfc6939</command>,
  2380. which is an alias for <command>client-link-addr-option</command>.
  2381. </simpara>
  2382. </listitem>
  2383. <listitem>
  2384. <simpara><command>remote-id</command> - <ulink
  2385. url="http://tools.ietf.org/html/rfc4649">RFC 4649</ulink>
  2386. defines remote-id option that is inserted by a relay agent. Depending
  2387. on the relay agent configuration, the inserted option may convey client's
  2388. MAC address information. This parameter can also be specified as
  2389. <command>rfc4649</command>, which is an alias for <command>remote-id</command>.
  2390. </simpara>
  2391. </listitem>
  2392. <listitem>
  2393. <simpara><command>subscriber-id</command> - Another option
  2394. that is somewhat similar to the previous one is subscriber-id,
  2395. defined in <ulink url="http://tools.ietf.org/html/rfc4580">RFC
  2396. 4580</ulink>. It is, too, inserted by a relay agent that is
  2397. configured to insert it. This parameter can also be specified
  2398. as <command>rfc4580</command>, which is an alias for
  2399. <command>subscriber-id</command>. This method is currently not
  2400. implemented.
  2401. </simpara>
  2402. </listitem>
  2403. <listitem>
  2404. <simpara><command>docsis-cmts</command> - Yet another possible source of MAC
  2405. address information are DOCSIS options inserted by a CMTS that acts
  2406. as a DHCPv6 relay agent in cable networks. This method attempts to extract
  2407. MAC address information from suboption 1026 (cm mac) of the vendor specific option
  2408. with vendor-id=4491. This vendor option is extracted from the relay-forward message,
  2409. not the original client's message.
  2410. </simpara>
  2411. </listitem>
  2412. <listitem>
  2413. <simpara><command>docsis-modem</command> - Yet another possible source of MAC
  2414. address information are DOCSIS options inserted by the cable modem itself.
  2415. This method attempts to extract MAC address information from suboption 36 (device id)
  2416. of the vendor specific option with vendor-id=4491. This vendor option is extracted from
  2417. the original client's message, not from any relay options.
  2418. </simpara>
  2419. </listitem>
  2420. </itemizedlist>
  2421. </para>
  2422. </section>
  2423. <section id="dhcp6-stats">
  2424. <title>Statistics in DHCPv6 server</title>
  2425. <note>
  2426. <para>This section describes DHCPv6-specific statistics. For a general
  2427. overview and usage of statistics, see <xref linkend="stats" />.</para>
  2428. </note>
  2429. <para>
  2430. The DHCPv6 server supports the following statistics:
  2431. </para>
  2432. <table frame="all" id="dhcp6-statistics">
  2433. <title>DHCPv6 Statistics</title>
  2434. <tgroup cols='3'>
  2435. <colspec colname='statistic' align='center'/>
  2436. <colspec colname='type' align='center'/>
  2437. <colspec colname='description' align='left'/>
  2438. <thead>
  2439. <row>
  2440. <entry>Statistic</entry>
  2441. <entry>Data Type</entry>
  2442. <entry>Description</entry>
  2443. </row>
  2444. </thead>
  2445. <tbody>
  2446. <row>
  2447. <entry>pkt6-received</entry>
  2448. <entry>integer</entry>
  2449. <entry>Number of DHCPv6 packets received. This includes all packets:
  2450. valid, bogus, corrupted, rejected etc. This statistic is expected
  2451. to grow rapidly.</entry>
  2452. </row>
  2453. <row>
  2454. <entry>pkt6-receive-drop</entry>
  2455. <entry>integer</entry>
  2456. <entry>Number of incoming packets that were dropped. Exact reason
  2457. for dropping packets is logged, but the most common reasons may
  2458. be: an unacceptable or not supported packet type, direct responses
  2459. are forbidden, the server-id sent by the client does not match the
  2460. server's server-id or the packet is malformed.</entry>
  2461. </row>
  2462. <row>
  2463. <entry>pkt6-parse-failed</entry>
  2464. <entry>integer</entry>
  2465. <entry>Number of incoming packets that could not be parsed.
  2466. A non-zero value of this statistic indicates that the server
  2467. received a malformed or truncated packet. This may indicate problems
  2468. in your network, faulty clients, faulty relay agents or server
  2469. code bug.</entry>
  2470. </row>
  2471. <row>
  2472. <entry>pkt6-solicit-received</entry>
  2473. <entry>integer</entry>
  2474. <entry>
  2475. Number of SOLICIT packets received. This statistic is expected
  2476. to grow. Its increase means that clients that just booted
  2477. started their configuration process and their initial packets
  2478. reached your server.
  2479. </entry>
  2480. </row>
  2481. <row>
  2482. <entry>pkt6-advertise-received</entry>
  2483. <entry>integer</entry>
  2484. <entry>
  2485. Number of ADVERTISE packets received. Advertise packets are sent
  2486. by the server and the server is never expected to receive them. A non-zero
  2487. value of this statistic indicates an error ocurring in the network.
  2488. One likely cause would be a misbehaving relay agent that incorrectly
  2489. forwards ADVERTISE messages towards the server, rather back to the
  2490. clients.
  2491. </entry>
  2492. </row>
  2493. <row>
  2494. <entry>pkt6-request-received</entry>
  2495. <entry>integer</entry>
  2496. <entry>Number of REQUEST packets received. This statistic
  2497. is expected to grow. Its increase means that clients that just booted
  2498. received the server's response (ADVERTISE), accepted it and are now
  2499. requesting an address (REQUEST).
  2500. </entry>
  2501. </row>
  2502. <row>
  2503. <entry>pkt6-reply-received</entry>
  2504. <entry>integer</entry>
  2505. <entry>Number of REPLY packets received. This statistic is
  2506. expected to remain zero at all times, as REPLY packets are sent by
  2507. the server and the server is never expected to receive
  2508. them. A non-zero value indicates an error. One likely cause would be
  2509. a misbehaving relay agent that incorrectly forwards REPLY messages
  2510. towards the server, rather back to the clients.
  2511. </entry>
  2512. </row>
  2513. <row>
  2514. <entry>pkt6-renew-received</entry>
  2515. <entry>integer</entry>
  2516. <entry>Number of RENEW packets received. This statistic
  2517. is expected to grow. Its increase means that clients received their
  2518. addresses and prefixes and are trying to renew them.
  2519. </entry>
  2520. </row>
  2521. <row>
  2522. <entry>pkt6-rebind-received</entry>
  2523. <entry>integer</entry>
  2524. <entry>Number of REBIND packets received. A non-zero value
  2525. indicates that clients didn't receive responses to their RENEW messages
  2526. (regular lease renewal mechanism) and are attempting to find any server
  2527. that is able to take over their leases. It may mean that some server's
  2528. REPLY messages never reached the clients.
  2529. </entry>
  2530. </row>
  2531. <row>
  2532. <entry>pkt6-release-received</entry>
  2533. <entry>integer</entry>
  2534. <entry>Number of RELEASE packets received. This statistic is expected
  2535. to grow when a device is being shut down in the network. It
  2536. indicates that the address or prefix assigned is reported as no longer
  2537. needed. Note that many devices, especially wireless, do not send RELEASE,
  2538. because of design choice or due to moving out of range.
  2539. </entry>
  2540. </row>
  2541. <row>
  2542. <entry>pkt6-decline-received</entry>
  2543. <entry>integer</entry>
  2544. <entry>
  2545. Number of DECLINE packets received. This statistic is expected to
  2546. remain close to zero. Its increase means that a client leased an
  2547. address, but discovered that the address is currently used by an
  2548. unknown device in your network. If this statistic is growing, it
  2549. may indicate misconfigured server or devices that have statically
  2550. assigned conflicting addresses.
  2551. </entry>
  2552. </row>
  2553. <row>
  2554. <entry>pkt6-infrequest-received</entry>
  2555. <entry>integer</entry>
  2556. <entry>
  2557. Number of INFORMATION-REQUEST packets received. This statistic
  2558. is expected to grow if there are devices that are using
  2559. stateless DHCPv6. INFORMATION-REQUEST messages are used by
  2560. clients that request stateless configuration, i.e. options
  2561. and parameters other than addresses or prefixes.
  2562. </entry>
  2563. </row>
  2564. <row>
  2565. <entry>pkt6-unknown-received</entry>
  2566. <entry>integer</entry>
  2567. <entry>Number of packets received of an unknown type. Non-zero
  2568. value of this statistic indicates that the server received a
  2569. packet that it wasn't able to recognize: either with unsupported
  2570. type or possibly malformed.</entry>
  2571. </row>
  2572. <row>
  2573. <entry>pkt6-sent</entry>
  2574. <entry>integer</entry>
  2575. <entry>Number of DHCPv6 packets sent. This statistic is expected
  2576. to grow every time the server transmits a packet. In general, it
  2577. should roughly match pkt6-received, as most incoming packets cause
  2578. the server to respond. There are exceptions (e.g. server receiving a
  2579. REQUEST with server-id matching other server), so do not worry, if
  2580. it is lesser than pkt6-received.</entry>
  2581. </row>
  2582. <row>
  2583. <entry>pkt6-advertise-sent</entry>
  2584. <entry>integer</entry>
  2585. <entry>Number of ADVERTISE packets sent. This statistic is
  2586. expected to grow in most cases after a SOLICIT is processed. There
  2587. are certain uncommon, but valid cases where incoming SOLICIT is
  2588. dropped, but in general this statistic is expected to be close to
  2589. pkt6-solicit-received.</entry>
  2590. </row>
  2591. <row>
  2592. <entry>pkt6-reply-sent</entry>
  2593. <entry>integer</entry>
  2594. <entry>Number of REPLY packets sent. This statistic is expected to
  2595. grow in most cases after a SOLICIT (with rapid-commit), REQUEST,
  2596. RENEW, REBIND, RELEASE, DECLINE or INFORMATION-REQUEST is
  2597. processed. There are certain cases where there is no response.
  2598. </entry>
  2599. </row>
  2600. <row>
  2601. <entry>subnet[id].total-nas</entry>
  2602. <entry>integer</entry>
  2603. <entry>
  2604. This statistic shows the total number of NA addresses available for
  2605. DHCPv6 management for a given subnet. In other words, this is the sum
  2606. of all addresses in all configured pools. This statistic changes only
  2607. during configuration changes. Note it does not take into account any
  2608. addresses that may be reserved due to host reservation. The
  2609. <emphasis>id</emphasis> is the subnet-id of a given subnet. This
  2610. statistic is exposed for each subnet separately. This statistic is
  2611. reset during a reconfiguration event.
  2612. </entry>
  2613. </row>
  2614. <row>
  2615. <entry>subnet[id].assigned-nas</entry>
  2616. <entry>integer</entry>
  2617. <entry>
  2618. This statistic shows the number of NA addresses in a given subnet that
  2619. are assigned. This statistic increases every time a new lease is allocated
  2620. (as a result of receiving a REQUEST message) and is decreased every time a
  2621. lease is released (a RELEASE message is received). When lease expiration
  2622. is implemented (planned for Kea 1.0), it will also decrease when a lease
  2623. is expired. The <emphasis>id</emphasis> is the subnet-id of a given
  2624. subnet. This statistic is exposed for each subnet separately. This
  2625. statistic is reset during a reconfiguration event.
  2626. </entry>
  2627. </row>
  2628. <row>
  2629. <entry>subnet[id].total-pds</entry>
  2630. <entry>integer</entry>
  2631. <entry>
  2632. This statistic shows the total number of PD prefixes available for
  2633. DHCPv6 management for a given subnet. In other words, this is the sum
  2634. of all prefixes in all configured pools. This statistic changes only
  2635. during configuration changes. Note it does not take into account any
  2636. prefixes that may be reserved due to host reservation. The
  2637. <emphasis>id</emphasis> is the subnet-id of a given subnet. This
  2638. statistic is exposed for each subnet separately. This statistic is
  2639. reset during a reconfiguration event.
  2640. </entry>
  2641. </row>
  2642. <row>
  2643. <entry>subnet[id].assigned-pds</entry>
  2644. <entry>integer</entry>
  2645. <entry>
  2646. This statistic shows the number of PD prefixes in a given subnet that
  2647. are assigned. This statistic increases every time a new lease is allocated
  2648. (as a result of receiving a REQUEST message) and is decreased every time a
  2649. lease is released (a RELEASE message is received). When lease expiration
  2650. is implemented (planned for Kea 1.0), it will also decrease when a lease
  2651. is expired. The <emphasis>id</emphasis> is the subnet-id of a given
  2652. subnet. This statistic is exposed for each subnet separately. This
  2653. statistic is reset during a reconfiguration event.
  2654. </entry>
  2655. </row>
  2656. </tbody>
  2657. </tgroup>
  2658. </table>
  2659. </section>
  2660. <section id="dhcp6-ctrl-channel">
  2661. <title>Management API for the DHCPv6 server</title>
  2662. <para>
  2663. Management API has been introduced in Kea 0.9.2-beta. It allows issuing specific
  2664. management commands, like statistics retrieval, reconfiguration or shutdown.
  2665. For more details, see <xref linkend="ctrl-channel" />. Currently the only
  2666. supported communication channel type is UNIX stream socket. By default there
  2667. are no sockets open. To instruct Kea to open a socket, the following entry
  2668. in the configuration file can be used:
  2669. <screen>
  2670. "Dhcp6": {
  2671. "control-socket": {
  2672. "socket-type": "unix",
  2673. "socket-name": <userinput>"/path/to/the/unix/socket"</userinput>
  2674. },
  2675. "subnet6": [
  2676. ...
  2677. ],
  2678. ...
  2679. }
  2680. </screen>
  2681. </para>
  2682. <para>
  2683. The length of the path specified by the <command>socket-name</command>
  2684. parameter is restricted by the maximum length for the unix socket name
  2685. on your operating system, i.e. the size of the <command>sun_path</command>
  2686. field in the <command>sockaddr_un</command> structure, decreased by 1.
  2687. This value varies on different operating systems between 91 and 107
  2688. characters. The typical values are 107 on Linux and 103 on FreeBSD.
  2689. </para>
  2690. <para>
  2691. Communication over control channel is conducted using JSON structures.
  2692. See the Control Channel section in the Kea Developer's Guide for more details.
  2693. </para>
  2694. <para>DHCPv6 server supports <command>statistic-get</command>,
  2695. <command>statistic-reset</command>, <command>statistic-remove</command>,
  2696. <command>statistic-get-all</command>, <command>statistic-reset-all</command>
  2697. and <command>statistic-remove-all</command>, specified in
  2698. <xref linkend="command-stats"/>. It also supports
  2699. <command>list-commands</command> and <command>shutdown</command>,
  2700. specified in <xref linkend="command-list-commands" /> and
  2701. <xref linkend="command-shutdown" />, respectively.</para>
  2702. </section>
  2703. <section id="dhcp6-std">
  2704. <title>Supported DHCPv6 Standards</title>
  2705. <para>The following standards are currently
  2706. supported:</para>
  2707. <itemizedlist>
  2708. <listitem>
  2709. <simpara><emphasis>Dynamic Host Configuration Protocol for IPv6</emphasis>,
  2710. <ulink url="http://tools.ietf.org/html/rfc3315">RFC 3315</ulink>:
  2711. Supported messages are SOLICIT,
  2712. ADVERTISE, REQUEST, RELEASE, RENEW, REBIND, INFORMATION-REQUEST,
  2713. CONFIRM and REPLY.</simpara>
  2714. </listitem>
  2715. <listitem>
  2716. <simpara><emphasis>IPv6 Prefix Options for
  2717. Dynamic Host Configuration Protocol (DHCP) version 6</emphasis>,
  2718. <ulink url="http://tools.ietf.org/html/rfc3633">RFC 3633</ulink>:
  2719. Supported options are IA_PD and
  2720. IA_PREFIX. Also supported is the status code NoPrefixAvail.</simpara>
  2721. </listitem>
  2722. <listitem>
  2723. <simpara><emphasis>DNS Configuration options for Dynamic Host
  2724. Configuration Protocol for IPv6 (DHCPv6)</emphasis>,
  2725. <ulink url="http://tools.ietf.org/html/rfc3646">RFC 3646</ulink>:
  2726. Supported option is DNS_SERVERS.</simpara>
  2727. </listitem>
  2728. <listitem>
  2729. <simpara><emphasis>The Dynamic Host Configuration Protocol for IPv6 (DHCPv6)
  2730. Relay Agent Remote-ID Option</emphasis>,
  2731. <ulink url="http://tools.ietf.org/html/rfc4649">RFC 4649</ulink>:
  2732. REMOTE-ID option is supported.</simpara>
  2733. </listitem>
  2734. <listitem>
  2735. <simpara><emphasis>The Dynamic Host Configuration Protocol for IPv6 (DHCPv6) Client
  2736. Fully Qualified Domain Name (FQDN) Option</emphasis>,
  2737. <ulink url="http://tools.ietf.org/html/rfc4704">RFC 4704</ulink>:
  2738. Supported option is CLIENT_FQDN.</simpara>
  2739. </listitem>
  2740. <listitem>
  2741. <simpara><emphasis>Relay-Supplied DHCP Options</emphasis>,
  2742. <ulink url="http://tools.ietf.org/html/rfc6422">RFC 6422</ulink>:
  2743. Full functionality is supported: OPTION_RSOO, ability of the server
  2744. to echo back the options, checks whether an option is RSOO-enabled,
  2745. ability to mark additional options as RSOO-enabled.</simpara>
  2746. </listitem>
  2747. <listitem>
  2748. <simpara><emphasis>Client Link-Layer Address Option in
  2749. DHCPv6</emphasis>,
  2750. <ulink url="http://tools.ietf.org/html/rfc6939">RFC
  2751. 6939</ulink>: Supported option is client link-layer
  2752. address option.</simpara>
  2753. </listitem>
  2754. </itemizedlist>
  2755. </section>
  2756. <section id="dhcp6-limit">
  2757. <title>DHCPv6 Server Limitations</title>
  2758. <para> These are the current limitations and known problems
  2759. with the DHCPv6 server
  2760. software. Most of them are reflections of the early stage of
  2761. development and should be treated as <quote>not implemented
  2762. yet</quote>, rather than actual limitations.</para>
  2763. <itemizedlist>
  2764. <listitem> <!-- see tickets #3234, #3281 -->
  2765. <para>
  2766. On-line configuration has some limitations. Adding new subnets or
  2767. modifying existing ones work, as is removing the last subnet from
  2768. the list. However, removing non-last (e.g. removing subnet 1,2 or 3 if
  2769. there are 4 subnets configured) will cause issues. The problem is
  2770. caused by simplistic subnet-id assignment. The subnets are always
  2771. numbered, starting from 1. That subnet-id is then used in leases
  2772. that are stored in the lease database. Removing non-last subnet will
  2773. cause the configuration information to mismatch data in the lease
  2774. database. It is possible to manually update subnet-id fields in
  2775. MySQL or PostgreSQL database, but it is awkward and error prone
  2776. process. A better reconfiguration support is planned.
  2777. </para>
  2778. </listitem>
  2779. <listitem>
  2780. <simpara>
  2781. The server will allocate, renew or rebind a maximum of one lease
  2782. for a particular IA option (IA_NA or IA_PD) sent by a client.
  2783. <ulink url="http://tools.ietf.org/html/rfc3315">RFC 3315</ulink> and
  2784. <ulink url="http://tools.ietf.org/html/rfc3633">RFC 3633</ulink> allow
  2785. for multiple addresses or prefixes to be allocated for a single IA.
  2786. </simpara>
  2787. </listitem>
  2788. <listitem>
  2789. <simpara>Temporary addresses are not supported.</simpara>
  2790. </listitem>
  2791. <listitem>
  2792. <simpara>
  2793. Duplication report (DECLINE) and client reconfiguration (RECONFIGURE) are
  2794. not yet supported.
  2795. </simpara>
  2796. </listitem>
  2797. <listitem>
  2798. <simpara>
  2799. The server doesn't act upon expired leases. In particular,
  2800. when a lease expires, the server doesn't request removal of
  2801. the DNS records associated with it.
  2802. </simpara>
  2803. </listitem>
  2804. </itemizedlist>
  2805. </section>
  2806. <!--
  2807. <section id="dhcp6-srv-examples">
  2808. <title>Kea DHCPv6 server examples</title>
  2809. <para>
  2810. This section provides easy to use example. Each example can be read
  2811. separately. It is not intended to be read sequentially as there will
  2812. be many repetitions between examples. They are expected to serve as
  2813. easy to use copy-paste solutions to many common deployments.
  2814. </para>
  2815. @todo: add simple configuration for direct clients
  2816. @todo: add configuration for relayed clients
  2817. @todo: add client classification example
  2818. </section> -->
  2819. </chapter>