dhcp6-srv.xml 78 KB

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