dhcp6-srv.xml 76 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853
  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>Each <command>pool</command> is a structure that contains the
  419. parameters th describe a single pool. Currently there is only one
  420. parameter, <command>pool</command>, which gives the range of addresses
  421. in the pool. Additional parameters will be added in future releases of
  422. Kea.</para>
  423. <para>It is possible to define more than one pool in a
  424. subnet: continuing the previous example, further assume that
  425. 2001:db8:1:0:5::/80 should be also be managed by the server. It could be written as
  426. 2001:db8:1:0:5:: to 2001:db8:1::5:ffff:ffff:ffff, but typing so many 'f's
  427. is cumbersome. It can be expressed more simply as 2001:db8:1:0:5::/80. Both
  428. formats are supported by Dhcp6 and can be mixed in the pool list.
  429. For example, one could define the following pools:
  430. <screen>
  431. "Dhcp6": {
  432. <userinput>"subnet6": [
  433. {
  434. "subnet": "2001:db8:1::/64",
  435. "pools": [
  436. { pool: "2001:db8:1::1-2001:db8:1::ffff" },
  437. { pool: "2001:db8:1:05::/80" }
  438. ]</userinput>,
  439. ...
  440. }
  441. ]
  442. }</screen>
  443. The number of pools is not limited, but for performance reasons it is recommended to
  444. use as few as possible.
  445. </para>
  446. <para>
  447. The server may be configured to serve more than one subnet. To add a second subnet,
  448. use a command similar to the following:
  449. <screen>
  450. "Dhcp6": {
  451. <userinput>"subnet6": [
  452. {
  453. "subnet": "2001:db8:1::/64",
  454. "pools": [
  455. { pool: "2001:db8:1::1-2001:db8:1::ffff" }
  456. ]
  457. },
  458. {
  459. "subnet": "2001:db8:2::/64",
  460. "pools": [
  461. { pool: "2001:db8:2::/64" }
  462. ]
  463. },
  464. </userinput>
  465. ...
  466. ]
  467. }</screen>
  468. In this example, we allow server to
  469. dynamically assign all addresses available in the whole subnet. Although
  470. rather wasteful, it is certainly a valid configuration to dedicate the
  471. whole /64 subnet for that purpose. Note that the Kea server does not preallocate
  472. the leases, so there is no danger of using gigantic address pools.
  473. </para>
  474. <para>
  475. When configuring a DHCPv6 server using prefix/length notation, please pay
  476. attention to the boundary values. When specifying that the server should use
  477. a given pool, it will be able to allocate also first (typically network
  478. address) address from that pool. For example for pool 2001:db8:2::/64 the
  479. 2001:db8:2:: address may be assigned as well. If you want to avoid this,
  480. use the "min-max" notation.
  481. </para>
  482. </section>
  483. <section>
  484. <!-- @todo: add real meat to the prefix delegation config this is just place holder stuff -->
  485. <title>Subnet and Prefix Delegation Pools</title>
  486. <para>
  487. Subnets may also be configured to delegate prefixes, as defined in
  488. <ulink url="http://tools.ietf.org/html/rfc3633">RFC 3633</ulink>.
  489. A subnet may have one or more prefix delegation pools. Each pool has
  490. a prefixed address, which is specified as a prefix and a prefix length,
  491. as well as a delegated prefix length. <command>delegated-len</command>
  492. must not be shorter (numerically greater) than
  493. <command>prefix-len</command>. If both <command>delegated-len</command>
  494. and <command>prefix-len</command> are equal, the server will be able to
  495. delegate only one prefix. A sample configuration is shown below:
  496. <screen>
  497. "Dhcp6": {
  498. "subnet6": [
  499. {
  500. "subnet": "2001:d8b:1::/64",
  501. <userinput>"pd-pools": [
  502. {
  503. "prefix": "2001:db8:1::",
  504. "prefix-len": 64,
  505. "delegated-len": 96
  506. }
  507. ]</userinput>
  508. }
  509. ],
  510. ...
  511. }</screen>
  512. </para>
  513. </section>
  514. <section id="dhcp6-std-options">
  515. <title>Standard DHCPv6 options</title>
  516. <para>
  517. One of the major features of DHCPv6 server is to provide configuration
  518. options to clients. Although there are several options that require
  519. special behavior, most options are sent by the server only if the client
  520. explicitly requested them. The following example shows how to
  521. configure DNS servers, which is one of the most frequently used
  522. options. Numbers in the first column are added for easier reference and
  523. will not appear on screen. Options specified in this way are considered
  524. global and apply to all configured subnets.
  525. <screen>
  526. "Dhcp6": {
  527. "option-data": [
  528. {
  529. <userinput>"name": "dns-servers",
  530. "code": 23,
  531. "space": "dhcp6",
  532. "csv-format": true,
  533. "data": "2001:db8::cafe, 2001:db8::babe"</userinput>
  534. },
  535. ...
  536. ]
  537. }
  538. </screen>
  539. </para>
  540. <para>
  541. The first line creates new entry in option-data table. It contains
  542. information on all global options that the server is supposed to configure
  543. in all subnets. The second line specifies option name. For a complete list
  544. of currently supported names, see <xref
  545. linkend="dhcp6-std-options-list"/>. The third line specifies option code,
  546. which must match one of the values from that list. Line beginning with
  547. <command>space</command> specifies option space, which must always be set
  548. to "dhcp6" as these are standard DHCPv6 options. For other name spaces,
  549. including custom option spaces, see <xref
  550. linkend="dhcp6-option-spaces"/>. The fifth line specifies the format in
  551. which the data will be entered: use of CSV (comma separated values) is
  552. recommended. The sixth line gives the actual value to be sent to
  553. clients. Data is specified as a normal text, with values separated by
  554. commas if more than one value is allowed.
  555. </para>
  556. <para>
  557. Options can also be configured as hexadecimal values. If csv-format is
  558. set to false, the option data must be specified as a string of hexadecimal
  559. numbers. The
  560. following commands configure the DNS-SERVERS option for all
  561. subnets with the following addresses: 2001:db8:1::cafe and
  562. 2001:db8:1::babe.
  563. <screen>
  564. "Dhcp6": {
  565. "option-data": [
  566. {
  567. <userinput>"name": "dns-servers",
  568. "code": 23,
  569. "space": "dhcp6",
  570. "csv-format": false,
  571. "data": "2001 0DB8 0001 0000 0000 0000 0000 CAFE
  572. 2001 0DB8 0001 0000 0000 0000 0000 BABE"</userinput>
  573. },
  574. ...
  575. ]
  576. }
  577. </screen>
  578. The value for the setting of the "data" element is split across two
  579. lines in this document for clarity: when entering the command, the
  580. whole string should be entered on the same line. Care should be taken
  581. to use proper encoding when using hexadecimal format as Kea's ability
  582. to validate data correctness in hexadecimal is limited.
  583. </para>
  584. <para>
  585. It is possible to override options on a per-subnet basis. If
  586. clients connected to most of your subnets are expected to get the
  587. same values of a given option, you should use global options: you
  588. can then override specific values for a small number of subnets.
  589. On the other hand, if you use different values in each subnet,
  590. it does not make sense to specify global option values
  591. (Dhcp6/option-data), rather you should set only subnet-specific values
  592. (Dhcp6/subnet[X]/option-data[Y]).
  593. </para>
  594. <para>
  595. The following commands override the global
  596. DNS servers option for a particular subnet, setting a single DNS
  597. server with address 2001:db8:1::3.
  598. <screen>
  599. "Dhcp6": {
  600. "subnet6": [
  601. {
  602. <userinput>"option-data": [
  603. {
  604. "name": "dns-servers",
  605. "code": 23,
  606. "space: "dhcp6",
  607. "csv-format": true,
  608. "data": "2001:db8:1::3"
  609. },
  610. ...
  611. ]</userinput>,
  612. ...
  613. },
  614. ...
  615. ],
  616. ...
  617. }
  618. </screen>
  619. </para>
  620. <note>
  621. <para>
  622. In future versions of Kea, it will not be necessary to specify
  623. the <command>code</command>, <command>space</command>
  624. and <command>csv-format</command> fields, as they will
  625. be set automatically.
  626. </para>
  627. </note>
  628. <para>
  629. The currently supported standard DHCPv6 options are
  630. listed in <xref linkend="dhcp6-std-options-list"/>.
  631. The "Name" and "Code"
  632. are the values that should be used as a name in the option-data
  633. structures. "Type" designates the format of the data: the meanings of
  634. the various types is given in <xref linkend="dhcp-types"/>.
  635. </para>
  636. <para>
  637. Some options are designated as arrays, which means that more than one
  638. value is allowed in such an option. For example the option dns-servers
  639. allows the specification of more than one IPv6 address, so allowing
  640. clients to obtain the addresses of multiple DNS servers.
  641. </para>
  642. <!-- @todo: describe record types -->
  643. <para>
  644. The <xref linkend="dhcp6-custom-options"/> describes the configuration
  645. syntax to create custom option definitions (formats). It is generally not
  646. allowed to create custom definitions for standard options, even if the
  647. definition being created matches the actual option format defined in the
  648. RFCs. There is an exception from this rule for standard options for which
  649. Kea does not provide a definition yet. In order to use such options,
  650. a server administrator must create a definition as described in
  651. <xref linkend="dhcp6-custom-options"/> in the 'dhcp6' option space. This
  652. definition should match the option format described in the relevant
  653. RFC but configuration mechanism would allow any option format as it has
  654. no means to validate it at the moment.
  655. </para>
  656. <para>
  657. <table frame="all" id="dhcp6-std-options-list">
  658. <title>List of standard DHCPv6 options</title>
  659. <tgroup cols='4'>
  660. <colspec colname='name'/>
  661. <colspec colname='code' align='center'/>
  662. <colspec colname='type' align='center'/>
  663. <colspec colname='array' align='center'/>
  664. <thead>
  665. <row><entry>Name</entry><entry>Code</entry><entry>Type</entry><entry>Array?</entry></row>
  666. </thead>
  667. <tbody>
  668. <!-- Our engine uses those options on its own, admin must not configure them on his own
  669. <row><entry>clientid</entry><entry>1</entry><entry>binary</entry><entry>false</entry></row>
  670. <row><entry>serverid</entry><entry>2</entry><entry>binary</entry><entry>false</entry></row>
  671. <row><entry>ia-na</entry><entry>3</entry><entry>record</entry><entry>false</entry></row>
  672. <row><entry>ia-ta</entry><entry>4</entry><entry>uint32</entry><entry>false</entry></row>
  673. <row><entry>iaaddr</entry><entry>5</entry><entry>record</entry><entry>false</entry></row>
  674. <row><entry>oro</entry><entry>6</entry><entry>uint16</entry><entry>true</entry></row> -->
  675. <row><entry>preference</entry><entry>7</entry><entry>uint8</entry><entry>false</entry></row>
  676. <!-- Our engine uses those options on its own, admin must not configure them on his own
  677. <row><entry>elapsed-time</entry><entry>8</entry><entry>uint16</entry><entry>false</entry></row>
  678. <row><entry>relay-msg</entry><entry>9</entry><entry>binary</entry><entry>false</entry></row>
  679. <row><entry>auth</entry><entry>11</entry><entry>binary</entry><entry>false</entry></row>
  680. <row><entry>unicast</entry><entry>12</entry><entry>ipv6-address</entry><entry>false</entry></row>
  681. <row><entry>status-code</entry><entry>13</entry><entry>record</entry><entry>false</entry></row>
  682. <row><entry>rapid-commit</entry><entry>14</entry><entry>empty</entry><entry>false</entry></row>
  683. <row><entry>user-class</entry><entry>15</entry><entry>binary</entry><entry>false</entry></row>
  684. <row><entry>vendor-class</entry><entry>16</entry><entry>record</entry><entry>false</entry></row>
  685. <row><entry>vendor-opts</entry><entry>17</entry><entry>uint32</entry><entry>false</entry></row>
  686. <row><entry>interface-id</entry><entry>18</entry><entry>binary</entry><entry>false</entry></row>
  687. <row><entry>reconf-msg</entry><entry>19</entry><entry>uint8</entry><entry>false</entry></row>
  688. <row><entry>reconf-accept</entry><entry>20</entry><entry>empty</entry><entry>false</entry></row> -->
  689. <row><entry>sip-server-dns</entry><entry>21</entry><entry>fqdn</entry><entry>true</entry></row>
  690. <row><entry>sip-server-addr</entry><entry>22</entry><entry>ipv6-address</entry><entry>true</entry></row>
  691. <row><entry>dns-servers</entry><entry>23</entry><entry>ipv6-address</entry><entry>true</entry></row>
  692. <row><entry>domain-search</entry><entry>24</entry><entry>fqdn</entry><entry>true</entry></row>
  693. <!-- <row><entry>ia-pd</entry><entry>25</entry><entry>record</entry><entry>false</entry></row> -->
  694. <!-- <row><entry>iaprefix</entry><entry>26</entry><entry>record</entry><entry>false</entry></row> -->
  695. <row><entry>nis-servers</entry><entry>27</entry><entry>ipv6-address</entry><entry>true</entry></row>
  696. <row><entry>nisp-servers</entry><entry>28</entry><entry>ipv6-address</entry><entry>true</entry></row>
  697. <row><entry>nis-domain-name</entry><entry>29</entry><entry>fqdn</entry><entry>true</entry></row>
  698. <row><entry>nisp-domain-name</entry><entry>30</entry><entry>fqdn</entry><entry>true</entry></row>
  699. <row><entry>sntp-servers</entry><entry>31</entry><entry>ipv6-address</entry><entry>true</entry></row>
  700. <row><entry>information-refresh-time</entry><entry>32</entry><entry>uint32</entry><entry>false</entry></row>
  701. <row><entry>bcmcs-server-dns</entry><entry>33</entry><entry>fqdn</entry><entry>true</entry></row>
  702. <row><entry>bcmcs-server-addr</entry><entry>34</entry><entry>ipv6-address</entry><entry>true</entry></row>
  703. <row><entry>geoconf-civic</entry><entry>36</entry><entry>record</entry><entry>false</entry></row>
  704. <row><entry>remote-id</entry><entry>37</entry><entry>record</entry><entry>false</entry></row>
  705. <row><entry>subscriber-id</entry><entry>38</entry><entry>binary</entry><entry>false</entry></row>
  706. <row><entry>client-fqdn</entry><entry>39</entry><entry>record</entry><entry>false</entry></row>
  707. <row><entry>pana-agent</entry><entry>40</entry><entry>ipv6-address</entry><entry>true</entry></row>
  708. <row><entry>new-posix-timezone</entry><entry>41</entry><entry>string</entry><entry>false</entry></row>
  709. <row><entry>new-tzdb-timezone</entry><entry>42</entry><entry>string</entry><entry>false</entry></row>
  710. <row><entry>ero</entry><entry>43</entry><entry>uint16</entry><entry>true</entry></row>
  711. <row><entry>lq-query</entry><entry>44</entry><entry>record</entry><entry>false</entry></row>
  712. <row><entry>client-data</entry><entry>45</entry><entry>empty</entry><entry>false</entry></row>
  713. <row><entry>clt-time</entry><entry>46</entry><entry>uint32</entry><entry>false</entry></row>
  714. <row><entry>lq-relay-data</entry><entry>47</entry><entry>record</entry><entry>false</entry></row>
  715. <row><entry>lq-client-link</entry><entry>48</entry><entry>ipv6-address</entry><entry>true</entry></row>
  716. </tbody>
  717. </tgroup>
  718. </table>
  719. </para>
  720. </section>
  721. <section id="dhcp6-custom-options">
  722. <title>Custom DHCPv6 options</title>
  723. <para>It is also possible to define options other than the standard ones.
  724. Assume that we want to define a new DHCPv6 option called "foo" which will have
  725. code 100 and will convey a single unsigned 32 bit integer value. We can define
  726. such an option by using the following commands:
  727. <screen>
  728. "Dhcp6": {
  729. "option-def": [
  730. {
  731. <userinput>"name": "foo",
  732. "code": 100,
  733. "type": "uint32",
  734. "array": false,
  735. "record-types": "",
  736. "space": "dhcp6",
  737. "encapsulate": ""</userinput>
  738. }, ...
  739. ],
  740. ...
  741. }
  742. </screen>
  743. The "false" value of the "array" parameter determines that the option does
  744. NOT comprise an array of "uint32" values but rather a single value. Two
  745. other parameters have been left blank: "record-types" and "encapsulate".
  746. The former specifies the comma separated list of option data fields if the
  747. option comprises a record of data fields. The "record-fields" value should
  748. be non-empty if the "type" is set to "record". Otherwise it must be left
  749. blank. The latter parameter specifies the name of the option space being
  750. encapsulated by the particular option. If the particular option does not
  751. encapsulate any option space it should be left blank. Note that the above
  752. set of comments define the format of the new option and do not set its
  753. values.
  754. </para>
  755. <para>Once the new option format is defined, its value is set
  756. in the same way as for a standard option. For example the following
  757. commands set a global value that applies to all subnets.
  758. <screen>
  759. "Dhcp6": {
  760. "option-data": [
  761. {
  762. <userinput>name "foo",
  763. "code": 100,
  764. "space": "dhcp6",
  765. "csv-format": true,
  766. "data": "12345"</userinput>
  767. }, ...
  768. ],
  769. ...
  770. }
  771. </screen>
  772. </para>
  773. <para>New options can take more complex forms than simple use of
  774. primitives (uint8, string, ipv6-address etc): it is possible to
  775. define an option comprising a number of existing primitives.
  776. </para>
  777. <para>
  778. Assume we want to define a new option that will consist of an IPv6
  779. address, followed by an unsigned 16 bit integer, followed by a
  780. boolean value, followed by a text string. Such an option could
  781. be defined in the following way:
  782. <screen>
  783. "Dhcp6": {
  784. "option-def": [
  785. {
  786. <userinput>"name": "bar",
  787. "code": 101,
  788. "space": "dhcp6",
  789. "type": "record",
  790. "array": false,
  791. "record-types": "ipv4-address, uint16, boolean, string",
  792. "encapsulate": ""</userinput>
  793. }, ...
  794. ],
  795. ...
  796. }
  797. </screen>
  798. The "type" is set to "record" to indicate that the option contains
  799. multiple values of different types. These types are given as a comma-separated
  800. list in the "record-types" field and should be those listed in <xref linkend="dhcp-types"/>.
  801. </para>
  802. <para>
  803. The values of the option are set as follows:
  804. <screen>
  805. "Dhcp6": {
  806. "option-data": [
  807. {
  808. <userinput>"name": "bar",
  809. "space": "dhcp6",
  810. "code": 101,
  811. "csv-format": true,
  812. "data": "2001:db8:1::10, 123, false, Hello World"</userinput>
  813. }
  814. ],
  815. ...
  816. }</screen>
  817. <command>csv-format</command> is set <command>true</command> to indicate
  818. that the <command>data</command> field comprises a command-separated list
  819. of values. The values in the "data" must correspond to the types set in
  820. the "record-types" field of the option definition.
  821. </para>
  822. <note>
  823. <para>In general case, boolean values are specified as <command>true</command> or
  824. <command>false</command>, without quotes. Some specific boolean parameters may
  825. accept also <command>"true"</command>, <command>"false"</command>,
  826. <command>0</command>, <command>1</command>, <command>"0"</command> and
  827. <command>"1"</command>. Future Kea versions will accept all those values
  828. for all boolean parameters.</para>
  829. </note>
  830. </section>
  831. <section id="dhcp6-vendor-opts">
  832. <title>DHCPv6 vendor specific options</title>
  833. <para>
  834. Currently there are three option spaces defined: dhcp4 (to be used
  835. in DHCPv4 daemon) and dhcp6 (for the DHCPv6 daemon); there is also
  836. vendor-opts-space, which is empty by default, but options can be
  837. defined in it. Those options are called vendor-specific information
  838. options. The following examples show how to define an option "foo"
  839. with code 1 that consists of an IPv6 address, an unsigned 16 bit integer
  840. and a string. The "foo" option is conveyed in a vendor specific
  841. information option. This option comprises a single uint32 value
  842. that is set to "12345". The sub-option "foo" follows the data
  843. field holding this value.
  844. <screen>
  845. "Dhcp6": {
  846. "option-def": [
  847. {
  848. <userinput>"name": "foo",
  849. "code": 1,
  850. "space": "vendor-encapsulated-options-space",
  851. "type": "record",
  852. "array": false,
  853. "record-types": "ipv6-address, uint16, string",
  854. "encapsulates": ""</userinput>
  855. }
  856. ],
  857. ...
  858. }</screen>
  859. (Note that the option space is set to <command>vendor-opts-space</command>.)
  860. Once the option format is defined, the next step is to define actual values
  861. for that option:
  862. <screen>
  863. "Dhcp6": {
  864. "option-data": [
  865. {
  866. <userinput>"name": "foo"
  867. "space": "vendor-encapsulated-options-space",
  868. "code": 1,
  869. "csv-format": true,
  870. "data": "2001:db8:1::10, 123, Hello World"</userinput>
  871. },
  872. ...
  873. ],
  874. ...
  875. }</screen>
  876. We should also define values for the vendor-opts, that will convey our
  877. option foo.
  878. <screen>
  879. "Dhcp6": {
  880. "option-data": [
  881. ...,
  882. {
  883. <userinput>"name": "vendor-encapsulated-options"
  884. "space": "dhcp6",
  885. "code": 17,
  886. "csv-format": true,
  887. "data": "12345"</userinput>
  888. }
  889. ],
  890. ...
  891. }</screen>
  892. </para>
  893. </section>
  894. <section id="dhcp6-option-spaces">
  895. <title>Nested DHCPv6 options (custom option spaces)</title>
  896. <para>It is sometimes useful to define completely new option
  897. spaces. This is useful if the user wants his new option to
  898. convey sub-options that use separate numbering scheme, for
  899. example sub-options with codes 1 and 2. Those option codes
  900. conflict with standard DHCPv6 options, so a separate option
  901. space must be defined.
  902. </para>
  903. <para>Note that it is not required to create new option space when
  904. defining sub-options for a standard option because it is by
  905. default created if the standard option is meant to convey
  906. any sub-options (see <xref linkend="dhcp6-vendor-opts"/>).
  907. </para>
  908. <para>
  909. Assume that we want to have a DHCPv6 option called "container"
  910. with code 102 that conveys two sub-options with codes 1 and 2.
  911. First we need to define the new sub-options:
  912. <screen>
  913. "Dhcp6": {
  914. "option-def": [
  915. {
  916. <userinput>"name": "subopt1",
  917. "code": 1,
  918. "space": "isc",
  919. "type": "ipv6-address".
  920. "record-types": "",
  921. "array": false,
  922. "encapsulate ""
  923. },
  924. {
  925. "name": "subopt2",
  926. "code": 2,
  927. "space": "isc",
  928. "type": "string",
  929. "record-types": "",
  930. "array": false
  931. "encapsulate": ""</userinput>
  932. }
  933. ],
  934. ...
  935. }</screen>
  936. Note that we have defined the options to belong to a new option space
  937. (in this case, "isc").
  938. </para>
  939. <para>
  940. The next step is to define a regular DHCPv6 option and specify that it
  941. should include options from the isc option space:
  942. <screen>
  943. "Dhcp6": {
  944. "option-def": [
  945. ...,
  946. {
  947. <userinput>"name": "container",
  948. "code": 102,
  949. "space": "dhcp6",
  950. "type": "empty",
  951. "array": false,
  952. "record-types": "",
  953. "encapsulate": "isc"</userinput>
  954. }
  955. ],
  956. ...
  957. }</screen>
  958. The name of the option space in which the sub-options are defined is set in
  959. the <command>encapsulate</command> field. The <command>type</command> field
  960. is set to <command>empty</command> which imposes that this option does not
  961. carry any data other than sub-options.
  962. </para>
  963. <para>
  964. Finally, we can set values for the new options:
  965. <screen>
  966. "Dhcp6": {
  967. "option-data": [
  968. {
  969. <userinput>"name": "subopt1",
  970. "space": "isc",
  971. "code": 1,
  972. "csv-format": true,
  973. "data": "2001:db8::abcd"</userinput>
  974. },
  975. }
  976. <userinput>"name": "subopt2",
  977. "space": "isc",
  978. "code": 2,
  979. "csv-format": true,
  980. "data": "Hello world"</userinput>
  981. },
  982. {
  983. <userinput>"name": "container",
  984. "space": "dhcp6",
  985. "code": 102,
  986. "csv-format": true,
  987. "data": ""</userinput>
  988. }
  989. ],
  990. ...
  991. }
  992. </screen>
  993. Even though the "container" option does not carry any data except
  994. sub-options, the "data" field must be explicitly set to an empty value.
  995. This is required because in the current version of BIND 10 DHCP, the default
  996. configuration values are not propagated to the configuration parsers: if the
  997. "data" is not set the parser will assume that this parameter is not
  998. specified and an error will be reported.
  999. </para>
  1000. <para>Note that it is possible to create an option which carries some data
  1001. in addition to the sub-options defined in the encapsulated option space.
  1002. For example, if the "container" option from the previous example was
  1003. required to carry an uint16 value as well as the sub-options, the "type"
  1004. value would have to be set to "uint16" in the option definition. (Such an
  1005. option would then have the following data structure: DHCP header, uint16
  1006. value, sub-options.) The value specified with the "data" parameter - which
  1007. should be a valid integer enclosed in quotes, e.g. "123" - would then be
  1008. assigned to the uint16 field in the "container" option.
  1009. </para>
  1010. </section>
  1011. <section id="dhcp6-config-subnets">
  1012. <title>IPv6 Subnet Selection</title>
  1013. <para>
  1014. The DHCPv6 server may receive requests from local (connected to the
  1015. same subnet as the server) and remote (connecting via relays) clients.
  1016. As server may have many subnet configurations defined, it must select
  1017. appropriate subnet for a given request.
  1018. </para>
  1019. <para>
  1020. The server can not assume which of configured subnets are local. It is
  1021. possible in IPv4, where there is reasonable expectation that the
  1022. server will have a (global) IPv4 address configured on the interface,
  1023. and can use that information to detect whether a subnet is local or
  1024. not. That assumption is not true in IPv6, as the DHCPv6 must be able
  1025. to operate with having link-local addresses only. Therefore an optional
  1026. &quot;interface&quot; parameter is available within a subnet definition
  1027. to designate that a given subnet is local, i.e. reachable directly over
  1028. specified interface. For example the server that is intended to serve
  1029. a local subnet over eth0 may be configured as follows:
  1030. <screen>
  1031. "Dhcp6": {
  1032. "subnet6": [
  1033. {
  1034. "subnet": "2001:db8:beef::/48",
  1035. "pools": [
  1036. {
  1037. "pool": "2001:db8:beef::/48"
  1038. }
  1039. ],
  1040. <userinput>"interface": "eth0"</userinput>
  1041. }
  1042. ],
  1043. ...
  1044. }
  1045. </screen>
  1046. </para>
  1047. </section>
  1048. <section id="dhcp6-relays">
  1049. <title>DHCPv6 Relays</title>
  1050. <para>
  1051. A DHCPv6 server with multiple subnets defined must select the
  1052. appropriate subnet when it receives a request from client. For clients
  1053. connected via relays, two mechanisms are used:
  1054. </para>
  1055. <para>
  1056. The first uses the linkaddr field in the RELAY_FORW message. The name
  1057. of this field is somewhat misleading in that it does not contain a link-layer
  1058. address: instead, it holds an address (typically a global address) that is
  1059. used to identify a link. The DHCPv6 server checks if the address belongs
  1060. to a defined subnet and, if it does, that subnet is selected for the client's
  1061. request.
  1062. </para>
  1063. <para>
  1064. The second mechanism is based on interface-id options. While forwarding a client's
  1065. message, relays may insert an interface-id option into the message that
  1066. identifies the interface on the relay that received the message. (Some
  1067. relays allow configuration of that parameter, but it is sometimes
  1068. hardcoded and may range from the very simple (e.g. "vlan100") to the very cryptic:
  1069. one example seen on real hardware was "ISAM144|299|ipv6|nt:vp:1:110"). The
  1070. server can use this information to select the appropriate subnet.
  1071. The information is also returned to the relay which then knows the
  1072. interface to use to transmit the response to the client. In order for
  1073. this to work successfully, the relay interface IDs must be unique within
  1074. the network and the server configuration must match those values.
  1075. </para>
  1076. <para>
  1077. When configuring the DHCPv6 server, it should be noted that two
  1078. similarly-named parameters can be configured for a subnet:
  1079. <itemizedlist>
  1080. <listitem><simpara>
  1081. "interface" defines which local network interface can be used
  1082. to access a given subnet.
  1083. </simpara></listitem>
  1084. <listitem><simpara>
  1085. "interface-id" specifies the content of the interface-id option
  1086. used by relays to identify the interface on the relay to which
  1087. the response packet is sent.
  1088. </simpara></listitem>
  1089. </itemizedlist>
  1090. The two are mutually exclusive: a subnet cannot be both reachable locally
  1091. (direct traffic) and via relays (remote traffic). Specifying both is a
  1092. configuration error and the DHCPv6 server will refuse such a configuration.
  1093. </para>
  1094. <para>
  1095. To specify interface-id with value "vlan123", the following commands can
  1096. be used:
  1097. <screen>
  1098. "Dhcp6": {
  1099. "subnet6": [
  1100. {
  1101. "subnet": "2001:db8:beef::/48",
  1102. "pools": [
  1103. {
  1104. "pool": "2001:db8:beef::/48"
  1105. }
  1106. ],
  1107. <userinput>"interface-id": "vlan123"</userinput>
  1108. }
  1109. ],
  1110. ...
  1111. }
  1112. </screen>
  1113. </para>
  1114. </section>
  1115. <section id="dhcp6-client-classifier">
  1116. <title>Client Classification in DHCPv6</title>
  1117. <note>
  1118. <para>
  1119. DHCPv6 server has been extended to support limited client classification.
  1120. Although the current capability is modest, it is expected to be expanded
  1121. in the future. It is envisaged that the majority of client classification
  1122. extensions will be using hooks extensions.
  1123. </para>
  1124. </note>
  1125. <para>In certain cases it is useful to differentiate between different types
  1126. of clients and treat them differently. The process of doing classification
  1127. is conducted in two steps. The first step is to assess incoming packet and
  1128. assign it to zero or more classes. This classification is currently simple,
  1129. but is expected to grow in capability soon. Currently the server checks whether
  1130. incoming packet has vendor class option (16). If it has, content
  1131. of that option is prepended with &quot;VENDOR_CLASS_&quot; interpreted as a
  1132. class. For example, modern cable modems will send this option with value
  1133. &quot;docsis3.0&quot; and as a result the packet will belong to class
  1134. &quot;VENDOR_CLASS_docsis3.0&quot;.
  1135. </para>
  1136. <para>It is envisaged that the client classification will be used for changing
  1137. behavior of almost any part of the DHCP engine processing, including assigning
  1138. leases from different pools, assigning different option (or different values of
  1139. the same options) etc. For now, there is only one mechanism that is taking
  1140. advantage of client classification: subnet selection.</para>
  1141. <para>
  1142. Kea can be instructed to limit access to given subnets based on class information.
  1143. This is particularly useful for cases where two types of devices share the
  1144. same link and are expected to be served from two different subnets. The
  1145. primary use case for such a scenario are cable networks. There are two
  1146. classes of devices: cable modem itself, which should be handled a lease
  1147. from subnet A and all other devices behind modems that should get a lease
  1148. from subnet B. That segregation is essential to prevent overly curious
  1149. users from playing with their cable modems. For details on how to set up
  1150. class restrictions on subnets, see <xref linkend="dhcp6-subnet-class"/>.
  1151. </para>
  1152. </section>
  1153. <section id="dhcp6-subnet-class">
  1154. <title>Limiting access to IPv6 subnet to certain classes</title>
  1155. <para>
  1156. In certain cases it beneficial to restrict access to certain subnets
  1157. only to clients that belong to a given subnet. For details on client
  1158. classes, see <xref linkend="dhcp6-client-classifier"/>. This is an
  1159. extension of a previous example from <xref linkend="dhcp6-address-config"/>.
  1160. Let's assume that the server is connected to a network segment that uses
  1161. the 2001:db8:1::/64 prefix. The Administrator of that network has
  1162. decided that addresses from range 2001:db8:1::1 to 2001:db8:1::ffff are
  1163. going to be managed by the Dhcp6 server. Only clients belonging to the
  1164. eRouter1.0 client class are allowed to use that pool. Such a
  1165. configuration can be achieved in the following way:
  1166. <screen>
  1167. "Dhcp6": {
  1168. "subnet6": [
  1169. {
  1170. "subnet": "2001:db8:1::/64",
  1171. "pools": [
  1172. {
  1173. "pool": "2001:db8:1::-2001:db8:1::ffff"
  1174. }
  1175. ],
  1176. <userinput>"client-class": "VENDOR_CLASS_eRouter1.0"</userinput>
  1177. }
  1178. ],
  1179. ...
  1180. }
  1181. </screen>
  1182. </para>
  1183. <para>
  1184. Care should be taken with client classification as it is easy to prevent
  1185. clients that do not meet class criteria to be denied any service altogether.
  1186. </para>
  1187. </section>
  1188. <section id="dhcp6-ddns-config">
  1189. <title>Configuring DHCPv6 for DDNS</title>
  1190. <para>
  1191. As mentioned earlier, kea-dhcp6 can be configured to generate requests to
  1192. the DHCP-DDNS server (referred to here as the "D2" server) to update
  1193. DNS entries. These requests are known as NameChangeRequests or NCRs.
  1194. Each NCR contains the following information:
  1195. <orderedlist>
  1196. <listitem><para>
  1197. Whether it is a request to add (update) or remove DNS entries
  1198. </para></listitem>
  1199. <listitem><para>
  1200. Whether the change requests forward DNS updates (AAAA records), reverse
  1201. DNS updates (PTR records), or both.
  1202. </para></listitem>
  1203. <listitem><para>
  1204. The FQDN, lease address, and DHCID
  1205. </para></listitem>
  1206. </orderedlist>
  1207. The parameters controlling the generation of NCRs for submission to D2
  1208. are contained in the "dhcp-ddns" section of kea-dhcp6
  1209. configuration. The default values for this section appears as follows:
  1210. <screen>
  1211. "Dhcp6": {
  1212. "dhcp-ddns": {
  1213. <userinput>"enable-updates": true,
  1214. "server-ip": "127.0.0.1",
  1215. "server-port": 53001,
  1216. "sender-ip": "",
  1217. "sender-port: 0,
  1218. "max-queue-size": 1024,
  1219. "ncr-protocol": "UDP",
  1220. "ncr-format": "JSON",
  1221. "override-no-update": false,
  1222. "override-client-update": false,
  1223. "replace-client-name": false,
  1224. "generated-prefix": "myhost",
  1225. "qualifying-suffix": "example.com"</userinput>
  1226. },
  1227. ...
  1228. }
  1229. </screen>
  1230. </para>
  1231. <section id="dhcpv6-d2-io-config">
  1232. <title>DHCP-DDNS Server Connectivity</title>
  1233. <para>
  1234. In order for NCRs to reach the D2 server, kea-dhcp6 must be able
  1235. to communicate with it. kea-dhcp6 uses the following configuration
  1236. parameters to control how it communications with D2:
  1237. <itemizedlist>
  1238. <listitem><simpara>
  1239. <command>enable-updates</command> - determines whether or not kea-dhcp6 will
  1240. generate NCRs. If missing, this value is assumed to be false hence DDNS updates
  1241. are disabled. To enable DDNS updates set this value to true:
  1242. </simpara></listitem>
  1243. <listitem><simpara>
  1244. <command>server-ip</command> - IP address on which D2 listens for requests. The default is
  1245. the local loopback interface at address 127.0.0.1. You may specify
  1246. either an IPv4 or IPv6 address.
  1247. </simpara></listitem>
  1248. <listitem><simpara>
  1249. <command>server-port</command> - port on which D2 listens for requests. The default value
  1250. is 53001.
  1251. </simpara></listitem>
  1252. <listitem><simpara>
  1253. <command>sender-ip</command> - IP address which kea-dhcp6 should use to send requests to D2.
  1254. The default value is blank which instructs kea-dhcp6 to select a suitable
  1255. address.
  1256. </simpara></listitem>
  1257. <listitem><simpara>
  1258. <command>sender-port</command> - port which kea-dhcp6 should use to send requests to D2. The
  1259. default value of 0 instructs kea-dhcp6 to select suitable port.
  1260. </simpara></listitem>
  1261. <listitem><simpara>
  1262. <command>max-queue-size</command> - maximum number of requests allowed to queue waiting to
  1263. be sent to D2. This value guards against requests accumulating
  1264. uncontrollably if they are being generated faster than they can be
  1265. delivered. If the number of requests queued for transmission reaches
  1266. this value, DDNS updating will be turned off until the queue backlog has
  1267. been sufficiently reduced. The intent is allow kea-dhcp6 to
  1268. continue lease operations. The default value is 1024.
  1269. </simpara></listitem>
  1270. <listitem><simpara>
  1271. <command>ncr-format</command> - Socket protocol use when sending requests to D2. Currently
  1272. only UDP is supported. TCP may be available in an upcoming release.
  1273. </simpara></listitem>
  1274. <listitem><simpara>
  1275. <command>ncr-protocol</command> - Packet format to use when sending requests to D2.
  1276. Currently only JSON format is supported. Other formats may be available
  1277. in future releases.
  1278. </simpara></listitem>
  1279. </itemizedlist>
  1280. By default, D2 is assumed to running on the same machine as kea-dhcp6, and
  1281. all of the default values mentioned above should be sufficient.
  1282. If, however, D2 has been configured to listen on a different address or
  1283. port, these values must altered accordingly. For example, if D2 has been
  1284. configured to listen on 2001:db8::5 port 900, the following commands
  1285. would be required:
  1286. <screen>
  1287. "Dhcp6": {
  1288. "dhcp-ddns: {
  1289. <userinput>"server-ip": "2001:db8::5",
  1290. "server-port": 900</userinput>,
  1291. ...
  1292. },
  1293. ...
  1294. }
  1295. </screen>
  1296. </para>
  1297. </section>
  1298. <section id="dhcpv6-d2-rules-config">
  1299. <title>When does kea-dhcp6 generate DDNS request</title>
  1300. <para>kea-dhcp6 follows the behavior prescribed for DHCP servers in
  1301. <ulink url="http://tools.ietf.org/html/rfc4704">RFC 4704</ulink>.
  1302. It is important to keep in mind that kea-dhcp6 provides the initial
  1303. decision making of when and what to update and forwards that
  1304. information to D2 in the form of NCRs. Carrying out the actual
  1305. DNS updates and dealing with such things as conflict resolution
  1306. are the purview of D2 (<xref linkend="dhcp-ddns-server"/>).</para>
  1307. <para>
  1308. This section describes when kea-dhcp6 will generate NCRs and the
  1309. configuration parameters that can be used to influence this decision.
  1310. It assumes that the "enable-updates" parameter is true.
  1311. </para>
  1312. <note>
  1313. <para>
  1314. Currently the interface between kea-dhcp6 and D2 only supports requests
  1315. which update DNS entries for a single IP address. If a lease grants
  1316. more than one address, kea-dhcp6 will create the DDNS update request for
  1317. only the first of these addresses. Support for multiple address
  1318. mappings may be provided in a future release.
  1319. </para>
  1320. </note>
  1321. <para>
  1322. In general, kea-dhcp6 will generate DDNS update requests when:
  1323. <orderedlist>
  1324. <listitem><para>
  1325. A new lease is granted in response to a DHCP REQUEST
  1326. </para></listitem>
  1327. <listitem><para>
  1328. An existing lease is renewed but the FQDN associated with it has
  1329. changed.
  1330. </para></listitem>
  1331. <listitem><para>
  1332. An existing lease is released in response to a DHCP RELEASE
  1333. </para></listitem>
  1334. </orderedlist>
  1335. In the second case, lease renewal, two DDNS requests will be issued: one
  1336. request to remove entries for the previous FQDN and a second request to
  1337. add entries for the new FQDN. In the last case, a lease release, a
  1338. single DDNS request to remove its entries will be made. The decision
  1339. making involved when granting a new lease is more involved and is
  1340. discussed next.
  1341. </para>
  1342. <para>
  1343. kea-dhcp6 will generate a DDNS update request only if the DHCP REQUEST
  1344. contains the FQDN option (code 39). By default kea-dhcp6 will
  1345. respect the FQDN N and S flags specified by the client as shown in the
  1346. following table:
  1347. </para>
  1348. <table id="dhcp6-fqdn-flag-table">
  1349. <title>Default FQDN Flag Behavior</title>
  1350. <tgroup cols='4' align='left'>
  1351. <colspec colname='cflags'/>
  1352. <colspec colname='meaning'/>
  1353. <colspec colname='response'/>
  1354. <colspec colname='sflags'/>
  1355. <thead>
  1356. <row>
  1357. <entry>Client Flags:N-S</entry>
  1358. <entry>Client Intent</entry>
  1359. <entry>Server Response</entry>
  1360. <entry>Server Flags:N-S-O</entry>
  1361. </row>
  1362. </thead>
  1363. <tbody>
  1364. <row>
  1365. <entry>0-0</entry>
  1366. <entry>
  1367. Client wants to do forward updates, server should do reverse updates
  1368. </entry>
  1369. <entry>Server generates reverse-only request</entry>
  1370. <entry>1-0-0</entry>
  1371. </row>
  1372. <row>
  1373. <entry>0-1</entry>
  1374. <entry>Server should do both forward and reverse updates</entry>
  1375. <entry>Server generates request to update both directions</entry>
  1376. <entry>0-1-0</entry>
  1377. </row>
  1378. <row>
  1379. <entry>1-0</entry>
  1380. <entry>Client wants no updates done</entry>
  1381. <entry>Server does not generate a request</entry>
  1382. <entry>1-0-0</entry>
  1383. </row>
  1384. </tbody>
  1385. </tgroup>
  1386. </table>
  1387. <para>
  1388. The first row in the table above represents "client delegation". Here
  1389. the DHCP client states that it intends to do the forward DNS updates and
  1390. the server should do the reverse updates. By default, kea-dhcp6 will honor
  1391. the client's wishes and generate a DDNS request to D2 to update only
  1392. reverse DNS data. The parameter, "override-client-update", can be used
  1393. to instruct the server to override client delegation requests. When
  1394. this parameter is true, kea-dhcp6 will disregard requests for client
  1395. delegation and generate a DDNS request to update both forward and
  1396. reverse DNS data. In this case, the N-S-O flags in the server's
  1397. response to the client will be 0-1-1 respectively.
  1398. </para>
  1399. <para>
  1400. (Note that the flag combination N=1, S=1 is prohibited according to
  1401. RFC 4702. If such a combination is received from the client, the packet
  1402. will be dropped by kea-dhcp6.)
  1403. </para>
  1404. <para>
  1405. To override client delegation, issue the following commands:
  1406. </para>
  1407. <screen>
  1408. "Dhcp6": {
  1409. "dhcp-ddns": {
  1410. <userinput>"override-client-update": true</userinput>,
  1411. ...
  1412. },
  1413. ...
  1414. }
  1415. </screen>
  1416. <para>
  1417. The third row in the table above describes the case in which the client
  1418. requests that no DNS updates be done. The parameter, "override-no-update",
  1419. can be used to instruct the server to disregard the client's wishes. When
  1420. this parameter is true, kea-dhcp6 will generate DDNS update request to D2
  1421. even if the client requests no updates be done. The N-S-O flags in the
  1422. server's response to the client will be 0-1-1.
  1423. </para>
  1424. <para>
  1425. To override client delegation, issue the following commands:
  1426. </para>
  1427. <screen>
  1428. "Dhcp6": {
  1429. "dhcp-ddns": {
  1430. <userinput>"override-no-update": true</userinput>,
  1431. ...
  1432. },
  1433. ...
  1434. }
  1435. </screen>
  1436. </section>
  1437. <section id="dhcpv6-fqdn-name-generation">
  1438. <title>kea-dhcp6 name generation for DDNS update requests</title>
  1439. <para>Each NameChangeRequest must of course include the fully qualified domain
  1440. name whose DNS entries are to be affected. kea-dhcp6 can be configured to
  1441. supply a portion or all of that name based upon what it receives from
  1442. the client in the DHCP REQUEST.</para>
  1443. <para>The rules for determining the FQDN option are as follows:
  1444. <orderedlist>
  1445. <listitem><para>
  1446. If configured to do so ignore the REQUEST contents and generate a
  1447. FQDN using a configurable prefix and suffix.
  1448. </para></listitem>
  1449. <listitem><para>
  1450. Otherwise, using is the domain name value from the client FQDN option as
  1451. the candidate name:
  1452. <orderedlist>
  1453. <listitem><para>
  1454. If the candidate name is a fully qualified domain name then use it.
  1455. </para></listitem>
  1456. <listitem><para>
  1457. If the candidate name is a partial (i.e. unqualified) name then
  1458. add a configurable suffix to the name and use the result as the FQDN.
  1459. </para></listitem>
  1460. <listitem><para>
  1461. If the candidate name is a empty then generate a FQDN using a
  1462. configurable prefix and suffix.
  1463. </para></listitem>
  1464. </orderedlist>
  1465. </para></listitem>
  1466. </orderedlist>
  1467. To instruct kea-dhcp6 to always generate a FQDN, set the parameter
  1468. "replace-client-name" to true:
  1469. </para>
  1470. <screen>
  1471. "Dhcp6": {
  1472. "dhcp-ddns": {
  1473. <userinput>"replace-client-name": true</userinput>,
  1474. ...
  1475. },
  1476. ...
  1477. }
  1478. </screen>
  1479. <para>
  1480. The prefix used when generating a FQDN is specified by the
  1481. "generated-prefix" parameter. The default value is "myhost". To alter
  1482. its value, simply set it to the desired string:
  1483. </para>
  1484. <screen>
  1485. "Dhcp6": {
  1486. "dhcp-ddns": {
  1487. <userinput>"generated-prefix": "another.host"</userinput>,
  1488. ...
  1489. },
  1490. ...
  1491. }
  1492. </screen>
  1493. <para>
  1494. The suffix used when generating a FQDN or when qualifying a partial name
  1495. is specified by the <command>qualifying-suffix</command> parameter. There
  1496. is no default value. To set its value simply set it to the desired string:
  1497. </para>
  1498. <screen>
  1499. "Dhcp6": {
  1500. "dhcp-ddns": {
  1501. <userinput>"qualifying-suffix": "foo.example.org"</userinput>,
  1502. ...
  1503. },
  1504. ...
  1505. }
  1506. </screen>
  1507. </section>
  1508. <para>
  1509. When qualifying a partial name, kea-dhcp6 will construct a name with the
  1510. format:
  1511. </para>
  1512. <para>
  1513. [candidate-name].[qualifying-suffix].
  1514. </para>
  1515. <para>
  1516. where candidate-name is the partial name supplied in the REQUEST.
  1517. For example, if FQDN domain name value was "some-computer" and assuming
  1518. the default value for qualifying-suffix, the generated FQDN would be:
  1519. </para>
  1520. <para>
  1521. some-computer.example.com.
  1522. </para>
  1523. <para>
  1524. When generating a the entire name, kea-dhcp6 will construct name of the
  1525. format:
  1526. </para>
  1527. <para>
  1528. [generated-prefix]-[address-text].[qualifying-suffix].
  1529. </para>
  1530. <para>
  1531. where address-text is simply the lease IP address converted to a
  1532. hyphenated string. For example, if lease address is 3001:1::70E and
  1533. assuming default values for generated-prefix and qualifying-suffix, the
  1534. generated FQDN would be:
  1535. </para>
  1536. <para>
  1537. myhost-3001-1--70E.example.com.
  1538. </para>
  1539. </section>
  1540. </section>
  1541. <section id="dhcp6-serverid">
  1542. <title>Server Identifier in DHCPv6</title>
  1543. <para>The DHCPv6 protocol uses a "server identifier" (also known
  1544. as a DUID) for clients to be able to discriminate between several
  1545. servers present on the same link. There are several types of
  1546. DUIDs defined, but <ulink url="http://tools.ietf.org/html/rfc3315">RFC 3315</ulink> instructs servers to use DUID-LLT if
  1547. possible. This format consists of a link-layer (MAC) address and a
  1548. timestamp. When started for the first time, the DHCPv6 server will
  1549. automatically generate such a DUID and store the chosen value to
  1550. a file. That file is read by the server
  1551. and the contained value used whenever the server is subsequently started.
  1552. </para>
  1553. <para>
  1554. It is unlikely that this parameter should ever need to be changed.
  1555. However, if such a need arises, stop the server, edit the file and restart
  1556. the server. (The file is named kea-dhcp6-serverid and by default is
  1557. stored in the "var" subdirectory of the directory in which BIND 10 is installed.
  1558. This can be changed when BIND 10 is built by using "--localstatedir"
  1559. on the "configure" command line.) The file is a text file that contains
  1560. double digit hexadecimal values
  1561. separated by colons. This format is similar to typical MAC address
  1562. format. Spaces are ignored. No extra characters are allowed in this
  1563. file.
  1564. </para>
  1565. </section>
  1566. <section id="dhcp6-relay-override">
  1567. <title>Using specific relay agent for a subnet</title>
  1568. <para>
  1569. The relay has to have an interface connected to the link on which
  1570. the clients are being configured. Typically the relay has a global IPv6
  1571. address configured on that interface that belongs to the subnet that
  1572. the server will assign addresses from. In such typical case, the
  1573. server is able to use IPv6 address inserted by the relay (in link-addr
  1574. field in RELAY-FORW message) to select appropriate subnet.
  1575. </para>
  1576. <para>
  1577. However, that is not always the case. The relay
  1578. address may not match the subnet in certain deployments. This
  1579. usually means that there is more than one subnet allocated for a given
  1580. link. Two most common examples where this is the case are long lasting
  1581. network renumbering (where both old and new address space is still being
  1582. used) and a cable network. In a cable network both cable modems and the
  1583. devices behind them are physically connected to the same link, yet
  1584. they use distinct addressing. In such case, the DHCPv6 server needs
  1585. additional information (like the value of interface-id option or IPv6
  1586. address inserted in the link-addr field in RELAY-FORW message) to
  1587. properly select an appropriate subnet.
  1588. </para>
  1589. <para>
  1590. The following example assumes that there is a subnet 2001:db8:1::/64
  1591. that is accessible via relay that uses 3000::1 as its IPv6 address.
  1592. The server will be able to select this subnet for any incoming packets
  1593. that came from a relay that has an address in 2001:db8:1::/64 subnet.
  1594. It will also select that subnet for a relay with address 3000::1.
  1595. <screen>
  1596. "Dhcp6": {
  1597. "subnet6": [
  1598. {
  1599. "subnet": "2001:db8:1::/64",
  1600. "pools": [
  1601. {
  1602. "pool": "2001:db8:1::1-2001:db8:1::ffff"
  1603. }
  1604. ],
  1605. <userinput>"relay": {
  1606. "ip-address": "3000::1"
  1607. }</userinput>
  1608. }
  1609. ]
  1610. }
  1611. </screen>
  1612. </para>
  1613. </section>
  1614. <section id="dhcp6-client-class-relay">
  1615. <title>Segregating IPv6 clients in a cable network</title>
  1616. <para>
  1617. In certain cases, it is useful to mix relay address information,
  1618. introduced in <xref linkend="dhcp6-relay-override"/> with client
  1619. classification, explained in <xref linkend="dhcp6-subnet-class"/>.
  1620. One specific example is cable network, where typically modems
  1621. get addresses from a different subnet than all devices connected
  1622. behind them.
  1623. </para>
  1624. <para>
  1625. Let's assume that there is one CMTS (Cable Modem Termination System)
  1626. with one CM MAC (a physical link that modems are connected to).
  1627. We want the modems to get addresses from the 3000::/64 subnet,
  1628. while everything connected behind modems should get addresses from
  1629. another subnet (2001:db8:1::/64). The CMTS that acts as a relay
  1630. an uses address 3000::1. The following configuration can serve
  1631. that configuration:
  1632. <screen>
  1633. "Dhcp6": {
  1634. "subnet6": [
  1635. {
  1636. "subnet": "3000::/64",
  1637. "pools": [
  1638. { "pool": "3000::2 - 3000::ffff" }
  1639. ],
  1640. <userinput>"client-class": "VENDOR_CLASS_docsis3.0",
  1641. "relay": {
  1642. "ip-address": "3000::1"
  1643. }</userinput>
  1644. },
  1645. {
  1646. "subnet": "2001:db8:1::/64",
  1647. "pools": [
  1648. {
  1649. "pool": "2001:db8:1::1-2001:db8:1::ffff"
  1650. }
  1651. ],
  1652. <userinput>"relay": {
  1653. "ip-address": "3000::1"
  1654. }</userinput>
  1655. }
  1656. ]
  1657. }
  1658. </screen>
  1659. </para>
  1660. </section>
  1661. <section id="dhcp6-std">
  1662. <title>Supported Standards</title>
  1663. <para>The following standards and draft standards are currently
  1664. supported:</para>
  1665. <itemizedlist>
  1666. <listitem>
  1667. <simpara><ulink url="http://tools.ietf.org/html/rfc3315">RFC 3315</ulink>: Supported messages are SOLICIT,
  1668. ADVERTISE, REQUEST, RELEASE, RENEW, REBIND, CONFIRM and REPLY.</simpara>
  1669. </listitem>
  1670. <listitem>
  1671. <simpara><ulink url="http://tools.ietf.org/html/rfc3633">RFC 3633</ulink>: Supported options are IA_PD and
  1672. IA_PREFIX. Also supported is the status code NoPrefixAvail.</simpara>
  1673. </listitem>
  1674. <listitem>
  1675. <simpara><ulink url="http://tools.ietf.org/html/rfc3646">RFC 3646</ulink>: Supported option is DNS_SERVERS.</simpara>
  1676. </listitem>
  1677. <listitem>
  1678. <simpara><ulink url="http://tools.ietf.org/html/rfc4704">RFC 4704</ulink>: Supported option is CLIENT_FQDN.</simpara>
  1679. </listitem>
  1680. </itemizedlist>
  1681. </section>
  1682. <section id="dhcp6-limit">
  1683. <title>DHCPv6 Server Limitations</title>
  1684. <para> These are the current limitations and known problems
  1685. with the DHCPv6 server
  1686. software. Most of them are reflections of the early stage of
  1687. development and should be treated as <quote>not implemented
  1688. yet</quote>, rather than actual limitations.</para>
  1689. <itemizedlist>
  1690. <listitem> <!-- see tickets #3234, #3281 -->
  1691. <para>
  1692. On-line configuration has some limitations. Adding new subnets or
  1693. modifying existing ones work, as is removing the last subnet from
  1694. the list. However, removing non-last (e.g. removing subnet 1,2 or 3 if
  1695. there are 4 subnets configured) will cause issues. The problem is
  1696. caused by simplistic subnet-id assignment. The subnets are always
  1697. numbered, starting from 1. That subnet-id is then used in leases
  1698. that are stored in the lease database. Removing non-last subnet will
  1699. cause the configuration information to mismatch data in the lease
  1700. database. It is possible to manually update subnet-id fields in
  1701. MySQL or PostgreSQL database, but it is awkward and error prone
  1702. process. A better reconfiguration support is planned.
  1703. </para>
  1704. </listitem>
  1705. <listitem>
  1706. <simpara>
  1707. The server will allocate, renew or rebind a maximum of one lease
  1708. for a particular IA option (IA_NA or IA_PD) sent by a client.
  1709. <ulink url="http://tools.ietf.org/html/rfc3315">RFC 3315</ulink> and
  1710. <ulink url="http://tools.ietf.org/html/rfc3633">RFC 3633</ulink> allow
  1711. for multiple addresses or prefixes to be allocated for a single IA.
  1712. </simpara>
  1713. </listitem>
  1714. <listitem>
  1715. <simpara>Temporary addresses are not supported.</simpara>
  1716. </listitem>
  1717. <listitem>
  1718. <simpara>
  1719. Duplication report (DECLINE), stateless configuration
  1720. (INFORMATION-REQUEST) and client reconfiguration (RECONFIGURE) are
  1721. not yet supported.
  1722. </simpara>
  1723. </listitem>
  1724. <listitem>
  1725. <simpara>
  1726. The server doesn't act upon expired leases. In particular,
  1727. when a lease expires, the server doesn't request removal of
  1728. the DNS records associated with it.
  1729. </simpara>
  1730. </listitem>
  1731. </itemizedlist>
  1732. </section>
  1733. <!--
  1734. <section id="dhcp6-srv-examples">
  1735. <title>Kea DHCPv6 server examples</title>
  1736. <para>
  1737. This section provides easy to use example. Each example can be read
  1738. separately. It is not intended to be read sequentially as there will
  1739. be many repetitions between examples. They are expected to serve as
  1740. easy to use copy-paste solutions to many common deployments.
  1741. </para>
  1742. @todo: add simple configuration for direct clients
  1743. @todo: add configuration for relayed clients
  1744. @todo: add client classification example
  1745. </section> -->
  1746. </chapter>