dhcp6-srv.xml 80 KB

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