dhcp6-srv.xml 137 KB

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