dhcp6-srv.xml 111 KB

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