kea-guide.xml 209 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449
  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. <!ENTITY % version SYSTEM "version.ent">
  6. %version;
  7. ]>
  8. <!--
  9. - Copyright (C) 2010-2014 Internet Systems Consortium, Inc. ("ISC")
  10. -
  11. - Permission to use, copy, modify, and/or distribute this software for any
  12. - purpose with or without fee is hereby granted, provided that the above
  13. - copyright notice and this permission notice appear in all copies.
  14. -
  15. - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
  16. - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  17. - AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
  18. - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  19. - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
  20. - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  21. - PERFORMANCE OF THIS SOFTWARE.
  22. -->
  23. <book>
  24. <?xml-stylesheet href="bind10-guide.css" type="text/css"?>
  25. <bookinfo>
  26. <title>Kea Administrator Reference Manual</title>
  27. <copyright>
  28. <year>2010-2014</year><holder>Internet Systems Consortium, Inc.</holder>
  29. </copyright>
  30. <abstract>
  31. <para>
  32. Kea is an open source implementation of the Dynamic Host Configuration
  33. Protocol (DHCP) servers, developed and maintained by Internet Systems
  34. Consortium (ISC).
  35. </para>
  36. <para>
  37. This is the reference guide for Kea version &__VERSION__;.
  38. The most up-to-date version of this document (in PDF, HTML,
  39. and plain text formats), along with other documents for
  40. Kea, can be found at <ulink url="http://kea.isc.org/docs"/>.
  41. </para> </abstract>
  42. <releaseinfo>This is the reference guide for Kea version
  43. &__VERSION__;.</releaseinfo>
  44. </bookinfo>
  45. <chapter id="intro">
  46. <title>Introduction</title>
  47. <para>
  48. Kea is the next generation of DHCP servers developed by ISC.
  49. It supports both DHCPv4 and DHCPv6 protocols along with their
  50. extensions, e.g. prefix delegation and dynamic updates to DNS.
  51. </para>
  52. <para>
  53. Kea has been initially developed as a part of the BIND 10 framework
  54. (<ulink url="http://bind10.isc.org"/>). In early 2014, ISC
  55. made the decision to discontinue active development of BIND 10 and
  56. continue development of Kea as standalone DHCP servers. As a result,
  57. the components and libraries related to the BIND10 framework and DNS
  58. are going to be removed from the Kea source tree over time.
  59. In order to remove the dependency on Python 3, the BIND 10 framework
  60. will be replaced by the server startup and configuration mechanisms
  61. written in C++.
  62. </para>
  63. <note>
  64. <simpara>Kea has been implemented in BIND 10 framework and to certain extent
  65. it still depends on various BIND 10 libraries. It also requires the BIND 10
  66. framework to run, because BIND 10 configuration mechanisms are used to
  67. configure Kea. As a result, this document still refers to BIND 10 in many
  68. paragraphs. The term "BIND 10" in the context of this document means
  69. "BIND 10 libraries and applications which are necessary for Kea to run
  70. and configure". The term "Kea" means "the collection of binaries and libraries
  71. which, as a whole, implement the DHCP protocols".
  72. </simpara>
  73. </note>
  74. <para>
  75. This guide covers Kea version &__VERSION__;.
  76. </para>
  77. <section>
  78. <title>Supported Platforms</title>
  79. <para>
  80. Kea is officially supported on RedHat Enterprise Linux,
  81. CentOS, Fedora and FreeBSD systems. It is also likely to work on many
  82. other platforms: builds have been tested on (in no particular order)
  83. Debian GNU/Linux 6 and unstable, Ubuntu 9.10, NetBSD 5,
  84. Solaris 10 and 11, FreeBSD 7 and 8, CentOS Linux 5.3,
  85. MacOS 10.6 and 10.7, and OpenBSD 5.1. Non supported systems
  86. (especially non-Linux) are likely to have issues with directly
  87. connected DHCPv4 clients.
  88. </para>
  89. <para>There are currently no plans to port Kea to Windows platforms.</para>
  90. </section>
  91. <section id="required-software">
  92. <title>Required Software at Run-time</title>
  93. <para>
  94. Running Kea uses various extra software which may
  95. not be provided in some operating systems' default
  96. installations nor standard packages collections. You may
  97. need to install this required software separately.
  98. (For the build requirements, also see
  99. <xref linkend="build-requirements"/>.)
  100. </para>
  101. <para>
  102. Kea was developed as a collection of applications within BIND
  103. 10 framework and it still relies on the remaining parts of
  104. this framework. In particular, the servers' configuration and
  105. startup are still facilitated by the modules which originate
  106. in BIND 10. These modules require at least Python 3.1 to run.
  107. They also work with Python 3.2, 3.3 or 3.4 (<ulink
  108. url="http://www.python.org/"/>). The dependency on Python will
  109. be removed once a replacing configuration and startup
  110. mechanisms are developed and released as Kea 0.9. At this
  111. point Kea will be written in pure C++.
  112. </para>
  113. <para>
  114. Kea uses the Botan crypto library for C++
  115. (<ulink url="http://botan.randombit.net/"/>).
  116. It requires at least Botan version 1.8.
  117. <!-- @todo 0.9/#2406: Add info about OpenSSL here -->
  118. </para>
  119. <para>
  120. Kea uses the log4cplus C++ logging library
  121. (<ulink url="http://log4cplus.sourceforge.net/"/>).
  122. It requires at least log4cplus version 1.0.3.
  123. </para>
  124. <para>
  125. Kea can use MySQL headers and libraries to build MySQL database backend
  126. that can be used to store leases. This is an optional dependency. When
  127. it is missing, Kea will lack the ability to store leases in MySQL
  128. database.
  129. </para>
  130. <para>
  131. Kea can use PostgreSQL headers and libraries to build PostgreSQL
  132. database backend that can be used to store leases. This is an optional
  133. dependency. When it is missing, Kea will lack the ability to store
  134. leases in PostgreSQL database.
  135. </para>
  136. </section>
  137. <section id="starting_stopping">
  138. <title>Starting and Stopping the Server</title>
  139. <!-- @todo: Rewrite this section as part of #3422-->
  140. <para>
  141. Kea is modular. Part of this modularity is
  142. accomplished using multiple cooperating processes which, together,
  143. provide the server functionality.
  144. </para>
  145. <!-- @todo: Rename processes here, once they are renamed in the source -->
  146. <para>
  147. At first, running many different processes may seem confusing.
  148. However, these processes are started by running a single
  149. command, <command>bind10</command>. This command starts
  150. a master process, <command>b10-init</command>, which will
  151. start other required processes and other processes when
  152. configured. The processes that may be started have names
  153. starting with "b10-", including:
  154. </para>
  155. <para>
  156. <itemizedlist>
  157. <listitem>
  158. <simpara>
  159. <command>b10-cfgmgr</command> &mdash;
  160. Configuration manager.
  161. This process maintains all of the configuration for BIND 10.
  162. </simpara>
  163. </listitem>
  164. <listitem>
  165. <simpara>
  166. <command>b10-cmdctl</command> &mdash;
  167. Command and control service.
  168. This process allows external control of the BIND 10 system.
  169. </simpara>
  170. </listitem>
  171. <listitem>
  172. <simpara>
  173. <command>b10-dhcp4</command> &mdash;
  174. DHCPv4 server process.
  175. This process responds to DHCPv4 queries from clients.
  176. </simpara>
  177. </listitem>
  178. <listitem>
  179. <simpara>
  180. <command>b10-dhcp6</command> &mdash;
  181. DHCPv6 server process.
  182. This process responds to DHCPv6 queries from clients.
  183. </simpara>
  184. </listitem>
  185. <listitem>
  186. <simpara>
  187. <command>b10-dhcp-ddns</command> &mdash;
  188. DHCP-DDNS process.
  189. This process acts as an intermediary between the DHCP servers
  190. and DNS server. It receives name update requests from the DHCP
  191. servers and sends DNS Update messages to the DNS servers.
  192. </simpara>
  193. </listitem>
  194. <listitem>
  195. <simpara>
  196. <command>b10-msgq</command> &mdash;
  197. Message bus daemon.
  198. This process coordinates communication between all of the other
  199. BIND 10 processes.
  200. </simpara>
  201. </listitem>
  202. <listitem>
  203. <simpara>
  204. <command>b10-sockcreator</command> &mdash;
  205. Socket creator daemon.
  206. This process creates sockets used by
  207. network-listening BIND 10 processes.
  208. </simpara>
  209. </listitem>
  210. <listitem>
  211. <simpara>
  212. <command>b10-stats</command> &mdash;
  213. Statistics collection daemon.
  214. This process collects and reports statistics data.
  215. </simpara>
  216. </listitem>
  217. <listitem>
  218. <simpara>
  219. <command>b10-stats-httpd</command> &mdash;
  220. HTTP server for statistics reporting.
  221. This process reports statistics data in XML format over HTTP.
  222. </simpara>
  223. </listitem>
  224. </itemizedlist>
  225. </para>
  226. <para>
  227. These do not need to be manually started independently.
  228. </para>
  229. </section>
  230. <section id="managing_once_running">
  231. <title>Managing BIND 10</title>
  232. <!-- @todo: Rewrite this section as part of #3422 -->
  233. <para>
  234. Once BIND 10 is running, a few commands are used to interact
  235. directly with the system:
  236. <itemizedlist>
  237. <listitem>
  238. <simpara>
  239. <command>bindctl</command> &mdash;
  240. Interactive administration interface.
  241. This is a low-level command-line tool which allows
  242. a developer or an experienced administrator to control
  243. Kea.
  244. </simpara>
  245. </listitem>
  246. <listitem>
  247. <simpara>
  248. <command>b10-cmdctl-usermgr</command> &mdash;
  249. User access control.
  250. This tool allows an administrator to authorize additional users
  251. to manage Kea.
  252. </simpara>
  253. </listitem>
  254. <!-- TODO usermgr -->
  255. </itemizedlist>
  256. </para>
  257. </section>
  258. <para>
  259. The tools and modules are covered in full detail in this guide.
  260. <!-- TODO point to these -->
  261. In addition, manual pages are also provided in the default installation.
  262. </para>
  263. <!--
  264. bin/
  265. bindctl*
  266. host*
  267. lib/
  268. libauth
  269. libdns
  270. libexceptions
  271. python3.1/site-packages/isc/{cc,config}
  272. sbin/
  273. bind10
  274. share/
  275. share/bind10/
  276. auth.spec
  277. b10-cmdctl.pem
  278. init.spec
  279. passwd.csv
  280. man/
  281. var/
  282. bind10/b10-config.db
  283. -->
  284. <para>
  285. BIND 10 also provides libraries and programmer interfaces
  286. for C++ and Python for the message bus and configuration backend,
  287. and, of course, DHCP. These include detailed developer
  288. documentation and code examples.
  289. <!-- TODO point to this -->
  290. </para>
  291. </chapter>
  292. <chapter id="quickstart">
  293. <title>Quick start</title>
  294. <para>
  295. This quickly covers the standard steps for installing and deploying Kea.
  296. For further details, full customizations, and troubleshooting, see the
  297. respective chapters in the Kea guide.
  298. </para>
  299. <section id="quick-start">
  300. <title>Quick start guide for DHCPv4 and DHCPv6 services</title>
  301. <orderedlist>
  302. <listitem>
  303. <simpara>
  304. Install required run-time and build dependencies. See <xref
  305. linkend="build-requirements"/> for details.
  306. </simpara>
  307. </listitem>
  308. <!-- We may need to replace it with the link to a downloadable tarball
  309. once we have it. -->
  310. <listitem>
  311. <simpara>
  312. Checkout the latest Kea revision from the Git repository:
  313. <screen>$ <userinput>git clone git://git.kea.isc.org/kea</userinput> </screen>
  314. </simpara>
  315. </listitem>
  316. <listitem>
  317. <para>Go into the source and run configure:
  318. <screen>$ <userinput>cd kea</userinput>
  319. $ <userinput>autoreconf --install</userinput>
  320. $ <userinput>./configure [your extra parameters]</userinput></screen>
  321. </para>
  322. </listitem>
  323. <listitem>
  324. <para>Build it:
  325. <screen>$ <userinput>make</userinput></screen>
  326. </para>
  327. </listitem>
  328. <listitem>
  329. <para>Install it as root (by default to prefix
  330. <filename>/usr/local/</filename>):
  331. <screen>$ <userinput>make install</userinput></screen>
  332. </para>
  333. </listitem>
  334. <listitem>
  335. <para>Edit your configuration file for DHCPv4. See doc/examples/kea4
  336. for a set of examples.
  337. </para>
  338. </listitem>
  339. <listitem>
  340. <para>Start Kea DHCPv4 server (as root):
  341. <screen># <userinput>b10-dhcp4 -c /path/to/your/kea4/config/file.json</userinput></screen>
  342. </para>
  343. </listitem>
  344. <listitem>
  345. <para>Test it; for example, use the
  346. <ulink url="http://www.isc.org/downloads/DHCP/">ISC DHCP client</ulink>
  347. to send DHCPv4 queries to the server and verify that the client receives a
  348. configuration from the server:
  349. <screen>$ <userinput>dhclient -4 eth0</userinput></screen>
  350. </para>
  351. </listitem>
  352. <listitem>
  353. <para>Edit your configuration file for DHCPv6. See doc/examples/kea6
  354. for a set of examples.
  355. </para>
  356. </listitem>
  357. <listitem>
  358. <para>Start Kea DHCPv6 server (as root):
  359. <screen># <userinput>b10-dhcp6 -c /path/to/your/kea6/config/file.json</userinput></screen>
  360. </para>
  361. </listitem>
  362. <listitem>
  363. <para>Test it; for example, use the
  364. <ulink url="http://www.isc.org/downloads/DHCP/">ISC DHCP client</ulink>
  365. to send DHCPv6 queries to the server and verify that the client receives a
  366. configuration from the server:
  367. <screen>$ <userinput>dhclient -6 eth0</userinput></screen>
  368. </para>
  369. </listitem>
  370. </orderedlist>
  371. </section>
  372. </chapter>
  373. <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="install.xml" />
  374. <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="config.xml" />
  375. <chapter id="dhcp4">
  376. <title>The DHCPv4 Server</title>
  377. <section id="dhcp4-start-stop">
  378. <title>Starting and Stopping the DHCPv4 Server</title>
  379. <para>
  380. <command>b10-dhcp4</command> is the Kea DHCPv4 server and is configured
  381. through the <command>bindctl</command> program.
  382. </para>
  383. <para>
  384. After starting <command>bind10</command> and entering bindctl, the first step
  385. in configuring the server is to add it to the list of running services.
  386. <screen>
  387. &gt; <userinput>config add Init/components b10-dhcp4</userinput>
  388. &gt; <userinput>config set Init/components/b10-dhcp4/kind dispensable</userinput>
  389. &gt; <userinput>config commit</userinput>
  390. </screen>
  391. </para>
  392. <para>
  393. To remove <command>b10-dhcp4</command> from the set of running services,
  394. the <command>b10-dhcp4</command> is removed from list of Init components:
  395. <screen>
  396. &gt; <userinput>config remove Init/components b10-dhcp4</userinput>
  397. &gt; <userinput>config commit</userinput>
  398. </screen>
  399. </para>
  400. <para>
  401. Note that the server was only removed from the list, so BIND10 will not
  402. restart it, but the server itself is still running. Hence it is usually
  403. desired to stop it:
  404. <screen>
  405. &gt; <userinput>Dhcp4 shutdown</userinput>
  406. </screen>
  407. </para>
  408. <para>
  409. On start-up, the server will detect available network interfaces
  410. and will attempt to open UDP sockets on all interfaces that
  411. are up, running, are not loopback, and have IPv4 address
  412. assigned.
  413. The server will then listen to incoming traffic. Currently
  414. supported client messages are DISCOVER and REQUEST. The server
  415. will respond to them with OFFER and ACK, respectively.
  416. Since the DHCPv4 server opens privileged ports, it requires root
  417. access. Make sure you run this daemon as root.
  418. </para>
  419. </section>
  420. <section id="dhcp4-configuration">
  421. <title>Configuring the DHCPv4 Server</title>
  422. <para>
  423. Once the server is started, it can be configured. To view the
  424. current configuration, use the following command in <command>bindctl</command>:
  425. <screen>
  426. &gt; <userinput>config show Dhcp4</userinput></screen>
  427. When starting the DHCPv4 daemon for the first time, the default configuration
  428. will be available. It will look similar to this:
  429. <screen>
  430. &gt; <userinput>config show Dhcp4</userinput>
  431. Dhcp4/hooks-libraries [] list (default)
  432. Dhcp4/interfaces/ list
  433. Dhcp4/renew-timer 1800 integer
  434. Dhcp4/rebind-timer 2000 integer (default)
  435. Dhcp4/valid-lifetime 4000 integer (default)
  436. Dhcp4/next-server "" string (default)
  437. Dhcp4/echo-client-id true boolean (default)
  438. Dhcp4/option-def [] list (default)
  439. Dhcp4/option-data [] list (default)
  440. Dhcp4/lease-database/type "" string (default)
  441. Dhcp4/lease-database/name "" string (default)
  442. Dhcp4/lease-database/user "" string (default)
  443. Dhcp4/lease-database/host "" string (default)
  444. Dhcp4/lease-database/password "" string (default)
  445. Dhcp4/subnet4/ list
  446. Dhcp4/dhcp-ddns/enable-updates true boolean
  447. Dhcp4/dhcp-ddns/server-ip "127.0.0.1" string
  448. Dhcp4/dhcp-ddns/server-port 53001 integer
  449. Dhcp4/dhcp-ddns/sender-ip "" string
  450. Dhcp4/dhcp-ddns/sender-port 0 integer
  451. Dhcp4/dhcp-ddns/max-queue-size 1024 integer
  452. Dhcp4/dhcp-ddns/ncr-protocol "UDP" string
  453. Dhcp4/dhcp-ddns/ncr-format "JSON" string
  454. Dhcp4/dhcp-ddns/override-no-update false boolean
  455. Dhcp4/dhcp-ddns/override-client-update false boolean
  456. Dhcp4/dhcp-ddns/replace-client-name false boolean
  457. Dhcp4/dhcp-ddns/generated-prefix "myhost" string
  458. Dhcp4/dhcp-ddns/qualifying-suffix "example.com" string
  459. </screen>
  460. </para>
  461. <para>
  462. To change one of the parameters, simply follow
  463. the usual <command>bindctl</command> procedure. For example, to make the
  464. leases longer, change their valid-lifetime parameter:
  465. <screen>
  466. &gt; <userinput>config set Dhcp4/valid-lifetime 7200</userinput>
  467. &gt; <userinput>config commit</userinput></screen>
  468. Please note that most Dhcp4 parameters are of global scope
  469. and apply to all defined subnets, unless they are overridden on a
  470. per-subnet basis.
  471. </para>
  472. <para>
  473. The renew-timer and rebind-timer are optional. If they are not specified,
  474. the DHCPv4 options 58 and 59 are not sent in the server's response to the
  475. client.
  476. </para>
  477. <section>
  478. <title>Default storage for leases</title>
  479. <para>
  480. The server is able to store lease data in different repositories. Larger deployments
  481. may elect to store leases in a database.
  482. <xref linkend="database-configuration4"/> describes one way to do it.
  483. By default, the server will use a CSV file rather than a database to store
  484. lease information. One of the advantages of using a file is that it eliminates
  485. dependency on third party database software.
  486. </para>
  487. <para>
  488. The configuration of the file backend (Memfile)
  489. is controlled through the Dhcp4/lease-database parameters. When default
  490. parameters are used, the Memfile backend will write leases to a disk in the
  491. [bind10-install-dir]/var/bind10/kea-leases4.csv.
  492. </para>
  493. <para>
  494. It is possible to alter the default location of the lease file. The following
  495. configuration:
  496. <screen>
  497. &gt; <userinput>config set Dhcp4/lease-database/type "memfile"</userinput>
  498. &gt; <userinput>config set Dhcp4/lease-database/persist true</userinput>
  499. &gt; <userinput>config set Dhcp4/lease-database/name "/tmp/kea-leases4.csv"</userinput>
  500. &gt; <userinput>config commit</userinput>
  501. </screen>
  502. will change the default location of the lease file to /tmp/kea-leases4.csv.
  503. </para>
  504. <para>
  505. The "persist" parameter controls whether the leases are written to disk.
  506. It is strongly recommended that this parameter is set to "true" at all times
  507. during the normal operation of the server
  508. </para>
  509. </section>
  510. <section id="database-configuration4">
  511. <title>Database Configuration</title>
  512. <para>
  513. All leases issued by the server are stored in the lease database. Currently
  514. there are 3 database backends available: MySQL, PostgreSQL and memfile.
  515. <footnote>
  516. <para>
  517. The server comes with an in-memory database ("memfile") configured as the default
  518. database. This is used for internal testing and is not supported. In addition,
  519. it does not store lease information on disk: lease information will be lost if the
  520. server is restarted.
  521. </para>
  522. </footnote>, and so the server must be configured to
  523. access the correct database with the appropriate credentials.
  524. </para>
  525. <note>
  526. <para>
  527. Database access information must be configured for the DHCPv4 server, even if
  528. it has already been configured for the DHCPv6 server. The servers store their
  529. information independently, so each server can use a separate
  530. database or both servers can use the same database.
  531. </para>
  532. </note>
  533. <para>
  534. Database configuration is controlled through the Dhcp4/lease-database parameters.
  535. The type of the database must be set to "mysql", "postgresql" or "memfile":
  536. <screen>
  537. &gt; <userinput>config set Dhcp4/lease-database/type "mysql"</userinput>
  538. </screen>
  539. Next, the name of the database is to hold the leases must be set: this is the
  540. name used when the lease database was created (see <xref linkend="dhcp-mysql-database-create"/>
  541. or <xref linkend="dhcp-pgsql-database-create"/>).
  542. <screen>
  543. &gt; <userinput>config set Dhcp4/lease-database/name "<replaceable>database-name</replaceable>"</userinput>
  544. </screen>
  545. If the database is located on a different system to the DHCPv4 server, the
  546. database host name must also be specified (although note that this configuration
  547. may have a severe impact on server performance):
  548. <screen>
  549. &gt; <userinput>config set Dhcp4/lease-database/host "<replaceable>remote-host-name</replaceable>"</userinput>
  550. </screen>
  551. The usual state of affairs will be to have the database on the same machine as the
  552. DHCPv4 server. In this case, set the value to the empty string (this is the default):
  553. <screen>
  554. &gt; <userinput>config set Dhcp4/lease-database/host ""</userinput>
  555. </screen>
  556. </para>
  557. <para>
  558. Finally, the credentials of the account under which the server will access the database
  559. should be set:
  560. <screen>
  561. &gt; <userinput>config set Dhcp4/lease-database/user "<replaceable>user-name</replaceable>"</userinput>
  562. &gt; <userinput>config set Dhcp4/lease-database/password "<replaceable>password</replaceable>"</userinput>
  563. </screen>
  564. If there is no password to the account, set the password to the empty string "". (This is also the default.)
  565. </para>
  566. <note>
  567. <para>The password is echoed when entered and is stored in clear text in the configuration
  568. database. Improved password security will be added in a future version of Kea.</para>
  569. </note>
  570. </section>
  571. <section id="dhcp4-interface-selection">
  572. <title>Interface selection</title>
  573. <para>
  574. When DHCPv4 server starts up, by default it will listen to the DHCP
  575. traffic and respond to it on all interfaces detected during startup.
  576. However, in many cases it is desired to configure the server to listen and
  577. respond on selected interfaces only. The sample commands in this section
  578. show how to make interface selection using bindctl.
  579. </para>
  580. <para>
  581. The default configuration can be presented with the following command:
  582. <screen>
  583. &gt; <userinput>config show Dhcp4/interfaces</userinput>
  584. <userinput>Dhcp4/interfaces[0] "*" string</userinput></screen>
  585. An asterisk sign plays a role of the wildcard and means "listen on all interfaces".
  586. </para>
  587. <para>
  588. In order to override the default configuration, the existing entry can be replaced
  589. with the actual interface name:
  590. <screen>
  591. &gt; <userinput>config set Dhcp4/interfaces[0] eth1</userinput>
  592. &gt; <userinput>config commit</userinput></screen>
  593. Other interface names can be added on one-by-one basis:
  594. <screen>
  595. &gt; <userinput>config add Dhcp4/interfaces eth2</userinput>
  596. &gt; <userinput>config commit</userinput></screen>
  597. Configuration will now contain two interfaces which can be presented as follows:
  598. <screen>
  599. &gt; <userinput>config show Dhcp4/interfaces</userinput>
  600. <userinput>Dhcp4/interfaces[0] "eth1" string</userinput>
  601. <userinput>Dhcp4/interfaces[1] "eth2" string</userinput></screen>
  602. When configuration gets committed, the server will start to listen on
  603. eth1 and eth2 interfaces only.
  604. </para>
  605. <para>
  606. It is possible to use wildcard interface name (asterisk) concurrently with explicit
  607. interface names:
  608. <screen>
  609. &gt; <userinput>config add Dhcp4/interfaces *</userinput>
  610. &gt; <userinput>config commit</userinput></screen>
  611. This will result in the following configuration:
  612. <screen>
  613. &gt; <userinput>config show Dhcp4/interfaces</userinput>
  614. <userinput>Dhcp4/interfaces[0] "eth1" string</userinput>
  615. <userinput>Dhcp4/interfaces[1] "eth2" string</userinput>
  616. <userinput>Dhcp4/interfaces[2] "*" string</userinput></screen>
  617. The presence of the wildcard name implies that server will listen on all interfaces.
  618. In order to fall back to the previous configuration when server listens on eth1 and eth2:
  619. <screen>
  620. &gt; <userinput>config remove Dhcp4/interfaces[2]</userinput>
  621. &gt; <userinput>config commit</userinput></screen>
  622. </para>
  623. </section>
  624. <section id="ipv4-subnet-id">
  625. <title>IPv4 Subnet Identifier</title>
  626. <para>
  627. Subnet identifier is a unique number associated with a particular subnet.
  628. In principle, it is used to associate clients' leases with respective subnets.
  629. When subnet identifier is not specified for a subnet being configured, it will
  630. be automatically assigned by the configuration mechanism. The identifiers
  631. are assigned from 1 and are monotonically increased for each subsequent
  632. subnet: 1, 2, 3 ....
  633. </para>
  634. <para>
  635. If there are multiple subnets configured with auto-generated identifiers and
  636. one of them is removed, the subnet identifiers may be renumbered. For example:
  637. if there are 4 subnets and 3rd is removed the last subnet will be assigned
  638. identifier that the 3rd subnet had before removal. As a result, the leases
  639. stored in the lease database for subnet 3 are now associated with the
  640. subnet 4, which may have unexpected consequences. In the future it is planned
  641. to implement the mechanism to preserve auto-generated subnet ids upon removal
  642. of one of the subnets. Currently, the only remedy for this issue is to
  643. manually specify the unique subnet identifier for each subnet.
  644. </para>
  645. <para>
  646. The following configuration:
  647. <screen>
  648. &gt; <userinput>config add Dhcp4/subnet4</userinput>
  649. &gt; <userinput>config set Dhcp4/subnet4[0]/subnet "192.0.2.0/24"</userinput>
  650. &gt; <userinput>config set Dhcp4/subnet4[0]/id 1024</userinput>
  651. &gt; <userinput>config commit</userinput>
  652. </screen>
  653. will assign the arbitrary subnet identifier to the newly configured subnet.
  654. This identifier will not change for this subnet until "id" parameter is
  655. removed or set to 0. The value of 0 forces auto-generation of subnet
  656. identifier.
  657. </para>
  658. </section>
  659. <section id="dhcp4-address-config">
  660. <title>Configuration of IPv4 Address Pools</title>
  661. <para>
  662. The essential role of DHCPv4 server is address assignment. The server
  663. has to be configured with at least one subnet and one pool of dynamic
  664. addresses to be managed. For example, assume that the server
  665. is connected to a network segment that uses the 192.0.2.0/24
  666. prefix. The Administrator of that network has decided that addresses from range
  667. 192.0.2.10 to 192.0.2.20 are going to be managed by the Dhcp4
  668. server. Such a configuration can be achieved in the following way:
  669. <screen>
  670. &gt; <userinput>config add Dhcp4/subnet4</userinput>
  671. &gt; <userinput>config set Dhcp4/subnet4[0]/subnet "192.0.2.0/24"</userinput>
  672. &gt; <userinput>config set Dhcp4/subnet4[0]/pool [ "192.0.2.10 - 192.0.2.20" ]</userinput>
  673. &gt; <userinput>config commit</userinput></screen>
  674. Note that subnet is defined as a simple string, but the pool parameter
  675. is actually a list of pools: for this reason, the pool definition is
  676. enclosed in square brackets, even though only one range of addresses
  677. is specified.</para>
  678. <para>It is possible to define more than one pool in a
  679. subnet: continuing the previous example, further assume that
  680. 192.0.2.64/26 should be also be managed by the server. It could be written as
  681. 192.0.2.64 to 192.0.2.127. Alternatively, it can be expressed more simply as
  682. 192.0.2.64/26. Both formats are supported by Dhcp4 and can be mixed in the pool list.
  683. For example, one could define the following pools:
  684. <screen>
  685. &gt; <userinput>config set Dhcp4/subnet4[0]/pool [ "192.0.2.10-192.0.2.20", "192.0.2.64/26" ]</userinput>
  686. &gt; <userinput>config commit</userinput></screen>
  687. The number of pools is not limited, but for performance reasons it is recommended to
  688. use as few as possible. Space and tabulations in pool definitions are ignored, so
  689. spaces before and after hyphen are optional. They can be used to improve readability.
  690. </para>
  691. <para>
  692. The server may be configured to serve more than one subnet. To add a second subnet,
  693. use a command similar to the following:
  694. <screen>
  695. &gt; <userinput>config add Dhcp4/subnet4</userinput>
  696. &gt; <userinput>config set Dhcp4/subnet4[1]/subnet "192.0.3.0/24"</userinput>
  697. &gt; <userinput>config set Dhcp4/subnet4[1]/pool [ "192.0.3.0/24" ]</userinput>
  698. &gt; <userinput>config commit</userinput></screen>
  699. Arrays are counted from 0. subnet[0] refers to the subnet defined in the
  700. previous example. The <command>config add Dhcp4/subnet4</command> command adds
  701. another (second) subnet. It can be referred to as
  702. <command>Dhcp4/subnet4[1]</command>. In this example, we allow server to
  703. dynamically assign all addresses available in the whole subnet.
  704. </para>
  705. <para>
  706. When configuring a DHCPv4 server using prefix/length notation, please pay
  707. attention to the boundary values. When specifying that the server should use
  708. a given pool, it will be able to allocate also first (typically network
  709. address) and the last (typically broadcast address) address from that pool.
  710. In the aforementioned example of pool 192.0.3.0/24, both 192.0.3.0 and
  711. 192.0.3.255 addresses may be assigned as well. This may be invalid in some
  712. network configurations. If you want to avoid this, please use the "min-max" notation.
  713. </para>
  714. </section>
  715. <section id="dhcp4-std-options">
  716. <title>Standard DHCPv4 options</title>
  717. <para>
  718. One of the major features of DHCPv4 server is to provide configuration
  719. options to clients. Although there are several options that require
  720. special behavior, most options are sent by the server only if the client
  721. explicitly requested them. The following example shows how to
  722. configure DNS servers, which is one of the most frequently used
  723. options. Options specified in this way are considered global and apply
  724. to all configured subnets.
  725. <screen>
  726. &gt; <userinput>config add Dhcp4/option-data</userinput>
  727. &gt; <userinput>config set Dhcp4/option-data[0]/name "domain-name-servers"</userinput>
  728. &gt; <userinput>config set Dhcp4/option-data[0]/code 6</userinput>
  729. &gt; <userinput>config set Dhcp4/option-data[0]/space "dhcp4"</userinput>
  730. &gt; <userinput>config set Dhcp4/option-data[0]/csv-format true</userinput>
  731. &gt; <userinput>config set Dhcp4/option-data[0]/data "192.0.3.1, 192.0.3.2"</userinput>
  732. &gt; <userinput>config commit</userinput>
  733. </screen>
  734. </para>
  735. <para>
  736. The first line creates new entry in option-data table. It
  737. contains information on all global options that the server is
  738. supposed to configure in all subnets. The second line specifies
  739. option name. For a complete list of currently supported names,
  740. see <xref linkend="dhcp4-std-options-list"/> below.
  741. The third line specifies option code, which must match one of the
  742. values from that list. Line 4 specifies option space, which must always
  743. be set to "dhcp4" as these are standard DHCPv4 options. For
  744. other option spaces, including custom option spaces, see <xref
  745. linkend="dhcp4-option-spaces"/>. The fifth line specifies the format in
  746. which the data will be entered: use of CSV (comma
  747. separated values) is recommended. The sixth line gives the actual value to
  748. be sent to clients. Data is specified as a normal text, with
  749. values separated by commas if more than one value is
  750. allowed.
  751. </para>
  752. <para>
  753. Options can also be configured as hexadecimal values. If csv-format is
  754. set to false, option data must be specified as a hex string. The
  755. following commands configure the domain-name-servers option for all
  756. subnets with the following addresses: 192.0.3.1 and 192.0.3.2.
  757. Note that csv-format is set to false.
  758. <screen>
  759. &gt; <userinput>config add Dhcp4/option-data</userinput>
  760. &gt; <userinput>config set Dhcp4/option-data[0]/name "domain-name-servers"</userinput>
  761. &gt; <userinput>config set Dhcp4/option-data[0]/code 6</userinput>
  762. &gt; <userinput>config set Dhcp4/option-data[0]/space "dhcp4"</userinput>
  763. &gt; <userinput>config set Dhcp4/option-data[0]/csv-format false</userinput>
  764. &gt; <userinput>config set Dhcp4/option-data[0]/data "C0 00 03 01 C0 00 03 02"</userinput>
  765. &gt; <userinput>config commit</userinput>
  766. </screen>
  767. </para>
  768. <para>
  769. It is possible to override options on a per-subnet basis. If
  770. clients connected to most of your subnets are expected to get the
  771. same values of a given option, you should use global options: you
  772. can then override specific values for a small number of subnets.
  773. On the other hand, if you use different values in each subnet,
  774. it does not make sense to specify global option values
  775. (Dhcp4/option-data), rather you should set only subnet-specific values
  776. (Dhcp4/subnet[X]/option-data[Y]).
  777. </para>
  778. <para>
  779. The following commands override the global
  780. DNS servers option for a particular subnet, setting a single DNS
  781. server with address 192.0.2.3.
  782. <screen>
  783. &gt; <userinput>config add Dhcp4/subnet4[0]/option-data</userinput>
  784. &gt; <userinput>config set Dhcp4/subnet4[0]/option-data[0]/name "domain-name-servers"</userinput>
  785. &gt; <userinput>config set Dhcp4/subnet4[0]/option-data[0]/code 6</userinput>
  786. &gt; <userinput>config set Dhcp4/subnet4[0]/option-data[0]/space "dhcp4"</userinput>
  787. &gt; <userinput>config set Dhcp4/subnet4[0]/option-data[0]/csv-format true</userinput>
  788. &gt; <userinput>config set Dhcp4/subnet4[0]/option-data[0]/data "192.0.2.3"</userinput>
  789. &gt; <userinput>config commit</userinput></screen>
  790. </para>
  791. <note>
  792. <para>In a future version of Kea, it will not be necessary to specify
  793. the option code, space and csv-format fields as they will be set
  794. automatically.</para>
  795. </note>
  796. <para>
  797. The currently supported standard DHCPv4 options are
  798. listed in <xref linkend="dhcp4-std-options-list"/>
  799. and <xref linkend="dhcp4-std-options-list-part2"/>.
  800. The "Name" and "Code"
  801. are the values that should be used as a name in the option-data
  802. structures. "Type" designates the format of the data: the meanings of
  803. the various types is given in <xref linkend="dhcp-types"/>.
  804. </para>
  805. <para>
  806. Some options are designated as arrays, which means that more than one
  807. value is allowed in such an option. For example the option time-servers
  808. allows the specification of more than one IPv4 address, so allowing
  809. clients to obtain the the addresses of multiple NTP servers.
  810. </para>
  811. <!-- @todo: describe record types -->
  812. <para>
  813. The <xref linkend="dhcp4-custom-options"/> describes the configuration
  814. syntax to create custom option definitions (formats). It is generally not
  815. allowed to create custom definitions for standard options, even if the
  816. definition being created matches the actual option format defined in the
  817. RFCs. There is an exception from this rule for standard options for which
  818. Kea does not provide a definition yet. In order to use such options,
  819. a server administrator must create a definition as described in
  820. <xref linkend="dhcp4-custom-options"/> in the 'dhcp4' option space. This
  821. definition should match the option format described in the relevant
  822. RFC but configuration mechanism would allow any option format as it has
  823. no means to validate it at the moment.
  824. </para>
  825. <para>
  826. <table frame="all" id="dhcp4-std-options-list">
  827. <title>List of standard DHCPv4 options</title>
  828. <tgroup cols='4'>
  829. <colspec colname='name'/>
  830. <colspec colname='code'/>
  831. <colspec colname='type'/>
  832. <colspec colname='array'/>
  833. <thead>
  834. <row>
  835. <entry>Name</entry>
  836. <entry>Code</entry>
  837. <entry>Type</entry>
  838. <entry>Array?</entry>
  839. </row>
  840. </thead>
  841. <tbody>
  842. <row><entry>subnet-mask</entry><entry>1</entry><entry>ipv4-address</entry><entry>false</entry></row>
  843. <row><entry>time-offset</entry><entry>2</entry><entry>int32</entry><entry>false</entry></row>
  844. <row><entry>routers</entry><entry>3</entry><entry>ipv4-address</entry><entry>true</entry></row>
  845. <row><entry>time-servers</entry><entry>4</entry><entry>ipv4-address</entry><entry>true</entry></row>
  846. <row><entry>name-servers</entry><entry>5</entry><entry>ipv4-address</entry><entry>false</entry></row>
  847. <row><entry>domain-name-servers</entry><entry>6</entry><entry>ipv4-address</entry><entry>true</entry></row>
  848. <row><entry>log-servers</entry><entry>7</entry><entry>ipv4-address</entry><entry>true</entry></row>
  849. <row><entry>cookie-servers</entry><entry>8</entry><entry>ipv4-address</entry><entry>true</entry></row>
  850. <row><entry>lpr-servers</entry><entry>9</entry><entry>ipv4-address</entry><entry>true</entry></row>
  851. <row><entry>impress-servers</entry><entry>10</entry><entry>ipv4-address</entry><entry>true</entry></row>
  852. <row><entry>resource-location-servers</entry><entry>11</entry><entry>ipv4-address</entry><entry>true</entry></row>
  853. <row><entry>host-name</entry><entry>12</entry><entry>string</entry><entry>false</entry></row>
  854. <row><entry>boot-size</entry><entry>13</entry><entry>uint16</entry><entry>false</entry></row>
  855. <row><entry>merit-dump</entry><entry>14</entry><entry>string</entry><entry>false</entry></row>
  856. <row><entry>domain-name</entry><entry>15</entry><entry>fqdn</entry><entry>false</entry></row>
  857. <row><entry>swap-server</entry><entry>16</entry><entry>ipv4-address</entry><entry>false</entry></row>
  858. <row><entry>root-path</entry><entry>17</entry><entry>string</entry><entry>false</entry></row>
  859. <row><entry>extensions-path</entry><entry>18</entry><entry>string</entry><entry>false</entry></row>
  860. <row><entry>ip-forwarding</entry><entry>19</entry><entry>boolean</entry><entry>false</entry></row>
  861. <row><entry>non-local-source-routing</entry><entry>20</entry><entry>boolean</entry><entry>false</entry></row>
  862. <row><entry>policy-filter</entry><entry>21</entry><entry>ipv4-address</entry><entry>true</entry></row>
  863. <row><entry>max-dgram-reassembly</entry><entry>22</entry><entry>uint16</entry><entry>false</entry></row>
  864. <row><entry>default-ip-ttl</entry><entry>23</entry><entry>uint8</entry><entry>false</entry></row>
  865. <row><entry>path-mtu-aging-timeout</entry><entry>24</entry><entry>uint32</entry><entry>false</entry></row>
  866. <row><entry>path-mtu-plateau-table</entry><entry>25</entry><entry>uint16</entry><entry>true</entry></row>
  867. <row><entry>interface-mtu</entry><entry>26</entry><entry>uint16</entry><entry>false</entry></row>
  868. <row><entry>all-subnets-local</entry><entry>27</entry><entry>boolean</entry><entry>false</entry></row>
  869. <row><entry>broadcast-address</entry><entry>28</entry><entry>ipv4-address</entry><entry>false</entry></row>
  870. <row><entry>perform-mask-discovery</entry><entry>29</entry><entry>boolean</entry><entry>false</entry></row>
  871. <row><entry>mask-supplier</entry><entry>30</entry><entry>boolean</entry><entry>false</entry></row>
  872. <row><entry>router-discovery</entry><entry>31</entry><entry>boolean</entry><entry>false</entry></row>
  873. <row><entry>router-solicitation-address</entry><entry>32</entry><entry>ipv4-address</entry><entry>false</entry></row>
  874. <row><entry>static-routes</entry><entry>33</entry><entry>ipv4-address</entry><entry>true</entry></row>
  875. <row><entry>trailer-encapsulation</entry><entry>34</entry><entry>boolean</entry><entry>false</entry></row>
  876. <row><entry>arp-cache-timeout</entry><entry>35</entry><entry>uint32</entry><entry>false</entry></row>
  877. <row><entry>ieee802-3-encapsulation</entry><entry>36</entry><entry>boolean</entry><entry>false</entry></row>
  878. <row><entry>default-tcp-ttl</entry><entry>37</entry><entry>uint8</entry><entry>false</entry></row>
  879. <row><entry>tcp-keepalive-internal</entry><entry>38</entry><entry>uint32</entry><entry>false</entry></row>
  880. <row><entry>tcp-keepalive-garbage</entry><entry>39</entry><entry>boolean</entry><entry>false</entry></row>
  881. </tbody>
  882. </tgroup>
  883. </table>
  884. </para>
  885. <para>
  886. <table frame="all" id="dhcp4-std-options-list-part2">
  887. <title>List of standard DHCPv4 options (continued)</title>
  888. <tgroup cols='4'>
  889. <colspec colname='name'/>
  890. <colspec colname='code'/>
  891. <colspec colname='type'/>
  892. <colspec colname='array'/>
  893. <thead>
  894. <row>
  895. <entry>Name</entry>
  896. <entry>Code</entry>
  897. <entry>Type</entry>
  898. <entry>Array?</entry>
  899. </row>
  900. </thead>
  901. <tbody>
  902. <row><entry>nis-domain</entry><entry>40</entry><entry>string</entry><entry>false</entry></row>
  903. <row><entry>nis-servers</entry><entry>41</entry><entry>ipv4-address</entry><entry>true</entry></row>
  904. <row><entry>ntp-servers</entry><entry>42</entry><entry>ipv4-address</entry><entry>true</entry></row>
  905. <row><entry>vendor-encapsulated-options</entry><entry>43</entry><entry>empty</entry><entry>false</entry></row>
  906. <row><entry>netbios-name-servers</entry><entry>44</entry><entry>ipv4-address</entry><entry>true</entry></row>
  907. <row><entry>netbios-dd-server</entry><entry>45</entry><entry>ipv4-address</entry><entry>true</entry></row>
  908. <row><entry>netbios-node-type</entry><entry>46</entry><entry>uint8</entry><entry>false</entry></row>
  909. <row><entry>netbios-scope</entry><entry>47</entry><entry>string</entry><entry>false</entry></row>
  910. <row><entry>font-servers</entry><entry>48</entry><entry>ipv4-address</entry><entry>true</entry></row>
  911. <row><entry>x-display-manager</entry><entry>49</entry><entry>ipv4-address</entry><entry>true</entry></row>
  912. <row><entry>dhcp-requested-address</entry><entry>50</entry><entry>ipv4-address</entry><entry>false</entry></row>
  913. <!-- Lease time should not be configured by a user.
  914. <row><entry>dhcp-lease-time</entry><entry>51</entry><entry>uint32</entry><entry>false</entry></row>
  915. -->
  916. <row><entry>dhcp-option-overload</entry><entry>52</entry><entry>uint8</entry><entry>false</entry></row>
  917. <!-- Message Type, Server Identifier and Parameter Request List should not be configured by a user.
  918. <row><entry>dhcp-message-type</entry><entry>53</entry><entry>uint8</entry><entry>false</entry></row>
  919. <row><entry>dhcp-server-identifier</entry><entry>54</entry><entry>ipv4-address</entry><entry>false</entry></row>
  920. <row><entry>dhcp-parameter-request-list</entry><entry>55</entry><entry>uint8</entry><entry>true</entry></row>
  921. -->
  922. <row><entry>dhcp-message</entry><entry>56</entry><entry>string</entry><entry>false</entry></row>
  923. <row><entry>dhcp-max-message-size</entry><entry>57</entry><entry>uint16</entry><entry>false</entry></row>
  924. <!-- Renewal and rebinding time should not be configured by a user.
  925. <row><entry>dhcp-renewal-time</entry><entry>58</entry><entry>uint32</entry><entry>false</entry></row>
  926. <row><entry>dhcp-rebinding-time</entry><entry>59</entry><entry>uint32</entry><entry>false</entry></row>
  927. -->
  928. <row><entry>vendor-class-identifier</entry><entry>60</entry><entry>binary</entry><entry>false</entry></row>
  929. <!-- Client identifier should not be configured by a user.
  930. <row><entry>dhcp-client-identifier</entry><entry>61</entry><entry>binary</entry><entry>false</entry></row>
  931. -->
  932. <row><entry>nwip-domain-name</entry><entry>62</entry><entry>string</entry><entry>false</entry></row>
  933. <row><entry>nwip-suboptions</entry><entry>63</entry><entry>binary</entry><entry>false</entry></row>
  934. <row><entry>tftp-server-name</entry><entry>66</entry><entry>string</entry><entry>false</entry></row>
  935. <row><entry>boot-file-name</entry><entry>67</entry><entry>string</entry><entry>false</entry></row>
  936. <row><entry>user-class</entry><entry>77</entry><entry>binary</entry><entry>false</entry></row>
  937. <row><entry>fqdn</entry><entry>81</entry><entry>record</entry><entry>false</entry></row>
  938. <row><entry>dhcp-agent-options</entry><entry>82</entry><entry>empty</entry><entry>false</entry></row>
  939. <row><entry>authenticate</entry><entry>90</entry><entry>binary</entry><entry>false</entry></row>
  940. <row><entry>client-last-transaction-time</entry><entry>91</entry><entry>uint32</entry><entry>false</entry></row>
  941. <row><entry>associated-ip</entry><entry>92</entry><entry>ipv4-address</entry><entry>true</entry></row>
  942. <row><entry>subnet-selection</entry><entry>118</entry><entry>ipv4-address</entry><entry>false</entry></row>
  943. <row><entry>domain-search</entry><entry>119</entry><entry>binary</entry><entry>false</entry></row>
  944. <row><entry>vivco-suboptions</entry><entry>124</entry><entry>binary</entry><entry>false</entry></row>
  945. <row><entry>vivso-suboptions</entry><entry>125</entry><entry>binary</entry><entry>false</entry></row>
  946. </tbody>
  947. </tgroup>
  948. </table>
  949. </para>
  950. <para>
  951. <table frame="all" id="dhcp-types">
  952. <title>List of standard DHCP option types</title>
  953. <tgroup cols='2'>
  954. <colspec colname='name'/>
  955. <colspec colname='meaning'/>
  956. <thead>
  957. <row><entry>Name</entry><entry>Meaning</entry></row>
  958. </thead>
  959. <tbody>
  960. <row><entry>binary</entry><entry>An arbitrary string of bytes, specified as a set of hexadecimal digits.</entry></row>
  961. <row><entry>boolean</entry><entry>Boolean value with allowed values true or false</entry></row>
  962. <row><entry>empty</entry><entry>No value, data is carried in suboptions</entry></row>
  963. <row><entry>fqdn</entry><entry>Fully qualified domain name (e.g. www.example.com)</entry></row>
  964. <row><entry>ipv4-address</entry><entry>IPv4 address in the usual dotted-decimal notation (e.g. 192.0.2.1)</entry></row>
  965. <row><entry>ipv6-address</entry><entry>IPv6 address in the usual colon notation (e.g. 2001:db8::1)</entry></row>
  966. <row><entry>record</entry><entry>Structured data that may comprise any types (except "record" and "empty")</entry></row>
  967. <row><entry>string</entry><entry>Any text</entry></row>
  968. <row><entry>uint8</entry><entry>8 bit unsigned integer with allowed values 0 to 255</entry></row>
  969. <row><entry>uint16</entry><entry>16 bit unsinged integer with allowed values 0 to 65535</entry></row>
  970. <row><entry>uint32</entry><entry>32 bit unsigned integer with allowed values 0 to 4294967295</entry></row>
  971. </tbody>
  972. </tgroup>
  973. </table>
  974. </para>
  975. </section>
  976. <section id="dhcp4-custom-options">
  977. <title>Custom DHCPv4 options</title>
  978. <para>It is also possible to define options other than the standard ones.
  979. Assume that we want to define a new DHCPv4 option called "foo" which will have
  980. code 222 and will convey a single unsigned 32 bit integer value. We can define
  981. such an option by using the following commands:
  982. <screen>
  983. &gt; <userinput>config add Dhcp4/option-def</userinput>
  984. &gt; <userinput>config set Dhcp4/option-def[0]/name "foo"</userinput>
  985. &gt; <userinput>config set Dhcp4/option-def[0]/code 222</userinput>
  986. &gt; <userinput>config set Dhcp4/option-def[0]/type "uint32"</userinput>
  987. &gt; <userinput>config set Dhcp4/option-def[0]/array false</userinput>
  988. &gt; <userinput>config set Dhcp4/option-def[0]/record-types ""</userinput>
  989. &gt; <userinput>config set Dhcp4/option-def[0]/space "dhcp4"</userinput>
  990. &gt; <userinput>config set Dhcp4/option-def[0]/encapsulate ""</userinput>
  991. &gt; <userinput>config commit</userinput></screen>
  992. The "false" value of the "array" parameter determines that the option
  993. does NOT comprise an array of "uint32" values but rather a single value.
  994. Two other parameters have been left blank: "record-types" and "encapsulate".
  995. The former specifies the comma separated list of option data fields if the
  996. option comprises a record of data fields. The "record-fields" value should
  997. be non-empty if the "type" is set to "record". Otherwise it must be left
  998. blank. The latter parameter specifies the name of the option space being
  999. encapsulated by the particular option. If the particular option does not
  1000. encapsulate any option space it should be left blank.
  1001. Note that the above set of comments define the format of the new option and do not
  1002. set its values.
  1003. </para>
  1004. <note>
  1005. <para>
  1006. In the current release the default values are not propagated to the
  1007. parser when the new configuration is being set. Therefore, all
  1008. parameters must be specified at all times, even if their values are
  1009. left blank.
  1010. </para>
  1011. </note>
  1012. <para>Once the new option format is defined, its value is set
  1013. in the same way as for a standard option. For example the following
  1014. commands set a global value that applies to all subnets.
  1015. <screen>
  1016. &gt; <userinput>config add Dhcp4/option-data</userinput>
  1017. &gt; <userinput>config set Dhcp4/option-data[0]/name "foo"</userinput>
  1018. &gt; <userinput>config set Dhcp4/option-data[0]/code 222</userinput>
  1019. &gt; <userinput>config set Dhcp4/option-data[0]/space "dhcp4"</userinput>
  1020. &gt; <userinput>config set Dhcp4/option-data[0]/csv-format true</userinput>
  1021. &gt; <userinput>config set Dhcp4/option-data[0]/data "12345"</userinput>
  1022. &gt; <userinput>config commit</userinput></screen>
  1023. </para>
  1024. <para>New options can take more complex forms than simple use of
  1025. primitives (uint8, string, ipv4-address etc): it is possible to
  1026. define an option comprising a number of existing primitives.
  1027. </para>
  1028. <para>Assume we want to define a new option that will consist of
  1029. an IPv4 address, followed by unsigned 16 bit integer, followed by
  1030. a boolean value, followed by a text string. Such an option could
  1031. be defined in the following way:
  1032. <screen>
  1033. &gt; <userinput>config add Dhcp4/option-def</userinput>
  1034. &gt; <userinput>config set Dhcp4/option-def[0]/name "bar"</userinput>
  1035. &gt; <userinput>config set Dhcp4/option-def[0]/code 223</userinput>
  1036. &gt; <userinput>config set Dhcp4/option-def[0]/space "dhcp4"</userinput>
  1037. &gt; <userinput>config set Dhcp4/option-def[0]/type "record"</userinput>
  1038. &gt; <userinput>config set Dhcp4/option-def[0]/array false</userinput>
  1039. &gt; <userinput>config set Dhcp4/option-def[0]/record-types "ipv4-address, uint16, boolean, string"</userinput>
  1040. &gt; <userinput>config set Dhcp4/option-def[0]/encapsulate ""</userinput>
  1041. </screen>
  1042. The "type" is set to "record" to indicate that the option contains
  1043. multiple values of different types. These types are given as a comma-separated
  1044. list in the "record-types" field and should be those listed in <xref linkend="dhcp-types"/>.
  1045. </para>
  1046. <para>
  1047. The values of the option are set as follows:
  1048. <screen>
  1049. &gt; <userinput>config add Dhcp4/option-data</userinput>
  1050. &gt; <userinput>config set Dhcp4/option-data[0]/name "bar"</userinput>
  1051. &gt; <userinput>config set Dhcp4/option-data[0]/space "dhcp4"</userinput>
  1052. &gt; <userinput>config set Dhcp4/option-data[0]/code 223</userinput>
  1053. &gt; <userinput>config set Dhcp4/option-data[0]/csv-format true</userinput>
  1054. &gt; <userinput>config set Dhcp4/option-data[0]/data "192.0.2.100, 123, true, Hello World"</userinput>
  1055. &gt; <userinput>config commit</userinput></screen>
  1056. "csv-format" is set "true" to indicate that the "data" field comprises a command-separated
  1057. list of values. The values in the "data" must correspond to the types set in
  1058. the "record-types" field of the option definition.
  1059. </para>
  1060. <note>
  1061. <para>
  1062. It is recommended that boolean values are specified using "true" and "false"
  1063. strings. This helps to prevent errors when typing multiple comma separated
  1064. values, as it make it easier to identify the type of the value being typed,
  1065. and compare it with the order of data fields. Nevertheless, it is possible
  1066. to use integer values: "1" and "0", instead of "true" and "false"
  1067. accordingly. If other integer value is specified, the configuration is
  1068. rejected.
  1069. </para>
  1070. </note>
  1071. </section>
  1072. <section id="dhcp4-vendor-opts">
  1073. <title>DHCPv4 vendor specific options</title>
  1074. <para>
  1075. Currently there are three option spaces defined: dhcp4 (to
  1076. be used in DHCPv4 daemon) and dhcp6 (for the DHCPv6 daemon); there
  1077. is also vendor-encapsulated-options-space, which is empty by default, but options
  1078. can be defined in it. Those options are called vendor-specific
  1079. information options. The following examples show how to define
  1080. an option "foo" with code 1 that consists of an IPv4 address, an
  1081. unsigned 16 bit integer and a string. The "foo" option is conveyed
  1082. in a vendor specific information option.
  1083. </para>
  1084. <para>
  1085. The first step is to define the format of the option:
  1086. <screen>
  1087. &gt; <userinput>config add Dhcp4/option-def</userinput>
  1088. &gt; <userinput>config set Dhcp4/option-def[0]/name "foo"</userinput>
  1089. &gt; <userinput>config set Dhcp4/option-def[0]/code 1</userinput>
  1090. &gt; <userinput>config set Dhcp4/option-def[0]/space "vendor-encapsulated-options-space"</userinput>
  1091. &gt; <userinput>config set Dhcp4/option-def[0]/type "record"</userinput>
  1092. &gt; <userinput>config set Dhcp4/option-def[0]/array false</userinput>
  1093. &gt; <userinput>config set Dhcp4/option-def[0]/record-types "ipv4-address, uint16, string"</userinput>
  1094. &gt; <userinput>config set Dhcp4/option-def[0]/encapsulates ""</userinput>
  1095. &gt; <userinput>config commit</userinput>
  1096. </screen>
  1097. (Note that the option space is set to "vendor-encapsulated-options-space".)
  1098. Once the option format is defined, the next step is to define actual values
  1099. for that option:
  1100. <screen>
  1101. &gt; <userinput>config add Dhcp4/option-data</userinput>
  1102. &gt; <userinput>config set Dhcp4/option-data[0]/name "foo"</userinput>
  1103. &gt; <userinput>config set Dhcp4/option-data[0]/space "vendor-encapsulated-options-space"</userinput>
  1104. &gt; <userinput>config set Dhcp4/option-data[0]/code 1</userinput>
  1105. &gt; <userinput>config set Dhcp4/option-data[0]/csv-format true</userinput>
  1106. &gt; <userinput>config set Dhcp4/option-data[0]/data "192.0.2.3, 123, Hello World"</userinput>
  1107. &gt; <userinput>config commit</userinput></screen>
  1108. We also set up a dummy value for vendor-opts, the option that conveys our sub-option "foo".
  1109. This is required else the option will not be included in messages sent to the client.
  1110. <screen>
  1111. &gt; <userinput>config add Dhcp4/option-data</userinput>
  1112. &gt; <userinput>config set Dhcp4/option-data[1]/name "vendor-encapsulated-options"</userinput>
  1113. &gt; <userinput>config set Dhcp4/option-data[1]/space "dhcp4"</userinput>
  1114. &gt; <userinput>config set Dhcp4/option-data[1]/code 43</userinput>
  1115. &gt; <userinput>config set Dhcp4/option-data[1]/csv-format false</userinput>
  1116. &gt; <userinput>config set Dhcp4/option-data[1]/data ""</userinput>
  1117. &gt; <userinput>config commit</userinput></screen>
  1118. </para>
  1119. <note>
  1120. <para>
  1121. With this version of Kea, the "vendor-encapsulated-options" option
  1122. must be specified in the configuration although it has no configurable
  1123. parameters. If it is not specified, the server will assume that it is
  1124. not configured and will not send it to a client. In the future there
  1125. will be no need to include this option in the configuration.
  1126. </para>
  1127. </note>
  1128. </section>
  1129. <section id="dhcp4-option-spaces">
  1130. <title>Nested DHCPv4 options (custom option spaces)</title>
  1131. <para>It is sometimes useful to define completely new option
  1132. space. This is the case when user creates new option in the
  1133. standard option space ("dhcp4 or "dhcp6") and wants this option
  1134. to convey sub-options. Thanks to being in the separate space,
  1135. sub-option codes will have a separate numbering scheme and may
  1136. overlap with codes of standard options.
  1137. </para>
  1138. <para>Note that creation of a new option space when defining
  1139. sub-options for a standard option is not required, because it is
  1140. created by default if the standard option is meant to convey any
  1141. sub-options (see <xref linkend="dhcp4-vendor-opts"/>).
  1142. </para>
  1143. <para>
  1144. Assume that we want to have a DHCPv4 option called "container" with
  1145. code 222 that conveys two sub-options with codes 1 and 2.
  1146. First we need to define the new sub-options:
  1147. <screen>
  1148. &gt; <userinput>config add Dhcp4/option-def</userinput>
  1149. &gt; <userinput>config set Dhcp4/option-def[0]/name "subopt1"</userinput>
  1150. &gt; <userinput>config set Dhcp4/option-def[0]/code 1</userinput>
  1151. &gt; <userinput>config set Dhcp4/option-def[0]/space "isc"</userinput>
  1152. &gt; <userinput>config set Dhcp4/option-def[0]/type "ipv4-address"</userinput>
  1153. &gt; <userinput>config set Dhcp4/option-def[0]/record-types ""</userinput>
  1154. &gt; <userinput>config set Dhcp4/option-def[0]/array false</userinput>
  1155. &gt; <userinput>config set Dhcp4/option-def[0]/encapsulate ""</userinput>
  1156. &gt; <userinput>config commit</userinput>
  1157. &gt; <userinput>config add Dhcp4/option-def</userinput>
  1158. &gt; <userinput>config set Dhcp4/option-def[1]/name "subopt2"</userinput>
  1159. &gt; <userinput>config set Dhcp4/option-def[1]/code 2</userinput>
  1160. &gt; <userinput>config set Dhcp4/option-def[1]/space "isc"</userinput>
  1161. &gt; <userinput>config set Dhcp4/option-def[1]/type "string"</userinput>
  1162. &gt; <userinput>config set Dhcp4/option-def[1]/record-types ""</userinput>
  1163. &gt; <userinput>config set Dhcp4/option-def[1]/array false</userinput>
  1164. &gt; <userinput>config set Dhcp4/option-def[1]/encapsulate ""</userinput>
  1165. &gt; <userinput>config commit</userinput>
  1166. </screen>
  1167. Note that we have defined the options to belong to a new option space
  1168. (in this case, "isc").
  1169. </para>
  1170. <para>
  1171. The next step is to define a regular DHCPv4 option with our desired
  1172. code and specify that it should include options from the new option space:
  1173. <screen>
  1174. &gt; <userinput>add Dhcp4/option-def</userinput>
  1175. &gt; <userinput>set Dhcp4/option-def[2]/name "container"</userinput>
  1176. &gt; <userinput>set Dhcp4/option-def[2]/code 222</userinput>
  1177. &gt; <userinput>set Dhcp4/option-def[2]/space "dhcp4"</userinput>
  1178. &gt; <userinput>set Dhcp4/option-def[2]/type "empty"</userinput>
  1179. &gt; <userinput>set Dhcp4/option-def[2]/array false</userinput>
  1180. &gt; <userinput>set Dhcp4/option-def[2]/record-types ""</userinput>
  1181. &gt; <userinput>set Dhcp4/option-def[2]/encapsulate "isc"</userinput>
  1182. &gt; <userinput>commit</userinput>
  1183. </screen>
  1184. The name of the option space in which the sub-options are defined
  1185. is set in the "encapsulate" field. The "type" field is set to "empty"
  1186. to indicate that this option does not carry any data other than
  1187. sub-options.
  1188. </para>
  1189. <para>
  1190. Finally, we can set values for the new options:
  1191. <screen>
  1192. &gt; <userinput>config add Dhcp4/option-data</userinput>
  1193. &gt; <userinput>config set Dhcp4/option-data[0]/name "subopt1"</userinput>
  1194. &gt; <userinput>config set Dhcp4/option-data[0]/space "isc"</userinput>
  1195. &gt; <userinput>config set Dhcp4/option-data[0]/code 1</userinput>
  1196. &gt; <userinput>config set Dhcp4/option-data[0]/csv-format true</userinput>
  1197. &gt; <userinput>config set Dhcp4/option-data[0]/data "192.0.2.3"</userinput>
  1198. &gt; <userinput>config commit</userinput>
  1199. <userinput></userinput>
  1200. &gt; <userinput>config add Dhcp4/option-data</userinput>
  1201. &gt; <userinput>config set Dhcp4/option-data[1]/name "subopt2"</userinput>
  1202. &gt; <userinput>config set Dhcp4/option-data[1]/space "isc"</userinput>
  1203. &gt; <userinput>config set Dhcp4/option-data[1]/code 2</userinput>
  1204. &gt; <userinput>config set Dhcp4/option-data[1]/csv-format true</userinput>
  1205. &gt; <userinput>config set Dhcp4/option-data[1]/data "Hello world"</userinput>
  1206. &gt; <userinput>config commit</userinput>
  1207. <userinput></userinput>
  1208. &gt; <userinput>config add Dhcp4/option-data</userinput>
  1209. &gt; <userinput>config set Dhcp4/option-data[2]/name "container"</userinput>
  1210. &gt; <userinput>config set Dhcp4/option-data[2]/space "dhcp4"</userinput>
  1211. &gt; <userinput>config set Dhcp4/option-data[2]/code 222</userinput>
  1212. &gt; <userinput>config set Dhcp4/option-data[2]/csv-format true</userinput>
  1213. &gt; <userinput>config set Dhcp4/option-data[2]/data ""</userinput>
  1214. &gt; <userinput>config commit</userinput>
  1215. </screen>
  1216. Even though the "container" option does not carry any data except
  1217. sub-options, the "data" field must be explicitly set to an empty value.
  1218. This is required because in the current version of BIND 10 DHCP, the
  1219. default configuration values are not propagated to the configuration parsers:
  1220. if the "data" is not set the parser will assume that this
  1221. parameter is not specified and an error will be reported.
  1222. </para>
  1223. <para>Note that it is possible to create an option which carries some data
  1224. in addition to the sub-options defined in the encapsulated option space. For example,
  1225. if the "container" option from the previous example was required to carry an uint16
  1226. value as well as the sub-options, the "type" value would have to be set to "uint16" in
  1227. the option definition. (Such an option would then have the following
  1228. data structure: DHCP header, uint16 value, sub-options.) The value specified
  1229. with the "data" parameter - which should be a valid integer enclosed in quotes,
  1230. e.g. "123" - would then be assigned to the uint16 field in the "container" option.
  1231. </para>
  1232. </section>
  1233. <section id="dhcp4-client-classifier">
  1234. <title>Client Classification in DHCPv4</title>
  1235. <note>
  1236. <para>
  1237. DHCPv4 server has been extended to support limited client classification.
  1238. Although the current capability is modest, it is expected to be expanded
  1239. in the future. It is envisaged that the majority of client classification
  1240. extensions will be using hooks extensions.
  1241. </para>
  1242. </note>
  1243. <para>In certain cases it is useful to differentiate between different
  1244. types of clients and treat them differently. The process of doing
  1245. classification is conducted in two steps. The first step is to assess
  1246. incoming packet and assign it to zero or more classes. This classification
  1247. is currently simple, but is expected to grow in capability soon. Currently
  1248. the server checks whether incoming packet has vendor class identifier
  1249. option (60). If it has, content of that option is prepended with
  1250. &quot;VENDOR_CLASS_&quot; then is interpreted as a class. For example,
  1251. modern cable modems will send this option with value &quot;docsis3.0&quot;
  1252. and as a result the packet will belong to class &quot;VENDOR_CLASS_docsis3.0&quot;.
  1253. </para>
  1254. <para>It is envisaged that the client classification will be used for changing
  1255. behavior of almost any part of the DHCP message processing, including assigning
  1256. leases from different pools, assigning different option (or different values of
  1257. the same options) etc. For now, there are only two mechanisms that are taking
  1258. advantage of client classification: specific processing for cable modems and
  1259. subnet selection.</para>
  1260. <para>
  1261. For clients that belong to the VENDOR_CLASS_docsis3.0 class, the siaddr
  1262. field is set to the value of next-server (if specified in a subnet). If
  1263. there is boot-file-name option specified, its value is also set in the
  1264. file field in the DHCPv4 packet. For eRouter1.0 class, the siaddr is
  1265. always set to 0.0.0.0. That capability is expected to be moved to
  1266. external hook library that will be dedicated to cable modems.
  1267. </para>
  1268. <para>
  1269. Kea can be instructed to limit access to given subnets based on class information.
  1270. This is particularly useful for cases where two types of devices share the
  1271. same link and are expected to be served from two different subnets. The
  1272. primary use case for such a scenario is cable networks. There are two
  1273. classes of devices: cable modem itself, which should be handled a lease
  1274. from subnet A and all other devices behind modems that should get a lease
  1275. from subnet B. That segregation is essential to prevent overly curious
  1276. users from playing with their cable modems. For details on how to set up
  1277. class restrictions on subnets, see <xref linkend="dhcp4-subnet-class"/>.
  1278. </para>
  1279. </section>
  1280. <section id="dhcp4-subnet-class">
  1281. <title>Limiting access to IPv4 subnet to certain classes</title>
  1282. <para>
  1283. In certain cases it beneficial to restrict access to certain subnets
  1284. only to clients that belong to a given subnet. For details on client
  1285. classes, see <xref linkend="dhcp4-client-classifier"/>. This is an
  1286. extension of a previous example from <xref linkend="dhcp4-address-config"/>.
  1287. Let's assume that the server is connected to a network segment that uses
  1288. the 192.0.2.0/24 prefix. The Administrator of that network has decided
  1289. that addresses from range 192.0.2.10 to 192.0.2.20 are going to be
  1290. managed by the Dhcp4 server. Only clients belonging to client class
  1291. VENDOR_CLASS_docsis3.0 are allowed to use this subnet. Such a
  1292. configuration can be achieved in the following way:
  1293. <screen>
  1294. &gt; <userinput>config add Dhcp4/subnet4</userinput>
  1295. &gt; <userinput>config set Dhcp4/subnet4[0]/subnet "192.0.2.0/24"</userinput>
  1296. &gt; <userinput>config set Dhcp4/subnet4[0]/pool [ "192.0.2.10 - 192.0.2.20" ]</userinput>
  1297. &gt; <userinput>config set Dhcp4/subnet4[0]/client-class "VENDOR_CLASS_docsis3.0"</userinput>
  1298. &gt; <userinput>config commit</userinput></screen>
  1299. </para>
  1300. <para>
  1301. Care should be taken with client classification as it is easy to prevent
  1302. clients that do not meet class criteria to be denied any service altogether.
  1303. </para>
  1304. </section>
  1305. <section id="dhcp4-ddns-config">
  1306. <title>Configuring DHCPv4 for DDNS</title>
  1307. <para>
  1308. As mentioned earlier, b10-dhcp4 can be configured to generate requests to the
  1309. DHCP-DDNS server to update DNS entries. These requests are known as
  1310. NameChangeRequests or NCRs. Each NCR contains the following information:
  1311. <orderedlist>
  1312. <listitem><para>
  1313. Whether it is a request to add (update) or remove DNS entries
  1314. </para></listitem>
  1315. <listitem><para>
  1316. Whether the change requests forward DNS updates (A records), reverse
  1317. DNS updates (PTR records), or both.
  1318. </para></listitem>
  1319. <listitem><para>
  1320. The FQDN, lease address, and DHCID
  1321. </para></listitem>
  1322. </orderedlist>
  1323. The parameters for controlling the generation of NCRs for submission to D2
  1324. are contained in the "dhcp-ddns" section of the b10-dhcp4 server
  1325. configuration. The default values for this section appears as follows:
  1326. <screen>
  1327. &gt; <userinput>config show Dhcp4/dhcp-ddns</userinput>
  1328. Dhcp4/dhcp-ddns/enable-updates true boolean
  1329. Dhcp4/dhcp-ddns/server-ip "127.0.0.1" string
  1330. Dhcp4/dhcp-ddns/server-port 53001 integer
  1331. Dhcp4/dhcp-ddns/sender-ip "" string
  1332. Dhcp4/dhcp-ddns/sender-port 0 integer
  1333. Dhcp4/dhcp-ddns/max-queue-size 1024 integer
  1334. Dhcp4/dhcp-ddns/ncr-protocol "UDP" string
  1335. Dhcp4/dhcp-ddns/ncr-format "JSON" string
  1336. Dhcp4/dhcp-ddns/override-no-update false boolean
  1337. Dhcp4/dhcp-ddns/override-client-update false boolean
  1338. Dhcp4/dhcp-ddns/replace-client-name false boolean
  1339. Dhcp4/dhcp-ddns/generated-prefix "myhost" string
  1340. Dhcp4/dhcp-ddns/qualifying-suffix "example.com" string
  1341. </screen>
  1342. </para>
  1343. <para>
  1344. The "enable-updates" parameter determines whether or not b10-dhcp4 will
  1345. generate NCRs. By default, this value is false hence DDNS updates are
  1346. disabled. To enable DDNS updates set this value to true:
  1347. </para>
  1348. <screen>
  1349. &gt; <userinput>config set Dhcp4/dhcp-ddns/enable-updates true</userinput>
  1350. &gt; <userinput>config commit</userinput>
  1351. </screen>
  1352. <section id="dhcpv4-d2-io-config">
  1353. <title>DHCP-DDNS Server Connectivity</title>
  1354. <para>
  1355. In order for NCRs to reach the D2 server, b10-dhcp4 must be able
  1356. to communicate with it. b10-dhcp4 uses the following configuration
  1357. parameters to control how it communications with D2:
  1358. <orderedlist>
  1359. <listitem><para>
  1360. server-ip - IP address on which D2 listens for requests. The default is
  1361. the local loopback interface at address 127.0.0.1. You may specify
  1362. either an IPv4 or IPv6 address.
  1363. </para></listitem>
  1364. <listitem><para>
  1365. server-port - port on which D2 listens for requests. The default value
  1366. is 53001.
  1367. </para></listitem>
  1368. <listitem><para>
  1369. sender-ip - IP address which b10-dhcp4 should use to send requests to D2.
  1370. The default value is blank which instructs b10-dhcp4 to select a suitable
  1371. address.
  1372. </para></listitem>
  1373. <listitem><para>
  1374. sender-port - port which b10-dhcp4 should use to send requests to D2. The
  1375. default value of 0 instructs b10-dhcp4 to select suitable port.
  1376. </para></listitem>
  1377. <listitem><para>
  1378. ncr-format - Socket protocol use when sending requests to D2. Currently
  1379. only UDP is supported. TCP may be available in an upcoming release.
  1380. </para></listitem>
  1381. <listitem><para>
  1382. ncr-protocol - Packet format to use when sending requests to D2.
  1383. Currently only JSON format is supported. Other formats may be available
  1384. in future releases.
  1385. </para></listitem>
  1386. <listitem><para>
  1387. max-queue-size - maximum number of requests allowed to queue waiting to
  1388. be sent to D2. This value guards against requests accumulating
  1389. uncontrollably if they are being generated faster than they can be
  1390. delivered. If the number of requests queued for transmission reaches
  1391. this value, DDNS updating will be turned off until the queue backlog has
  1392. been sufficiently reduced. The intent is allow the b10-dhcp4 server to
  1393. continue lease operations. The default value is 1024.
  1394. </para></listitem>
  1395. </orderedlist>
  1396. By default, D2 is assumed to running on the same machine as b10-dhcp4, and
  1397. all of the default values mentioned above should be sufficient.
  1398. If, however, D2 has been configured to listen on a different address or
  1399. port, these values must altered accordingly. For example, if D2 has been
  1400. configured to listen on 198.162.1.10 port 900, the following commands
  1401. would be required:
  1402. <screen>
  1403. &gt; <userinput>config set Dhcp4/dhcp-ddns/server-ip "198.162.1.10"</userinput>
  1404. &gt; <userinput>config set Dhcp4/dhcp-ddns/server-port 900</userinput>
  1405. &gt; <userinput>config commit</userinput>
  1406. </screen>
  1407. </para>
  1408. </section>
  1409. <section id="dhcpv4-d2-rules-config">
  1410. <title>When does the b10-dhcp4 server generate DDNS requests?</title>
  1411. b10-dhcp4 follows the behavior prescribed for DHCP servers in RFC 4702.
  1412. It is important to keep in mind that b10-dhcp4 provides the initial decision
  1413. making of when and what to update and forwards that information to D2 in
  1414. the form of NCRs. Carrying out the actual DNS updates and dealing with
  1415. such things as conflict resolution are the purview of D2 (<xref linkend="dhcp-ddns-server"/>).
  1416. <para>
  1417. This section describes when b10-dhcp4 will generate NCRs and the
  1418. configuration parameters that can be used to influence this decision.
  1419. It assumes that the "enable-updates" parameter is true.
  1420. </para>
  1421. <para>
  1422. In general, b10-dhcp4 will generate DDNS update requests when:
  1423. <orderedlist>
  1424. <listitem><para>
  1425. A new lease is granted in response to a DHCP REQUEST
  1426. </para></listitem>
  1427. <listitem><para>
  1428. An existing lease is renewed but the FQDN associated with it has
  1429. changed.
  1430. </para></listitem>
  1431. <listitem><para>
  1432. An existing lease is released in response to a DHCP RELEASE
  1433. </para></listitem>
  1434. </orderedlist>
  1435. In the second case, lease renewal, two DDNS requests will be issued: one
  1436. request to remove entries for the previous FQDN and a second request to
  1437. add entries for the new FQDN. In the last case, a lease release, a
  1438. single DDNS request to remove its entries will be made. The decision
  1439. making involved when granting a new lease (the first case) is more
  1440. involved and is discussed next.
  1441. </para>
  1442. <para>
  1443. When a new lease is granted, b10-dhcp4 will generate a DDNS
  1444. update request if the DHCP REQUEST contains either the FQDN option
  1445. (code 81) or the Host Name option (code 12). If both are present,
  1446. the server will use the FQDN option. By default b10-dhcp4
  1447. will respect the FQDN N and S flags specified by the client as shown
  1448. in the following table:
  1449. </para>
  1450. <table id="fqdn-flag-table">
  1451. <title>Default FQDN Flag Behavior</title>
  1452. <tgroup cols='4' align='left'>
  1453. <colspec colname='cflags'/>
  1454. <colspec colname='meaning'/>
  1455. <colspec colname='response'/>
  1456. <colspec colname='sflags'/>
  1457. <thead>
  1458. <row>
  1459. <entry>Client Flags:N-S</entry>
  1460. <entry>Client Intent</entry>
  1461. <entry>Server Response</entry>
  1462. <entry>Server Flags:N-S-O</entry>
  1463. </row>
  1464. </thead>
  1465. <tbody>
  1466. <row>
  1467. <entry>0-0</entry>
  1468. <entry>
  1469. Client wants to do forward updates, server should do reverse updates
  1470. </entry>
  1471. <entry>Server generates reverse-only request</entry>
  1472. <entry>1-0-0</entry>
  1473. </row>
  1474. <row>
  1475. <entry>0-1</entry>
  1476. <entry>Server should do both forward and reverse updates</entry>
  1477. <entry>Server generates request to update both directions</entry>
  1478. <entry>0-1-0</entry>
  1479. </row>
  1480. <row>
  1481. <entry>1-0</entry>
  1482. <entry>Client wants no updates done</entry>
  1483. <entry>Server does not generate a request</entry>
  1484. <entry>1-0-0</entry>
  1485. </row>
  1486. </tbody>
  1487. </tgroup>
  1488. </table>
  1489. <para>
  1490. The first row in the table above represents "client delegation". Here
  1491. the DHCP client states that it intends to do the forward DNS updates and
  1492. the server should do the reverse updates. By default, b10-dhcp4 will honor
  1493. the client's wishes and generate a DDNS request to D2 to update only
  1494. reverse DNS data. The parameter, "override-client-update", can be used
  1495. to instruct the server to override client delegation requests. When
  1496. this parameter is true, b10-dhcp4 will disregard requests for client
  1497. delegation and generate a DDNS request to update both forward and
  1498. reverse DNS data. In this case, the N-S-O flags in the server's
  1499. response to the client will be 0-1-1 respectively.
  1500. </para>
  1501. <para>
  1502. (Note that the flag combination N=1, S=1 is prohibited according to
  1503. RFC 4702. If such a combination is received from the client, the packet
  1504. will be dropped by the b10-dhcp4.)
  1505. </para>
  1506. <para>
  1507. To override client delegation, issue the following commands:
  1508. </para>
  1509. <screen>
  1510. &gt; <userinput>config set Dhcp4/dhcp-ddns/override-client-update true</userinput>
  1511. &gt; <userinput>config commit</userinput>
  1512. </screen>
  1513. <para>
  1514. The third row in the table above describes the case in which the client
  1515. requests that no DNS updates be done. The parameter, "override-no-update",
  1516. can be used to instruct the server to disregard the client's wishes. When
  1517. this parameter is true, b10-dhcp4 will generate DDNS update request to D2
  1518. even if the client requests no updates be done. The N-S-O flags in the
  1519. server's response to the client will be 0-1-1.
  1520. </para>
  1521. <para>
  1522. To override client delegation, issue the following commands:
  1523. </para>
  1524. <screen>
  1525. &gt; <userinput>config set Dhcp4/dhcp-ddns/override-no-update true</userinput>
  1526. &gt; <userinput>config commit</userinput>
  1527. </screen>
  1528. <para>
  1529. b10-dhcp4 will always generate DDNS update requests if the client request
  1530. only contains the Host Name option. In addition it will include an FQDN
  1531. option in the response to the client with the FQDN N-S-O flags set to
  1532. 0-1-0 respectively. The domain name portion of the FQDN option will be
  1533. the name submitted to D2 in the DDNS update request.
  1534. </para>
  1535. </section>
  1536. <section id="dhcpv4-fqdn-name-generation">
  1537. <title>b10-dhcp4 name generation for DDNS update requests</title>
  1538. Each NameChangeRequest must of course include the fully qualified domain
  1539. name whose DNS entries are to be affected. b10-dhcp4 can be configured to
  1540. supply a portion or all of that name based upon what it receives from
  1541. the client in the DHCP REQUEST.
  1542. <para>
  1543. The rules for determining the FQDN option are as follows:
  1544. <orderedlist>
  1545. <listitem><para>
  1546. If configured to do, so ignore the REQUEST contents and generate a
  1547. FQDN using a configurable prefix and suffix.
  1548. </para></listitem>
  1549. <listitem><para>
  1550. If the REQUEST contains the client FQDN option, the candidate
  1551. name is taken from there, otherwise it is taken from the Host Name option.
  1552. The candiate name may then be modified:
  1553. <orderedlist>
  1554. <listitem><para>
  1555. If the candidate name is a fully qualified domain name, use it.
  1556. </para></listitem>
  1557. <listitem><para>
  1558. If the candidate name is a partial (i.e. unqualified) name then
  1559. add a configurable suffix to the name and use the result as the FQDN.
  1560. </para></listitem>
  1561. <listitem><para>
  1562. If the candidate name is a empty, generate a FQDN using a
  1563. configurable prefix and suffix.
  1564. </para></listitem>
  1565. </orderedlist>
  1566. </para></listitem>
  1567. </orderedlist>
  1568. To instruct b10-dhcp4 to always generate the FQDN for a client, set the
  1569. parameter "replace-client-name" to true as follows:
  1570. </para>
  1571. <screen>
  1572. &gt; <userinput>config set Dhcp4/dhcp-ddns/replace-client-name true</userinput>
  1573. &gt; <userinput>config commit</userinput>
  1574. </screen>
  1575. <para>
  1576. The prefix used in the generation of a FQDN is specified by the
  1577. "generated-prefix" parameter. The default value is "myhost". To alter
  1578. its value simply set it to the desired string:
  1579. </para>
  1580. <screen>
  1581. &gt; <userinput>config set Dhcp4/dhcp-ddns/generated-prefix "another.host"</userinput>
  1582. &gt; <userinput>config commit</userinput>
  1583. </screen>
  1584. <para>
  1585. The suffix used when generating a FQDN or when qualifying a partial
  1586. name is specified by the "qualifying-suffix" parameter. The default
  1587. value is "example.com". To alter its value simply set it to the desired
  1588. string:
  1589. </para>
  1590. <screen>
  1591. &gt; <userinput>config set Dhcp4/dhcp-ddns/generated-prefix "our.net"</userinput>
  1592. &gt; <userinput>config commit</userinput>
  1593. </screen>
  1594. </section>
  1595. <para>
  1596. When generating a name, b10-dhcp4 will construct name of the format:
  1597. </para>
  1598. <para>
  1599. [generated-prefix]-[address-text].[qualifying-suffix].
  1600. </para>
  1601. <para>
  1602. where address-text is simply the lease IP address converted to a
  1603. hyphenated string. For example, if lease address is 172.16.1.10 and
  1604. assuming default values for generated-prefix and qualifying-suffix, the
  1605. generated FQDN would be:
  1606. </para>
  1607. <para>
  1608. myhost-172-16-1-10.example.com.
  1609. </para>
  1610. </section>
  1611. </section> <!-- end of configuring b10-dhcp4 server section with many subsections -->
  1612. <section id="dhcp4-serverid">
  1613. <title>Server Identifier in DHCPv4</title>
  1614. <para>
  1615. The DHCPv4 protocol uses a "server identifier" for clients to be able
  1616. to discriminate between several servers present on the same link: this
  1617. value is an IPv4 address of the server. The server chooses the IPv4 address
  1618. of the interface on which the message from the client (or relay) has been
  1619. received. A single server instance will use multiple server identifiers
  1620. if it is receiving queries on multiple interfaces.
  1621. </para>
  1622. <para>
  1623. Currently there is no mechanism to override the default server identifiers
  1624. by an administrator. In the future, the configuration mechanism will be used
  1625. to specify the custom server identifier.
  1626. </para>
  1627. </section>
  1628. <section id="dhcp4-next-server">
  1629. <title>Next server (siaddr)</title>
  1630. <para>In some cases, clients want to obtain configuration from the TFTP server.
  1631. Although there is a dedicated option for it, some devices may use siaddr field
  1632. in the DHCPv4 packet for that purpose. That specific field can be configured
  1633. using next-server directive. It is possible to define it in global scope or
  1634. for a given subnet only. If both are defined, subnet value takes precedence.
  1635. The value in subnet can be set to 0.0.0.0, which means that next-server should
  1636. not be sent. It may also be set to empty string, which means the same as if
  1637. it was not defined at all - use global value.
  1638. </para>
  1639. <screen>
  1640. &gt; <userinput>config add Dhcp4/next-server</userinput>
  1641. &gt; <userinput>config set Dhcp4/next-server "192.0.2.123"</userinput>
  1642. &gt; <userinput>config commit</userinput>
  1643. <userinput></userinput>
  1644. &gt; <userinput>config add Dhcp4/subnet[0]/next-server</userinput>
  1645. &gt; <userinput>config set Dhcp4/subnet[0]/next-server "192.0.2.234"</userinput>
  1646. &gt; <userinput>config commit</userinput>
  1647. </screen>
  1648. </section>
  1649. <section id="dhcp4-echo-client-id">
  1650. <title>Echoing client-id (RFC6842)</title>
  1651. <para>Original DHCPv4 spec (RFC2131) states that the DHCPv4
  1652. server must not send back client-id options when responding to
  1653. clients. However, in some cases that confused clients that did
  1654. not have MAC address or client-id. See RFC6842 for details. That
  1655. behavior has changed with the publication of RFC6842 which
  1656. updated RFC2131. That update now states that the server must
  1657. send client-id if client sent it. That is the default behaviour
  1658. that Kea offers. However, in some cases older devices that do
  1659. not support RFC6842 may refuse to accept responses that include
  1660. client-id option. To enable backward compatibility, an optional
  1661. configuration parameter has been introduced. To configure it,
  1662. use the following commands:</para>
  1663. <screen>
  1664. &gt; <userinput>config add Dhcp4/echo-client-id</userinput>
  1665. &gt; <userinput>config set Dhcp4/echo-client-id False</userinput>
  1666. &gt; <userinput>config commit</userinput>
  1667. </screen>
  1668. </section>
  1669. <section id="dhcp4-subnet-selection">
  1670. <title>How DHCPv4 server selects subnet for a client</title>
  1671. <para>
  1672. The DHCPv4 server differentiates between the directly connected clients,
  1673. clients trying to renew leases and clients sending their messages through
  1674. relays. For the directly connected clients the server will check the
  1675. configuration of the interface on which the message has been received, and
  1676. if the server configuration doesn't match any configured subnet the
  1677. message is discarded.</para>
  1678. <para>Assuming that the server's interface is configured with the 192.0.2.3
  1679. IPv4 address, the server will only process messages received through
  1680. this interface from the directly connected client, if there is a subnet
  1681. configured, to which this IPv4 address belongs, e.g. 192.0.2.0/24.
  1682. The server will use this subnet to assign IPv4 address for the client.
  1683. </para>
  1684. <para>
  1685. The rule above does not apply when the client unicasts its message, i.e.
  1686. is trying to renew its lease. Such message is accepted through any
  1687. interface. The renewing client sets ciaddr to the currently used IPv4
  1688. address. The server uses this address to select the subnet for the client
  1689. (in particular, to extend the lease using this address).
  1690. </para>
  1691. <para>
  1692. If the message is relayed it is accepted through any interface. The giaddr
  1693. set by the relay agent is used to select the subnet for the client.
  1694. </para>
  1695. <para>
  1696. It is also possible to specify a relay IPv4 address for a given subnet. It
  1697. can be used to match incoming packets into a subnet in uncommon configurations,
  1698. e.g. shared subnets. See <xref linkend="dhcp4-relay-override"/> for details.
  1699. </para>
  1700. <note>
  1701. <para>The subnet selection mechanism described in this section is based
  1702. on the assumption that client classification is not used. The classification
  1703. mechanism alters the way in which subnet is selected for the client,
  1704. depending on the classes that the client belongs to.</para>
  1705. </note>
  1706. </section>
  1707. <section id="dhcp4-relay-override">
  1708. <title>Using specific relay agent for a subnet</title>
  1709. <para>
  1710. The relay has to have an interface connected to the link on which
  1711. the clients are being configured. Typically the relay has an IPv4
  1712. address configured on that interface that belongs to the subnet that
  1713. the server will assign addresses from. In such typical case, the
  1714. server is able to use IPv4 address inserted by the relay (in GIADDR
  1715. field of the DHCPv4 packet) to select appropriate subnet.
  1716. </para>
  1717. <para>
  1718. However, that is not always the case. In certain uncommon, but
  1719. valid deployments, the relay address may not match the subnet. This
  1720. usually means that there is more than one subnet allocated for a given
  1721. link. Two most common examples where this is the case are long lasting
  1722. network renumbering (where both old and new address space is still being
  1723. used) and a cable network. In a cable network both cable modems and the
  1724. devices behind them are physically connected to the same link, yet
  1725. they use distinct addressing. In such case, the DHCPv4 server needs
  1726. additional information (IPv4 address of the relay) to properly select
  1727. an appropriate subnet.
  1728. </para>
  1729. <para>
  1730. The following example assumes that there is a subnet 192.0.2.0/24
  1731. that is accessible via relay that uses 10.0.0.1 as its IPv4 address.
  1732. The server will be able to select this subnet for any incoming packets
  1733. that came from a relay that has an address in 192.0.2.0/24 subnet.
  1734. It will also select that subnet for a relay with address 10.0.0.1.
  1735. <screen>
  1736. &gt; <userinput>config add Dhcp4/subnet4</userinput>
  1737. &gt; <userinput>config set Dhcp4/subnet4[0]/subnet "192.0.2.0/24"</userinput>
  1738. &gt; <userinput>config set Dhcp4/subnet4[0]/pool [ "192.0.2.10 - 192.0.2.20" ]</userinput>
  1739. &gt; <userinput>config set Dhcp4/subnet4[0]/relay/ip-address "10.0.0.1"</userinput>
  1740. &gt; <userinput>config commit</userinput></screen>
  1741. </para>
  1742. </section>
  1743. <section id="dhcp4-srv-example-client-class-relay">
  1744. <title>Segregating IPv4 clients in a cable network</title>
  1745. <para>
  1746. In certain cases, it is useful to mix relay address information,
  1747. introduced in <xref linkend="dhcp4-relay-override"/> with client
  1748. classification, explained in <xref linkend="dhcp4-subnet-class"/>.
  1749. One specific example is cable network, where typically modems
  1750. get addresses from a different subnet than all devices connected
  1751. behind them.
  1752. </para>
  1753. <para>
  1754. Let's assume that there is one CMTS (Cable Modem Termination System)
  1755. with one CM MAC (a physical link that modems are connected to).
  1756. We want the modems to get addresses from the 10.1.1.0/24 subnet, while
  1757. everything connected behind modems should get addresses from another
  1758. subnet (192.0.2.0/24). The CMTS that acts as a relay an uses address
  1759. 10.1.1.1. The following configuration can serve that configuration:
  1760. <screen>
  1761. &gt; <userinput>config add Dhcp4/subnet4</userinput>
  1762. &gt; <userinput>config set Dhcp4/subnet4[0]/subnet "10.1.1.0/24"</userinput>
  1763. &gt; <userinput>config set Dhcp4/subnet4[0]/pool [ "10.1.1.2 - 10.1.1.20" ]</userinput>
  1764. &gt; <userinput>config set Dhcp4/subnet4[0]/client-class "docsis3.0"</userinput>
  1765. &gt; <userinput>config set Dhcp4/subnet4[0]/relay/ip-address "10.1.1.1"</userinput>
  1766. &gt; <userinput>config add Dhcp4/subnet4</userinput>
  1767. &gt; <userinput>config set Dhcp4/subnet4[1]/subnet "192.0.2.0/24"</userinput>
  1768. &gt; <userinput>config set Dhcp4/subnet4[1]/pool [ "192.0.2.10 - 192.0.2.20" ]</userinput>
  1769. &gt; <userinput>config set Dhcp4/subnet4[1]/relay/ip-address "10.1.1.1"</userinput>
  1770. &gt; <userinput>config commit</userinput></screen>
  1771. </para>
  1772. </section>
  1773. <section id="dhcp4-std">
  1774. <title>Supported Standards</title>
  1775. <para>The following standards and draft standards are currently
  1776. supported:</para>
  1777. <itemizedlist>
  1778. <listitem>
  1779. <simpara><ulink url="http://tools.ietf.org/html/rfc2131">RFC 2131</ulink>: Supported messages are DISCOVER, OFFER,
  1780. REQUEST, RELEASE, ACK, and NAK.</simpara>
  1781. </listitem>
  1782. <listitem>
  1783. <simpara><ulink url="http://tools.ietf.org/html/rfc2132">RFC 2132</ulink>:
  1784. Supported options are: PAD (0),
  1785. END(255), Message Type(53), DHCP Server Identifier (54),
  1786. Domain Name (15), DNS Servers (6), IP Address Lease Time
  1787. (51), Subnet mask (1), and Routers (3).</simpara>
  1788. </listitem>
  1789. <listitem>
  1790. <simpara><ulink url="http://tools.ietf.org/html/rfc3046">RFC 3046</ulink>:
  1791. Relay Agent Information option is supported.</simpara>
  1792. </listitem>
  1793. <listitem>
  1794. <simpara><ulink url="http://tools.ietf.org/html/rfc3925">RFC 3925</ulink>:
  1795. Vendor-Identifying Vendor Class and Vendor-Identifying Vendor-Specific
  1796. Information option are supported.</simpara>
  1797. </listitem>
  1798. <listitem>
  1799. <simpara><ulink url="http://tools.ietf.org/html/rfc6842">RFC 6842</ulink>:
  1800. Server by default sends back client-id option. That capability may be
  1801. disabled. See <xref linkend="dhcp4-echo-client-id"/> for details.
  1802. </simpara>
  1803. </listitem>
  1804. </itemizedlist>
  1805. </section>
  1806. <section id="dhcp4-limit">
  1807. <title>DHCPv4 Server Limitations</title>
  1808. <para>These are the current limitations of the DHCPv4 server
  1809. software. Most of them are reflections of the current stage of
  1810. development and should be treated as <quote>not implemented
  1811. yet</quote>, rather than actual limitations.</para>
  1812. <itemizedlist>
  1813. <listitem> <!-- see tickets #3234, #3281 -->
  1814. <simpara>
  1815. Removal of a subnet during server reconfiguration may cause renumbering
  1816. of auto-generated subnet identifiers, as described in section
  1817. <xref linkend="ipv4-subnet-id"/>.
  1818. </simpara>
  1819. </listitem>
  1820. <listitem>
  1821. <simpara>
  1822. BOOTP (<ulink url="http://tools.ietf.org/html/rfc951">RFC 951</ulink>)
  1823. is not supported.
  1824. </simpara>
  1825. </listitem>
  1826. <listitem>
  1827. <simpara>Raw sockets operation is working on Linux
  1828. only. See <xref linkend="iface-detect"/> for details.</simpara>
  1829. </listitem>
  1830. <listitem>
  1831. <simpara>The DHCPv4 server does not verify that
  1832. assigned address is unused. According to <ulink url="http://tools.ietf.org/html/rfc2131">RFC 2131</ulink>, the
  1833. allocating server should verify that address is not used by
  1834. sending ICMP echo request.</simpara>
  1835. </listitem>
  1836. <listitem>
  1837. <simpara>Address duplication report (DECLINE) is not supported yet.</simpara>
  1838. </listitem>
  1839. <listitem>
  1840. <simpara>
  1841. The server doesn't act upon expired leases. In particular,
  1842. when a lease expires, the server doesn't request the removal
  1843. of the DNS records associated with it.
  1844. </simpara>
  1845. </listitem>
  1846. </itemizedlist>
  1847. </section>
  1848. <!--
  1849. <section id="dhcp4-srv-examples">
  1850. <title>Kea DHCPv4 server examples</title>
  1851. <para>
  1852. This section provides easy to use example. Each example can be read
  1853. separately. It is not intended to be read sequentially as there will
  1854. be many repetitions between examples. They are expected to serve as
  1855. easy to use copy-paste solutions to many common deployments.
  1856. </para>
  1857. @todo: add simple configuration for direct clients
  1858. @todo: add configuration for relayed clients
  1859. @todo: add client classification example
  1860. </section> -->
  1861. </chapter>
  1862. <chapter id="dhcp6">
  1863. <title>The DHCPv6 Server</title>
  1864. <section id="dhcp6-start-stop">
  1865. <title>Starting and Stopping the DHCPv6 Server</title>
  1866. <para>
  1867. <command>b10-dhcp6</command> is the Kea DHCPv6 server and is configured
  1868. through the <command>bindctl</command> program.
  1869. </para>
  1870. <para>
  1871. After starting <command>bind10</command> and starting <command>bindctl</command>, the first step
  1872. in configuring the server is to add <command>b10-dhcp6</command> to the list of running services.
  1873. <screen>
  1874. &gt; <userinput>config add Init/components b10-dhcp6</userinput>
  1875. &gt; <userinput>config set Init/components/b10-dhcp6/kind dispensable</userinput>
  1876. &gt; <userinput>config commit</userinput>
  1877. </screen>
  1878. </para>
  1879. <para>
  1880. To remove <command>b10-dhcp6</command> from the set of running services,
  1881. the <command>b10-dhcp6</command> is removed from list of Init components:
  1882. <screen>
  1883. &gt; <userinput>config remove Init/components b10-dhcp6</userinput>
  1884. &gt; <userinput>config commit</userinput>
  1885. </screen>
  1886. </para>
  1887. <para>
  1888. Note that the server was only removed from the list, so BIND10 will not
  1889. restart it, but the server itself is still running. Hence it is usually
  1890. desired to stop it:
  1891. <screen>
  1892. &gt; <userinput>Dhcp6 shutdown</userinput>
  1893. </screen>
  1894. </para>
  1895. <para>
  1896. During start-up the server will detect available network interfaces
  1897. and will attempt to open UDP sockets on all interfaces that
  1898. are up, running, are not loopback, are multicast-capable, and
  1899. have IPv6 address assigned. It will then listen to incoming traffic.
  1900. </para>
  1901. </section>
  1902. <section id="dhcp6-configuration">
  1903. <title>DHCPv6 Server Configuration</title>
  1904. <para>
  1905. Once the server has been started, it can be configured. To view the
  1906. current configuration, use the following command in <command>bindctl</command>:
  1907. <screen>&gt; <userinput>config show Dhcp6</userinput></screen>
  1908. When starting the Dhcp6 daemon for the first time, the default configuration
  1909. will be available. It will look similar to this:
  1910. <screen>
  1911. &gt; <userinput>config show Dhcp6</userinput>
  1912. Dhcp6/hooks-libraries [] list (default)
  1913. Dhcp6/interfaces/ list (default)
  1914. Dhcp6/renew-timer 1000 integer (default)
  1915. Dhcp6/rebind-timer 2000 integer (default)
  1916. Dhcp6/preferred-lifetime 3000 integer (default)
  1917. Dhcp6/valid-lifetime 4000 integer (default)
  1918. Dhcp6/option-def [] list (default)
  1919. Dhcp6/option-data [] list (default)
  1920. Dhcp6/lease-database/type "" string (default)
  1921. Dhcp6/lease-database/name "" string (default)
  1922. Dhcp6/lease-database/user "" string (default)
  1923. Dhcp6/lease-database/host "" string (default)
  1924. Dhcp6/lease-database/password "" string (default)
  1925. Dhcp6/subnet6/ list
  1926. Dhcp6/dhcp-ddns/enable-updates true boolean
  1927. Dhcp6/dhcp-ddns/server-ip "127.0.0.1" string
  1928. Dhcp6/dhcp-ddns/server-port 53001 integer
  1929. Dhcp6/dhcp-ddns/sender-ip "" string
  1930. Dhcp6/dhcp-ddns/sender-port 0 integer
  1931. Dhcp6/dhcp-ddns/max-queue-size 1024 integer
  1932. Dhcp6/dhcp-ddns/ncr-protocol "UDP" string
  1933. Dhcp6/dhcp-ddns/ncr-format "JSON" string
  1934. Dhcp6/dhcp-ddns/always-include-fqdn false boolean
  1935. Dhcp6/dhcp-ddns/override-no-update false boolean
  1936. Dhcp6/dhcp-ddns/override-client-update false boolean
  1937. Dhcp6/dhcp-ddns/replace-client-name false boolean
  1938. Dhcp6/dhcp-ddns/generated-prefix "myhost" string
  1939. Dhcp6/dhcp-ddns/qualifying-suffix "example.com" string
  1940. </screen>
  1941. </para>
  1942. <para>
  1943. To change one of the parameters, simply follow
  1944. the usual <command>bindctl</command> procedure. For example, to make the
  1945. leases longer, change their valid-lifetime parameter:
  1946. <screen>
  1947. &gt; <userinput>config set Dhcp6/valid-lifetime 7200</userinput>
  1948. &gt; <userinput>config commit</userinput></screen>
  1949. Most Dhcp6 parameters are of global scope
  1950. and apply to all defined subnets, unless they are overridden on a
  1951. per-subnet basis.
  1952. </para>
  1953. <note>
  1954. <para>
  1955. With this version of Kea, there are a number of known limitations
  1956. and problems in the DHCPv6 server. See <xref linkend="dhcp6-limit"/>.
  1957. </para>
  1958. </note>
  1959. <section>
  1960. <title>Default storage for leases</title>
  1961. <para>
  1962. The server is able to store lease data in different repositories. Larger deployments
  1963. may elect to store leases in a database.
  1964. <xref linkend="database-configuration6"/> describes one way to do it.
  1965. By default, the server will use a CSV file rather than a database to store
  1966. lease information. One of the advantages of using a file is that it eliminates
  1967. dependency on third party database software.
  1968. </para>
  1969. <para>
  1970. The configuration of the file backend (Memfile)
  1971. is controlled through the Dhcp6/lease-database parameters. When default
  1972. parameters are left, the Memfile backend will write leases to a disk in the
  1973. [bind10-install-dir]/var/bind10/kea-leases6.csv.
  1974. </para>
  1975. <para>
  1976. It is possible to alter the default location of the lease file. The following
  1977. configuration:
  1978. <screen>
  1979. &gt; <userinput>config set Dhcp4/lease-database/type "memfile"</userinput>
  1980. &gt; <userinput>config set Dhcp4/lease-database/persist true</userinput>
  1981. &gt; <userinput>config set Dhcp4/lease-database/leasefile "/tmp/kea-leases6.csv"</userinput>
  1982. &gt; <userinput>config commit</userinput>
  1983. </screen>
  1984. will change the default location of the lease file to /tmp/kea-leases6.csv.
  1985. </para>
  1986. <para>
  1987. The "persist" parameter controls whether the leases are written to disk.
  1988. It is strongly recommended that this parameter is set to "true" at all times
  1989. during the normal operation of the server.
  1990. </para>
  1991. </section>
  1992. <section id="database-configuration6">
  1993. <title>Database Configuration</title>
  1994. <para>
  1995. All leases issued by the server are stored in the lease database. Currently
  1996. there are 3 database backends available: MySQL, PostgreSQL and memfile.
  1997. <footnote>
  1998. <para>
  1999. The server comes with an in-memory database ("memfile") configured as the default
  2000. database. This is used for internal testing and is not supported. In addition,
  2001. it does not store lease information on disk: lease information will be lost if the
  2002. server is restarted.
  2003. </para>
  2004. </footnote>, and so the server must be configured to
  2005. access the correct database with the appropriate credentials.
  2006. </para>
  2007. <note>
  2008. <para>
  2009. Database access information must be configured for the DHCPv6 server, even if
  2010. it has already been configured for the DHCPv4 server. The servers store their
  2011. information independently, so each server can use a separate
  2012. database or both servers can use the same database.
  2013. </para>
  2014. </note>
  2015. <para>
  2016. Database configuration is controlled through the Dhcp6/lease-database parameters.
  2017. The type of the database must be set to "mysql", "postgresql" or "memfile":
  2018. <screen>
  2019. &gt; <userinput>config set Dhcp6/lease-database/type "mysql"</userinput>
  2020. </screen>
  2021. Next, the name of the database is to hold the leases must be set: this is the
  2022. name used when the lease database was created (see <xref linkend="dhcp-mysql-database-create"/>
  2023. or <xref linkend="dhcp-pgsql-database-create"/>).
  2024. <screen>
  2025. &gt; <userinput>config set Dhcp6/lease-database/name "<replaceable>database-name</replaceable>"</userinput>
  2026. </screen>
  2027. If the database is located on a different system to the DHCPv6 server, the
  2028. database host name must also be specified (although note that this configuration
  2029. may have a severe impact on server performance):
  2030. <screen>
  2031. &gt; <userinput>config set Dhcp6/lease-database/host "<replaceable>remote-host-name</replaceable>"</userinput>
  2032. </screen>
  2033. The usual state of affairs will be to have the database on the same machine as the
  2034. DHCPv6 server. In this case, set the value to the empty string (this is the default):
  2035. <screen>
  2036. &gt; <userinput>config set Dhcp6/lease-database/host ""</userinput>
  2037. </screen>
  2038. </para>
  2039. <para>
  2040. Finally, the credentials of the account under which the server will access the database
  2041. should be set:
  2042. <screen>
  2043. &gt; <userinput>config set Dhcp6/lease-database/user "<replaceable>user-name</replaceable>"</userinput>
  2044. &gt; <userinput>config set Dhcp6/lease-database/password "<replaceable>password</replaceable>"</userinput>
  2045. </screen>
  2046. If there is no password to the account, set the password to the empty string "". (This is also the default.)
  2047. </para>
  2048. <note>
  2049. <para>The password is echoed when entered and is stored in clear text in the configuration
  2050. database. Improved password security will be added in a future version of Kea.</para>
  2051. </note>
  2052. </section>
  2053. <section id="dhcp6-interface-selection">
  2054. <title>Interface selection</title>
  2055. <para>
  2056. When DHCPv6 server starts up, by default it will listen to the DHCP
  2057. traffic and respond to it on all interfaces detected during startup.
  2058. However, in many cases it is desired to configure the server to listen and
  2059. respond on selected interfaces only. The sample commands in this section
  2060. show how to make interface selection using bindctl.
  2061. </para>
  2062. <para>
  2063. The default configuration can be presented with the following command:
  2064. <screen>
  2065. &gt; <userinput>config show Dhcp6/interfaces</userinput>
  2066. <userinput>Dhcp6/interfaces[0] "*" string</userinput></screen>
  2067. An asterisk sign plays a role of the wildcard and means "listen on all interfaces".
  2068. </para>
  2069. <para>
  2070. In order to override the default configuration, the existing entry can be replaced
  2071. with the actual interface name:
  2072. <screen>
  2073. &gt; <userinput>config set Dhcp6/interfaces[0] eth1</userinput>
  2074. &gt; <userinput>config commit</userinput></screen>
  2075. Other interface names can be added on one-by-one basis:
  2076. <screen>
  2077. &gt; <userinput>config add Dhcp6/interfaces eth2</userinput>
  2078. &gt; <userinput>config commit</userinput></screen>
  2079. Configuration will now contain two interfaces which can be presented as follows:
  2080. <screen>
  2081. &gt; <userinput>config show Dhcp6/interfaces</userinput>
  2082. <userinput>Dhcp6/interfaces[0] "eth1" string</userinput>
  2083. <userinput>Dhcp6/interfaces[1] "eth2" string</userinput></screen>
  2084. When configuration gets committed, the server will start to listen on
  2085. eth1 and eth2 interfaces only.
  2086. </para>
  2087. <para>
  2088. It is possible to use wildcard interface name (asterisk) concurrently with explicit
  2089. interface names:
  2090. <screen>
  2091. &gt; <userinput>config add Dhcp6/interfaces *</userinput>
  2092. &gt; <userinput>config commit</userinput></screen>
  2093. This will result in the following configuration:
  2094. <screen>
  2095. &gt; <userinput>config show Dhcp6/interfaces</userinput>
  2096. <userinput>Dhcp6/interfaces[0] "eth1" string</userinput>
  2097. <userinput>Dhcp6/interfaces[1] "eth2" string</userinput>
  2098. <userinput>Dhcp6/interfaces[2] "*" string</userinput></screen>
  2099. The presence of the wildcard name implies that server will listen on all interfaces.
  2100. In order to fall back to the previous configuration when server listens on eth1 and eth2:
  2101. <screen>
  2102. &gt; <userinput>config remove Dhcp6/interfaces[2]</userinput>
  2103. &gt; <userinput>config commit</userinput></screen>
  2104. </para>
  2105. </section>
  2106. <section id="ipv6-subnet-id">
  2107. <title>IPv6 Subnet Identifier</title>
  2108. <para>
  2109. Subnet identifier is a unique number associated with a particular subnet.
  2110. In principle, it is used to associate clients' leases with respective subnets.
  2111. When subnet identifier is not specified for a subnet being configured, it will
  2112. be automatically assigned by the configuration mechanism. The identifiers
  2113. are assigned from 1 and are monotonically increased for each subsequent
  2114. subnet: 1, 2, 3 ....
  2115. </para>
  2116. <para>
  2117. If there are multiple subnets configured with auto-generated identifiers and
  2118. one of them is removed, the subnet identifiers may be renumbered. For example:
  2119. if there are 4 subnets and 3rd is removed the last subnet will be assigned
  2120. identifier that the 3rd subnet had before removal. As a result, the leases
  2121. stored in the lease database for subnet 3 are now associated with the
  2122. subnet 4, which may have unexpected consequences. In the future it is planned
  2123. to implement the mechanism to preserve auto-generated subnet ids upon removal
  2124. of one of the subnets. Currently, the only remedy for this issue is to
  2125. manually specify the unique subnet identifier for each subnet.
  2126. </para>
  2127. <para>
  2128. The following configuration:
  2129. <screen>
  2130. &gt; <userinput>config add Dhcp6/subnet6</userinput>
  2131. &gt; <userinput>config set Dhcp6/subnet6[0]/subnet "2001:db8:1::/64"</userinput>
  2132. &gt; <userinput>config set Dhcp6/subnet6[0]/id 1024</userinput>
  2133. &gt; <userinput>config commit</userinput>
  2134. </screen>
  2135. will assign the arbitrary subnet identifier to the newly configured subnet.
  2136. This identifier will not change for this subnet until "id" parameter is
  2137. removed or set to 0. The value of 0 forces auto-generation of subnet
  2138. identifier.
  2139. </para>
  2140. </section>
  2141. <section id="dhcp6-unicast">
  2142. <title>Unicast traffic support</title>
  2143. <para>
  2144. When DHCPv6 server starts up, by default it listens to the DHCP traffic
  2145. sent to multicast address ff02::1:2 on each interface that it is
  2146. configured to listen on (see <xref linkend="dhcp6-interface-selection"/>).
  2147. In some cases it is useful to configure a server to handle incoming
  2148. traffic sent to the global unicast addresses as well. The most common
  2149. reason for that is to have relays send their traffic to the server
  2150. directly. To configure server to listen on specific unicast address, a
  2151. notation to specify interfaces has been extended. Interface name can be
  2152. optionally followed by a slash, followed by global unicast address that
  2153. server should listen on. That will be done in addition to normal
  2154. link-local binding + listening on ff02::1:2 address. The sample commands
  2155. listed below show how to listen on 2001:db8::1 (a global address)
  2156. configured on the eth1 interface.
  2157. </para>
  2158. <para>
  2159. <screen>
  2160. &gt; <userinput>config set Dhcp6/interfaces[0] eth1/2001:db8::1</userinput>
  2161. &gt; <userinput>config commit</userinput></screen>
  2162. When configuration gets committed, the server will start to listen on
  2163. eth1 on link-local address, multicast group (ff02::1:2) and 2001:db8::1.
  2164. </para>
  2165. <para>
  2166. It is possible to mix interface names, wildcards and interface name/addresses
  2167. on the Dhcp6/interface list. It is not possible to specify more than one
  2168. unicast address on a given interface.
  2169. </para>
  2170. <para>
  2171. Care should be taken to specify proper unicast addresses. The server will
  2172. attempt to bind to those addresses specified, without any additional checks.
  2173. That approach is selected on purpose, so in the software can be used to
  2174. communicate over uncommon addresses if the administrator desires so.
  2175. </para>
  2176. </section>
  2177. <section id="dhcp6-address-config">
  2178. <title>Subnet and Address Pool</title>
  2179. <para>
  2180. The essential role of a DHCPv6 server is address assignment. For this,
  2181. the server has to be configured with at least one subnet and one pool of dynamic
  2182. addresses to be managed. For example, assume that the server
  2183. is connected to a network segment that uses the 2001:db8:1::/64
  2184. prefix. The Administrator of that network has decided that addresses from range
  2185. 2001:db8:1::1 to 2001:db8:1::ffff are going to be managed by the Dhcp6
  2186. server. Such a configuration can be achieved in the following way:
  2187. <screen>
  2188. &gt; <userinput>config add Dhcp6/subnet6</userinput>
  2189. &gt; <userinput>config set Dhcp6/subnet6[0]/subnet "2001:db8:1::/64"</userinput>
  2190. &gt; <userinput>config set Dhcp6/subnet6[0]/pool [ "2001:db8:1::0 - 2001:db8:1::ffff" ]</userinput>
  2191. &gt; <userinput>config commit</userinput></screen>
  2192. Note that subnet is defined as a simple string, but the pool parameter
  2193. is actually a list of pools: for this reason, the pool definition is
  2194. enclosed in square brackets, even though only one range of addresses
  2195. is specified.</para>
  2196. <para>It is possible to define more than one pool in a
  2197. subnet: continuing the previous example, further assume that
  2198. 2001:db8:1:0:5::/80 should be also be managed by the server. It could be written as
  2199. 2001:db8:1:0:5:: to 2001:db8:1::5:ffff:ffff:ffff, but typing so many 'f's
  2200. is cumbersome. It can be expressed more simply as 2001:db8:1:0:5::/80. Both
  2201. formats are supported by Dhcp6 and can be mixed in the pool list.
  2202. For example, one could define the following pools:
  2203. <screen>
  2204. &gt; <userinput>config set Dhcp6/subnet6[0]/pool [ "2001:db8:1::1 - 2001:db8:1::ffff", "2001:db8:1:0:5::/80" ]</userinput>
  2205. &gt; <userinput>config commit</userinput></screen>
  2206. The number of pools is not limited, but for performance reasons it is recommended to
  2207. use as few as possible.
  2208. </para>
  2209. <para>
  2210. The server may be configured to serve more than one subnet. To add a second subnet,
  2211. use a command similar to the following:
  2212. <screen>
  2213. &gt; <userinput>config add Dhcp6/subnet6</userinput>
  2214. &gt; <userinput>config set Dhcp6/subnet6[1]/subnet "2001:db8:beef::/48"</userinput>
  2215. &gt; <userinput>config set Dhcp6/subnet6[1]/pool [ "2001:db8:beef::/48" ]</userinput>
  2216. &gt; <userinput>config commit</userinput></screen>
  2217. Arrays are counted from 0. subnet[0] refers to the subnet defined in the
  2218. previous example. The <command>config add Dhcp6/subnet6</command> command adds
  2219. another (second) subnet. It can be referred to as
  2220. <command>Dhcp6/subnet6[1]</command>. In this example, we allow server to
  2221. dynamically assign all addresses available in the whole subnet. Although
  2222. very wasteful, it is certainly a valid configuration to dedicate the
  2223. whole /48 subnet for that purpose.
  2224. </para>
  2225. <para>
  2226. When configuring a DHCPv6 server using prefix/length notation, please pay
  2227. attention to the boundary values. When specifying that the server should use
  2228. a given pool, it will be able to allocate also first (typically network
  2229. address) address from that pool. For example for pool 2001:db8::/64 the
  2230. 2001:db8:: address may be assigned as well. If you want to avoid this,
  2231. please use the "min-max" notation.
  2232. </para>
  2233. </section>
  2234. <section>
  2235. <!-- @todo: add real meat to the prefix delegation config this is just place holder stuff -->
  2236. <title>Subnet and Prefix Delegation Pools</title>
  2237. <para>
  2238. Subnets may also be configured to delegate address prefixes....
  2239. A subnet may have one or more prefix delegation pools. Each pool has
  2240. a prefixed address, which is specified as a prefix and a prefix length,
  2241. as well as a delegated prefix length. A sample configuration is shown
  2242. below:
  2243. <screen>
  2244. &gt; <userinput>config add Dhcp6/subnet6</userinput>
  2245. &gt; <userinput>config set Dhcp6/subnet6[0]/subnet "2001:db8:1::/64"</userinput>
  2246. &gt; <userinput>config show Dhcp6/subnet6[0]</userinput>
  2247. &gt; <userinput>config add Dhcp6/subnet6[0]/pd-pools</userinput>
  2248. &gt; <userinput>config set Dhcp6/subnet6[0]/pd-pools[0]/prefix "2001:db8:1::"</userinput>
  2249. &gt; <userinput>config set Dhcp6/subnet6[0]/pd-pools[0]/prefix-len 64</userinput>
  2250. &gt; <userinput>config set Dhcp6/subnet6[0]/pd-pools[0]/delegated-len 96</userinput>
  2251. &gt; <userinput>config commit</userinput></screen>
  2252. </para>
  2253. </section>
  2254. <section id="dhcp6-std-options">
  2255. <title>Standard DHCPv6 options</title>
  2256. <para>
  2257. One of the major features of DHCPv6 server is to provide configuration
  2258. options to clients. Although there are several options that require
  2259. special behavior, most options are sent by the server only if the client
  2260. explicitly requested them. The following example shows how to
  2261. configure DNS servers, which is one of the most frequently used
  2262. options. Numbers in the first column are added for easier reference and
  2263. will not appear on screen. Options specified in this way are considered
  2264. global and apply to all configured subnets.
  2265. <screen>
  2266. 1. &gt; <userinput>config add Dhcp6/option-data</userinput>
  2267. 2. &gt; <userinput>config set Dhcp6/option-data[0]/name "dns-servers"</userinput>
  2268. 3. &gt; <userinput>config set Dhcp6/option-data[0]/code 23</userinput>
  2269. 4. &gt; <userinput>config set Dhcp6/option-data[0]/space "dhcp6"</userinput>
  2270. 5. &gt; <userinput>config set Dhcp6/option-data[0]/csv-format true</userinput>
  2271. 6. &gt; <userinput>config set Dhcp6/option-data[0]/data "2001:db8::cafe, 2001:db8::babe"</userinput>
  2272. 7. &gt; <userinput>config commit</userinput>
  2273. </screen>
  2274. </para>
  2275. <para>
  2276. The first line creates new entry in option-data table. It
  2277. contains information on all global options that the server is
  2278. supposed to configure in all subnets. The second line specifies
  2279. option name. For a complete list of currently supported names,
  2280. see <xref linkend="dhcp6-std-options-list"/>.
  2281. The third line specifies option code, which must match one of the
  2282. values from that
  2283. list. Line 4 specifies option space, which must always
  2284. be set to "dhcp6" as these are standard DHCPv6 options. For
  2285. other name spaces, including custom option spaces, see <xref
  2286. linkend="dhcp6-option-spaces"/>. The fifth line specifies the format in
  2287. which the data will be entered: use of CSV (comma
  2288. separated values) is recommended. The sixth line gives the actual value to
  2289. be sent to clients. Data is specified as a normal text, with
  2290. values separated by commas if more than one value is
  2291. allowed.
  2292. </para>
  2293. <para>
  2294. Options can also be configured as hexadecimal values. If csv-format is
  2295. set to false, the option data must be specified as a string of hexadecimal
  2296. numbers. The
  2297. following commands configure the DNS-SERVERS option for all
  2298. subnets with the following addresses: 2001:db8:1::cafe and
  2299. 2001:db8:1::babe.
  2300. <screen>
  2301. &gt; <userinput>config add Dhcp6/option-data</userinput>
  2302. &gt; <userinput>config set Dhcp6/option-data[0]/name "dns-servers"</userinput>
  2303. &gt; <userinput>config set Dhcp6/option-data[0]/code 23</userinput>
  2304. &gt; <userinput>config set Dhcp6/option-data[0]/space "dhcp6"</userinput>
  2305. &gt; <userinput>config set Dhcp6/option-data[0]/csv-format false</userinput>
  2306. &gt; <userinput>config set Dhcp6/option-data[0]/data "2001 0DB8 0001 0000 0000 0000</userinput>
  2307. <userinput>0000 CAFE 2001 0DB8 0001 0000 0000 0000 0000 BABE"</userinput>
  2308. &gt; <userinput>config commit</userinput>
  2309. </screen>
  2310. (The value for the setting of the "data" element is split across two
  2311. lines in this document for clarity: when entering the command, the
  2312. whole string should be entered on the same line.)
  2313. </para>
  2314. <para>
  2315. It is possible to override options on a per-subnet basis. If
  2316. clients connected to most of your subnets are expected to get the
  2317. same values of a given option, you should use global options: you
  2318. can then override specific values for a small number of subnets.
  2319. On the other hand, if you use different values in each subnet,
  2320. it does not make sense to specify global option values
  2321. (Dhcp6/option-data), rather you should set only subnet-specific values
  2322. (Dhcp6/subnet[X]/option-data[Y]).
  2323. </para>
  2324. <para>
  2325. The following commands override the global
  2326. DNS servers option for a particular subnet, setting a single DNS
  2327. server with address 2001:db8:1::3.
  2328. <screen>
  2329. &gt; <userinput>config add Dhcp6/subnet6[0]/option-data</userinput>
  2330. &gt; <userinput>config set Dhcp6/subnet6[0]/option-data[0]/name "dns-servers"</userinput>
  2331. &gt; <userinput>config set Dhcp6/subnet6[0]/option-data[0]/code 23</userinput>
  2332. &gt; <userinput>config set Dhcp6/subnet6[0]/option-data[0]/space "dhcp6"</userinput>
  2333. &gt; <userinput>config set Dhcp6/subnet6[0]/option-data[0]/csv-format true</userinput>
  2334. &gt; <userinput>config set Dhcp6/subnet6[0]/option-data[0]/data "2001:db8:1::3"</userinput>
  2335. &gt; <userinput>config commit</userinput></screen>
  2336. </para>
  2337. <note>
  2338. <para>
  2339. In future versions of BIND 10 DHCP, it will not be necessary to specify
  2340. option code, space and csv-format fields, as those fields will be set
  2341. automatically.
  2342. </para>
  2343. </note>
  2344. <para>
  2345. The currently supported standard DHCPv6 options are
  2346. listed in <xref linkend="dhcp6-std-options-list"/>.
  2347. The "Name" and "Code"
  2348. are the values that should be used as a name in the option-data
  2349. structures. "Type" designates the format of the data: the meanings of
  2350. the various types is given in <xref linkend="dhcp-types"/>.
  2351. </para>
  2352. <para>
  2353. Some options are designated as arrays, which means that more than one
  2354. value is allowed in such an option. For example the option dns-servers
  2355. allows the specification of more than one IPv6 address, so allowing
  2356. clients to obtain the the addresses of multiple DNS servers.
  2357. </para>
  2358. <!-- @todo: describe record types -->
  2359. <para>
  2360. The <xref linkend="dhcp6-custom-options"/> describes the configuration
  2361. syntax to create custom option definitions (formats). It is generally not
  2362. allowed to create custom definitions for standard options, even if the
  2363. definition being created matches the actual option format defined in the
  2364. RFCs. There is an exception from this rule for standard options for which
  2365. Kea does not provide a definition yet. In order to use such options,
  2366. a server administrator must create a definition as described in
  2367. <xref linkend="dhcp6-custom-options"/> in the 'dhcp6' option space. This
  2368. definition should match the option format described in the relevant
  2369. RFC but configuration mechanism would allow any option format as it has
  2370. no means to validate it at the moment.
  2371. </para>
  2372. <para>
  2373. <table frame="all" id="dhcp6-std-options-list">
  2374. <title>List of standard DHCPv6 options</title>
  2375. <tgroup cols='4'>
  2376. <colspec colname='name'/>
  2377. <colspec colname='code'/>
  2378. <colspec colname='type'/>
  2379. <colspec colname='array'/>
  2380. <thead>
  2381. <row><entry>Name</entry><entry>Code</entry><entry>Type</entry><entry>Array?</entry></row>
  2382. </thead>
  2383. <tbody>
  2384. <!-- Our engine uses those options on its own, admin must not configure them on his own
  2385. <row><entry>clientid</entry><entry>1</entry><entry>binary</entry><entry>false</entry></row>
  2386. <row><entry>serverid</entry><entry>2</entry><entry>binary</entry><entry>false</entry></row>
  2387. <row><entry>ia-na</entry><entry>3</entry><entry>record</entry><entry>false</entry></row>
  2388. <row><entry>ia-ta</entry><entry>4</entry><entry>uint32</entry><entry>false</entry></row>
  2389. <row><entry>iaaddr</entry><entry>5</entry><entry>record</entry><entry>false</entry></row>
  2390. <row><entry>oro</entry><entry>6</entry><entry>uint16</entry><entry>true</entry></row> -->
  2391. <row><entry>preference</entry><entry>7</entry><entry>uint8</entry><entry>false</entry></row>
  2392. <!-- Our engine uses those options on its own, admin must not configure them on his own
  2393. <row><entry>elapsed-time</entry><entry>8</entry><entry>uint16</entry><entry>false</entry></row>
  2394. <row><entry>relay-msg</entry><entry>9</entry><entry>binary</entry><entry>false</entry></row>
  2395. <row><entry>auth</entry><entry>11</entry><entry>binary</entry><entry>false</entry></row>
  2396. <row><entry>unicast</entry><entry>12</entry><entry>ipv6-address</entry><entry>false</entry></row>
  2397. <row><entry>status-code</entry><entry>13</entry><entry>record</entry><entry>false</entry></row>
  2398. <row><entry>rapid-commit</entry><entry>14</entry><entry>empty</entry><entry>false</entry></row>
  2399. <row><entry>user-class</entry><entry>15</entry><entry>binary</entry><entry>false</entry></row>
  2400. <row><entry>vendor-class</entry><entry>16</entry><entry>record</entry><entry>false</entry></row>
  2401. <row><entry>vendor-opts</entry><entry>17</entry><entry>uint32</entry><entry>false</entry></row>
  2402. <row><entry>interface-id</entry><entry>18</entry><entry>binary</entry><entry>false</entry></row>
  2403. <row><entry>reconf-msg</entry><entry>19</entry><entry>uint8</entry><entry>false</entry></row>
  2404. <row><entry>reconf-accept</entry><entry>20</entry><entry>empty</entry><entry>false</entry></row> -->
  2405. <row><entry>sip-server-dns</entry><entry>21</entry><entry>fqdn</entry><entry>true</entry></row>
  2406. <row><entry>sip-server-addr</entry><entry>22</entry><entry>ipv6-address</entry><entry>true</entry></row>
  2407. <row><entry>dns-servers</entry><entry>23</entry><entry>ipv6-address</entry><entry>true</entry></row>
  2408. <row><entry>domain-search</entry><entry>24</entry><entry>fqdn</entry><entry>true</entry></row>
  2409. <!-- <row><entry>ia-pd</entry><entry>25</entry><entry>record</entry><entry>false</entry></row> -->
  2410. <!-- <row><entry>iaprefix</entry><entry>26</entry><entry>record</entry><entry>false</entry></row> -->
  2411. <row><entry>nis-servers</entry><entry>27</entry><entry>ipv6-address</entry><entry>true</entry></row>
  2412. <row><entry>nisp-servers</entry><entry>28</entry><entry>ipv6-address</entry><entry>true</entry></row>
  2413. <row><entry>nis-domain-name</entry><entry>29</entry><entry>fqdn</entry><entry>true</entry></row>
  2414. <row><entry>nisp-domain-name</entry><entry>30</entry><entry>fqdn</entry><entry>true</entry></row>
  2415. <row><entry>sntp-servers</entry><entry>31</entry><entry>ipv6-address</entry><entry>true</entry></row>
  2416. <row><entry>information-refresh-time</entry><entry>32</entry><entry>uint32</entry><entry>false</entry></row>
  2417. <row><entry>bcmcs-server-dns</entry><entry>33</entry><entry>fqdn</entry><entry>true</entry></row>
  2418. <row><entry>bcmcs-server-addr</entry><entry>34</entry><entry>ipv6-address</entry><entry>true</entry></row>
  2419. <row><entry>geoconf-civic</entry><entry>36</entry><entry>record</entry><entry>false</entry></row>
  2420. <row><entry>remote-id</entry><entry>37</entry><entry>record</entry><entry>false</entry></row>
  2421. <row><entry>subscriber-id</entry><entry>38</entry><entry>binary</entry><entry>false</entry></row>
  2422. <row><entry>client-fqdn</entry><entry>39</entry><entry>record</entry><entry>false</entry></row>
  2423. <row><entry>pana-agent</entry><entry>40</entry><entry>ipv6-address</entry><entry>true</entry></row>
  2424. <row><entry>new-posix-timezone</entry><entry>41</entry><entry>string</entry><entry>false</entry></row>
  2425. <row><entry>new-tzdb-timezone</entry><entry>42</entry><entry>string</entry><entry>false</entry></row>
  2426. <row><entry>ero</entry><entry>43</entry><entry>uint16</entry><entry>true</entry></row>
  2427. <row><entry>lq-query</entry><entry>44</entry><entry>record</entry><entry>false</entry></row>
  2428. <row><entry>client-data</entry><entry>45</entry><entry>empty</entry><entry>false</entry></row>
  2429. <row><entry>clt-time</entry><entry>46</entry><entry>uint32</entry><entry>false</entry></row>
  2430. <row><entry>lq-relay-data</entry><entry>47</entry><entry>record</entry><entry>false</entry></row>
  2431. <row><entry>lq-client-link</entry><entry>48</entry><entry>ipv6-address</entry><entry>true</entry></row>
  2432. </tbody>
  2433. </tgroup>
  2434. </table>
  2435. </para>
  2436. </section>
  2437. <section id="dhcp6-custom-options">
  2438. <title>Custom DHCPv6 options</title>
  2439. <para>It is also possible to define options other than the standard ones.
  2440. Assume that we want to define a new DHCPv6 option called "foo" which will have
  2441. code 100 and will convey a single unsigned 32 bit integer value. We can define
  2442. such an option by using the following commands:
  2443. <screen>
  2444. &gt; <userinput>config add Dhcp6/option-def</userinput>
  2445. &gt; <userinput>config set Dhcp6/option-def[0]/name "foo"</userinput>
  2446. &gt; <userinput>config set Dhcp6/option-def[0]/code 100</userinput>
  2447. &gt; <userinput>config set Dhcp6/option-def[0]/type "uint32"</userinput>
  2448. &gt; <userinput>config set Dhcp6/option-def[0]/array false</userinput>
  2449. &gt; <userinput>config set Dhcp6/option-def[0]/record-types ""</userinput>
  2450. &gt; <userinput>config set Dhcp6/option-def[0]/space "dhcp6"</userinput>
  2451. &gt; <userinput>config set Dhcp6/option-def[0]/encapsulate ""</userinput>
  2452. &gt; <userinput>config commit</userinput></screen>
  2453. The "false" value of the "array" parameter determines that the option
  2454. does NOT comprise an array of "uint32" values but rather a single value.
  2455. Two other parameters have been left blank: "record-types" and "encapsulate".
  2456. The former specifies the comma separated list of option data fields if the
  2457. option comprises a record of data fields. The "record-fields" value should
  2458. be non-empty if the "type" is set to "record". Otherwise it must be left
  2459. blank. The latter parameter specifies the name of the option space being
  2460. encapsulated by the particular option. If the particular option does not
  2461. encapsulate any option space it should be left blank.
  2462. Note that the above set of comments define the format of the new option and do not
  2463. set its values.
  2464. </para>
  2465. <para>Once the new option format is defined, its value is set
  2466. in the same way as for a standard option. For example the following
  2467. commands set a global value that applies to all subnets.
  2468. <screen>
  2469. &gt; <userinput>config add Dhcp6/option-data</userinput>
  2470. &gt; <userinput>config set Dhcp6/option-data[0]/name "foo"</userinput>
  2471. &gt; <userinput>config set Dhcp6/option-data[0]/code 100</userinput>
  2472. &gt; <userinput>config set Dhcp6/option-data[0]/space "dhcp6"</userinput>
  2473. &gt; <userinput>config set Dhcp6/option-data[0]/csv-format true</userinput>
  2474. &gt; <userinput>config set Dhcp6/option-data[0]/data "12345"</userinput>
  2475. &gt; <userinput>config commit</userinput></screen>
  2476. </para>
  2477. <para>New options can take more complex forms than simple use of
  2478. primitives (uint8, string, ipv6-address etc): it is possible to
  2479. define an option comprising a number of existing primitives.
  2480. </para>
  2481. <para>
  2482. Assume we want to define a new option that will consist of an IPv6
  2483. address, followed by an unsigned 16 bit integer, followed by a
  2484. boolean value, followed by a text string. Such an option could
  2485. be defined in the following way:
  2486. <screen>
  2487. &gt; <userinput>config add Dhcp6/option-def</userinput>
  2488. &gt; <userinput>config set Dhcp6/option-def[0]/name "bar"</userinput>
  2489. &gt; <userinput>config set Dhcp6/option-def[0]/code 101</userinput>
  2490. &gt; <userinput>config set Dhcp6/option-def[0]/space "dhcp6"</userinput>
  2491. &gt; <userinput>config set Dhcp6/option-def[0]/type "record"</userinput>
  2492. &gt; <userinput>config set Dhcp6/option-def[0]/array false</userinput>
  2493. &gt; <userinput>config set Dhcp6/option-def[0]/record-types "ipv6-address, uint16, boolean, string"</userinput>
  2494. &gt; <userinput>config set Dhcp6/option-def[0]/encapsulate ""</userinput>
  2495. </screen>
  2496. The "type" is set to "record" to indicate that the option contains
  2497. multiple values of different types. These types are given as a comma-separated
  2498. list in the "record-types" field and should be those listed in <xref linkend="dhcp-types"/>.
  2499. </para>
  2500. <para>
  2501. The values of the option are set as follows:
  2502. <screen>
  2503. &gt; <userinput>config add Dhcp6/option-data</userinput>
  2504. &gt; <userinput>config set Dhcp6/option-data[0]/name "bar"</userinput>
  2505. &gt; <userinput>config set Dhcp6/option-data[0]/space "dhcp6"</userinput>
  2506. &gt; <userinput>config set Dhcp6/option-data[0]/code 101</userinput>
  2507. &gt; <userinput>config set Dhcp6/option-data[0]/csv-format true</userinput>
  2508. &gt; <userinput>config set Dhcp6/option-data[0]/data "2001:db8:1::10, 123, false, Hello World"</userinput>
  2509. &gt; <userinput>config commit</userinput></screen>
  2510. "csv-format" is set "true" to indicate that the "data" field comprises a command-separated
  2511. list of values. The values in the "data" must correspond to the types set in
  2512. the "record-types" field of the option definition.
  2513. </para>
  2514. <note>
  2515. <para>
  2516. It is recommended that boolean values are specified using "true" and "false"
  2517. strings. This helps to prevent errors when typing multiple comma separated
  2518. values, as it make it easier to identify the type of the value being typed,
  2519. and compare it with the order of data fields. Nevertheless, it is possible
  2520. to use integer values: "1" and "0", instead of "true" and "false"
  2521. accordingly. If other integer value is specified, the configuration is
  2522. rejected.
  2523. </para>
  2524. </note>
  2525. </section>
  2526. <section id="dhcp6-vendor-opts">
  2527. <title>DHCPv6 vendor specific options</title>
  2528. <para>
  2529. Currently there are three option spaces defined: dhcp4 (to be used
  2530. in DHCPv4 daemon) and dhcp6 (for the DHCPv6 daemon); there is also
  2531. vendor-opts-space, which is empty by default, but options can be
  2532. defined in it. Those options are called vendor-specific information
  2533. options. The following examples show how to define an option "foo"
  2534. with code 1 that consists of an IPv6 address, an unsigned 16 bit integer
  2535. and a string. The "foo" option is conveyed in a vendor specific
  2536. information option. This option comprises a single uint32 value
  2537. that is set to "12345". The sub-option "foo" follows the data
  2538. field holding this value.
  2539. <screen>
  2540. &gt; <userinput>config add Dhcp6/option-def</userinput>
  2541. &gt; <userinput>config set Dhcp6/option-def[0]/name "foo"</userinput>
  2542. &gt; <userinput>config set Dhcp6/option-def[0]/code 1</userinput>
  2543. &gt; <userinput>config set Dhcp6/option-def[0]/space "vendor-opts-space"</userinput>
  2544. &gt; <userinput>config set Dhcp6/option-def[0]/type "record"</userinput>
  2545. &gt; <userinput>config set Dhcp6/option-def[0]/array false</userinput>
  2546. &gt; <userinput>config set Dhcp6/option-def[0]/record-types "ipv6-address, uint16, string"</userinput>
  2547. &gt; <userinput>config set Dhcp6/option-def[0]/encapsulates ""</userinput>
  2548. &gt; <userinput>config commit</userinput>
  2549. </screen>
  2550. (Note that the option space is set to "vendor-opts-space".)
  2551. Once the option format is defined, the next step is to define actual values
  2552. for that option:
  2553. <screen>
  2554. &gt; <userinput>config add Dhcp6/option-data</userinput>
  2555. &gt; <userinput>config set Dhcp6/option-data[0]/name "foo"</userinput>
  2556. &gt; <userinput>config set Dhcp6/option-data[0]/space "vendor-opts-space"</userinput>
  2557. &gt; <userinput>config set Dhcp6/option-data[0]/code 1</userinput>
  2558. &gt; <userinput>config set Dhcp6/option-data[0]/csv-format true</userinput>
  2559. &gt; <userinput>config set Dhcp6/option-data[0]/data "2001:db8:1::10, 123, Hello World"</userinput>
  2560. &gt; <userinput>config commit</userinput></screen>
  2561. We should also define values for the vendor-opts, that will convey our option foo.
  2562. <screen>
  2563. &gt; <userinput>config add Dhcp6/option-data</userinput>
  2564. &gt; <userinput>config set Dhcp6/option-data[1]/name "vendor-opts"</userinput>
  2565. &gt; <userinput>config set Dhcp6/option-data[1]/space "dhcp6"</userinput>
  2566. &gt; <userinput>config set Dhcp6/option-data[1]/code 17</userinput>
  2567. &gt; <userinput>config set Dhcp6/option-data[1]/csv-format true</userinput>
  2568. &gt; <userinput>config set Dhcp6/option-data[1]/data "12345"</userinput>
  2569. &gt; <userinput>config commit</userinput></screen>
  2570. </para>
  2571. </section>
  2572. <section id="dhcp6-option-spaces">
  2573. <title>Nested DHCPv6 options (custom option spaces)</title>
  2574. <para>It is sometimes useful to define completely new option
  2575. spaces. This is useful if the user wants his new option to
  2576. convey sub-options that use separate numbering scheme, for
  2577. example sub-options with codes 1 and 2. Those option codes
  2578. conflict with standard DHCPv6 options, so a separate option
  2579. space must be defined.
  2580. </para>
  2581. <para>Note that it is not required to create new option space when
  2582. defining sub-options for a standard option because it is by
  2583. default created if the standard option is meant to convey
  2584. any sub-options (see <xref linkend="dhcp6-vendor-opts"/>).
  2585. </para>
  2586. <para>
  2587. Assume that we want to have a DHCPv6 option called "container"
  2588. with code 102 that conveys two sub-options with codes 1 and 2.
  2589. First we need to define the new sub-options:
  2590. <screen>
  2591. &gt; <userinput>config add Dhcp6/option-def</userinput>
  2592. &gt; <userinput>config set Dhcp6/option-def[0]/name "subopt1"</userinput>
  2593. &gt; <userinput>config set Dhcp6/option-def[0]/code 1</userinput>
  2594. &gt; <userinput>config set Dhcp6/option-def[0]/space "isc"</userinput>
  2595. &gt; <userinput>config set Dhcp6/option-def[0]/type "ipv6-address"</userinput>
  2596. &gt; <userinput>config set Dhcp6/option-def[0]/record-types ""</userinput>
  2597. &gt; <userinput>config set Dhcp6/option-def[0]/array false</userinput>
  2598. &gt; <userinput>config set Dhcp6/option-def[0]/encapsulate ""</userinput>
  2599. &gt; <userinput>config commit</userinput>
  2600. &gt; <userinput></userinput>
  2601. &gt; <userinput>config add Dhcp6/option-def</userinput>
  2602. &gt; <userinput>config set Dhcp6/option-def[1]/name "subopt2"</userinput>
  2603. &gt; <userinput>config set Dhcp6/option-def[1]/code 2</userinput>
  2604. &gt; <userinput>config set Dhcp6/option-def[1]/space "isc"</userinput>
  2605. &gt; <userinput>config set Dhcp6/option-def[1]/type "string"</userinput>
  2606. &gt; <userinput>config set Dhcp6/option-def[1]/record-types ""</userinput>
  2607. &gt; <userinput>config set Dhcp6/option-def[1]/array false</userinput>
  2608. &gt; <userinput>config set Dhcp6/option-def[1]/encapsulate ""</userinput>
  2609. &gt; <userinput>config commit</userinput>
  2610. </screen>
  2611. Note that we have defined the options to belong to a new option space
  2612. (in this case, "isc").
  2613. </para>
  2614. <para>
  2615. The next step is to define a regular DHCPv6 option and specify that it
  2616. should include options from the isc option space:
  2617. <screen>
  2618. &gt; <userinput>config add Dhcp6/option-def</userinput>
  2619. &gt; <userinput>config set Dhcp6/option-def[2]/name "container"</userinput>
  2620. &gt; <userinput>config set Dhcp6/option-def[2]/code 102</userinput>
  2621. &gt; <userinput>config set Dhcp6/option-def[2]/space "dhcp6"</userinput>
  2622. &gt; <userinput>config set Dhcp6/option-def[2]/type "empty"</userinput>
  2623. &gt; <userinput>config set Dhcp6/option-def[2]/array false</userinput>
  2624. &gt; <userinput>config set Dhcp6/option-def[2]/record-types ""</userinput>
  2625. &gt; <userinput>config set Dhcp6/option-def[2]/encapsulate "isc"</userinput>
  2626. &gt; <userinput>config commit</userinput>
  2627. </screen>
  2628. The name of the option space in which the sub-options are defined
  2629. is set in the "encapsulate" field. The "type" field is set to "empty"
  2630. which imposes that this option does not carry any data other than
  2631. sub-options.
  2632. </para>
  2633. <para>
  2634. Finally, we can set values for the new options:
  2635. <screen>
  2636. &gt; <userinput>config add Dhcp6/option-data</userinput>
  2637. &gt; <userinput>config set Dhcp6/option-data[0]/name "subopt1"</userinput>
  2638. &gt; <userinput>config set Dhcp6/option-data[0]/space "isc"</userinput>
  2639. &gt; <userinput>config set Dhcp6/option-data[0]/code 1</userinput>
  2640. &gt; <userinput>config set Dhcp6/option-data[0]/csv-format true</userinput>
  2641. &gt; <userinput>config set Dhcp6/option-data[0]/data "2001:db8::abcd"</userinput>
  2642. &gt; <userinput>config commit</userinput>
  2643. &gt; <userinput></userinput>
  2644. &gt; <userinput>config add Dhcp6/option-data</userinput>
  2645. &gt; <userinput>config set Dhcp6/option-data[1]/name "subopt2"</userinput>
  2646. &gt; <userinput>config set Dhcp6/option-data[1]/space "isc"</userinput>
  2647. &gt; <userinput>config set Dhcp6/option-data[1]/code 2</userinput>
  2648. &gt; <userinput>config set Dhcp6/option-data[1]/csv-format true</userinput>
  2649. &gt; <userinput>config set Dhcp6/option-data[1]/data "Hello world"</userinput>
  2650. &gt; <userinput>config commit</userinput>
  2651. &gt; <userinput></userinput>
  2652. &gt; <userinput>config add Dhcp6/option-data</userinput>
  2653. &gt; <userinput>config set Dhcp6/option-data[2]/name "container"</userinput>
  2654. &gt; <userinput>config set Dhcp6/option-data[2]/space "dhcp6"</userinput>
  2655. &gt; <userinput>config set Dhcp6/option-data[2]/code 102</userinput>
  2656. &gt; <userinput>config set Dhcp6/option-data[2]/csv-format true</userinput>
  2657. &gt; <userinput>config set Dhcp6/option-data[2]/data ""</userinput>
  2658. &gt; <userinput>config commit</userinput>
  2659. </screen>
  2660. Even though the "container" option does not carry any data except
  2661. sub-options, the "data" field must be explicitly set to an empty value.
  2662. This is required because in the current version of BIND 10 DHCP, the
  2663. default configuration values are not propagated to the configuration parsers:
  2664. if the "data" is not set the parser will assume that this
  2665. parameter is not specified and an error will be reported.
  2666. </para>
  2667. <para>Note that it is possible to create an option which carries some data
  2668. in addition to the sub-options defined in the encapsulated option space. For example,
  2669. if the "container" option from the previous example was required to carry an uint16
  2670. value as well as the sub-options, the "type" value would have to be set to "uint16" in
  2671. the option definition. (Such an option would then have the following
  2672. data structure: DHCP header, uint16 value, sub-options.) The value specified
  2673. with the "data" parameter - which should be a valid integer enclosed in quotes,
  2674. e.g. "123" - would then be assigned to the uint16 field in the "container" option.
  2675. </para>
  2676. </section>
  2677. <section id="dhcp6-config-subnets">
  2678. <title>IPv6 Subnet Selection</title>
  2679. <para>
  2680. The DHCPv6 server may receive requests from local (connected to the
  2681. same subnet as the server) and remote (connecting via relays) clients.
  2682. As server may have many subnet configurations defined, it must select
  2683. appropriate subnet for a given request.
  2684. </para>
  2685. <para>
  2686. The server can not assume which of configured subnets are local. It is
  2687. possible in IPv4, where there is reasonable expectation that the
  2688. server will have a (global) IPv4 address configured on the interface,
  2689. and can use that information to detect whether a subnet is local or
  2690. not. That assumption is not true in IPv6, as the DHCPv6 must be able
  2691. to operate with having link-local addresses only. Therefore an optional
  2692. &quot;interface&quot; parameter is available within a subnet definition
  2693. to designate that a given subnet is local, i.e. reachable directly over
  2694. specified interface. For example the server that is intended to serve
  2695. a local subnet over eth0 may be configured as follows:
  2696. <screen>
  2697. &gt; <userinput>config add Dhcp6/subnet6</userinput>
  2698. &gt; <userinput>config set Dhcp6/subnet6[1]/subnet "2001:db8:beef::/48"</userinput>
  2699. &gt; <userinput>config set Dhcp6/subnet6[1]/pool [ "2001:db8:beef::/48" ]</userinput>
  2700. &gt; <userinput>config set Dhcp6/subnet6[1]/interface "eth0"</userinput>
  2701. &gt; <userinput>config commit</userinput>
  2702. </screen>
  2703. </para>
  2704. </section>
  2705. <section id="dhcp6-relays">
  2706. <title>DHCPv6 Relays</title>
  2707. <para>
  2708. A DHCPv6 server with multiple subnets defined must select the
  2709. appropriate subnet when it receives a request from client. For clients
  2710. connected via relays, two mechanisms are used:
  2711. </para>
  2712. <para>
  2713. The first uses the linkaddr field in the RELAY_FORW message. The name
  2714. of this field is somewhat misleading in that it does not contain a link-layer
  2715. address: instead, it holds an address (typically a global address) that is
  2716. used to identify a link. The DHCPv6 server checks if the address belongs
  2717. to a defined subnet and, if it does, that subnet is selected for the client's
  2718. request.
  2719. </para>
  2720. <para>
  2721. The second mechanism is based on interface-id options. While forwarding a client's
  2722. message, relays may insert an interface-id option into the message that
  2723. identifies the interface on the relay that received the message. (Some
  2724. relays allow configuration of that parameter, but it is sometimes
  2725. hardcoded and may range from the very simple (e.g. "vlan100") to the very cryptic:
  2726. one example seen on real hardware was "ISAM144|299|ipv6|nt:vp:1:110"). The
  2727. server can use this information to select the appropriate subnet.
  2728. The information is also returned to the relay which then knows the
  2729. interface to use to transmit the response to the client. In order for
  2730. this to work successfully, the relay interface IDs must be unique within
  2731. the network and the server configuration must match those values.
  2732. </para>
  2733. <para>
  2734. When configuring the DHCPv6 server, it should be noted that two
  2735. similarly-named parameters can be configured for a subnet:
  2736. <itemizedlist>
  2737. <listitem><simpara>
  2738. "interface" defines which local network interface can be used
  2739. to access a given subnet.
  2740. </simpara></listitem>
  2741. <listitem><simpara>
  2742. "interface-id" specifies the content of the interface-id option
  2743. used by relays to identify the interface on the relay to which
  2744. the response packet is sent.
  2745. </simpara></listitem>
  2746. </itemizedlist>
  2747. The two are mutually exclusive: a subnet cannot be both reachable locally
  2748. (direct traffic) and via relays (remote traffic). Specifying both is a
  2749. configuration error and the DHCPv6 server will refuse such a configuration.
  2750. </para>
  2751. <para>
  2752. To specify interface-id with value "vlan123", the following commands can
  2753. be used:
  2754. <screen>
  2755. &gt; <userinput>config add Dhcp6/subnet6</userinput>
  2756. &gt; <userinput>config set Dhcp6/subnet6[0]/subnet "2001:db8:beef::/48"</userinput>
  2757. &gt; <userinput>config set Dhcp6/subnet6[0]/pool [ "2001:db8:beef::/48" ]</userinput>
  2758. &gt; <userinput>config set Dhcp6/subnet6[0]/interface-id "vland123"</userinput>
  2759. &gt; <userinput>config commit</userinput>
  2760. </screen>
  2761. </para>
  2762. </section>
  2763. <section id="dhcp6-client-classifier">
  2764. <title>Client Classification in DHCPv6</title>
  2765. <note>
  2766. <para>
  2767. DHCPv6 server has been extended to support limited client classification.
  2768. Although the current capability is modest, it is expected to be expanded
  2769. in the future. It is envisaged that the majority of client classification
  2770. extensions will be using hooks extensions.
  2771. </para>
  2772. </note>
  2773. <para>In certain cases it is useful to differentiate between different types
  2774. of clients and treat them differently. The process of doing classification
  2775. is conducted in two steps. The first step is to assess incoming packet and
  2776. assign it to zero or more classes. This classification is currently simple,
  2777. but is expected to grow in capability soon. Currently the server checks whether
  2778. incoming packet has vendor class option (16). If it has, content
  2779. of that option is prepended with &quot;VENDOR_CLASS_&quot; interpreted as a
  2780. class. For example, modern cable modems will send this option with value
  2781. &quot;docsis3.0&quot; and as a result the packet will belong to class
  2782. &quot;VENDOR_CLASS_docsis3.0&quot;.
  2783. </para>
  2784. <para>It is envisaged that the client classification will be used for changing
  2785. behavior of almost any part of the DHCP engine processing, including assigning
  2786. leases from different pools, assigning different option (or different values of
  2787. the same options) etc. For now, there is only one mechanism that is taking
  2788. advantage of client classification: subnet selection.</para>
  2789. <para>
  2790. Kea can be instructed to limit access to given subnets based on class information.
  2791. This is particularly useful for cases where two types of devices share the
  2792. same link and are expected to be served from two different subnets. The
  2793. primary use case for such a scenario are cable networks. There are two
  2794. classes of devices: cable modem itself, which should be handled a lease
  2795. from subnet A and all other devices behind modems that should get a lease
  2796. from subnet B. That segregation is essential to prevent overly curious
  2797. users from playing with their cable modems. For details on how to set up
  2798. class restrictions on subnets, see <xref linkend="dhcp6-subnet-class"/>.
  2799. </para>
  2800. </section>
  2801. <section id="dhcp6-subnet-class">
  2802. <title>Limiting access to IPv6 subnet to certain classes</title>
  2803. <para>
  2804. In certain cases it beneficial to restrict access to certains subnets
  2805. only to clients that belong to a given subnet. For details on client
  2806. classes, see <xref linkend="dhcp6-client-classifier"/>. This is an
  2807. extension of a previous example from <xref linkend="dhcp6-address-config"/>.
  2808. Let's assume that the server is connected to a network segment that uses
  2809. the 2001:db8:1::/64 prefix. The Administrator of that network has
  2810. decided that addresses from range 2001:db8:1::1 to 2001:db8:1::ffff are
  2811. going to be managed by the Dhcp6 server. Only clients belonging to the
  2812. eRouter1.0 client class are allowed to use that pool. Such a
  2813. configuration can be achieved in the following way:
  2814. <screen>
  2815. &gt; <userinput>config add Dhcp6/subnet6</userinput>
  2816. &gt; <userinput>config set Dhcp6/subnet6[0]/subnet "2001:db8:1::/64"</userinput>
  2817. &gt; <userinput>config set Dhcp6/subnet6[0]/pool [ "2001:db8:1::0 - 2001:db8:1::ffff" ]</userinput>
  2818. &gt; <userinput>config set Dhcp6/subnet6[0]/client-class "eRouter1.0"</userinput>
  2819. &gt; <userinput>config commit</userinput></screen>
  2820. </para>
  2821. <para>
  2822. Care should be taken with client classification as it is easy to prevent
  2823. clients that do not meet class criteria to be denied any service altogether.
  2824. </para>
  2825. </section>
  2826. <section id="dhcp6-ddns-config">
  2827. <title>Configuring DHCPv6 for DDNS</title>
  2828. <para>
  2829. As mentioned earlier, b10-dhcp6 can be configured to generate requests to
  2830. the DHCP-DDNS server (referred to here as the "D2" server) to update
  2831. DNS entries. These requests are known as NameChangeRequests or NCRs.
  2832. Each NCR contains the following information:
  2833. <orderedlist>
  2834. <listitem><para>
  2835. Whether it is a request to add (update) or remove DNS entries
  2836. </para></listitem>
  2837. <listitem><para>
  2838. Whether the change requests forward DNS updates (AAAA records), reverse
  2839. DNS updates (PTR records), or both.
  2840. </para></listitem>
  2841. <listitem><para>
  2842. The FQDN, lease address, and DHCID
  2843. </para></listitem>
  2844. </orderedlist>
  2845. The parameters controlling the generation of NCRs for submission to D2
  2846. are contained in the "dhcp-ddns" section of b10-dhcp6
  2847. configuration. The default values for this section appears as follows:
  2848. <screen>
  2849. &gt; <userinput>config show Dhcp6/dhcp-ddns</userinput>
  2850. Dhcp6/dhcp-ddns/enable-updates true boolean
  2851. Dhcp6/dhcp-ddns/server-ip "127.0.0.1" string
  2852. Dhcp6/dhcp-ddns/server-port 53001 integer
  2853. Dhcp6/dhcp-ddns/sender-ip "" string
  2854. Dhcp6/dhcp-ddns/sender-port 0 integer
  2855. Dhcp6/dhcp-ddns/max-queue-size 1024 integer
  2856. Dhcp6/dhcp-ddns/ncr-protocol "UDP" string
  2857. Dhcp6/dhcp-ddns/ncr-format "JSON" string
  2858. Dhcp6/dhcp-ddns/override-no-update false boolean
  2859. Dhcp6/dhcp-ddns/override-client-update false boolean
  2860. Dhcp6/dhcp-ddns/replace-client-name false boolean
  2861. Dhcp6/dhcp-ddns/generated-prefix "myhost" string
  2862. Dhcp6/dhcp-ddns/qualifying-suffix "example.com" string
  2863. </screen>
  2864. </para>
  2865. <para>
  2866. The "enable-updates" parameter determines whether or not b10-dhcp6 will
  2867. generate NCRs. By default, this value is false hence DDNS updates are
  2868. disabled. To enable DDNS updates set this value to true as follows:
  2869. </para>
  2870. <screen>
  2871. &gt; <userinput>config set Dhcp6/dhcp-ddns/enable-updates true</userinput>
  2872. &gt; <userinput>config commit</userinput>
  2873. </screen>
  2874. <section id="dhcpv6-d2-io-config">
  2875. <title>DHCP-DDNS Server Connectivity</title>
  2876. <para>
  2877. In order for NCRs to reach the D2 server, b10-dhcp6 must be able
  2878. to communicate with it. b10-dhcp6 uses the following configuration
  2879. parameters to control how it communications with D2:
  2880. <orderedlist>
  2881. <listitem><para>
  2882. server-ip - IP address on which D2 listens for requests. The default is
  2883. the local loopback interface at address 127.0.0.1. You may specify
  2884. either an IPv4 or IPv6 address.
  2885. </para></listitem>
  2886. <listitem><para>
  2887. server-port - port on which D2 listens for requests. The default value
  2888. is 53001.
  2889. </para></listitem>
  2890. <listitem><para>
  2891. sender-ip - IP address which b10-dhcp6 should use to send requests to D2.
  2892. The default value is blank which instructs b10-dhcp6 to select a suitable
  2893. address.
  2894. </para></listitem>
  2895. <listitem><para>
  2896. sender-port - port which b10-dhcp6 should use to send requests to D2. The
  2897. default value of 0 instructs b10-dhcp6 to select suitable port.
  2898. </para></listitem>
  2899. <listitem><para>
  2900. ncr-format - Socket protocol use when sending requests to D2. Currently
  2901. only UDP is supported. TCP may be available in an upcoming release.
  2902. </para></listitem>
  2903. <listitem><para>
  2904. ncr-protocol - Packet format to use when sending requests to D2.
  2905. Currently only JSON format is supported. Other formats may be available
  2906. in future releases.
  2907. </para></listitem>
  2908. <listitem><para>
  2909. max-queue-size - maximum number of requests allowed to queue waiting to
  2910. be sent to D2. This value guards against requests accumulating
  2911. uncontrollably if they are being generated faster than they can be
  2912. delivered. If the number of requests queued for transmission reaches
  2913. this value, DDNS updating will be turned off until the queue backlog has
  2914. been sufficiently reduced. The intent is allow b10-dhcp6 to
  2915. continue lease operations. The default value is 1024.
  2916. </para></listitem>
  2917. </orderedlist>
  2918. By default, D2 is assumed to running on the same machine as b10-dhcp6, and
  2919. all of the default values mentioned above should be sufficient.
  2920. If, however, D2 has been configured to listen on a different address or
  2921. port, these values must altered accordingly. For example, if D2 has been
  2922. configured to listen on 3001::5 port 900, the following commands
  2923. would be required:
  2924. <screen>
  2925. &gt; <userinput>config set Dhcp6/dhcp-ddns/server-ip "3001::5"</userinput>
  2926. &gt; <userinput>config set Dhcp6/dhcp-ddns/server-port 900</userinput>
  2927. &gt; <userinput>config commit</userinput>
  2928. </screen>
  2929. </para>
  2930. </section>
  2931. <section id="dhcpv6-d2-rules-config">
  2932. <title>When does b10-dhcp6 generate DDNS request</title>
  2933. b10-dhcp6 follows the behavior prescribed for DHCP servers in RFC 4704.
  2934. It is important to keep in mind that b10-dhcp6 provides the initial decision
  2935. making of when and what to update and forwards that information to D2 in
  2936. the form of NCRs. Carrying out the actual DNS updates and dealing with
  2937. such things as conflict resolution are the purview of D2 (<xref linkend="dhcp-ddns-server"/>).
  2938. <para>
  2939. This section describes when b10-dhcp6 will generate NCRs and the
  2940. configuration parameters that can be used to influence this decision.
  2941. It assumes that the "enable-updates" parameter is true.
  2942. </para>
  2943. <note>
  2944. <para>
  2945. Currently the interface between b10-dhcp6 and D2 only supports requests
  2946. which update DNS entries for a single IP address. If a lease grants
  2947. more than one address, b10-dhcp6 will create the DDNS update request for
  2948. only the first of these addresses. Support for multiple address
  2949. mappings may be provided in a future release.
  2950. </para>
  2951. </note>
  2952. <para>
  2953. In general, b10-dhcp6 will generate DDNS update requests when:
  2954. <orderedlist>
  2955. <listitem><para>
  2956. A new lease is granted in response to a DHCP REQUEST
  2957. </para></listitem>
  2958. <listitem><para>
  2959. An existing lease is renewed but the FQDN associated with it has
  2960. changed.
  2961. </para></listitem>
  2962. <listitem><para>
  2963. An existing lease is released in response to a DHCP RELEASE
  2964. </para></listitem>
  2965. </orderedlist>
  2966. In the second case, lease renewal, two DDNS requests will be issued: one
  2967. request to remove entries for the previous FQDN and a second request to
  2968. add entries for the new FQDN. In the last case, a lease release, a
  2969. single DDNS request to remove its entries will be made. The decision
  2970. making involved when granting a new lease is more involved and is
  2971. discussed next.
  2972. </para>
  2973. <para>
  2974. b10-dhcp6 will generate a DDNS update request only if the DHCP REQUEST
  2975. contains the FQDN option (code 39). By default b10-dhcp6 will
  2976. respect the FQDN N and S flags specified by the client as shown in the
  2977. following table:
  2978. </para>
  2979. <table id="dhcp6-fqdn-flag-table">
  2980. <title>Default FQDN Flag Behavior</title>
  2981. <tgroup cols='4' align='left'>
  2982. <colspec colname='cflags'/>
  2983. <colspec colname='meaning'/>
  2984. <colspec colname='response'/>
  2985. <colspec colname='sflags'/>
  2986. <thead>
  2987. <row>
  2988. <entry>Client Flags:N-S</entry>
  2989. <entry>Client Intent</entry>
  2990. <entry>Server Response</entry>
  2991. <entry>Server Flags:N-S-O</entry>
  2992. </row>
  2993. </thead>
  2994. <tbody>
  2995. <row>
  2996. <entry>0-0</entry>
  2997. <entry>
  2998. Client wants to do forward updates, server should do reverse updates
  2999. </entry>
  3000. <entry>Server generates reverse-only request</entry>
  3001. <entry>1-0-0</entry>
  3002. </row>
  3003. <row>
  3004. <entry>0-1</entry>
  3005. <entry>Server should do both forward and reverse updates</entry>
  3006. <entry>Server generates request to update both directions</entry>
  3007. <entry>0-1-0</entry>
  3008. </row>
  3009. <row>
  3010. <entry>1-0</entry>
  3011. <entry>Client wants no updates done</entry>
  3012. <entry>Server does not generate a request</entry>
  3013. <entry>1-0-0</entry>
  3014. </row>
  3015. </tbody>
  3016. </tgroup>
  3017. </table>
  3018. <para>
  3019. The first row in the table above represents "client delegation". Here
  3020. the DHCP client states that it intends to do the forward DNS updates and
  3021. the server should do the reverse updates. By default, b10-dhcp6 will honor
  3022. the client's wishes and generate a DDNS request to D2 to update only
  3023. reverse DNS data. The parameter, "override-client-update", can be used
  3024. to instruct the server to override client delegation requests. When
  3025. this parameter is true, b10-dhcp6 will disregard requests for client
  3026. delegation and generate a DDNS request to update both forward and
  3027. reverse DNS data. In this case, the N-S-O flags in the server's
  3028. response to the client will be 0-1-1 respectively.
  3029. </para>
  3030. <para>
  3031. (Note that the flag combination N=1, S=1 is prohibited according to
  3032. RFC 4702. If such a combination is received from the client, the packet
  3033. will be dropped by b10-dhcp6.)
  3034. </para>
  3035. <para>
  3036. To override client delegation, issue the following commands:
  3037. </para>
  3038. <screen>
  3039. &gt; <userinput>config set Dhcp6/dhcp-ddns/override-client-update true</userinput>
  3040. &gt; <userinput>config commit</userinput>
  3041. </screen>
  3042. <para>
  3043. The third row in the table above describes the case in which the client
  3044. requests that no DNS updates be done. The parameter, "override-no-update",
  3045. can be used to instruct the server to disregard the client's wishes. When
  3046. this parameter is true, b10-dhcp6 will generate DDNS update request to D2
  3047. even if the client requests no updates be done. The N-S-O flags in the
  3048. server's response to the client will be 0-1-1.
  3049. </para>
  3050. <para>
  3051. To override client delegation, issue the following commands:
  3052. </para>
  3053. <screen>
  3054. &gt; <userinput>config set Dhcp6/dhcp-ddns/override-no-update true</userinput>
  3055. &gt; <userinput>config commit</userinput>
  3056. </screen>
  3057. </section>
  3058. <section id="dhcpv6-fqdn-name-generation">
  3059. <title>b10-dhcp6 name generation for DDNS update requests</title>
  3060. Each NameChangeRequest must of course include the fully qualified domain
  3061. name whose DNS entries are to be affected. b10-dhcp6 can be configured to
  3062. supply a portion or all of that name based upon what it receives from
  3063. the client in the DHCP REQUEST.
  3064. <para>
  3065. The rules for determining the FQDN option are as follows:
  3066. <orderedlist>
  3067. <listitem><para>
  3068. If configured to do so ignore the REQUEST contents and generate a
  3069. FQDN using a configurable prefix and suffix.
  3070. </para></listitem>
  3071. <listitem><para>
  3072. Otherwise, using is the domain name value from the client FQDN option as
  3073. the candidate name:
  3074. <orderedlist>
  3075. <listitem><para>
  3076. If the candidate name is a fully qualified domain name then use it.
  3077. </para></listitem>
  3078. <listitem><para>
  3079. If the candidate name is a partial (i.e. unqualified) name then
  3080. add a configurable suffix to the name and use the result as the FQDN.
  3081. </para></listitem>
  3082. <listitem><para>
  3083. If the candidate name is a empty then generate a FQDN using a
  3084. configurable prefix and suffix.
  3085. </para></listitem>
  3086. </orderedlist>
  3087. </para></listitem>
  3088. </orderedlist>
  3089. To instruct b10-dhcp6 to always generate a FQDN, set the parameter
  3090. "replace-client-name" to true:
  3091. </para>
  3092. <screen>
  3093. &gt; <userinput>config set Dhcp6/dhcp-ddns/replace-client-name true</userinput>
  3094. &gt; <userinput>config commit</userinput>
  3095. </screen>
  3096. <para>
  3097. The prefix used when generating a FQDN is specified by the
  3098. "generated-prefix" parameter. The default value is "myhost". To alter
  3099. its value, simply set it to the desired string:
  3100. </para>
  3101. <screen>
  3102. &gt; <userinput>config set Dhcp6/dhcp-ddns/generated-prefix "another.host"</userinput>
  3103. &gt; <userinput>config commit</userinput>
  3104. </screen>
  3105. <para>
  3106. The suffix used when generating a FQDN or when qualifying a partial
  3107. name is specified by the "qualifying-suffix" parameter. The default
  3108. value is "example.com". To alter its value simply set it to the desired
  3109. string:
  3110. </para>
  3111. <screen>
  3112. &gt; <userinput>config set Dhcp6/dhcp-ddns/generated-prefix "our.net"</userinput>
  3113. &gt; <userinput>config commit</userinput>
  3114. </screen>
  3115. </section>
  3116. <para>
  3117. When qualifying a partial name, b10-dhcp6 will construct a name with the
  3118. format:
  3119. </para>
  3120. <para>
  3121. [candidate-name].[qualifying-suffix].
  3122. </para>
  3123. <para>
  3124. where candidate-name is the partial name supplied in the REQUEST.
  3125. For example, if FQDN domain name value was "some-computer" and assuming
  3126. the default value for qualifying-suffix, the generated FQDN would be:
  3127. </para>
  3128. <para>
  3129. some-computer.example.com.
  3130. </para>
  3131. <para>
  3132. When generating a the entire name, b10-dhcp6 will construct name of the
  3133. format:
  3134. </para>
  3135. <para>
  3136. [generated-prefix]-[address-text].[qualifying-suffix].
  3137. </para>
  3138. <para>
  3139. where address-text is simply the lease IP address converted to a
  3140. hyphenated string. For example, if lease address is 3001:1::70E and
  3141. assuming default values for generated-prefix and qualifying-suffix, the
  3142. generated FQDN would be:
  3143. </para>
  3144. <para>
  3145. myhost-3001-1--70E.example.com.
  3146. </para>
  3147. </section>
  3148. </section>
  3149. <section id="dhcp6-serverid">
  3150. <title>Server Identifier in DHCPv6</title>
  3151. <para>The DHCPv6 protocol uses a "server identifier" (also known
  3152. as a DUID) for clients to be able to discriminate between several
  3153. servers present on the same link. There are several types of
  3154. DUIDs defined, but <ulink url="http://tools.ietf.org/html/rfc3315">RFC 3315</ulink> instructs servers to use DUID-LLT if
  3155. possible. This format consists of a link-layer (MAC) address and a
  3156. timestamp. When started for the first time, the DHCPv6 server will
  3157. automatically generate such a DUID and store the chosen value to
  3158. a file. That file is read by the server
  3159. and the contained value used whenever the server is subsequently started.
  3160. </para>
  3161. <para>
  3162. It is unlikely that this parameter should ever need to be changed.
  3163. However, if such a need arises, stop the server, edit the file and restart
  3164. the server. (The file is named b10-dhcp6-serverid and by default is
  3165. stored in the "var" subdirectory of the directory in which BIND 10 is installed.
  3166. This can be changed when BIND 10 is built by using "--localstatedir"
  3167. on the "configure" command line.) The file is a text file that contains
  3168. double digit hexadecimal values
  3169. separated by colons. This format is similar to typical MAC address
  3170. format. Spaces are ignored. No extra characters are allowed in this
  3171. file.
  3172. </para>
  3173. </section>
  3174. <section id="dhcp6-relay-override">
  3175. <title>Using specific relay agent for a subnet</title>
  3176. <para>
  3177. The relay has to have an interface connected to the link on which
  3178. the clients are being configured. Typically the relay has a global IPv6
  3179. address configured on that interface that belongs to the subnet that
  3180. the server will assign addresses from. In such typical case, the
  3181. server is able to use IPv6 address inserted by the relay (in link-addr
  3182. field in RELAY-FORW message) to select appropriate subnet.
  3183. </para>
  3184. <para>
  3185. However, that is not always the case. The relay
  3186. address may not match the subnet in certain deployments. This
  3187. usually means that there is more than one subnet allocated for a given
  3188. link. Two most common examples where this is the case are long lasting
  3189. network renumbering (where both old and new address space is still being
  3190. used) and a cable network. In a cable network both cable modems and the
  3191. devices behind them are physically connected to the same link, yet
  3192. they use distinct addressing. In such case, the DHCPv6 server needs
  3193. additional information (like the value of interface-id option or IPv6
  3194. address inserted in the link-addr field in RELAY-FORW message) to
  3195. properly select an appropriate subnet.
  3196. </para>
  3197. <para>
  3198. The following example assumes that there is a subnet 2001:db8:1::/64
  3199. that is accessible via relay that uses 3000::1 as its IPv6 address.
  3200. The server will be able to select this subnet for any incoming packets
  3201. that came from a relay that has an address in 2001:db8:1::/64 subnet.
  3202. It will also select that subnet for a relay with address 3000::1.
  3203. <screen>
  3204. &gt; <userinput>config add Dhcp6/subnet6</userinput>
  3205. &gt; <userinput>config set Dhcp6/subnet6[0]/subnet "2001:db8:1::/64"</userinput>
  3206. &gt; <userinput>config set Dhcp6/subnet6[0]/pool [ "2001:db8:1::2 - 2001:db8:1::ffff" ]</userinput>
  3207. &gt; <userinput>config set Dhcp6/subnet6[0]/relay/ip-address "3000::1"</userinput>
  3208. &gt; <userinput>config commit</userinput></screen>
  3209. </para>
  3210. </section>
  3211. <section id="dhcp6-client-class-relay">
  3212. <title>Segregating IPv6 clients in a cable network</title>
  3213. <para>
  3214. In certain cases, it is useful to mix relay address information,
  3215. introduced in <xref linkend="dhcp6-relay-override"/> with client
  3216. classification, explained in <xref linkend="dhcp6-subnet-class"/>.
  3217. One specific example is cable network, where typically modems
  3218. get addresses from a different subnet than all devices connected
  3219. behind them.
  3220. </para>
  3221. <para>
  3222. Let's assume that there is one CMTS (Cable Modem Termination System)
  3223. with one CM MAC (a physical link that modems are connected to).
  3224. We want the modems to get addresses from the 3000::/64 subnet,
  3225. while everything connected behind modems should get addresses from
  3226. another subnet (2001:db8:1::/64). The CMTS that acts as a relay
  3227. an uses address 3000::1. The following configuration can serve
  3228. that configuration:
  3229. <screen>
  3230. &gt; <userinput>config add Dhcp6/subnet6</userinput>
  3231. &gt; <userinput>config set Dhcp6/subnet6[0]/subnet "3000::/64"</userinput>
  3232. &gt; <userinput>config set Dhcp6/subnet6[0]/pool [ "3000::2 - 3000::ffff" ]</userinput>
  3233. &gt; <userinput>config set Dhcp6/subnet6[0]/client-class "docsis3.0"</userinput>
  3234. &gt; <userinput>config set Dhcp6/subnet6[0]/relay/ip-address "3000::1"</userinput>
  3235. &gt; <userinput>config add Dhcp6/subnet6</userinput>
  3236. &gt; <userinput>config set Dhcp6/subnet6[1]/subnet "2001:db8:1::/64"</userinput>
  3237. &gt; <userinput>config set Dhcp6/subnet6[1]/pool [ "2001:db8:1::1 - 2001:db8:1::ffff" ]</userinput>
  3238. &gt; <userinput>config set Dhcp6/subnet6[1]/relay/ip-address "3000::1"</userinput>
  3239. &gt; <userinput>config commit</userinput></screen>
  3240. </para>
  3241. </section>
  3242. <section id="dhcp6-std">
  3243. <title>Supported Standards</title>
  3244. <para>The following standards and draft standards are currently
  3245. supported:</para>
  3246. <itemizedlist>
  3247. <listitem>
  3248. <simpara><ulink url="http://tools.ietf.org/html/rfc3315">RFC 3315</ulink>: Supported messages are SOLICIT,
  3249. ADVERTISE, REQUEST, RELEASE, RENEW, REBIND and REPLY.</simpara>
  3250. </listitem>
  3251. <listitem>
  3252. <simpara><ulink url="http://tools.ietf.org/html/rfc3633">RFC 3633</ulink>: Supported options are IA_PD and
  3253. IA_PREFIX. Also supported is the status code NoPrefixAvail.</simpara>
  3254. </listitem>
  3255. <listitem>
  3256. <simpara><ulink url="http://tools.ietf.org/html/rfc3646">RFC 3646</ulink>: Supported option is DNS_SERVERS.</simpara>
  3257. </listitem>
  3258. <listitem>
  3259. <simpara><ulink url="http://tools.ietf.org/html/rfc4704">RFC 4704</ulink>: Supported option is CLIENT_FQDN.</simpara>
  3260. </listitem>
  3261. </itemizedlist>
  3262. </section>
  3263. <section id="dhcp6-limit">
  3264. <title>DHCPv6 Server Limitations</title>
  3265. <para> These are the current limitations and known problems
  3266. with the DHCPv6 server
  3267. software. Most of them are reflections of the early stage of
  3268. development and should be treated as <quote>not implemented
  3269. yet</quote>, rather than actual limitations.</para>
  3270. <itemizedlist>
  3271. <listitem> <!-- see tickets #3234, #3281 -->
  3272. <para>
  3273. On-line configuration has some limitations. Adding new subnets or
  3274. modifying existing ones work, as is removing the last subnet from
  3275. the list. However, removing non-last (e.g. removing subnet 1,2 or 3 if
  3276. there are 4 subnets configured) will cause issues. The problem is
  3277. caused by simplistic subnet-id assignment. The subnets are always
  3278. numbered, starting from 1. That subnet-id is then used in leases
  3279. that are stored in the lease database. Removing non-last subnet will
  3280. cause the configuration information to mismatch data in the lease
  3281. database. It is possible to manually update subnet-id fields in
  3282. MySQL or PostgreSQL database, but it is awkward and error prone
  3283. process. A better reconfiguration support is planned.
  3284. </para>
  3285. </listitem>
  3286. <listitem>
  3287. <para>
  3288. On startup, the DHCPv6 server does not get the full configuration from
  3289. BIND 10. To remedy this, after starting BIND 10, modify any parameter
  3290. and commit the changes, e.g.
  3291. <screen>
  3292. &gt; <userinput>config show Dhcp6/renew-timer</userinput>
  3293. Dhcp6/renew-timer 1000 integer (default)
  3294. &gt; <userinput>config set Dhcp6/renew-timer 1001</userinput>
  3295. &gt; <userinput>config commit</userinput></screen>
  3296. </para>
  3297. </listitem>
  3298. <listitem>
  3299. <simpara>Temporary addresses are not supported.</simpara>
  3300. </listitem>
  3301. <listitem>
  3302. <simpara>
  3303. The server will allocate, renew or rebind a maximum of one lease
  3304. for a particular IA option (IA_NA or IA_PD) sent by a client.
  3305. <ulink url="http://tools.ietf.org/html/rfc3315">RFC 3315</ulink> and
  3306. <ulink url="http://tools.ietf.org/html/rfc3633">RFC 3633</ulink> allow
  3307. for multiple addresses or prefixes to be allocated for a single IA.
  3308. </simpara>
  3309. </listitem>
  3310. <listitem>
  3311. <simpara>Temporary addresses are not supported.</simpara>
  3312. </listitem>
  3313. <listitem>
  3314. <simpara>
  3315. Confirmation (CONFIRM), duplication report (DECLINE),
  3316. stateless configuration (INFORMATION-REQUEST) and client
  3317. reconfiguration (RECONFIGURE) are not yet supported.
  3318. </simpara>
  3319. </listitem>
  3320. <listitem>
  3321. <simpara>
  3322. The server doesn't act upon expired leases. In particular,
  3323. when a lease expires, the server doesn't request removal of
  3324. the DNS records associated with it.
  3325. </simpara>
  3326. </listitem>
  3327. </itemizedlist>
  3328. </section>
  3329. <!--
  3330. <section id="dhcp6-srv-examples">
  3331. <title>Kea DHCPv6 server examples</title>
  3332. <para>
  3333. This section provides easy to use example. Each example can be read
  3334. separately. It is not intended to be read sequentially as there will
  3335. be many repetitions between examples. They are expected to serve as
  3336. easy to use copy-paste solutions to many common deployments.
  3337. </para>
  3338. @todo: add simple configuration for direct clients
  3339. @todo: add configuration for relayed clients
  3340. @todo: add client classification example
  3341. </section> -->
  3342. </chapter>
  3343. <chapter id="dhcp-ddns-server">
  3344. <title>The DHCP-DDNS Server</title>
  3345. <para>
  3346. The DHCP-DDNS Server (b10-dhcp-ddns, known informally as D2) conducts the client side of
  3347. the DDNS protocol (defined in RFC 2136) on behalf of the DHCPv4 and DHCPv6
  3348. servers (b10-dhcp4 and b10-dhcp6 respectively). The DHCP servers construct
  3349. DDNS update requests, known as NameChangeRequests (NCRs), based upon DHCP
  3350. lease change events and then post these to D2. D2 attempts to match
  3351. each such request to the appropriate DNS server(s) and carry out the
  3352. necessary conversation with those servers to update the DNS data.
  3353. </para>
  3354. <para>
  3355. In order to match a request to appropriate DNS servers, D2 must have a
  3356. catalog of servers from which to select. In fact, D2 has two such catalogs,
  3357. one for forward DNS and one for reverse DNS; these catalogs are referred
  3358. to as DDNS Domain Lists. Each list consists of one or more named DDNS
  3359. Domains. Further, each DDNS Domain has a list of of one or more DNS
  3360. servers that publish the DNS data for that domain.
  3361. </para>
  3362. <para>
  3363. When conducting forward domain matching, D2 will compare the FQDN in
  3364. the request against the name of each forward DDNS Domain. The domain
  3365. whose name matches the longest portion of the FQDN is considered the
  3366. best match. For example, if the FQDN is "myhost.sample.example.com.",
  3367. and there are two forward domains in the catalog: "sample.example.com."
  3368. and "example.com.", the former is regarded as the best match. In some
  3369. cases, it may not be possible to find a suitable match. Given the same two
  3370. forward domains there would be no match for the FQDN, "bogus.net", so the
  3371. request would be rejected. Finally, if there are no forward DDNS Domains
  3372. defined, D2 will simply disregard the forward update portion of requests.
  3373. </para>
  3374. <para>
  3375. When conducting reverse domain matching, D2 constructs a reverse
  3376. FQDN from the lease address in the request and compare that against
  3377. the name of each reverse DDNS Domain. Again, the domain whose name matches
  3378. the longest portion of the FQDN is considered the best match. For instance,
  3379. if the lease address is "172.16.1.40" and there are two reverse domains in
  3380. the catalog: "1.16.172.in-addr.arpa." and "16.172.in-addr.arpa", the
  3381. former is the best match. As with forward matching, it is possible to not
  3382. find a suitable match. Given the same two domains, there would be no
  3383. match for the lease address, "192.168.1.50", and the request would be
  3384. rejected. Finally, if there are no reverse DDNS Domains defined, D2 will
  3385. simply disregard the reverse update portion of requests.
  3386. </para>
  3387. <section id="dhcp-ddns-server-start-stop">
  3388. <title>Starting and Stopping the DHCP-DDNS Server</title>
  3389. <para>
  3390. <command>b10-dhcp-ddns</command> is the BIND 10 DHCP-DDNS server and,
  3391. like other parts of BIND 10, is configured through the
  3392. <command>bindctl</command> program.
  3393. </para>
  3394. <para>
  3395. After starting BIND 10 and entering bindctl, the first step in
  3396. configuring the server is to add it to the list of running BIND 10
  3397. services.
  3398. <screen>
  3399. &gt; <userinput>config add Init/components b10-dhcp-ddns</userinput>
  3400. &gt; <userinput>config set Init/components/b10-dhcp-ddns/kind dispensable</userinput>
  3401. &gt; <userinput>config commit</userinput>
  3402. </screen>
  3403. </para>
  3404. <para>
  3405. To remove <command>b10-dhcp-ddns</command> from the set of running services,
  3406. the <command>b10-dhcp-ddns</command> is removed from list of Init components:
  3407. <screen>
  3408. &gt; <userinput>config remove Init/components b10-dhcp-ddns</userinput>
  3409. &gt; <userinput>config commit</userinput>
  3410. </screen>
  3411. </para>
  3412. <para>
  3413. Note that the server was only removed from the list, so it will not be
  3414. automatically restarted, but the server itself is still running. Hence it
  3415. is usually desired to stop it:
  3416. </para>
  3417. <screen>
  3418. &gt; <userinput>DhcpDdns shutdown</userinput>
  3419. </screen>
  3420. <para>
  3421. Upon start up the module will load its configuration and begin listening
  3422. for NCRs based on that configuration.
  3423. </para>
  3424. </section> <!-- end start-stop -->
  3425. <section id="d2-configuration">
  3426. <title>Configuring the DHCP-DDNS Server</title>
  3427. <para>
  3428. Once the server is started, it can be configured. To view the
  3429. current configuration, use the following command in <command>bindctl</command>:
  3430. <screen>
  3431. &gt; <userinput>config show DhcpDdns</userinput></screen>
  3432. When starting b10-dhcp-ddns module for the first time, the default
  3433. configuration will be available. It will look similar to this:
  3434. <screen>
  3435. &gt; <userinput>config show DhcpDdns</userinput>
  3436. DhcpDdns/ip_address "127.0.0.1" string (default)
  3437. DhcpDdns/port 53001 integer (default)
  3438. DhcpDdns/dns_server_timeout 100 integer (default)
  3439. DhcpDdns/ncr_protocol "UDP" string (default)
  3440. DhcpDdns/ncr_format "JSON" string (default)
  3441. DhcpDdns/tsig_keys [] list (default)
  3442. DhcpDdns/forward_ddns/ddns_domains [] list (default)
  3443. DhcpDdns/reverse_ddns/ddns_domains [] list (default)
  3444. </screen>
  3445. <para>
  3446. (While displayed, the parameter "interface" is not implemented, and
  3447. will be removed in the near future.)
  3448. </para>
  3449. </para>
  3450. <para>
  3451. The configuration can be divided as follows, each of which is described
  3452. in its own section:
  3453. </para>
  3454. <itemizedlist>
  3455. <listitem>
  3456. <simpara>
  3457. <command>Global Server Parameters</command> &mdash;
  3458. values which control connectivity and global server behavior
  3459. </simpara>
  3460. </listitem>
  3461. <listitem>
  3462. <simpara>
  3463. <command>TSIG Key Info</command> &mdash;
  3464. defines the TSIG keys used for secure traffic with DNS servers
  3465. </simpara>
  3466. </listitem>
  3467. <listitem>
  3468. <simpara>
  3469. <command>Forward DDNS</command> &mdash;
  3470. defines the catalog of Forward DDNS Domains
  3471. </simpara>
  3472. </listitem>
  3473. <listitem>
  3474. <simpara>
  3475. <command>Reverse DDNS</command> &mdash;
  3476. defines the catalog of Forward DDNS Domains
  3477. </simpara>
  3478. </listitem>
  3479. </itemizedlist>
  3480. <section id="d2-server-parameter-config">
  3481. <title>Global Server Parameters</title>
  3482. <orderedlist>
  3483. <listitem><para>
  3484. ip_address - IP address on which D2 listens for requests. The default is
  3485. the local loopback interface at address 127.0.0.1. You may specify
  3486. either an IPv4 or IPv6 address.
  3487. </para></listitem>
  3488. <listitem><para>
  3489. port - Port on which D2 listens for requests. The default value
  3490. is 53001.
  3491. </para></listitem>
  3492. <listitem><para>
  3493. ncr_format - Socket protocol to use when sending requests to D2.
  3494. Currently only UDP is supported. TCP may be available in an upcoming
  3495. release.
  3496. </para></listitem>
  3497. <listitem><para>
  3498. ncr_protocol - Packet format to use when sending requests to D2.
  3499. Currently only JSON format is supported. Other formats may be available
  3500. in future releases.
  3501. </para></listitem>
  3502. <listitem><para>
  3503. dns_server_timeout - The maximum amount of time in milliseconds, that
  3504. D2 will wait for a response from a DNS server to a single DNS update
  3505. message.
  3506. </para></listitem>
  3507. </orderedlist>
  3508. <para>
  3509. D2 must listen for change requests on a known address and port. By
  3510. default it listens at 127.0.0.1 on port 53001. The following example
  3511. illustrates how to change D2's global parameters so it will listen
  3512. at 192.168.1.10 port 900:
  3513. <screen>
  3514. &gt; <userinput>config set DhcpDdns/ip_address "192.168.1.10"</userinput>
  3515. &gt; <userinput>config set DhcpDdns/port 900</userinput>
  3516. &gt; <userinput>config commit</userinput>
  3517. </screen>
  3518. </para>
  3519. <warning>
  3520. <simpara>
  3521. When the DHCP-DDNS server is configured to listen at an address
  3522. other than the loopback address (127.0.0.1 or ::1), it is possible
  3523. for a malicious attacker to send bogus NameChangeRequests to it
  3524. and change entries in the DNS. For this reason, addresses other
  3525. than the IPv4 or IPv6 loopback addresses should only be used
  3526. for testing purposes. A future version of Kea will implement
  3527. authentication to guard against such attacks.
  3528. </simpara>
  3529. </warning>
  3530. <note>
  3531. <simpara>
  3532. If the ip_address and port are changed, it will be necessary to change the
  3533. corresponding values in the DHCP servers' "dhcp-ddns" configuration section.
  3534. </simpara>
  3535. </note>
  3536. </section> <!-- "d2-server-parameter-config" -->
  3537. <section id="d2-tsig-key-list-config">
  3538. <title>TSIG Key List</title>
  3539. <para>
  3540. A DDNS protocol exchange can be conducted with or without TSIG
  3541. (defined in <ulink url="http://tools.ietf/org/html/rfc2845">RFC
  3542. 2845</ulink>). This configuration section allows the administrator
  3543. to define the set of TSIG keys that may be used in such
  3544. exchanges.</para>
  3545. <para>To use TSIG when updating entries in a DNS Domain,
  3546. a key must be defined in the TSIG Key List and referenced by
  3547. name in that domain's configuration entry. When D2 matches a
  3548. change request to a domain, it checks whether the domain has
  3549. a TSIG key associated with it. If so, D2 will use that key to
  3550. sign DNS update messages sent to and verify repsonses received
  3551. from the domain's DNS server(s). For each TSIG key required by
  3552. the DNS servers that D2 will be working with there must be a
  3553. corresponding TSIG key in the TSIG Key list.</para>
  3554. <para>
  3555. As one might gather from the name, the tsig_key section of the
  3556. D2 configuration lists the TSIG keys. Each entry describes a
  3557. TSIG key used by one or more DNS servers to authenticate requests
  3558. and sign responses. Every entry in the list has three parameters:
  3559. <itemizedlist>
  3560. <listitem>
  3561. <simpara>
  3562. <command>name</command> &mdash;
  3563. a unique text label used to identify this key within the
  3564. list. This value is used to specify which key (if any) should be
  3565. used when updating a specific domain. So long as it is unique its
  3566. content is arbitrary, although for clarity and ease of maintenance
  3567. it is recommended that it match the name used on the DNS server(s).
  3568. It cannot be blank.
  3569. </simpara>
  3570. </listitem>
  3571. <listitem>
  3572. <simpara>
  3573. <command>algorithm</command> &mdash;
  3574. specifies which hashing algorithm should be used with this
  3575. key. This value must specify the same algorithm used for the
  3576. key on the DNS server(s). The supported algorithms are listed below:
  3577. <itemizedlist>
  3578. <listitem>
  3579. <command>HMAC-MD5</command>
  3580. </listitem>
  3581. <listitem>
  3582. <command>HMAC-SHA1</command>
  3583. </listitem>
  3584. <listitem>
  3585. <command>HMAC-SHA224</command>
  3586. </listitem>
  3587. <listitem>
  3588. <command>HMAC-SHA256</command>
  3589. </listitem>
  3590. <listitem>
  3591. <command>HMAC-SHA384</command>
  3592. </listitem>
  3593. <listitem>
  3594. <command>HMAC-SHA512</command>
  3595. </listitem>
  3596. </itemizedlist>
  3597. This value is not case sensitive.
  3598. </simpara>
  3599. </listitem>
  3600. <listitem>
  3601. <simpara>
  3602. <command>secret</command> &mdash;
  3603. is used to specify the shared secret key code for this key. This value is
  3604. case sensitive and must exactly match the value specified on the DNS server(s).
  3605. It is a base64-encoded text value.
  3606. </simpara>
  3607. </listitem>
  3608. </itemizedlist>
  3609. </para>
  3610. <para>
  3611. As an example, suppose that a domain D2 will be updating is
  3612. maintained by a BIND9 DNS server which requires dynamic updates
  3613. to be secured with TSIG. Suppose further that the entry for
  3614. the TSIG key in BIND9's named.conf file looks like this:
  3615. <screen>
  3616. :
  3617. key "key.four.example.com." {
  3618. algorithm hmac-sha224;
  3619. secret "bZEG7Ow8OgAUPfLWV3aAUQ==";
  3620. };
  3621. :
  3622. </screen>
  3623. By default, the TSIG Key list is empty:
  3624. <screen>
  3625. <userinput>> config show DhcpDdns/tsig_keys</userinput>
  3626. DhcpDdns/tsig_keys [] list (default)
  3627. </screen>
  3628. We must first create a new key in the list:
  3629. <screen>
  3630. <userinput>> config add DhcpDdns/tsig_keys</userinput>
  3631. </screen>
  3632. Displaying the new element, reveals:
  3633. <screen>
  3634. <userinput>> config show DhcpDdns/tsig_keys[0]</userinput>
  3635. DhcpDdns/tsig_keys[0]/name "" string (default)
  3636. DhcpDdns/tsig_keys[0]/algorithm "HMAC-MD5" string (modified)
  3637. DhcpDdns/tsig_keys[0]/secret "" string (default)
  3638. </screen>
  3639. Now set all three values to match BIND9's key:
  3640. <screen>
  3641. <userinput>> config set DhcpDdns/tsig_keys[0]/name "key.four.example.com"</userinput>
  3642. <userinput>> config set DhcpDdns/tsig_keys[0]/algorithm "HMAC-SHA224"</userinput>
  3643. <userinput>> config set DhcpDdns/tsig_keys[0]/secret "bZEG7Ow8OgAUPfLWV3aAUQ=="</userinput>
  3644. <userinput>> config commit</userinput>
  3645. </screen>
  3646. </para>
  3647. These steps would be repeated for each TSIG key needed. Note that the same TSIG key
  3648. can be used with more than one domain.
  3649. </section> <!-- "d2-tsig-key-list-config" -->
  3650. <section id="d2-forward-ddns-config">
  3651. <title>Forward DDNS</title>
  3652. <para>
  3653. The Forward DDNS section is used to configure D2's forward update
  3654. behavior. Currently it contains a single parameter, the catalog of
  3655. forward DDNS Domains:
  3656. <screen>
  3657. <userinput>> config show DhcpDdns/forward_ddns/</userinput>
  3658. DhcpDdns/forward_ddns/ddns_domains [] list (default)
  3659. </screen>
  3660. By default, this list is empty, which will cause the server to ignore
  3661. the forward update portions of requests.
  3662. </para>
  3663. <section id="add-forward-ddns-domain">
  3664. <title>Adding Forward DDNS Domains</title>
  3665. <para>
  3666. A forward DDNS Domain maps a forward DNS zone to a set of DNS servers
  3667. which maintain the forward DNS data for that zone. You will need one
  3668. forward DDNS Domain for each zone you wish to service. It may very
  3669. well be that some or all of your zones are maintained by the same
  3670. servers. You will still need one DDNS Domain per zone. Remember that
  3671. matching a request to the appropriate server(s) is done by zone and
  3672. a DDNS Domain only defines a single zone.
  3673. </para>
  3674. <para>
  3675. The section describes how to add Forward DDNS Domains. Repeat these
  3676. steps for each Forward DDNS Domain desired. Each Forward DDNS Domain
  3677. has the following parameters:
  3678. <itemizedlist>
  3679. <listitem>
  3680. <simpara>
  3681. <command>name</command> &mdash;
  3682. The fully qualified domain name (or zone) that this DDNS Domain
  3683. can update. This is value used to compare against the request
  3684. FQDN during forward matching. It must be unique within the
  3685. catalog.
  3686. </simpara>
  3687. </listitem>
  3688. <listitem>
  3689. <simpara>
  3690. <command>key_name</command> &mdash;
  3691. If TSIG is used with this domain's servers, this
  3692. value should be the name of the key from within the TSIG Key List
  3693. to use. If the value is blank (the default), TSIG will not be
  3694. used in DDNS conversations with this domain's servers. Currently
  3695. TSIG has not been implemented, so this value is ignored.
  3696. </simpara>
  3697. </listitem>
  3698. <listitem>
  3699. <simpara>
  3700. <command>dns_servers</command> &mdash;
  3701. A list of one or more DNS servers which can conduct the server
  3702. side of the DDNS protocol for this domain. The servers
  3703. are used in a first to last preference. In other words, when D2
  3704. begins to process a request for this domain it will pick the
  3705. first server in this list and attempt to communicate with it.
  3706. If that attempt fails, it will move to next one in the list and
  3707. so on until the it achieves success or the list is exhausted.
  3708. </simpara>
  3709. </listitem>
  3710. </itemizedlist>
  3711. To create a new forward DDNS Domain, one must first add a new domain
  3712. element:
  3713. <screen>
  3714. <userinput>> config add DhcpDdns/forward_ddns/ddns_domains</userinput>
  3715. </screen>
  3716. Displaying the DDNS Domain reveals this:
  3717. <screen>
  3718. <userinput>> config show DhcpDdns/forward_ddns/ddns_domains[0]</userinput>
  3719. DhcpDdns/forward_ddns/ddns_domains[0]/name "" string (default)
  3720. DhcpDdns/forward_ddns/ddns_domains[0]/key_name "" string (default)
  3721. DhcpDdns/forward_ddns/ddns_domains[0]/dns_servers [] list (default)
  3722. </screen>
  3723. To set the domain's name to "other.example.com":
  3724. <screen>
  3725. <userinput>> config set DhcpDdns/forward_ddns/ddns_domains[1]/name "other.example.com"</userinput>
  3726. <userinput>> config commit</userinput>
  3727. </screen>
  3728. It is permissible to add a domain without any servers. If that domain
  3729. should be matched to a request, however, the request will fail. In
  3730. order to make the domain useful though, we must add at least one DNS
  3731. server to it.
  3732. </para>
  3733. <section id="add-forward-dns-servers">
  3734. <title>Adding Forward DNS Servers</title>
  3735. <para>
  3736. The section describes how to add DNS servers to a Forward DDNS Domain.
  3737. Repeat them for as many servers as desired for a each domain.
  3738. </para>
  3739. <para>
  3740. Forward DNS Server entries represent actual DNS servers which
  3741. support the server side of the DDNS protocol. Each Forward DNS Server
  3742. has the following parameters:
  3743. <itemizedlist>
  3744. <listitem>
  3745. <simpara>
  3746. <command>hostname</command> &mdash;
  3747. The resolvable host name of the DNS server. This value is not
  3748. yet implemented.
  3749. </simpara>
  3750. </listitem>
  3751. <listitem>
  3752. <simpara>
  3753. <command>ip_address</command> &mdash;
  3754. The IP address at which the server listens for DDNS requests.
  3755. This may be either an IPv4 or an IPv6 address.
  3756. </simpara>
  3757. </listitem>
  3758. <listitem>
  3759. <simpara>
  3760. <command>port</command> &mdash;
  3761. The port on which the server listens for DDNS requests. It
  3762. defaults to the standard DNS service port of 53.
  3763. </simpara>
  3764. </listitem>
  3765. </itemizedlist>
  3766. To create a new forward DNS Server, one must first add a new server
  3767. element to the domain:
  3768. <screen>
  3769. <userinput>> config add DhcpDdns/forward_ddns/ddns_domains[0]/dns_servers</userinput>
  3770. </screen>
  3771. Displaying the DNS Server element should appear as follows:
  3772. <screen>
  3773. <userinput>> config show DhcpDdns/forward_ddns/ddns_domains[0]/dns_servers[0]</userinput>
  3774. DhcpDdns/forward_ddns/ddns_domains[0]/dns_servers[0]/hostname "" string (default)
  3775. DhcpDdns/forward_ddns/ddns_domains[0]/dns_servers[0]/ip_address "" string (default)
  3776. DhcpDdns/forward_ddns/ddns_domains[0]/dns_servers[0]/port 53 integer(default)
  3777. </screen>
  3778. As stated earlier, "hostname" is not yet supported so, the parameter
  3779. "ip_address" must be set to the address of the DNS server. If for
  3780. example the service is running at "172.88.99.10", then set it as
  3781. follows:
  3782. <screen>
  3783. <userinput>> config set DhcpDdns/forward_ddns/ddns_domains[0]/dns_servers[0]/ip_address "172.88.99.10"</userinput>
  3784. <userinput>> config commit</userinput>
  3785. </screen>
  3786. </para>
  3787. </section> <!-- "add-forward-dns-servers" -->
  3788. </section> <!-- "add-forward-ddns-domains" -->
  3789. </section> <!-- "d2-forward-ddns-config" -->
  3790. <section id="d2-reverse-ddns-config">
  3791. <title>Reverse DDNS</title>
  3792. <para>
  3793. The Reverse DDNS section is used to configure D2's reverse update
  3794. behavior, and the concepts are the same as for the forward DDNS
  3795. section. Currently it contains a single parameter, the catalog of
  3796. reverse DDNS Domains:
  3797. <screen>
  3798. <userinput>> config show DhcpDdns/reverse_ddns/</userinput>
  3799. DhcpDdns/reverse_ddns/ddns_domains [] list (default)
  3800. </screen>
  3801. By default, this list is empty, which will cause the server to ignore
  3802. the reverse update portions of requests.
  3803. </para>
  3804. <section id="add-reverse-ddns-domain">
  3805. <title>Adding Reverse DDNS Domains</title>
  3806. <para>
  3807. A reverse DDNS Domain maps a reverse DNS zone to a set of DNS servers
  3808. which maintain the reverse DNS data for that zone. You will need one
  3809. reverse DDNS Domain for each zone you wish to service. It may very
  3810. well be that some or all of your zones are maintained by the same
  3811. servers; even then, you will still need one DDNS Domain entry for each
  3812. zone. Remember that
  3813. matching a request to the appropriate server(s) is done by zone and
  3814. a DDNS Domain only defines a single zone.
  3815. </para>
  3816. <para>
  3817. The section describes how to add Reverse DDNS Domains. Repeat these
  3818. steps for each Reverse DDNS Domain desired. Each Reverse DDNS Domain
  3819. has the following parameters:
  3820. <itemizedlist>
  3821. <listitem>
  3822. <simpara>
  3823. <command>name</command> &mdash;
  3824. The fully qualified reverse zone that this DDNS Domain
  3825. can update. This is the value used during reverse matching
  3826. which will compare it with a reversed version of the request's
  3827. lease address. The zone name should follow the appropriate
  3828. standards: for example, to to support the IPv4 subnet 172.16.1,
  3829. the name should be. "1.16.172.in-addr.arpa.". Similarly,
  3830. to support an IPv6 subent of 2001:db8:1, the name should be
  3831. "1.0.0.0.8.B.D.0.1.0.0.2.ip6.arpa."
  3832. Whatever the name, it must be unique within the catalog.
  3833. </simpara>
  3834. </listitem>
  3835. <listitem>
  3836. <simpara>
  3837. <command>key_name</command> &mdash;
  3838. If TSIG should be used with this domain's servers, then this
  3839. value should be the name of that key from the TSIG Key List.
  3840. If the value is blank (the default), TSIG will not be
  3841. used in DDNS conversations with this domain's servers. Currently
  3842. this value is not used as TSIG has not been implemented.
  3843. </simpara>
  3844. </listitem>
  3845. <listitem>
  3846. <simpara>
  3847. <command>dns_servers</command> &mdash;
  3848. a list of one or more DNS servers which can conduct the server
  3849. side of the DDNS protocol for this domain. Currently the servers
  3850. are used in a first to last preference. In other words, when D2
  3851. begins to process a request for this domain it will pick the
  3852. first server in this list and attempt to communicate with it.
  3853. If that attempt fails, it will move to next one in the list and
  3854. so on until the it achieves success or the list is exhausted.
  3855. </simpara>
  3856. </listitem>
  3857. </itemizedlist>
  3858. To create a new reverse DDNS Domain, one must first add a new domain
  3859. element:
  3860. <screen>
  3861. <userinput>> config add DhcpDdns/reverse_ddns/ddns_domains</userinput>
  3862. </screen>
  3863. Displaying the DDNS Domain reveals this:
  3864. <screen>
  3865. <userinput>> config show DhcpDdns/reverse_ddns/ddns_domains[0]</userinput>
  3866. DhcpDdns/reverse_ddns/ddns_domains[0]/name "" string (default)
  3867. DhcpDdns/reverse_ddns/ddns_domains[0]/key_name "" string (default)
  3868. DhcpDdns/reverse_ddns/ddns_domains[0]/dns_servers [] list (default)
  3869. </screen>
  3870. For domain supporting the subnet 2001:db8:1::, we would set the
  3871. domain's name as follows:
  3872. <screen>
  3873. <userinput>> config set DhcpDdns/reverse_ddns/ddns_domains[1]/name "1.0.0.0.8.B.D.0.1.0.0.2.ip6.arpa."</userinput>
  3874. <userinput>> config commit</userinput>
  3875. </screen>
  3876. It is permissible to add a domain without any servers. If that domain
  3877. should be matched to a request, however, the request will fail. In
  3878. order to make the domain useful though, we must add at least one DNS
  3879. server to it.
  3880. </para>
  3881. <section id="add-reverse-dns-servers">
  3882. <title>Adding Reverse DNS Servers</title>
  3883. <para>
  3884. The section describes how to add DNS servers to a Reverse DDNS Domain.
  3885. Repeat them for as many servers as desired for a each domain.
  3886. </para>
  3887. <para>
  3888. Reverse DNS Server entries represents a actual DNS servers which
  3889. support the server side of the DDNS protocol. Each Reverse DNS Server
  3890. has the following parameters:
  3891. <itemizedlist>
  3892. <listitem>
  3893. <simpara>
  3894. <command>hostname</command> &mdash;
  3895. The resolvable host name of the DNS server. This value is
  3896. currently ignored.
  3897. </simpara>
  3898. </listitem>
  3899. <listitem>
  3900. <simpara>
  3901. <command>ip_address</command> &mdash;
  3902. The IP address at which the server listens for DDNS requests.
  3903. </simpara>
  3904. </listitem>
  3905. <listitem>
  3906. <simpara>
  3907. <command>port</command> &mdash;
  3908. The port on which the server listens for DDNS requests. It
  3909. defaults to the standard DNS service port of 53.
  3910. </simpara>
  3911. </listitem>
  3912. </itemizedlist>
  3913. To create a new reverse DNS Server, one must first add a new server
  3914. element to the domain:
  3915. <screen>
  3916. <userinput>> config add DhcpDdns/reverse_ddns/ddns_domains[0]/dns_servers</userinput>
  3917. </screen>
  3918. Displaying the DNS Server element should appear as follows:
  3919. <screen>
  3920. <userinput>> config show DhcpDdns/reverse_ddns/ddns_domains[0]/dns_servers[0]</userinput>
  3921. DhcpDdns/reverse_ddns/ddns_domains[0]/dns_servers[0]/hostname "" string (default)
  3922. DhcpDdns/reverse_ddns/ddns_domains[0]/dns_servers[0]/ip_address "" string (default)
  3923. DhcpDdns/reverse_ddns/ddns_domains[0]/dns_servers[0]/port 53 integer(default)
  3924. </screen>
  3925. As stated earlier, "hostname" is not yet supported so, the parameter
  3926. "ip_address" must be set to the address of the DNS server. If for
  3927. example the service is running at "172.88.99.10", then set it as
  3928. follows:
  3929. <screen>
  3930. <userinput>> config set DhcpDdns/reverse_ddns/ddns_domains[0]/dns_servers[0]/ip_address "172.88.99.10"</userinput>
  3931. <userinput>> config commit</userinput>
  3932. </screen>
  3933. </para>
  3934. </section> <!-- "add-reverse-dns-servers" -->
  3935. </section> <!-- "add-reverse-ddns-domains" -->
  3936. </section> <!-- "d2-reverse-ddns-config" -->
  3937. <section id="d2-exmaple-config">
  3938. <title>Example DHCP-DDNS Server Configuration</title>
  3939. <para>
  3940. This section provides an example DHCP-DDNS server configuration based
  3941. on a small example network. Let's suppose our example network has
  3942. three domains, each with their own subnet.
  3943. <table>
  3944. <title>Our example network</title>
  3945. <tgroup cols='4' align='left'>
  3946. <colspec colname='domain'/>
  3947. <colspec colname='subnet'/>
  3948. <colspec colname='fservers'/>
  3949. <colspec colname='rservers'/>
  3950. <thead>
  3951. <row>
  3952. <entry>Domain</entry>
  3953. <entry>Subnet</entry>
  3954. <entry>Forward DNS Servers</entry>
  3955. <entry>Reverse DNS Servers</entry>
  3956. </row>
  3957. </thead>
  3958. <tbody>
  3959. <row>
  3960. <entry>four.example.com</entry>
  3961. <entry>192.0.2.0/24</entry>
  3962. <entry>172.16.1.5, 172.16.2.5</entry>
  3963. <entry>172.16.1.5, 172.16.2.5</entry>
  3964. </row>
  3965. <row>
  3966. <entry>six.example.com</entry>
  3967. <entry>2001:db8:1::/64</entry>
  3968. <entry>3001:1::50</entry>
  3969. <entry>3001:1::51</entry>
  3970. </row>
  3971. <row>
  3972. <entry>example.com</entry>
  3973. <entry>192.0.0.0/16</entry>
  3974. <entry>172.16.2.5</entry>
  3975. <entry>172.16.2.5</entry>
  3976. </row>
  3977. </tbody>
  3978. </tgroup>
  3979. </table>
  3980. </para>
  3981. <para>
  3982. We need to construct three forward DDNS Domains:
  3983. <table>
  3984. <title>Forward DDNS Domains Needed</title>
  3985. <tgroup cols='3' align='left'>
  3986. <colspec colname='num'/>
  3987. <colspec colname='name'/>
  3988. <colspec colname='servers'/>
  3989. <thead>
  3990. <row>
  3991. <entry>#</entry>
  3992. <entry>DDNS Domain Name</entry>
  3993. <entry>DNS Servers</entry>
  3994. </row>
  3995. </thead>
  3996. <tbody>
  3997. <row>
  3998. <entry>1.</entry>
  3999. <entry>four.example.com.</entry>
  4000. <entry>172.16.1.5, 172.16.2.5</entry>
  4001. </row>
  4002. <row>
  4003. <entry>2.</entry>
  4004. <entry>six.example.com.</entry>
  4005. <entry>3001:1::50</entry>
  4006. </row>
  4007. <row>
  4008. <entry>3.</entry>
  4009. <entry>example.com.</entry>
  4010. <entry>172.16.2.5</entry>
  4011. </row>
  4012. </tbody>
  4013. </tgroup>
  4014. </table>
  4015. As discussed earlier, FQDN to domain matching is based on the longest
  4016. match. The FQDN, "myhost.four.example.com.", will match the first
  4017. domain ("four.example.com") while "admin.example.com." will match the
  4018. third domain ("example.com"). The
  4019. FQDN, "other.example.net." will fail to match any domain and would
  4020. be rejected.
  4021. </para>
  4022. <para>
  4023. The following series of commands in bindctl will create the Forward
  4024. DDNS Domains.
  4025. <screen>
  4026. <userinput>
  4027. > config add DhcpDdns/forward_ddns/ddns_domains
  4028. > config set DhcpDdns/forward_ddns/ddns_domains[0]/name "four.example.com."
  4029. > config add DhcpDdns/forward_ddns/ddns_domains[0]/dns_servers
  4030. > config set DhcpDdns/forward_ddns/ddns_domains[0]/dns_servers[0]/ip_address "172.16.1.5"
  4031. > config add DhcpDdns/forward_ddns/ddns_domains[0]/dns_servers
  4032. > config set DhcpDdns/forward_ddns/ddns_domains[0]/dns_servers[1]/ip_address "172.16.2.5"
  4033. >
  4034. > config add DhcpDdns/forward_ddns/ddns_domains
  4035. > config set DhcpDdns/forward_ddns/ddns_domains[1]/name "six.example.com."
  4036. > config add DhcpDdns/forward_ddns/ddns_domains[1]/dns_servers
  4037. > config set DhcpDdns/forward_ddns/ddns_domains[1]/dns_servers[0]/ip_address "3001:1::50:"
  4038. >
  4039. > config add DhcpDdns/forward_ddns/ddns_domains
  4040. > config set DhcpDdns/forward_ddns/ddns_domains[2]/name "example.com."
  4041. > config add DhcpDdns/forward_ddns/ddns_domains[2]/dns_servers
  4042. > config set DhcpDdns/forward_ddns/ddns_domains[2]/dns_servers[0]/ip_address "172.16.2.5"
  4043. >
  4044. > config commit
  4045. </userinput>
  4046. </screen>
  4047. </para>
  4048. <para>
  4049. Similarly, we need to construct the three reverse DDNS Domains:
  4050. <table>
  4051. <title>Reverse DDNS Domains Needed</title>
  4052. <tgroup cols='3' align='left'>
  4053. <colspec colname='num'/>
  4054. <colspec colname='DDNS Domain name'/>
  4055. <colspec colname='DDNS Domain DNS Servers'/>
  4056. <thead>
  4057. <row>
  4058. <entry>#</entry>
  4059. <entry>DDNS Domain Name</entry>
  4060. <entry>DNS Servers</entry>
  4061. </row>
  4062. </thead>
  4063. <tbody>
  4064. <row>
  4065. <entry>1.</entry>
  4066. <entry>2.0.192.in-addr.arpa.</entry>
  4067. <entry>172.16.1.5, 172.16.2.5</entry>
  4068. </row>
  4069. <row>
  4070. <entry>2.</entry>
  4071. <entry>1.0.0.0.8.d.b.0.1.0.0.2.ip6.arpa.</entry>
  4072. <entry>3001:1::50</entry>
  4073. </row>
  4074. <row>
  4075. <entry>3.</entry>
  4076. <entry>0.182.in-addr.arpa.</entry>
  4077. <entry>172.16.2.5</entry>
  4078. </row>
  4079. </tbody>
  4080. </tgroup>
  4081. </table>
  4082. An address of "192.0.2.150" will match the first domain,
  4083. "2001:db8:1::10" will match the second domain, and "192.0.50.77"
  4084. the third domain.
  4085. </para>
  4086. <para>
  4087. The following series of commands in bindctl will create our Reverse
  4088. DDNS Domains.
  4089. <screen>
  4090. <userinput>
  4091. > config add DhcpDdns/reverse_ddns/ddns_domains
  4092. > config set DhcpDdns/reverse_ddns/ddns_domains[0]/name "2.0.192.in-addr.arpa."
  4093. > config add DhcpDdns/reverse_ddns/ddns_domains[0]/dns_servers
  4094. > config set DhcpDdns/reverse_ddns/ddns_domains[0]/dns_servers[0]/ip_address "172.16.1.5"
  4095. > config add DhcpDdns/reverse_ddns/ddns_domains[0]/dns_servers
  4096. > config set DhcpDdns/reverse_ddns/ddns_domains[0]/dns_servers[1]/ip_address "172.16.2.5"
  4097. >
  4098. > config add DhcpDdns/reverse_ddns/ddns_domains
  4099. > config set DhcpDdns/reverse_ddns/ddns_domains[1]/name "1.0.0.0.8.d.b.0.1.0.0.2.ip6.arpa."
  4100. > config add DhcpDdns/reverse_ddns/ddns_domains[1]/dns_servers
  4101. > config set DhcpDdns/reverse_ddns/ddns_domains[1]/dns_servers[0]/ip_address "3001:1::50:"
  4102. >
  4103. > config add DhcpDdns/reverse_ddns/ddns_domains
  4104. > config set DhcpDdns/reverse_ddns/ddns_domains[2]/name "0.192.in-addr.arpa."
  4105. > config add DhcpDdns/reverse_ddns/ddns_domains[2]/dns_servers
  4106. > config set DhcpDdns/reverse_ddns/ddns_domains[2]/dns_servers[0]/ip_address "172.16.2.5"
  4107. >
  4108. > config commit
  4109. </userinput>
  4110. </screen>
  4111. </para>
  4112. </section> <!-- end of "d2-example" -->
  4113. </section> <!-- end of section "d2-configuration" -->
  4114. <section>
  4115. <title>DHCP-DDNS Server Limitations</title>
  4116. <para>The following are the current limitations of the DHCP-DDNS Server.</para>
  4117. <itemizedlist>
  4118. <listitem>
  4119. <simpara>
  4120. Requests received from the DHCP servers are placed in a
  4121. queue until they are processed. Currently all queued requests
  4122. are lost when the server shuts down.
  4123. </simpara>
  4124. </listitem>
  4125. <listitem>
  4126. <simpara>
  4127. TSIG Authentication (<ulink
  4128. url="http://tools.ietf.org/html/rfc2845">RFC 2845</ulink>)
  4129. is not supported yet.
  4130. </simpara>
  4131. </listitem>
  4132. </itemizedlist>
  4133. </section>
  4134. </chapter> <!-- DHCP-DDNS Server -->
  4135. <chapter id="libdhcp">
  4136. <title>libdhcp++ library</title>
  4137. <para>
  4138. libdhcp++ is a common library written in C++ that handles
  4139. many DHCP-related tasks, including:
  4140. <itemizedlist>
  4141. <listitem>
  4142. <simpara>DHCPv4 and DHCPv6 packets parsing, manipulation and assembly</simpara>
  4143. </listitem>
  4144. <listitem>
  4145. <simpara>Option parsing, manipulation and assembly</simpara>
  4146. </listitem>
  4147. <listitem>
  4148. <simpara>Network interface detection</simpara>
  4149. </listitem>
  4150. <listitem>
  4151. <simpara>Socket operations such as creation, data transmission and reception and socket closing.</simpara>
  4152. </listitem>
  4153. </itemizedlist>
  4154. </para>
  4155. <para>
  4156. While this library is currently used by Kea, it is designed to
  4157. be a portable, universal library, useful for any kind of DHCP-related software.
  4158. </para>
  4159. <!-- TODO: point to doxygen docs -->
  4160. <section id="iface-detect">
  4161. <title>Interface detection and Socket handling</title>
  4162. <para>Both the DHCPv4 and DHCPv6 components share network
  4163. interface detection routines. Interface detection is
  4164. currently supported on Linux, all BSD family (FreeBSD, NetBSD,
  4165. OpenBSD), Mac OS X and Solaris 11 systems.</para>
  4166. <para>DHCPv4 requires special raw socket processing to send and receive
  4167. packets from hosts that do not have IPv4 address assigned yet. Support
  4168. for this operation is implemented on Linux only, so it is likely that
  4169. DHCPv4 component will not work in certain cases on systems other than
  4170. Linux.</para>
  4171. </section>
  4172. <!--
  4173. <section id="packet-handling">
  4174. <title>DHCPv4/DHCPv6 packet handling</title>
  4175. <para>TODO: Describe packet handling here, with pointers to wiki</para>
  4176. </section>
  4177. -->
  4178. </chapter>
  4179. <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="logging.xml" />
  4180. <chapter id="acknowledgements">
  4181. <title>Acknowledgements</title>
  4182. <para>Kea was initially implemented as a collection of applications
  4183. within the BIND 10 framework. Hence, Kea development would not be
  4184. possible without the generous support of BIND 10 project sponsors.</para>
  4185. <para><ulink url="http://jprs.co.jp/">JPRS</ulink> and
  4186. <ulink url="http://cira.ca/">CIRA</ulink> are Patron Level
  4187. sponsors.</para>
  4188. <para><ulink url="https://www.afnic.fr/">AFNIC</ulink>,
  4189. <ulink url="https://www.cnnic.net.cn/">CNNIC</ulink>,
  4190. <ulink url="https://www.nic.cz/">CZ.NIC</ulink>,
  4191. <ulink url="http://www.denic.de/">DENIC eG</ulink>,
  4192. <ulink url="https://www.google.com/">Google</ulink>,
  4193. <ulink url="https://www.ripe.net/">RIPE NCC</ulink>,
  4194. <ulink url="https://registro.br/">Registro.br</ulink>,
  4195. <ulink url="https://nzrs.net.nz/">.nz Registry Services</ulink>, and
  4196. <ulink url="https://www.tcinet.ru/">Technical Center of Internet</ulink>
  4197. are current sponsors.</para>
  4198. <para><ulink url="https://www.afilias.info/">Afilias</ulink>,
  4199. <ulink url="https://www.iis.se/">IIS.SE</ulink>,
  4200. <ulink url="http://www.nominet.org.uk/">Nominet</ulink>, and
  4201. <ulink url="https://www.sidn.nl/">SIDN</ulink> were founding
  4202. sponsors of the project.</para>
  4203. <!-- DHCP sponsorship by Comcast -->
  4204. <para>Support for the development of the DHCPv4, DHCPv6 and
  4205. DHCP-DDNS components is provided by
  4206. <ulink url="http://www.comcast.com/">Comcast</ulink>.</para>
  4207. </chapter>
  4208. <!-- TODO: Add bibliography section (mostly RFCs, probably) -->
  4209. <!-- TODO: how to help: run unit tests, join lists, review trac tickets -->
  4210. <!-- <index> <title>Index</title> </index> -->
  4211. </book>
  4212. <!--
  4213. TODO:
  4214. Overview
  4215. Getting BIND 10 Installed
  4216. Basics
  4217. Dependencies
  4218. Optional
  4219. Advanced
  4220. How Does Everything Work Together?
  4221. Need Help?
  4222. -->