kea-guide.xml 234 KB

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