dhcp6-srv.xml 76 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846
  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 DHCPv4 server be started and stopped
  12. using <command>keactl</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>-v</command> - specifies whether the server
  26. logging should be switched to verbose mode. In verbose mode,
  27. the logging severity and debuglevel specified in a 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 the server will listen on. This is only
  37. useful during testing, as the 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. </itemizedlist>
  42. <para>
  43. When running in a console, the server can be shut down by
  44. pressing ctrl-c. It detects the key combination and shuts
  45. down gracefully.
  46. </para>
  47. <para>
  48. On start-up, the server will detect available network interfaces
  49. and will attempt to open UDP sockets on all interfaces
  50. mentioned in the configuration file.
  51. </para>
  52. <para>
  53. Since the DHCPv6 server opens privileged ports, it requires root
  54. access. Make sure you run this daemon as root.
  55. </para>
  56. </section>
  57. <section id="dhcp6-configuration">
  58. <title>DHCPv6 Server Configuration</title>
  59. <section>
  60. <title>Introduction</title>
  61. <para>
  62. This section explains how to configure the DHCPv6 server using the
  63. Kea configuration backend. (Kea configuration using any other
  64. backends is outside of scope of this document.) Before DHCPv6
  65. is started, its configuration file has to be created. The
  66. basic configuration looks as follows:
  67. <screen>
  68. {
  69. # DHCPv6 configuration starts on the next line
  70. "Dhcp6": {
  71. # First we set up global values
  72. "interfaces": [ "eth0" ],
  73. "renew-timer": 1000,
  74. "rebind-timer": 2000,
  75. "preferred-lifetime": 3000,
  76. "valid-lifetime": 4000,
  77. # Next we specify the type of lease database
  78. "lease-database": {
  79. "type": "memfile",
  80. "persist": true,
  81. "name": "/var/kea/dhcp6.leases"
  82. },
  83. # Finally, we list the subnets from which we will be leasing addresses.
  84. "subnet6": [
  85. {
  86. "subnet": "2001:db8:1::/64",
  87. "pools": [
  88. {
  89. "pool": "2001:db8:1::1-2001:db8:1::ffff"
  90. }
  91. ]
  92. }
  93. ]
  94. # DHCPv6 configuration ends with the next line
  95. }
  96. } </screen>
  97. </para>
  98. <para>The following paragraphs provide a brief overview of the parameters in
  99. the above example and
  100. their format. Subsequent sections of this chapter go into much greater detail
  101. for these and other parameters.</para>
  102. <para>The lines starting with a hash (#) are comments and are ignored by
  103. the server; they do not impact its
  104. operation in any way.</para>
  105. <para>The configuration starts in the first line with the initial
  106. opening curly bracket (or brace). Each configuration consists of
  107. one or more objects. In this specific example, we have only one
  108. object called Dhcp6. This is a simplified configuration, as usually
  109. there will be additional objects, like <command>Logging</command> or
  110. <command>DhcpDns</command>, but we omit them now for clarity. The Dhcp6
  111. configuration starts with the <command>"Dhcp6": {</command> line
  112. and ends with the corresponding closing brace (in the above example,
  113. the brace after the last comment). Everything defined between those
  114. lines is considered to be the Dhcp6 configuration.</para>
  115. <para>In general case, the order in which those parameters appear does not
  116. matter. There are two caveats here though. The first one is to remember that
  117. the configuration file must be a well formed JSON. That means that parameters
  118. for any given scope must be separate by a comma and there must not be a comma
  119. after the last parameter. When reordering configuration file, keep in mind that
  120. moving a parameter to or from the last position in a given scope may require
  121. moving the comma as well. The second caveat is that it is uncommon - although
  122. legal JSON - to
  123. repeat the same parameter multiple times. If that happens, the last occurrence of a
  124. given parameter in a given scope is used while all previous instances are
  125. ignored. This is unlikely to cause any confusion as there are no real life
  126. reasons to keep multiple copies of the same parameter in your configuration
  127. file.</para>
  128. <para>Moving onto the DHCPv6 configuration elements,
  129. the line defining <command>interfaces</command> parameter specifies a list
  130. of network interfaces on which the server should listen.
  131. Lists are opened and closed with square brackets, with elements
  132. separated by commas. Had we wanted to listen on two interfaces, the line could
  133. look like this:
  134. <screen>
  135. "interfaces": [ "eth0", "eth1" ],
  136. </screen>
  137. As "<command>interfaces</command>" is not the last parameter in the
  138. configuration, a trailing comma is required.</para>
  139. <para>A number of other parameters follow. <command>valid-lifetime</command>
  140. defines how long the addresses (leases) given out by the server are valid. If
  141. nothing changes, client that got the address is allowed to use it for 4000
  142. seconds. (Note that integer numbers are specified as is, without any quotes
  143. around them.) The address will become deprecated in 3000 seconds (clients are
  144. allowed to keep old connections, but can't use this address for creating new
  145. connections). <command>renew-timer</command> and <command>
  146. rebind-timer</command> are values that define T1 and T2 timers that govern when
  147. the client will begin renewal and rebind procedures.</para>
  148. <para>The next couple lines define the lease database, the place where the server
  149. stores its lease information. This particular example tells the server to use
  150. <command>memfile</command>, which is the simplest (and fastest) database
  151. backend. It uses in-memory database and stores leases on disk in a CSV
  152. file. This is a very simple configuration. Usually, lease database configuration
  153. is more extensive and contains additional parameters. Note that
  154. <command>lease-database</command>
  155. is an object and opens up a new scope, using an opening brace.
  156. Its parameters (just one in this example -- <command>type</command>)
  157. follow. Had there been more than one, they would be separated by commas. This
  158. scope is closed with a closing brace. As more parameters follow, a trailing
  159. comma is present.</para>
  160. <para>Finally, we need to define a list of IPv6 subnets. This is the
  161. most important DHCPv6 configuration structure as the server uses that
  162. information to process clients' requests. It defines all subnets that
  163. the server is expected to receive DHCP requests from. The subnets are
  164. specified with the <command>subnet6</command> parameter. It is a list,
  165. so it starts and ends with square brackets. Each subnet definition in
  166. the list has several attributes associated with it, so is a structure
  167. and is opened and closed with braces. At minimum, a subnet definition
  168. has to have at least two parameters: <command>subnet</command> (that
  169. defines the whole subnet) and <command>pool</command> (which is a list of
  170. dynamically allocated pools that are governed by the DHCP server).</para>
  171. <para>The example contains a single subnet. Had more than one been defined,
  172. additional elements
  173. in the <command>subnet6</command> parameter would be specified and
  174. separated by commas. For example, to define two subnets, the following
  175. syntax would be used:
  176. <screen>
  177. "subnet6": [
  178. {
  179. "pools": [
  180. {
  181. "pool": "2001:db8:1::/112"
  182. }
  183. ],
  184. "subnet": "2001:db8:1::/64"
  185. },
  186. {
  187. "pools": [ { "pool": "2001:db8:2::1-2001:db8:2::ffff" } ],
  188. "subnet": "2001:db8:2::/64",
  189. "interface": "eth0"
  190. }
  191. ]
  192. </screen>
  193. Note that indentation is optional and is used for aesthetic purposes only.
  194. In some cases in may be preferable to use more compact notation.
  195. </para>
  196. <para>After all parameters are specified, we have two contexts open:
  197. global and Dhcp6, hence we need two closing curly brackets to close them.
  198. In a real life configuration file there most likely would be additional
  199. components defined such as Logging or DhcpDdns, so the closing brace would
  200. be followed by a comma and another object definition.</para>
  201. <para>Kea 0.9 does not have configuration syntax validation
  202. implemented yet. Such a feature is planned for the near future. For
  203. the time being, it is convenient to use on-line JSON validators and/or
  204. viewers to check whether the syntax is correct. One example of such a
  205. JSON validator is available at <ulink url="http://jsonviewer.stack.hu/"/>.
  206. </para>
  207. </section>
  208. <section>
  209. <title>Lease Storage</title>
  210. <para>All leases issued by the server are stored in the lease database.
  211. Currently there are three database backends available:
  212. memfile (which is the default backend), MySQL and PostgreSQL.</para>
  213. <section>
  214. <title>Memfile - Basic Storage for Leases</title>
  215. <para>The server is able to store lease data in different repositories. Larger
  216. deployments may elect to store leases in a database. <xref
  217. linkend="database-configuration6"/> describes this option. In typical
  218. smaller deployments though, the server will use a CSV file rather than a database to
  219. store lease information. As well as requiring less administration, an
  220. advantage of using a file for storage is that it
  221. eliminates a dependency on third-party database software.</para>
  222. <para>The configuration of the file backend (Memfile) is controlled through
  223. the Dhcp6/lease-database parameters. <!-- @todo: we don't have default
  224. parameters. Let's comment this out When default parameters are used, the
  225. Memfile backend will write leases to a disk in the
  226. [kea-install-dir]/var/kea/kea-leases4.csv. -->
  227. The following configuration:
  228. <screen>
  229. "Dhcp6": {
  230. "lease-database": {
  231. <userinput>"type": "memfile"</userinput>,
  232. <userinput>"persist": true</userinput>,
  233. <userinput>"name": "/tmp/kea-leases6.csv"</userinput>
  234. }
  235. ...
  236. }
  237. </screen>
  238. ...sets the name of the lease file to /tmp/kea-leases6.csv.
  239. </para>
  240. <para>The "persist" parameter controls whether the leases are written to disk.
  241. It is strongly recommended that this parameter is set to true at all times
  242. during the normal operation of the server. (Not writing leases to disk will
  243. mean that if a server is restarted (e.g. after a power failure), it will not
  244. know what addresses have been assigned. As a result, it may hand out addresses
  245. to new clients that are already in use.)
  246. </para>
  247. </section>
  248. <section id="database-configuration6">
  249. <title>Database Configuration</title>
  250. <note>
  251. <para>Database access information must be configured for the DHCPv6 server,
  252. even if it has already been configured for the DHCPv4 server. The servers
  253. store their information independently, so each server can use a separate
  254. database or both servers can use the same database.</para>
  255. </note>
  256. <para>Database configuration is controlled through the Dhcp6/lease-database
  257. parameters. The type of the database must be set to "mysql" or "postgresql",
  258. e.g.
  259. <screen>
  260. "Dhcp6": { "lease-database": { <userinput>"type": "mysql"</userinput>, ... }, ... }
  261. </screen>
  262. Next, the name of the database is to hold the leases must be set: this is the
  263. name used when the lease database was created (see <xref linkend="dhcp-mysql-database-create"/>
  264. or <xref linkend="dhcp-pgsql-database-create"/>).
  265. <screen>
  266. "Dhcp6": { "lease-database": { <userinput>"name": "<replaceable>database-name</replaceable>" </userinput>, ... }, ... }
  267. </screen>
  268. If the database is located on a different system than the DHCPv6 server, the
  269. database host name must also be specified (although it should be noted that this
  270. configuration may have a severe impact on server performance):
  271. <screen>
  272. "Dhcp6": { "lease-database": { <userinput>"host": <replaceable>remote-host-name</replaceable>"</userinput>, ... }, ... }
  273. </screen>
  274. The usual state of affairs will be to have the database on the same machine as
  275. the DHCPv6 server. In this case, set the value to the empty string:
  276. <screen>
  277. "Dhcp6": { "lease-database": { <userinput>"host" : ""</userinput>, ... }, ... }
  278. </screen>
  279. </para>
  280. <para>Finally, the credentials of the account under which the server will
  281. access the database should be set:
  282. <screen>
  283. "Dhcp6": { "lease-database": { <userinput>"user": "<replaceable>user-name</replaceable>"</userinput>,
  284. <userinput>"password" "<replaceable>password</replaceable>"</userinput>,
  285. ... },
  286. ... }
  287. </screen>
  288. If there is no password to the account, set the password to the empty string
  289. "". (This is also the default.)</para>
  290. </section>
  291. </section>
  292. <section id="dhcp6-interface-selection">
  293. <title>Interface selection</title>
  294. <para>The DHCPv6 server has to be configured to listen on specific network
  295. interfaces. The simplest network interface configuration tells the server to
  296. listen on all available interfaces:
  297. <screen>
  298. "Dhcp6": { <userinput>"interfaces": ["*"]</userinput>, ... }</screen>
  299. The asterisk plays the role of a wildcard and means "listen on all interfaces".
  300. However, it is usually a good idea to explicitly specify interface names:
  301. <screen>
  302. "Dhcp6": { <userinput>"interfaces": [ "eth1", "eth3" ]</userinput>, ... }</screen>
  303. </para>
  304. <para>It is possible to use wildcard interface name (asterisk) concurrently
  305. with explicit interface names:
  306. <screen>
  307. "Dhcp6": { <userinput>"interfaces": [ "eth1", "eth3", "*" ]</userinput>, ... }</screen>
  308. It is anticipated that this will form of usage only be used where it is desired to
  309. temporarily override a list of interface names and listen on all interfaces.
  310. </para>
  311. </section>
  312. <section id="ipv6-subnet-id">
  313. <title>IPv6 Subnet Identifier</title>
  314. <para>
  315. Subnet identifier is a unique number associated with a particular subnet.
  316. In principle, it is used to associate clients' leases with respective subnets.
  317. When the subnet identifier is not specified for a subnet being configured, it will
  318. be automatically assigned by the configuration mechanism. The identifiers
  319. are assigned from 1 and are monotonically increased for each subsequent
  320. subnet: 1, 2, 3 ....
  321. </para>
  322. <para>
  323. If there are multiple subnets configured with auto-generated identifiers and
  324. one of them is removed, the subnet identifiers may be renumbered. For example:
  325. if there are 4 subnets and 3rd is removed the last subnet will be assigned
  326. identifier that the 3rd subnet had before removal. As a result, the leases
  327. stored in the lease database for subnet 3 are now associated with the
  328. subnet 4, which may have unexpected consequences. In the future it is planned
  329. to implement the mechanism to preserve auto-generated subnet ids upon removal
  330. of one of the subnets. Currently, the only remedy for this issue is to
  331. manually specify the unique subnet identifier for each subnet.
  332. </para>
  333. <para>
  334. The following configuration:
  335. <screen>
  336. "Dhcp6": {
  337. "subnet6": [
  338. "subnet": "2001:db8:1::/64",
  339. <userinput>"id": 1024</userinput>,
  340. ...
  341. ]
  342. }
  343. </screen>
  344. will assign the arbitrary subnet identifier to the newly configured subnet.
  345. This identifier will not change for this subnet unless the "id" parameter is
  346. removed or set to 0. The value of 0 forces auto-generation of the subnet
  347. identifier.
  348. </para>
  349. <!-- @todo: describe whether database needs to be updated after changing
  350. id -->
  351. </section>
  352. <section id="dhcp6-unicast">
  353. <title>Unicast traffic support</title>
  354. <para>
  355. When DHCPv6 server starts up, by default it listens to the DHCP traffic
  356. sent to multicast address ff02::1:2 on each interface that it is
  357. configured to listen on (see <xref linkend="dhcp6-interface-selection"/>).
  358. In some cases it is useful to configure a server to handle incoming
  359. traffic sent to the global unicast addresses as well. The most common
  360. reason for that is to have relays send their traffic to the server
  361. directly. To configure server to listen on specific unicast address, a
  362. notation to specify interfaces has been extended. Interface name can be
  363. optionally followed by a slash, followed by global unicast address that
  364. server should listen on. That will be done in addition to normal
  365. link-local binding + listening on ff02::1:2 address. The sample commands
  366. listed below show how to listen on 2001:db8::1 (a global address)
  367. configured on the eth1 interface.
  368. </para>
  369. <para>
  370. <screen>
  371. "Dhcp6": {
  372. <userinput>"interfaces": [ "eth1/2001:db8::1"],</userinput>
  373. ...
  374. }</screen>
  375. When configuration gets committed, the server will start to listen on
  376. eth1 on link-local address, multicast group (ff02::1:2) and 2001:db8::1.
  377. </para>
  378. <para>
  379. It is possible to mix interface names, wildcards and interface name/addresses
  380. on the Dhcp6/interface list. It is not possible to specify more than one
  381. unicast address on a given interface.
  382. </para>
  383. <para>
  384. Care should be taken to specify proper unicast addresses. The server will
  385. attempt to bind to those addresses specified, without any additional checks.
  386. That approach is selected on purpose, so in the software can be used to
  387. communicate over uncommon addresses if the administrator desires so.
  388. </para>
  389. </section>
  390. <section id="dhcp6-address-config">
  391. <title>Subnet and Address Pool</title>
  392. <para>
  393. The essential role of a DHCPv6 server is address assignment. For this,
  394. the server has to be configured with at least one subnet and one pool of dynamic
  395. addresses to be managed. For example, assume that the server
  396. is connected to a network segment that uses the 2001:db8:1::/64
  397. prefix. The Administrator of that network has decided that addresses from range
  398. 2001:db8:1::1 to 2001:db8:1::ffff are going to be managed by the Dhcp6
  399. server. Such a configuration can be achieved in the following way:
  400. <screen>
  401. "Dhcp6": {
  402. <userinput>"subnet6": [
  403. {
  404. "subnet": "2001:db8:1::/64",
  405. "pools": [
  406. {
  407. pool: "2001:db8:1::1-2001:db8:1::ffff"
  408. }
  409. ],
  410. ...
  411. }
  412. ]</userinput>
  413. }</screen>
  414. Note that subnet is defined as a simple string, but the pool parameter
  415. is actually a list of pools: for this reason, the pool definition is
  416. enclosed in square brackets, even though only one range of addresses
  417. is specified.</para>
  418. <para>It is possible to define more than one pool in a
  419. subnet: continuing the previous example, further assume that
  420. 2001:db8:1:0:5::/80 should be also be managed by the server. It could be written as
  421. 2001:db8:1:0:5:: to 2001:db8:1::5:ffff:ffff:ffff, but typing so many 'f's
  422. is cumbersome. It can be expressed more simply as 2001:db8:1:0:5::/80. Both
  423. formats are supported by Dhcp6 and can be mixed in the pool list.
  424. For example, one could define the following pools:
  425. <screen>
  426. "Dhcp6": {
  427. <userinput>"subnet6": [
  428. {
  429. "subnet": "2001:db8:1::/64",
  430. "pools": [
  431. { pool: "2001:db8:1::1-2001:db8:1::ffff" },
  432. { pool: "2001:db8:1:05::/80" }
  433. ]</userinput>,
  434. ...
  435. }
  436. ]
  437. }</screen>
  438. The number of pools is not limited, but for performance reasons it is recommended to
  439. use as few as possible.
  440. </para>
  441. <para>
  442. The server may be configured to serve more than one subnet. To add a second subnet,
  443. use a command similar to the following:
  444. <screen>
  445. "Dhcp6": {
  446. <userinput>"subnet6": [
  447. {
  448. "subnet": "2001:db8:1::/64",
  449. "pools": [
  450. { pool: "2001:db8:1::1-2001:db8:1::ffff" }
  451. ]
  452. },
  453. {
  454. "subnet": "2001:db8:2::/64",
  455. "pools": [
  456. { pool: "2001:db8:2::/64" }
  457. ]
  458. },
  459. </userinput>
  460. ...
  461. ]
  462. }</screen>
  463. In this example, we allow server to
  464. dynamically assign all addresses available in the whole subnet. Although
  465. rather wasteful, it is certainly a valid configuration to dedicate the
  466. whole /64 subnet for that purpose. Note that the Kea server does not preallocate
  467. the leases, so there is no danger of using gigantic address pools.
  468. </para>
  469. <para>
  470. When configuring a DHCPv6 server using prefix/length notation, please pay
  471. attention to the boundary values. When specifying that the server should use
  472. a given pool, it will be able to allocate also first (typically network
  473. address) address from that pool. For example for pool 2001:db8:2::/64 the
  474. 2001:db8:2:: address may be assigned as well. If you want to avoid this,
  475. use the "min-max" notation.
  476. </para>
  477. </section>
  478. <section>
  479. <!-- @todo: add real meat to the prefix delegation config this is just place holder stuff -->
  480. <title>Subnet and Prefix Delegation Pools</title>
  481. <para>
  482. Subnets may also be configured to delegate prefixes, as defined in
  483. <ulink url="http://tools.ietf.org/html/rfc3633">RFC 3633</ulink>.
  484. A subnet may have one or more prefix delegation pools. Each pool has
  485. a prefixed address, which is specified as a prefix and a prefix length,
  486. as well as a delegated prefix length. <command>delegated-len</command>
  487. must not be shorter (numerically greater) than
  488. <command>prefix-len</command>. If both <command>delegated-len</command>
  489. and <command>prefix-len</command> are equal, the server will be able to
  490. delegate only one prefix. A sample configuration is shown below:
  491. <screen>
  492. "Dhcp6": {
  493. "subnet6": [
  494. {
  495. "subnet": "2001:d8b:1::/64",
  496. <userinput>"pd-pools": [
  497. {
  498. "prefix": "2001:db8:1::",
  499. "prefix-len": 64,
  500. "delegated-len": 96
  501. }
  502. ]</userinput>
  503. }
  504. ],
  505. ...
  506. }</screen>
  507. </para>
  508. </section>
  509. <section id="dhcp6-std-options">
  510. <title>Standard DHCPv6 options</title>
  511. <para>
  512. One of the major features of DHCPv6 server is to provide configuration
  513. options to clients. Although there are several options that require
  514. special behavior, most options are sent by the server only if the client
  515. explicitly requested them. The following example shows how to
  516. configure DNS servers, which is one of the most frequently used
  517. options. Numbers in the first column are added for easier reference and
  518. will not appear on screen. Options specified in this way are considered
  519. global and apply to all configured subnets.
  520. <screen>
  521. "Dhcp6": {
  522. "option-data": [
  523. {
  524. <userinput>"name": "dns-servers",
  525. "code": 23,
  526. "space": "dhcp6",
  527. "csv-format": true,
  528. "data": "2001:db8::cafe, 2001:db8::babe"</userinput>
  529. },
  530. ...
  531. ]
  532. }
  533. </screen>
  534. </para>
  535. <para>
  536. The first line creates new entry in option-data table. It contains
  537. information on all global options that the server is supposed to configure
  538. in all subnets. The second line specifies option name. For a complete list
  539. of currently supported names, see <xref
  540. linkend="dhcp6-std-options-list"/>. The third line specifies option code,
  541. which must match one of the values from that list. Line beginning with
  542. <command>space</command> specifies option space, which must always be set
  543. to "dhcp6" as these are standard DHCPv6 options. For other name spaces,
  544. including custom option spaces, see <xref
  545. linkend="dhcp6-option-spaces"/>. The fifth line specifies the format in
  546. which the data will be entered: use of CSV (comma separated values) is
  547. recommended. The sixth line gives the actual value to be sent to
  548. clients. Data is specified as a normal text, with values separated by
  549. commas if more than one value is allowed.
  550. </para>
  551. <para>
  552. Options can also be configured as hexadecimal values. If csv-format is
  553. set to false, the option data must be specified as a string of hexadecimal
  554. numbers. The
  555. following commands configure the DNS-SERVERS option for all
  556. subnets with the following addresses: 2001:db8:1::cafe and
  557. 2001:db8:1::babe.
  558. <screen>
  559. "Dhcp6": {
  560. "option-data": [
  561. {
  562. <userinput>"name": "dns-servers",
  563. "code": 23,
  564. "space": "dhcp6",
  565. "csv-format": false,
  566. "data": "2001 0DB8 0001 0000 0000 0000 0000 CAFE
  567. 2001 0DB8 0001 0000 0000 0000 0000 BABE"</userinput>
  568. },
  569. ...
  570. ]
  571. }
  572. </screen>
  573. The value for the setting of the "data" element is split across two
  574. lines in this document for clarity: when entering the command, the
  575. whole string should be entered on the same line. Care should be taken
  576. to use proper encoding when using hexadecimal format as Kea's ability
  577. to validate data correctness in hexadecimal is limited.
  578. </para>
  579. <para>
  580. It is possible to override options on a per-subnet basis. If
  581. clients connected to most of your subnets are expected to get the
  582. same values of a given option, you should use global options: you
  583. can then override specific values for a small number of subnets.
  584. On the other hand, if you use different values in each subnet,
  585. it does not make sense to specify global option values
  586. (Dhcp6/option-data), rather you should set only subnet-specific values
  587. (Dhcp6/subnet[X]/option-data[Y]).
  588. </para>
  589. <para>
  590. The following commands override the global
  591. DNS servers option for a particular subnet, setting a single DNS
  592. server with address 2001:db8:1::3.
  593. <screen>
  594. "Dhcp6": {
  595. "subnet6": [
  596. {
  597. <userinput>"option-data": [
  598. {
  599. "name": "dns-servers",
  600. "code": 23,
  601. "space: "dhcp6",
  602. "csv-format": true,
  603. "data": "2001:db8:1::3"
  604. },
  605. ...
  606. ]</userinput>,
  607. ...
  608. },
  609. ...
  610. ],
  611. ...
  612. }
  613. </screen>
  614. </para>
  615. <note>
  616. <para>
  617. In future versions of Kea, it will not be necessary to specify
  618. the <command>code</command>, <command>space</command>
  619. and <command>csv-format</command> fields, as they will
  620. be set automatically.
  621. </para>
  622. </note>
  623. <para>
  624. The currently supported standard DHCPv6 options are
  625. listed in <xref linkend="dhcp6-std-options-list"/>.
  626. The "Name" and "Code"
  627. are the values that should be used as a name in the option-data
  628. structures. "Type" designates the format of the data: the meanings of
  629. the various types is given in <xref linkend="dhcp-types"/>.
  630. </para>
  631. <para>
  632. Some options are designated as arrays, which means that more than one
  633. value is allowed in such an option. For example the option dns-servers
  634. allows the specification of more than one IPv6 address, so allowing
  635. clients to obtain the addresses of multiple DNS servers.
  636. </para>
  637. <!-- @todo: describe record types -->
  638. <para>
  639. The <xref linkend="dhcp6-custom-options"/> describes the configuration
  640. syntax to create custom option definitions (formats). It is generally not
  641. allowed to create custom definitions for standard options, even if the
  642. definition being created matches the actual option format defined in the
  643. RFCs. There is an exception from this rule for standard options for which
  644. Kea does not provide a definition yet. In order to use such options,
  645. a server administrator must create a definition as described in
  646. <xref linkend="dhcp6-custom-options"/> in the 'dhcp6' option space. This
  647. definition should match the option format described in the relevant
  648. RFC but configuration mechanism would allow any option format as it has
  649. no means to validate it at the moment.
  650. </para>
  651. <para>
  652. <table frame="all" id="dhcp6-std-options-list">
  653. <title>List of standard DHCPv6 options</title>
  654. <tgroup cols='4'>
  655. <colspec colname='name'/>
  656. <colspec colname='code' align='center'/>
  657. <colspec colname='type' align='center'/>
  658. <colspec colname='array' align='center'/>
  659. <thead>
  660. <row><entry>Name</entry><entry>Code</entry><entry>Type</entry><entry>Array?</entry></row>
  661. </thead>
  662. <tbody>
  663. <!-- Our engine uses those options on its own, admin must not configure them on his own
  664. <row><entry>clientid</entry><entry>1</entry><entry>binary</entry><entry>false</entry></row>
  665. <row><entry>serverid</entry><entry>2</entry><entry>binary</entry><entry>false</entry></row>
  666. <row><entry>ia-na</entry><entry>3</entry><entry>record</entry><entry>false</entry></row>
  667. <row><entry>ia-ta</entry><entry>4</entry><entry>uint32</entry><entry>false</entry></row>
  668. <row><entry>iaaddr</entry><entry>5</entry><entry>record</entry><entry>false</entry></row>
  669. <row><entry>oro</entry><entry>6</entry><entry>uint16</entry><entry>true</entry></row> -->
  670. <row><entry>preference</entry><entry>7</entry><entry>uint8</entry><entry>false</entry></row>
  671. <!-- Our engine uses those options on its own, admin must not configure them on his own
  672. <row><entry>elapsed-time</entry><entry>8</entry><entry>uint16</entry><entry>false</entry></row>
  673. <row><entry>relay-msg</entry><entry>9</entry><entry>binary</entry><entry>false</entry></row>
  674. <row><entry>auth</entry><entry>11</entry><entry>binary</entry><entry>false</entry></row>
  675. <row><entry>unicast</entry><entry>12</entry><entry>ipv6-address</entry><entry>false</entry></row>
  676. <row><entry>status-code</entry><entry>13</entry><entry>record</entry><entry>false</entry></row>
  677. <row><entry>rapid-commit</entry><entry>14</entry><entry>empty</entry><entry>false</entry></row>
  678. <row><entry>user-class</entry><entry>15</entry><entry>binary</entry><entry>false</entry></row>
  679. <row><entry>vendor-class</entry><entry>16</entry><entry>record</entry><entry>false</entry></row>
  680. <row><entry>vendor-opts</entry><entry>17</entry><entry>uint32</entry><entry>false</entry></row>
  681. <row><entry>interface-id</entry><entry>18</entry><entry>binary</entry><entry>false</entry></row>
  682. <row><entry>reconf-msg</entry><entry>19</entry><entry>uint8</entry><entry>false</entry></row>
  683. <row><entry>reconf-accept</entry><entry>20</entry><entry>empty</entry><entry>false</entry></row> -->
  684. <row><entry>sip-server-dns</entry><entry>21</entry><entry>fqdn</entry><entry>true</entry></row>
  685. <row><entry>sip-server-addr</entry><entry>22</entry><entry>ipv6-address</entry><entry>true</entry></row>
  686. <row><entry>dns-servers</entry><entry>23</entry><entry>ipv6-address</entry><entry>true</entry></row>
  687. <row><entry>domain-search</entry><entry>24</entry><entry>fqdn</entry><entry>true</entry></row>
  688. <!-- <row><entry>ia-pd</entry><entry>25</entry><entry>record</entry><entry>false</entry></row> -->
  689. <!-- <row><entry>iaprefix</entry><entry>26</entry><entry>record</entry><entry>false</entry></row> -->
  690. <row><entry>nis-servers</entry><entry>27</entry><entry>ipv6-address</entry><entry>true</entry></row>
  691. <row><entry>nisp-servers</entry><entry>28</entry><entry>ipv6-address</entry><entry>true</entry></row>
  692. <row><entry>nis-domain-name</entry><entry>29</entry><entry>fqdn</entry><entry>true</entry></row>
  693. <row><entry>nisp-domain-name</entry><entry>30</entry><entry>fqdn</entry><entry>true</entry></row>
  694. <row><entry>sntp-servers</entry><entry>31</entry><entry>ipv6-address</entry><entry>true</entry></row>
  695. <row><entry>information-refresh-time</entry><entry>32</entry><entry>uint32</entry><entry>false</entry></row>
  696. <row><entry>bcmcs-server-dns</entry><entry>33</entry><entry>fqdn</entry><entry>true</entry></row>
  697. <row><entry>bcmcs-server-addr</entry><entry>34</entry><entry>ipv6-address</entry><entry>true</entry></row>
  698. <row><entry>geoconf-civic</entry><entry>36</entry><entry>record</entry><entry>false</entry></row>
  699. <row><entry>remote-id</entry><entry>37</entry><entry>record</entry><entry>false</entry></row>
  700. <row><entry>subscriber-id</entry><entry>38</entry><entry>binary</entry><entry>false</entry></row>
  701. <row><entry>client-fqdn</entry><entry>39</entry><entry>record</entry><entry>false</entry></row>
  702. <row><entry>pana-agent</entry><entry>40</entry><entry>ipv6-address</entry><entry>true</entry></row>
  703. <row><entry>new-posix-timezone</entry><entry>41</entry><entry>string</entry><entry>false</entry></row>
  704. <row><entry>new-tzdb-timezone</entry><entry>42</entry><entry>string</entry><entry>false</entry></row>
  705. <row><entry>ero</entry><entry>43</entry><entry>uint16</entry><entry>true</entry></row>
  706. <row><entry>lq-query</entry><entry>44</entry><entry>record</entry><entry>false</entry></row>
  707. <row><entry>client-data</entry><entry>45</entry><entry>empty</entry><entry>false</entry></row>
  708. <row><entry>clt-time</entry><entry>46</entry><entry>uint32</entry><entry>false</entry></row>
  709. <row><entry>lq-relay-data</entry><entry>47</entry><entry>record</entry><entry>false</entry></row>
  710. <row><entry>lq-client-link</entry><entry>48</entry><entry>ipv6-address</entry><entry>true</entry></row>
  711. </tbody>
  712. </tgroup>
  713. </table>
  714. </para>
  715. </section>
  716. <section id="dhcp6-custom-options">
  717. <title>Custom DHCPv6 options</title>
  718. <para>It is also possible to define options other than the standard ones.
  719. Assume that we want to define a new DHCPv6 option called "foo" which will have
  720. code 100 and will convey a single unsigned 32 bit integer value. We can define
  721. such an option by using the following commands:
  722. <screen>
  723. "Dhcp6": {
  724. "option-def": [
  725. {
  726. <userinput>"name": "foo",
  727. "code": 100,
  728. "type": "uint32",
  729. "array": false,
  730. "record-types": "",
  731. "space": "dhcp6",
  732. "encapsulate": ""</userinput>
  733. }, ...
  734. ],
  735. ...
  736. }
  737. </screen>
  738. The "false" value of the "array" parameter determines that the option does
  739. NOT comprise an array of "uint32" values but rather a single value. Two
  740. other parameters have been left blank: "record-types" and "encapsulate".
  741. The former specifies the comma separated list of option data fields if the
  742. option comprises a record of data fields. The "record-fields" value should
  743. be non-empty if the "type" is set to "record". Otherwise it must be left
  744. blank. The latter parameter specifies the name of the option space being
  745. encapsulated by the particular option. If the particular option does not
  746. encapsulate any option space it should be left blank. Note that the above
  747. set of comments define the format of the new option and do not set its
  748. values.
  749. </para>
  750. <para>Once the new option format is defined, its value is set
  751. in the same way as for a standard option. For example the following
  752. commands set a global value that applies to all subnets.
  753. <screen>
  754. "Dhcp6": {
  755. "option-data": [
  756. {
  757. <userinput>name "foo",
  758. "code": 100,
  759. "space": "dhcp6",
  760. "csv-format": true,
  761. "data": "12345"</userinput>
  762. }, ...
  763. ],
  764. ...
  765. }
  766. </screen>
  767. </para>
  768. <para>New options can take more complex forms than simple use of
  769. primitives (uint8, string, ipv6-address etc): it is possible to
  770. define an option comprising a number of existing primitives.
  771. </para>
  772. <para>
  773. Assume we want to define a new option that will consist of an IPv6
  774. address, followed by an unsigned 16 bit integer, followed by a
  775. boolean value, followed by a text string. Such an option could
  776. be defined in the following way:
  777. <screen>
  778. "Dhcp6": {
  779. "option-def": [
  780. {
  781. <userinput>"name": "bar",
  782. "code": 101,
  783. "space": "dhcp6",
  784. "type": "record",
  785. "array": false,
  786. "record-types": "ipv4-address, uint16, boolean, string",
  787. "encapsulate": ""</userinput>
  788. }, ...
  789. ],
  790. ...
  791. }
  792. </screen>
  793. The "type" is set to "record" to indicate that the option contains
  794. multiple values of different types. These types are given as a comma-separated
  795. list in the "record-types" field and should be those listed in <xref linkend="dhcp-types"/>.
  796. </para>
  797. <para>
  798. The values of the option are set as follows:
  799. <screen>
  800. "Dhcp6": {
  801. "option-data": [
  802. {
  803. <userinput>"name": "bar",
  804. "space": "dhcp6",
  805. "code": 101,
  806. "csv-format": true,
  807. "data": "2001:db8:1::10, 123, false, Hello World"</userinput>
  808. }
  809. ],
  810. ...
  811. }</screen>
  812. <command>csv-format</command> is set <command>true</command> to indicate
  813. that the <command>data</command> field comprises a command-separated list
  814. of values. The values in the "data" must correspond to the types set in
  815. the "record-types" field of the option definition.
  816. </para>
  817. <note>
  818. <para>In general case, boolean values are specified as <command>true</command> or
  819. <command>false</command>, without quotes. Some specific boolean parameters may
  820. accept also <command>"true"</command>, <command>"false"</command>,
  821. <command>0</command>, <command>1</command>, <command>"0"</command> and
  822. <command>"1"</command>. Future Kea versions will accept all those values
  823. for all boolean parameters.</para>
  824. </note>
  825. </section>
  826. <section id="dhcp6-vendor-opts">
  827. <title>DHCPv6 vendor specific options</title>
  828. <para>
  829. Currently there are three option spaces defined: dhcp4 (to be used
  830. in DHCPv4 daemon) and dhcp6 (for the DHCPv6 daemon); there is also
  831. vendor-opts-space, which is empty by default, but options can be
  832. defined in it. Those options are called vendor-specific information
  833. options. The following examples show how to define an option "foo"
  834. with code 1 that consists of an IPv6 address, an unsigned 16 bit integer
  835. and a string. The "foo" option is conveyed in a vendor specific
  836. information option. This option comprises a single uint32 value
  837. that is set to "12345". The sub-option "foo" follows the data
  838. field holding this value.
  839. <screen>
  840. "Dhcp6": {
  841. "option-def": [
  842. {
  843. <userinput>"name": "foo",
  844. "code": 1,
  845. "space": "vendor-encapsulated-options-space",
  846. "type": "record",
  847. "array": false,
  848. "record-types": "ipv6-address, uint16, string",
  849. "encapsulates": ""</userinput>
  850. }
  851. ],
  852. ...
  853. }</screen>
  854. (Note that the option space is set to <command>vendor-opts-space</command>.)
  855. Once the option format is defined, the next step is to define actual values
  856. for that option:
  857. <screen>
  858. "Dhcp6": {
  859. "option-data": [
  860. {
  861. <userinput>"name": "foo"
  862. "space": "vendor-encapsulated-options-space",
  863. "code": 1,
  864. "csv-format": true,
  865. "data": "2001:db8:1::10, 123, Hello World"</userinput>
  866. },
  867. ...
  868. ],
  869. ...
  870. }</screen>
  871. We should also define values for the vendor-opts, that will convey our
  872. option foo.
  873. <screen>
  874. "Dhcp6": {
  875. "option-data": [
  876. ...,
  877. {
  878. <userinput>"name": "vendor-encapsulated-options"
  879. "space": "dhcp6",
  880. "code": 17,
  881. "csv-format": true,
  882. "data": "12345"</userinput>
  883. }
  884. ],
  885. ...
  886. }</screen>
  887. </para>
  888. </section>
  889. <section id="dhcp6-option-spaces">
  890. <title>Nested DHCPv6 options (custom option spaces)</title>
  891. <para>It is sometimes useful to define completely new option
  892. spaces. This is useful if the user wants his new option to
  893. convey sub-options that use separate numbering scheme, for
  894. example sub-options with codes 1 and 2. Those option codes
  895. conflict with standard DHCPv6 options, so a separate option
  896. space must be defined.
  897. </para>
  898. <para>Note that it is not required to create new option space when
  899. defining sub-options for a standard option because it is by
  900. default created if the standard option is meant to convey
  901. any sub-options (see <xref linkend="dhcp6-vendor-opts"/>).
  902. </para>
  903. <para>
  904. Assume that we want to have a DHCPv6 option called "container"
  905. with code 102 that conveys two sub-options with codes 1 and 2.
  906. First we need to define the new sub-options:
  907. <screen>
  908. "Dhcp6": {
  909. "option-def": [
  910. {
  911. <userinput>"name": "subopt1",
  912. "code": 1,
  913. "space": "isc",
  914. "type": "ipv6-address".
  915. "record-types": "",
  916. "array": false,
  917. "encapsulate ""
  918. },
  919. {
  920. "name": "subopt2",
  921. "code": 2,
  922. "space": "isc",
  923. "type": "string",
  924. "record-types": "",
  925. "array": false
  926. "encapsulate": ""</userinput>
  927. }
  928. ],
  929. ...
  930. }</screen>
  931. Note that we have defined the options to belong to a new option space
  932. (in this case, "isc").
  933. </para>
  934. <para>
  935. The next step is to define a regular DHCPv6 option and specify that it
  936. should include options from the isc option space:
  937. <screen>
  938. "Dhcp6": {
  939. "option-def": [
  940. ...,
  941. {
  942. <userinput>"name": "container",
  943. "code": 102,
  944. "space": "dhcp6",
  945. "type": "empty",
  946. "array": false,
  947. "record-types": "",
  948. "encapsulate": "isc"</userinput>
  949. }
  950. ],
  951. ...
  952. }</screen>
  953. The name of the option space in which the sub-options are defined is set in
  954. the <command>encapsulate</command> field. The <command>type</command> field
  955. is set to <command>empty</command> which imposes that this option does not
  956. carry any data other than sub-options.
  957. </para>
  958. <para>
  959. Finally, we can set values for the new options:
  960. <screen>
  961. "Dhcp6": {
  962. "option-data": [
  963. {
  964. <userinput>"name": "subopt1",
  965. "space": "isc",
  966. "code": 1,
  967. "csv-format": true,
  968. "data": "2001:db8::abcd"</userinput>
  969. },
  970. }
  971. <userinput>"name": "subopt2",
  972. "space": "isc",
  973. "code": 2,
  974. "csv-format": true,
  975. "data": "Hello world"</userinput>
  976. },
  977. {
  978. <userinput>"name": "container",
  979. "space": "dhcp6",
  980. "code": 102,
  981. "csv-format": true,
  982. "data": ""</userinput>
  983. }
  984. ],
  985. ...
  986. }
  987. </screen>
  988. Even though the "container" option does not carry any data except
  989. sub-options, the "data" field must be explicitly set to an empty value.
  990. This is required because in the current version of BIND 10 DHCP, the default
  991. configuration values are not propagated to the configuration parsers: if the
  992. "data" is not set the parser will assume that this parameter is not
  993. specified and an error will be reported.
  994. </para>
  995. <para>Note that it is possible to create an option which carries some data
  996. in addition to the sub-options defined in the encapsulated option space.
  997. For example, if the "container" option from the previous example was
  998. required to carry an uint16 value as well as the sub-options, the "type"
  999. value would have to be set to "uint16" in the option definition. (Such an
  1000. option would then have the following data structure: DHCP header, uint16
  1001. value, sub-options.) The value specified with the "data" parameter - which
  1002. should be a valid integer enclosed in quotes, e.g. "123" - would then be
  1003. assigned to the uint16 field in the "container" option.
  1004. </para>
  1005. </section>
  1006. <section id="dhcp6-config-subnets">
  1007. <title>IPv6 Subnet Selection</title>
  1008. <para>
  1009. The DHCPv6 server may receive requests from local (connected to the
  1010. same subnet as the server) and remote (connecting via relays) clients.
  1011. As server may have many subnet configurations defined, it must select
  1012. appropriate subnet for a given request.
  1013. </para>
  1014. <para>
  1015. The server can not assume which of configured subnets are local. It is
  1016. possible in IPv4, where there is reasonable expectation that the
  1017. server will have a (global) IPv4 address configured on the interface,
  1018. and can use that information to detect whether a subnet is local or
  1019. not. That assumption is not true in IPv6, as the DHCPv6 must be able
  1020. to operate with having link-local addresses only. Therefore an optional
  1021. &quot;interface&quot; parameter is available within a subnet definition
  1022. to designate that a given subnet is local, i.e. reachable directly over
  1023. specified interface. For example the server that is intended to serve
  1024. a local subnet over eth0 may be configured as follows:
  1025. <screen>
  1026. "Dhcp6": {
  1027. "subnet6": [
  1028. {
  1029. "subnet": "2001:db8:beef::/48",
  1030. "pools": [
  1031. {
  1032. "pool": "2001:db8:beef::/48"
  1033. }
  1034. ],
  1035. <userinput>"interface": "eth0"</userinput>
  1036. }
  1037. ],
  1038. ...
  1039. }
  1040. </screen>
  1041. </para>
  1042. </section>
  1043. <section id="dhcp6-relays">
  1044. <title>DHCPv6 Relays</title>
  1045. <para>
  1046. A DHCPv6 server with multiple subnets defined must select the
  1047. appropriate subnet when it receives a request from client. For clients
  1048. connected via relays, two mechanisms are used:
  1049. </para>
  1050. <para>
  1051. The first uses the linkaddr field in the RELAY_FORW message. The name
  1052. of this field is somewhat misleading in that it does not contain a link-layer
  1053. address: instead, it holds an address (typically a global address) that is
  1054. used to identify a link. The DHCPv6 server checks if the address belongs
  1055. to a defined subnet and, if it does, that subnet is selected for the client's
  1056. request.
  1057. </para>
  1058. <para>
  1059. The second mechanism is based on interface-id options. While forwarding a client's
  1060. message, relays may insert an interface-id option into the message that
  1061. identifies the interface on the relay that received the message. (Some
  1062. relays allow configuration of that parameter, but it is sometimes
  1063. hardcoded and may range from the very simple (e.g. "vlan100") to the very cryptic:
  1064. one example seen on real hardware was "ISAM144|299|ipv6|nt:vp:1:110"). The
  1065. server can use this information to select the appropriate subnet.
  1066. The information is also returned to the relay which then knows the
  1067. interface to use to transmit the response to the client. In order for
  1068. this to work successfully, the relay interface IDs must be unique within
  1069. the network and the server configuration must match those values.
  1070. </para>
  1071. <para>
  1072. When configuring the DHCPv6 server, it should be noted that two
  1073. similarly-named parameters can be configured for a subnet:
  1074. <itemizedlist>
  1075. <listitem><simpara>
  1076. "interface" defines which local network interface can be used
  1077. to access a given subnet.
  1078. </simpara></listitem>
  1079. <listitem><simpara>
  1080. "interface-id" specifies the content of the interface-id option
  1081. used by relays to identify the interface on the relay to which
  1082. the response packet is sent.
  1083. </simpara></listitem>
  1084. </itemizedlist>
  1085. The two are mutually exclusive: a subnet cannot be both reachable locally
  1086. (direct traffic) and via relays (remote traffic). Specifying both is a
  1087. configuration error and the DHCPv6 server will refuse such a configuration.
  1088. </para>
  1089. <para>
  1090. To specify interface-id with value "vlan123", the following commands can
  1091. be used:
  1092. <screen>
  1093. "Dhcp6": {
  1094. "subnet6": [
  1095. {
  1096. "subnet": "2001:db8:beef::/48",
  1097. "pools": [
  1098. {
  1099. "pool": "2001:db8:beef::/48"
  1100. }
  1101. ],
  1102. <userinput>"interface-id": "vlan123"</userinput>
  1103. }
  1104. ],
  1105. ...
  1106. }
  1107. </screen>
  1108. </para>
  1109. </section>
  1110. <section id="dhcp6-client-classifier">
  1111. <title>Client Classification in DHCPv6</title>
  1112. <note>
  1113. <para>
  1114. DHCPv6 server has been extended to support limited client classification.
  1115. Although the current capability is modest, it is expected to be expanded
  1116. in the future. It is envisaged that the majority of client classification
  1117. extensions will be using hooks extensions.
  1118. </para>
  1119. </note>
  1120. <para>In certain cases it is useful to differentiate between different types
  1121. of clients and treat them differently. The process of doing classification
  1122. is conducted in two steps. The first step is to assess incoming packet and
  1123. assign it to zero or more classes. This classification is currently simple,
  1124. but is expected to grow in capability soon. Currently the server checks whether
  1125. incoming packet has vendor class option (16). If it has, content
  1126. of that option is prepended with &quot;VENDOR_CLASS_&quot; interpreted as a
  1127. class. For example, modern cable modems will send this option with value
  1128. &quot;docsis3.0&quot; and as a result the packet will belong to class
  1129. &quot;VENDOR_CLASS_docsis3.0&quot;.
  1130. </para>
  1131. <para>It is envisaged that the client classification will be used for changing
  1132. behavior of almost any part of the DHCP engine processing, including assigning
  1133. leases from different pools, assigning different option (or different values of
  1134. the same options) etc. For now, there is only one mechanism that is taking
  1135. advantage of client classification: subnet selection.</para>
  1136. <para>
  1137. Kea can be instructed to limit access to given subnets based on class information.
  1138. This is particularly useful for cases where two types of devices share the
  1139. same link and are expected to be served from two different subnets. The
  1140. primary use case for such a scenario are cable networks. There are two
  1141. classes of devices: cable modem itself, which should be handled a lease
  1142. from subnet A and all other devices behind modems that should get a lease
  1143. from subnet B. That segregation is essential to prevent overly curious
  1144. users from playing with their cable modems. For details on how to set up
  1145. class restrictions on subnets, see <xref linkend="dhcp6-subnet-class"/>.
  1146. </para>
  1147. </section>
  1148. <section id="dhcp6-subnet-class">
  1149. <title>Limiting access to IPv6 subnet to certain classes</title>
  1150. <para>
  1151. In certain cases it beneficial to restrict access to certain subnets
  1152. only to clients that belong to a given subnet. For details on client
  1153. classes, see <xref linkend="dhcp6-client-classifier"/>. This is an
  1154. extension of a previous example from <xref linkend="dhcp6-address-config"/>.
  1155. Let's assume that the server is connected to a network segment that uses
  1156. the 2001:db8:1::/64 prefix. The Administrator of that network has
  1157. decided that addresses from range 2001:db8:1::1 to 2001:db8:1::ffff are
  1158. going to be managed by the Dhcp6 server. Only clients belonging to the
  1159. eRouter1.0 client class are allowed to use that pool. Such a
  1160. configuration can be achieved in the following way:
  1161. <screen>
  1162. "Dhcp6": {
  1163. "subnet6": [
  1164. {
  1165. "subnet": "2001:db8:1::/64",
  1166. "pools": [
  1167. {
  1168. "pool": "2001:db8:1::-2001:db8:1::ffff"
  1169. }
  1170. ],
  1171. <userinput>"client-class": "VENDOR_CLASS_eRouter1.0"</userinput>
  1172. }
  1173. ],
  1174. ...
  1175. }
  1176. </screen>
  1177. </para>
  1178. <para>
  1179. Care should be taken with client classification as it is easy to prevent
  1180. clients that do not meet class criteria to be denied any service altogether.
  1181. </para>
  1182. </section>
  1183. <section id="dhcp6-ddns-config">
  1184. <title>Configuring DHCPv6 for DDNS</title>
  1185. <para>
  1186. As mentioned earlier, kea-dhcp6 can be configured to generate requests to
  1187. the DHCP-DDNS server (referred to here as the "D2" server) to update
  1188. DNS entries. These requests are known as NameChangeRequests or NCRs.
  1189. Each NCR contains the following information:
  1190. <orderedlist>
  1191. <listitem><para>
  1192. Whether it is a request to add (update) or remove DNS entries
  1193. </para></listitem>
  1194. <listitem><para>
  1195. Whether the change requests forward DNS updates (AAAA records), reverse
  1196. DNS updates (PTR records), or both.
  1197. </para></listitem>
  1198. <listitem><para>
  1199. The FQDN, lease address, and DHCID
  1200. </para></listitem>
  1201. </orderedlist>
  1202. The parameters controlling the generation of NCRs for submission to D2
  1203. are contained in the "dhcp-ddns" section of kea-dhcp6
  1204. configuration. The default values for this section appears as follows:
  1205. <screen>
  1206. "Dhcp6": {
  1207. "dhcp-ddns": {
  1208. <userinput>"enable-updates": true,
  1209. "server-ip": "127.0.0.1",
  1210. "server-port": 53001,
  1211. "sender-ip": "",
  1212. "sender-port: 0,
  1213. "max-queue-size": 1024,
  1214. "ncr-protocol": "UDP",
  1215. "ncr-format": "JSON",
  1216. "override-no-update": false,
  1217. "override-client-update": false,
  1218. "replace-client-name": false,
  1219. "generated-prefix": "myhost",
  1220. "qualifying-suffix": "example.com"</userinput>
  1221. },
  1222. ...
  1223. }
  1224. </screen>
  1225. </para>
  1226. <section id="dhcpv6-d2-io-config">
  1227. <title>DHCP-DDNS Server Connectivity</title>
  1228. <para>
  1229. In order for NCRs to reach the D2 server, kea-dhcp6 must be able
  1230. to communicate with it. kea-dhcp6 uses the following configuration
  1231. parameters to control how it communications with D2:
  1232. <itemizedlist>
  1233. <listitem><simpara>
  1234. <command>enable-updates</command> - determines whether or not kea-dhcp6 will
  1235. generate NCRs. If missing, this value is assumed to be false hence DDNS updates
  1236. are disabled. To enable DDNS updates set this value to true:
  1237. </simpara></listitem>
  1238. <listitem><simpara>
  1239. <command>server-ip</command> - IP address on which D2 listens for requests. The default is
  1240. the local loopback interface at address 127.0.0.1. You may specify
  1241. either an IPv4 or IPv6 address.
  1242. </simpara></listitem>
  1243. <listitem><simpara>
  1244. <command>server-port</command> - port on which D2 listens for requests. The default value
  1245. is 53001.
  1246. </simpara></listitem>
  1247. <listitem><simpara>
  1248. <command>sender-ip</command> - IP address which kea-dhcp6 should use to send requests to D2.
  1249. The default value is blank which instructs kea-dhcp6 to select a suitable
  1250. address.
  1251. </simpara></listitem>
  1252. <listitem><simpara>
  1253. <command>sender-port</command> - port which kea-dhcp6 should use to send requests to D2. The
  1254. default value of 0 instructs kea-dhcp6 to select suitable port.
  1255. </simpara></listitem>
  1256. <listitem><simpara>
  1257. <command>max-queue-size</command> - maximum number of requests allowed to queue waiting to
  1258. be sent to D2. This value guards against requests accumulating
  1259. uncontrollably if they are being generated faster than they can be
  1260. delivered. If the number of requests queued for transmission reaches
  1261. this value, DDNS updating will be turned off until the queue backlog has
  1262. been sufficiently reduced. The intent is allow kea-dhcp6 to
  1263. continue lease operations. The default value is 1024.
  1264. </simpara></listitem>
  1265. <listitem><simpara>
  1266. <command>ncr-format</command> - Socket protocol use when sending requests to D2. Currently
  1267. only UDP is supported. TCP may be available in an upcoming release.
  1268. </simpara></listitem>
  1269. <listitem><simpara>
  1270. <command>ncr-protocol</command> - Packet format to use when sending requests to D2.
  1271. Currently only JSON format is supported. Other formats may be available
  1272. in future releases.
  1273. </simpara></listitem>
  1274. </itemizedlist>
  1275. By default, D2 is assumed to running on the same machine as kea-dhcp6, and
  1276. all of the default values mentioned above should be sufficient.
  1277. If, however, D2 has been configured to listen on a different address or
  1278. port, these values must altered accordingly. For example, if D2 has been
  1279. configured to listen on 2001:db8::5 port 900, the following commands
  1280. would be required:
  1281. <screen>
  1282. "Dhcp6": {
  1283. "dhcp-ddns: {
  1284. <userinput>"server-ip": "2001:db8::5",
  1285. "server-port": 900</userinput>,
  1286. ...
  1287. },
  1288. ...
  1289. }
  1290. </screen>
  1291. </para>
  1292. </section>
  1293. <section id="dhcpv6-d2-rules-config">
  1294. <title>When does kea-dhcp6 generate DDNS request</title>
  1295. <para>kea-dhcp6 follows the behavior prescribed for DHCP servers in
  1296. <ulink url="http://tools.ietf.org/html/rfc4704">RFC 4704</ulink>.
  1297. It is important to keep in mind that kea-dhcp6 provides the initial
  1298. decision making of when and what to update and forwards that
  1299. information to D2 in the form of NCRs. Carrying out the actual
  1300. DNS updates and dealing with such things as conflict resolution
  1301. are the purview of D2 (<xref linkend="dhcp-ddns-server"/>).</para>
  1302. <para>
  1303. This section describes when kea-dhcp6 will generate NCRs and the
  1304. configuration parameters that can be used to influence this decision.
  1305. It assumes that the "enable-updates" parameter is true.
  1306. </para>
  1307. <note>
  1308. <para>
  1309. Currently the interface between kea-dhcp6 and D2 only supports requests
  1310. which update DNS entries for a single IP address. If a lease grants
  1311. more than one address, kea-dhcp6 will create the DDNS update request for
  1312. only the first of these addresses. Support for multiple address
  1313. mappings may be provided in a future release.
  1314. </para>
  1315. </note>
  1316. <para>
  1317. In general, kea-dhcp6 will generate DDNS update requests when:
  1318. <orderedlist>
  1319. <listitem><para>
  1320. A new lease is granted in response to a DHCP REQUEST
  1321. </para></listitem>
  1322. <listitem><para>
  1323. An existing lease is renewed but the FQDN associated with it has
  1324. changed.
  1325. </para></listitem>
  1326. <listitem><para>
  1327. An existing lease is released in response to a DHCP RELEASE
  1328. </para></listitem>
  1329. </orderedlist>
  1330. In the second case, lease renewal, two DDNS requests will be issued: one
  1331. request to remove entries for the previous FQDN and a second request to
  1332. add entries for the new FQDN. In the last case, a lease release, a
  1333. single DDNS request to remove its entries will be made. The decision
  1334. making involved when granting a new lease is more involved and is
  1335. discussed next.
  1336. </para>
  1337. <para>
  1338. kea-dhcp6 will generate a DDNS update request only if the DHCP REQUEST
  1339. contains the FQDN option (code 39). By default kea-dhcp6 will
  1340. respect the FQDN N and S flags specified by the client as shown in the
  1341. following table:
  1342. </para>
  1343. <table id="dhcp6-fqdn-flag-table">
  1344. <title>Default FQDN Flag Behavior</title>
  1345. <tgroup cols='4' align='left'>
  1346. <colspec colname='cflags'/>
  1347. <colspec colname='meaning'/>
  1348. <colspec colname='response'/>
  1349. <colspec colname='sflags'/>
  1350. <thead>
  1351. <row>
  1352. <entry>Client Flags:N-S</entry>
  1353. <entry>Client Intent</entry>
  1354. <entry>Server Response</entry>
  1355. <entry>Server Flags:N-S-O</entry>
  1356. </row>
  1357. </thead>
  1358. <tbody>
  1359. <row>
  1360. <entry>0-0</entry>
  1361. <entry>
  1362. Client wants to do forward updates, server should do reverse updates
  1363. </entry>
  1364. <entry>Server generates reverse-only request</entry>
  1365. <entry>1-0-0</entry>
  1366. </row>
  1367. <row>
  1368. <entry>0-1</entry>
  1369. <entry>Server should do both forward and reverse updates</entry>
  1370. <entry>Server generates request to update both directions</entry>
  1371. <entry>0-1-0</entry>
  1372. </row>
  1373. <row>
  1374. <entry>1-0</entry>
  1375. <entry>Client wants no updates done</entry>
  1376. <entry>Server does not generate a request</entry>
  1377. <entry>1-0-0</entry>
  1378. </row>
  1379. </tbody>
  1380. </tgroup>
  1381. </table>
  1382. <para>
  1383. The first row in the table above represents "client delegation". Here
  1384. the DHCP client states that it intends to do the forward DNS updates and
  1385. the server should do the reverse updates. By default, kea-dhcp6 will honor
  1386. the client's wishes and generate a DDNS request to D2 to update only
  1387. reverse DNS data. The parameter, "override-client-update", can be used
  1388. to instruct the server to override client delegation requests. When
  1389. this parameter is true, kea-dhcp6 will disregard requests for client
  1390. delegation and generate a DDNS request to update both forward and
  1391. reverse DNS data. In this case, the N-S-O flags in the server's
  1392. response to the client will be 0-1-1 respectively.
  1393. </para>
  1394. <para>
  1395. (Note that the flag combination N=1, S=1 is prohibited according to
  1396. RFC 4702. If such a combination is received from the client, the packet
  1397. will be dropped by kea-dhcp6.)
  1398. </para>
  1399. <para>
  1400. To override client delegation, issue the following commands:
  1401. </para>
  1402. <screen>
  1403. "Dhcp6": {
  1404. "dhcp-ddns": {
  1405. <userinput>"override-client-update": true</userinput>,
  1406. ...
  1407. },
  1408. ...
  1409. }
  1410. </screen>
  1411. <para>
  1412. The third row in the table above describes the case in which the client
  1413. requests that no DNS updates be done. The parameter, "override-no-update",
  1414. can be used to instruct the server to disregard the client's wishes. When
  1415. this parameter is true, kea-dhcp6 will generate DDNS update request to D2
  1416. even if the client requests no updates be done. The N-S-O flags in the
  1417. server's response to the client will be 0-1-1.
  1418. </para>
  1419. <para>
  1420. To override client delegation, issue the following commands:
  1421. </para>
  1422. <screen>
  1423. "Dhcp6": {
  1424. "dhcp-ddns": {
  1425. <userinput>"override-no-update": true</userinput>,
  1426. ...
  1427. },
  1428. ...
  1429. }
  1430. </screen>
  1431. </section>
  1432. <section id="dhcpv6-fqdn-name-generation">
  1433. <title>kea-dhcp6 name generation for DDNS update requests</title>
  1434. <para>Each NameChangeRequest must of course include the fully qualified domain
  1435. name whose DNS entries are to be affected. kea-dhcp6 can be configured to
  1436. supply a portion or all of that name based upon what it receives from
  1437. the client in the DHCP REQUEST.</para>
  1438. <para>The rules for determining the FQDN option are as follows:
  1439. <orderedlist>
  1440. <listitem><para>
  1441. If configured to do so ignore the REQUEST contents and generate a
  1442. FQDN using a configurable prefix and suffix.
  1443. </para></listitem>
  1444. <listitem><para>
  1445. Otherwise, using is the domain name value from the client FQDN option as
  1446. the candidate name:
  1447. <orderedlist>
  1448. <listitem><para>
  1449. If the candidate name is a fully qualified domain name then use it.
  1450. </para></listitem>
  1451. <listitem><para>
  1452. If the candidate name is a partial (i.e. unqualified) name then
  1453. add a configurable suffix to the name and use the result as the FQDN.
  1454. </para></listitem>
  1455. <listitem><para>
  1456. If the candidate name is a empty then generate a FQDN using a
  1457. configurable prefix and suffix.
  1458. </para></listitem>
  1459. </orderedlist>
  1460. </para></listitem>
  1461. </orderedlist>
  1462. To instruct kea-dhcp6 to always generate a FQDN, set the parameter
  1463. "replace-client-name" to true:
  1464. </para>
  1465. <screen>
  1466. "Dhcp6": {
  1467. "dhcp-ddns": {
  1468. <userinput>"replace-client-name": true</userinput>,
  1469. ...
  1470. },
  1471. ...
  1472. }
  1473. </screen>
  1474. <para>
  1475. The prefix used when generating a FQDN is specified by the
  1476. "generated-prefix" parameter. The default value is "myhost". To alter
  1477. its value, simply set it to the desired string:
  1478. </para>
  1479. <screen>
  1480. "Dhcp6": {
  1481. "dhcp-ddns": {
  1482. <userinput>"generated-prefix": "another.host"</userinput>,
  1483. ...
  1484. },
  1485. ...
  1486. }
  1487. </screen>
  1488. <para>
  1489. The suffix used when generating a FQDN or when qualifying a partial name
  1490. is specified by the <command>qualifying-suffix</command> parameter. There
  1491. is no default value. To set its value simply set it to the desired string:
  1492. </para>
  1493. <screen>
  1494. "Dhcp6": {
  1495. "dhcp-ddns": {
  1496. <userinput>"qualifying-suffix": "foo.example.org"</userinput>,
  1497. ...
  1498. },
  1499. ...
  1500. }
  1501. </screen>
  1502. </section>
  1503. <para>
  1504. When qualifying a partial name, kea-dhcp6 will construct a name with the
  1505. format:
  1506. </para>
  1507. <para>
  1508. [candidate-name].[qualifying-suffix].
  1509. </para>
  1510. <para>
  1511. where candidate-name is the partial name supplied in the REQUEST.
  1512. For example, if FQDN domain name value was "some-computer" and assuming
  1513. the default value for qualifying-suffix, the generated FQDN would be:
  1514. </para>
  1515. <para>
  1516. some-computer.example.com.
  1517. </para>
  1518. <para>
  1519. When generating a the entire name, kea-dhcp6 will construct name of the
  1520. format:
  1521. </para>
  1522. <para>
  1523. [generated-prefix]-[address-text].[qualifying-suffix].
  1524. </para>
  1525. <para>
  1526. where address-text is simply the lease IP address converted to a
  1527. hyphenated string. For example, if lease address is 3001:1::70E and
  1528. assuming default values for generated-prefix and qualifying-suffix, the
  1529. generated FQDN would be:
  1530. </para>
  1531. <para>
  1532. myhost-3001-1--70E.example.com.
  1533. </para>
  1534. </section>
  1535. </section>
  1536. <section id="dhcp6-serverid">
  1537. <title>Server Identifier in DHCPv6</title>
  1538. <para>The DHCPv6 protocol uses a "server identifier" (also known
  1539. as a DUID) for clients to be able to discriminate between several
  1540. servers present on the same link. There are several types of
  1541. DUIDs defined, but <ulink url="http://tools.ietf.org/html/rfc3315">RFC 3315</ulink> instructs servers to use DUID-LLT if
  1542. possible. This format consists of a link-layer (MAC) address and a
  1543. timestamp. When started for the first time, the DHCPv6 server will
  1544. automatically generate such a DUID and store the chosen value to
  1545. a file. That file is read by the server
  1546. and the contained value used whenever the server is subsequently started.
  1547. </para>
  1548. <para>
  1549. It is unlikely that this parameter should ever need to be changed.
  1550. However, if such a need arises, stop the server, edit the file and restart
  1551. the server. (The file is named kea-dhcp6-serverid and by default is
  1552. stored in the "var" subdirectory of the directory in which BIND 10 is installed.
  1553. This can be changed when BIND 10 is built by using "--localstatedir"
  1554. on the "configure" command line.) The file is a text file that contains
  1555. double digit hexadecimal values
  1556. separated by colons. This format is similar to typical MAC address
  1557. format. Spaces are ignored. No extra characters are allowed in this
  1558. file.
  1559. </para>
  1560. </section>
  1561. <section id="dhcp6-relay-override">
  1562. <title>Using specific relay agent for a subnet</title>
  1563. <para>
  1564. The relay has to have an interface connected to the link on which
  1565. the clients are being configured. Typically the relay has a global IPv6
  1566. address configured on that interface that belongs to the subnet that
  1567. the server will assign addresses from. In such typical case, the
  1568. server is able to use IPv6 address inserted by the relay (in link-addr
  1569. field in RELAY-FORW message) to select appropriate subnet.
  1570. </para>
  1571. <para>
  1572. However, that is not always the case. The relay
  1573. address may not match the subnet in certain deployments. This
  1574. usually means that there is more than one subnet allocated for a given
  1575. link. Two most common examples where this is the case are long lasting
  1576. network renumbering (where both old and new address space is still being
  1577. used) and a cable network. In a cable network both cable modems and the
  1578. devices behind them are physically connected to the same link, yet
  1579. they use distinct addressing. In such case, the DHCPv6 server needs
  1580. additional information (like the value of interface-id option or IPv6
  1581. address inserted in the link-addr field in RELAY-FORW message) to
  1582. properly select an appropriate subnet.
  1583. </para>
  1584. <para>
  1585. The following example assumes that there is a subnet 2001:db8:1::/64
  1586. that is accessible via relay that uses 3000::1 as its IPv6 address.
  1587. The server will be able to select this subnet for any incoming packets
  1588. that came from a relay that has an address in 2001:db8:1::/64 subnet.
  1589. It will also select that subnet for a relay with address 3000::1.
  1590. <screen>
  1591. "Dhcp6": {
  1592. "subnet6": [
  1593. {
  1594. "subnet": "2001:db8:1::/64",
  1595. "pools": [
  1596. {
  1597. "pool": "2001:db8:1::1-2001:db8:1::ffff"
  1598. }
  1599. ],
  1600. <userinput>"relay": {
  1601. "ip-address": "3000::1"
  1602. }</userinput>
  1603. }
  1604. ]
  1605. }
  1606. </screen>
  1607. </para>
  1608. </section>
  1609. <section id="dhcp6-client-class-relay">
  1610. <title>Segregating IPv6 clients in a cable network</title>
  1611. <para>
  1612. In certain cases, it is useful to mix relay address information,
  1613. introduced in <xref linkend="dhcp6-relay-override"/> with client
  1614. classification, explained in <xref linkend="dhcp6-subnet-class"/>.
  1615. One specific example is cable network, where typically modems
  1616. get addresses from a different subnet than all devices connected
  1617. behind them.
  1618. </para>
  1619. <para>
  1620. Let's assume that there is one CMTS (Cable Modem Termination System)
  1621. with one CM MAC (a physical link that modems are connected to).
  1622. We want the modems to get addresses from the 3000::/64 subnet,
  1623. while everything connected behind modems should get addresses from
  1624. another subnet (2001:db8:1::/64). The CMTS that acts as a relay
  1625. an uses address 3000::1. The following configuration can serve
  1626. that configuration:
  1627. <screen>
  1628. "Dhcp6": {
  1629. "subnet6": [
  1630. {
  1631. "subnet": "3000::/64",
  1632. "pools": [
  1633. { "pool": "3000::2 - 3000::ffff" }
  1634. ],
  1635. <userinput>"client-class": "VENDOR_CLASS_docsis3.0",
  1636. "relay": {
  1637. "ip-address": "3000::1"
  1638. }</userinput>
  1639. },
  1640. {
  1641. "subnet": "2001:db8:1::/64",
  1642. "pools": [
  1643. {
  1644. "pool": "2001:db8:1::1-2001:db8:1::ffff"
  1645. }
  1646. ],
  1647. <userinput>"relay": {
  1648. "ip-address": "3000::1"
  1649. }</userinput>
  1650. }
  1651. ]
  1652. }
  1653. </screen>
  1654. </para>
  1655. </section>
  1656. <section id="dhcp6-std">
  1657. <title>Supported Standards</title>
  1658. <para>The following standards and draft standards are currently
  1659. supported:</para>
  1660. <itemizedlist>
  1661. <listitem>
  1662. <simpara><ulink url="http://tools.ietf.org/html/rfc3315">RFC 3315</ulink>: Supported messages are SOLICIT,
  1663. ADVERTISE, REQUEST, RELEASE, RENEW, REBIND and REPLY.</simpara>
  1664. </listitem>
  1665. <listitem>
  1666. <simpara><ulink url="http://tools.ietf.org/html/rfc3633">RFC 3633</ulink>: Supported options are IA_PD and
  1667. IA_PREFIX. Also supported is the status code NoPrefixAvail.</simpara>
  1668. </listitem>
  1669. <listitem>
  1670. <simpara><ulink url="http://tools.ietf.org/html/rfc3646">RFC 3646</ulink>: Supported option is DNS_SERVERS.</simpara>
  1671. </listitem>
  1672. <listitem>
  1673. <simpara><ulink url="http://tools.ietf.org/html/rfc4704">RFC 4704</ulink>: Supported option is CLIENT_FQDN.</simpara>
  1674. </listitem>
  1675. </itemizedlist>
  1676. </section>
  1677. <section id="dhcp6-limit">
  1678. <title>DHCPv6 Server Limitations</title>
  1679. <para> These are the current limitations and known problems
  1680. with the DHCPv6 server
  1681. software. Most of them are reflections of the early stage of
  1682. development and should be treated as <quote>not implemented
  1683. yet</quote>, rather than actual limitations.</para>
  1684. <itemizedlist>
  1685. <listitem> <!-- see tickets #3234, #3281 -->
  1686. <para>
  1687. On-line configuration has some limitations. Adding new subnets or
  1688. modifying existing ones work, as is removing the last subnet from
  1689. the list. However, removing non-last (e.g. removing subnet 1,2 or 3 if
  1690. there are 4 subnets configured) will cause issues. The problem is
  1691. caused by simplistic subnet-id assignment. The subnets are always
  1692. numbered, starting from 1. That subnet-id is then used in leases
  1693. that are stored in the lease database. Removing non-last subnet will
  1694. cause the configuration information to mismatch data in the lease
  1695. database. It is possible to manually update subnet-id fields in
  1696. MySQL or PostgreSQL database, but it is awkward and error prone
  1697. process. A better reconfiguration support is planned.
  1698. </para>
  1699. </listitem>
  1700. <listitem>
  1701. <simpara>
  1702. The server will allocate, renew or rebind a maximum of one lease
  1703. for a particular IA option (IA_NA or IA_PD) sent by a client.
  1704. <ulink url="http://tools.ietf.org/html/rfc3315">RFC 3315</ulink> and
  1705. <ulink url="http://tools.ietf.org/html/rfc3633">RFC 3633</ulink> allow
  1706. for multiple addresses or prefixes to be allocated for a single IA.
  1707. </simpara>
  1708. </listitem>
  1709. <listitem>
  1710. <simpara>Temporary addresses are not supported.</simpara>
  1711. </listitem>
  1712. <listitem>
  1713. <simpara>
  1714. Duplication report (DECLINE),
  1715. stateless configuration (INFORMATION-REQUEST) and client
  1716. reconfiguration (RECONFIGURE) are not yet supported.
  1717. </simpara>
  1718. </listitem>
  1719. <listitem>
  1720. <simpara>
  1721. The server doesn't act upon expired leases. In particular,
  1722. when a lease expires, the server doesn't request removal of
  1723. the DNS records associated with it.
  1724. </simpara>
  1725. </listitem>
  1726. </itemizedlist>
  1727. </section>
  1728. <!--
  1729. <section id="dhcp6-srv-examples">
  1730. <title>Kea DHCPv6 server examples</title>
  1731. <para>
  1732. This section provides easy to use example. Each example can be read
  1733. separately. It is not intended to be read sequentially as there will
  1734. be many repetitions between examples. They are expected to serve as
  1735. easy to use copy-paste solutions to many common deployments.
  1736. </para>
  1737. @todo: add simple configuration for direct clients
  1738. @todo: add configuration for relayed clients
  1739. @todo: add client classification example
  1740. </section> -->
  1741. </chapter>