bind10-guide.xml 291 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722
  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 Guide</title>
  27. <subtitle>Administrator Reference for Kea</subtitle>
  28. <copyright>
  29. <year>2010-2014</year><holder>Internet Systems Consortium, Inc.</holder>
  30. </copyright>
  31. <abstract>
  32. <para>
  33. Kea is an open source implementation of the Dynamic Host Configuration
  34. Protocol (DHCP) servers, developed and maintained by Internet Systems
  35. Consortium (ISC).
  36. </para>
  37. <!-- TODO: The VERSION needs to be updated -->
  38. <para>
  39. This is the reference guide for Kea version &__VERSION__;.
  40. The most up-to-date version of this document (in PDF, HTML,
  41. and plain text formats), along with other documents for
  42. Kea, can be found at <ulink url="http://kea.isc.org/docs"/>.
  43. </para> </abstract>
  44. <releaseinfo>This is the reference guide for Kea version
  45. &__VERSION__;.</releaseinfo>
  46. </bookinfo>
  47. <!-- todo: Preface is now empty, but leave it around now
  48. <preface>
  49. <title>Preface</title>
  50. </preface>
  51. -->
  52. <chapter id="intro">
  53. <title>Introduction</title>
  54. <para>
  55. Kea is the next generation of DHCP servers developed by ISC.
  56. It supports both DHCPv4 and DHCPv6 protocols along with their
  57. extensions (e.g. prefix delegation). It also supports the dynamic
  58. updates to DNS.
  59. </para>
  60. <para>
  61. Kea has been initially developed as a part of the BIND 10 framework
  62. (<ulink url="http://bind10.isc.org"/>). In early 2014, ISC
  63. made the decision to discontinue active development of BIND 10 and
  64. continue development of Kea as standalone DHCP servers. As a result,
  65. the components and libraries related to the BIND10 framework and DNS
  66. are going to be removed from the Kea source tree over time.
  67. In order to remove the dependency on Python 3, the BIND 10 framework
  68. will be replaced by the server startup and configuration mechanisms
  69. written in C++.
  70. </para>
  71. <note>
  72. <simpara>Kea has been implemented in BIND 10 framework and to certain extent
  73. it still depends on various BIND 10 libraries. It also requires the BIND 10
  74. framework to run, because BIND 10 configuration mechanisms are used to
  75. configure Kea. As a result, this document still refers to BIND 10 in many
  76. paragraphs. The term "BIND 10" in the context of this document means
  77. "BIND 10 libraries and applications which are necessary for Kea to run
  78. and configure". The term "Kea" means "the collection of binaries and libraries
  79. which, as a whole, implement the DHCP protocols.
  80. </simpara>
  81. </note>
  82. <para>
  83. This guide covers Kea version &__VERSION__;.
  84. </para>
  85. <section>
  86. <!-- todo: revisit (maybe extend) the list of supported platforms -->
  87. <title>Supported Platforms</title>
  88. <para>
  89. Kea builds have been tested on (in no particular order)
  90. Debian GNU/Linux 6 and unstable, Ubuntu 9.10, NetBSD 5,
  91. Solaris 10 and 11, FreeBSD 7 and 8, CentOS Linux 5.3,
  92. MacOS 10.6 and 10.7, and OpenBSD 5.1.
  93. It has been tested on Sparc, i386, and amd64 hardware
  94. platforms.
  95. It is planned for Kea to build, install and run on
  96. Windows and standard Unix-type platforms.
  97. </para>
  98. </section>
  99. <section id="required-software">
  100. <title>Required Software at Run-time</title>
  101. <para>
  102. Running Kea uses various extra software which may
  103. not be provided in some operating systems' default
  104. installations nor standard packages collections. You may
  105. need to install this required software separately.
  106. (For the build requirements, also see
  107. <xref linkend="build-requirements"/>.)
  108. </para>
  109. <para>
  110. Kea was developed as a collection of applications within
  111. BIND 10 framework and it still relies on the remaining parts
  112. of this framework. In particular, the servers' configuration
  113. and startup are still facilitated by the modules which originate
  114. in BIND 10. These modules require at least Python 3.1 to run.
  115. They also work with Python 3.2
  116. (<ulink url="http://www.python.org/"/>)). The dependency
  117. on Python will be removed once a replacing configuration
  118. and startup mechanisms are developed for Kea. At this point
  119. Kea will be written in pure C++.
  120. </para>
  121. <para>
  122. Kea uses the Botan crypto library for C++
  123. (<ulink url="http://botan.randombit.net/"/>).
  124. It requires at least Botan version 1.8.
  125. </para>
  126. <para>
  127. Kea uses the log4cplus C++ logging library
  128. (<ulink url="http://log4cplus.sourceforge.net/"/>).
  129. It requires at least log4cplus version 1.0.3.
  130. <!-- TODO: It is recommended to use at least version .... -->
  131. </para>
  132. </section>
  133. <section id="starting_stopping">
  134. <title>Starting and Stopping the Server</title>
  135. <para>
  136. Kea is modular. Part of this modularity is
  137. accomplished using multiple cooperating processes which, together,
  138. provide the server functionality.
  139. </para>
  140. <!-- todo: Rename processes here, once they are renamed in the source -->
  141. <para>
  142. At first, running many different processes may seem confusing.
  143. However, these processes are started by running a single
  144. command, <command>bind10</command>. This command starts
  145. a master process, <command>b10-init</command>, which will
  146. start other required processes and other processes when
  147. configured. The processes that may be started have names
  148. starting with "b10-", including:
  149. </para>
  150. <para>
  151. <itemizedlist>
  152. <listitem>
  153. <simpara>
  154. <command>b10-cfgmgr</command> &mdash;
  155. Configuration manager.
  156. This process maintains all of the configuration for BIND 10.
  157. </simpara>
  158. </listitem>
  159. <listitem>
  160. <simpara>
  161. <command>b10-cmdctl</command> &mdash;
  162. Command and control service.
  163. This process allows external control of the BIND 10 system.
  164. </simpara>
  165. </listitem>
  166. <listitem>
  167. <simpara>
  168. <command>b10-dhcp4</command> &mdash;
  169. DHCPv4 server process.
  170. This process responds to DHCPv4 queries from clients.
  171. </simpara>
  172. </listitem>
  173. <listitem>
  174. <simpara>
  175. <command>b10-dhcp6</command> &mdash;
  176. DHCPv6 server process.
  177. This process responds to DHCPv6 queries from clients.
  178. </simpara>
  179. </listitem>
  180. <listitem>
  181. <simpara>
  182. <command>b10-dhcp-ddns</command> &mdash;
  183. DHCP-DDNS process.
  184. This process acts as an intermediary between the DHCP servers
  185. and DNS server. It receives name update requests from the DHCP
  186. servers and sends DNS Update messages to the DNS servers.
  187. </simpara>
  188. </listitem>
  189. <listitem>
  190. <simpara>
  191. <command>b10-msgq</command> &mdash;
  192. Message bus daemon.
  193. This process coordinates communication between all of the other
  194. BIND 10 processes.
  195. </simpara>
  196. </listitem>
  197. <listitem>
  198. <simpara>
  199. <command>b10-sockcreator</command> &mdash;
  200. Socket creator daemon.
  201. This process creates sockets used by
  202. network-listening BIND 10 processes.
  203. </simpara>
  204. </listitem>
  205. <listitem>
  206. <simpara>
  207. <command>b10-stats</command> &mdash;
  208. Statistics collection daemon.
  209. This process collects and reports statistics data.
  210. </simpara>
  211. </listitem>
  212. <listitem>
  213. <simpara>
  214. <command>b10-stats-httpd</command> &mdash;
  215. HTTP server for statistics reporting.
  216. This process reports statistics data in XML format over HTTP.
  217. </simpara>
  218. </listitem>
  219. </itemizedlist>
  220. </para>
  221. <para>
  222. These do not need to be manually started independently.
  223. </para>
  224. </section>
  225. <section id="managing_once_running">
  226. <title>Managing BIND 10</title>
  227. <para>
  228. Once BIND 10 is running, a few commands are used to interact
  229. directly with the system:
  230. <itemizedlist>
  231. <listitem>
  232. <simpara>
  233. <command>bindctl</command> &mdash;
  234. Interactive administration interface.
  235. This is a low-level command-line tool which allows
  236. a developer or an experienced administrator to control
  237. Kea.
  238. </simpara>
  239. </listitem>
  240. <listitem>
  241. <simpara>
  242. <command>b10-cmdctl-usermgr</command> &mdash;
  243. User access control.
  244. This tool allows an administrator to authorize additional users
  245. to manage Kea.
  246. </simpara>
  247. </listitem>
  248. <!-- TODO usermgr -->
  249. </itemizedlist>
  250. </para>
  251. </section>
  252. <para>
  253. The tools and modules are covered in full detail in this guide.
  254. <!-- TODO point to these -->
  255. In addition, manual pages are also provided in the default installation.
  256. </para>
  257. <!--
  258. bin/
  259. bindctl*
  260. host*
  261. lib/
  262. libauth
  263. libdns
  264. libexceptions
  265. python3.1/site-packages/isc/{cc,config}
  266. sbin/
  267. bind10
  268. share/
  269. share/bind10/
  270. auth.spec
  271. b10-cmdctl.pem
  272. init.spec
  273. passwd.csv
  274. man/
  275. var/
  276. bind10/b10-config.db
  277. -->
  278. <para>
  279. BIND 10 also provides libraries and programmer interfaces
  280. for C++ and Python for the message bus and configuration backend,
  281. and, of course, DHCP. These include detailed developer
  282. documentation and code examples.
  283. <!-- TODO point to this -->
  284. </para>
  285. </chapter>
  286. <chapter id="quickstart">
  287. <title>Quick start</title>
  288. <para>
  289. This quickly covers the standard steps for installing
  290. and deploying Kea.
  291. For further details, full customizations, and troubleshooting,
  292. see the respective chapters in the Kea guide.
  293. </para>
  294. <section id="quick-start-dhcp6">
  295. <title>Quick start guide for DHCPv6 service</title>
  296. <orderedlist>
  297. <listitem>
  298. <simpara>
  299. Install required run-time and build dependencies.
  300. </simpara>
  301. </listitem>
  302. <!-- We may need to replace it with the link to a downloadable tarball
  303. once we have it. -->
  304. <listitem>
  305. <simpara>
  306. Checkout the latest Kea revision from the Git repository:
  307. <screen>$ <userinput>git clone git://git.kea.isc.org/kea</userinput> </screen>
  308. </simpara>
  309. </listitem>
  310. <listitem>
  311. <para>Go into the source and run configure:
  312. <screen>$ <userinput>cd kea</userinput>
  313. $ <userinput>autoreconf --install</userinput>
  314. $ <userinput>./configure</userinput></screen>
  315. </para>
  316. </listitem>
  317. <listitem>
  318. <para>Build it:
  319. <screen>$ <userinput>make</userinput></screen>
  320. </para>
  321. </listitem>
  322. <listitem>
  323. <para>Install it as root (by default to prefix
  324. <filename>/usr/local/</filename>):
  325. <screen>$ <userinput>make install</userinput></screen>
  326. </para>
  327. </listitem>
  328. <listitem>
  329. <para>Change directory to the install prefix (by default
  330. <filename>/usr/local/</filename>):
  331. <screen>$ <userinput>cd /usr/local/</userinput></screen>
  332. </para>
  333. </listitem>
  334. <listitem>
  335. <para>Create a user for yourself:
  336. <screen>$ <userinput>sbin/b10-cmdctl-usermgr add root</userinput></screen>
  337. and enter a newly chosen password when prompted.
  338. </para>
  339. </listitem>
  340. <listitem>
  341. <para>Start the server (as root):
  342. <screen>$ <userinput>sbin/bind10</userinput></screen>
  343. </para>
  344. </listitem>
  345. <listitem>
  346. <para>DHCP components are not started in the default
  347. configuration. In another console, enable the DHCPv6
  348. service (by using the <command>bindctl</command> utility
  349. to configure the <command>b10-dhcp6</command> component to
  350. run): <screen>$ <userinput>bin/bindctl</userinput></screen>
  351. (Login with the username and password you used above to create a user.)
  352. <screen>
  353. &gt; <userinput>config add Init/components b10-dhcp6</userinput>
  354. <!-- todo: Should the kind be needed or dispensable? -->
  355. &gt; <userinput>config set Init/components/b10-dhcp6/kind dispensable</userinput>
  356. &gt; <userinput>config commit</userinput>
  357. &gt; <userinput>quit</userinput>
  358. </screen>
  359. </para>
  360. </listitem>
  361. <listitem>
  362. <para>Test it; for example, use the
  363. <ulink url="http://www.isc.org/downloads/DHCP/">ISC DHCP client</ulink>
  364. to send DHCPv6 queries to the server and verify that the client receives a
  365. configuration from the server:
  366. <screen>$ <userinput>dhclient -6</userinput></screen>
  367. </para>
  368. </listitem>
  369. </orderedlist>
  370. </section>
  371. </chapter>
  372. <chapter id="installation">
  373. <title>Installation</title>
  374. <section id="packages">
  375. <title>Packages</title>
  376. <para>
  377. Some operating systems or software package vendors may
  378. provide ready-to-use, pre-built software packages for Kea.
  379. Installing a pre-built package means you do not need to
  380. install build-only prerequisites and do not need to
  381. <emphasis>make</emphasis> the software.
  382. </para>
  383. <para>
  384. FreeBSD ports, NetBSD pkgsrc, and Debian
  385. <emphasis>testing</emphasis> package collections provide
  386. all the prerequisite packages.
  387. </para>
  388. </section>
  389. <section id="install-hierarchy">
  390. <title>Install Hierarchy</title>
  391. <para>
  392. The following is the standard, common layout of the
  393. complete Kea installation:
  394. <itemizedlist>
  395. <listitem>
  396. <simpara>
  397. <filename>bin/</filename> &mdash;
  398. general tools and diagnostic clients.
  399. </simpara>
  400. </listitem>
  401. <listitem>
  402. <simpara>
  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. <filename>libexec/bind10/</filename> &mdash;
  416. executables that a user wouldn't normally run directly and
  417. are not run independently.
  418. These are the BIND 10 and Kea modules which are daemons started by
  419. the <command>b10-init</command> master process.
  420. </simpara>
  421. </listitem>
  422. <listitem>
  423. <simpara>
  424. <filename>sbin/</filename> &mdash;
  425. commands used by the system administrator.
  426. </simpara>
  427. </listitem>
  428. <listitem>
  429. <simpara>
  430. <filename>share/bind10/</filename> &mdash;
  431. configuration specifications.
  432. </simpara>
  433. </listitem>
  434. <listitem>
  435. <simpara>
  436. <filename>share/doc/bind10/</filename> &mdash;
  437. this guide and other supplementary documentation.
  438. </simpara>
  439. </listitem>
  440. <listitem>
  441. <simpara>
  442. <filename>share/man/</filename> &mdash;
  443. manual pages (online documentation).
  444. </simpara>
  445. </listitem>
  446. <listitem>
  447. <simpara>
  448. <filename>var/bind10/</filename> &mdash;
  449. data source and configuration databases.
  450. </simpara>
  451. </listitem>
  452. </itemizedlist>
  453. </para>
  454. </section>
  455. <section id="build-requirements">
  456. <title>Building Requirements</title>
  457. <para>
  458. In addition to the run-time requirements (listed in
  459. <xref linkend="required-software"/>), building Kea
  460. from source code requires various development include headers and
  461. program development tools.
  462. </para>
  463. <note>
  464. <simpara>
  465. Some operating systems have split their distribution packages into
  466. a run-time and a development package. You will need to install
  467. the development package versions, which include header files and
  468. libraries, to build Kea from source code.
  469. </simpara>
  470. </note>
  471. <para>
  472. Building from source code requires the Boost
  473. build-time headers
  474. (<ulink url="http://www.boost.org/"/>).
  475. At least Boost version 1.35 is required.
  476. <!-- TODO: we don't check for this version -->
  477. <!-- NOTE: jreed has tested with 1.34, 1.38, and 1.41. -->
  478. </para>
  479. <para>
  480. To build Kea, also install the Botan (at least version
  481. 1.8) and the log4cplus (at least version 1.0.3)
  482. development include headers.
  483. </para>
  484. <!--
  485. TODO
  486. Debian and Ubuntu:
  487. libgmp3-dev and libbz2-dev required for botan too
  488. -->
  489. <!-- NOTE: _sqlite3 is only needed at test time; it is already listed
  490. as a dependency earlier -->
  491. <para>
  492. Building Kea also requires a C++ compiler and
  493. standard development headers, make, and pkg-config.
  494. Kea builds have been tested with GCC g++ 3.4.3, 4.1.2,
  495. 4.1.3, 4.2.1, 4.3.2, and 4.4.1; Clang++ 2.8; and Sun C++ 5.10.
  496. </para>
  497. <para>
  498. Visit the user-contributed wiki at <ulink
  499. url="http://kea.isc.org/wiki/SystemSpecificNotes" />
  500. for system-specific installation tips.
  501. </para>
  502. </section>
  503. <section id="install">
  504. <title>Installation from source</title>
  505. <para>
  506. Kea is open source software written in C++ (some components of the
  507. BIND 10 framework are written in Python).
  508. It is freely available in source code form from ISC as a
  509. downloadable tar file or via Kea Git code revision control
  510. service. (It may also be available in pre-compiled ready-to-use
  511. packages from operating system vendors.)
  512. </para>
  513. <section>
  514. <title>Download Tar File</title>
  515. <para>
  516. Kea 0.8 is available as a part of BIND10 1.2 release, which is
  517. a final release of BIND10 from ISC. This release can be downloaded
  518. from: <ulink url="ftp://ftp.isc.org/isc/bind10/"/>.
  519. </para>
  520. </section>
  521. <section>
  522. <title>Retrieve from Git</title>
  523. <para>
  524. Downloading this "bleeding edge" code is recommended only for
  525. developers or advanced users. Using development code in a production
  526. environment is not recommended.
  527. </para>
  528. <note>
  529. <para>
  530. When using source code retrieved via Git, additional
  531. software will be required: automake (v1.11 or newer),
  532. libtoolize, and autoconf (2.59 or newer).
  533. These may need to be installed.
  534. </para>
  535. </note>
  536. <para>
  537. The latest development code (and temporary experiments
  538. and un-reviewed code) is available via the Kea code revision
  539. control system. This is powered by Git and all the Kea
  540. development is public.
  541. The leading development is done in the <quote>master</quote>
  542. branch.
  543. </para>
  544. <para>
  545. The code can be checked out from
  546. <filename>git://git.kea.isc.org/kea</filename>;
  547. for example:
  548. <screen>$ <userinput>git clone git://git.kea.isc.org/kea</userinput></screen>
  549. </para>
  550. <para>
  551. When checking out the code from
  552. the code version control system, it doesn't include the
  553. generated configure script, Makefile.in files, nor their
  554. related build files.
  555. They can be created by running <command>autoreconf</command>
  556. with the <option>--install</option> switch.
  557. This will run <command>autoconf</command>,
  558. <command>aclocal</command>,
  559. <command>libtoolize</command>,
  560. <command>autoheader</command>,
  561. <command>automake</command>,
  562. and related commands.
  563. </para>
  564. </section>
  565. <section id="configure">
  566. <title>Configure before the build</title>
  567. <para>
  568. Kea uses the GNU Build System to discover build environment
  569. details.
  570. To generate the makefiles using the defaults, simply run:
  571. <screen>$ <userinput>./configure</userinput></screen>
  572. </para>
  573. <para>
  574. Run <command>./configure</command> with the <option>--help</option>
  575. switch to view the different options. Some commonly-used options are:
  576. <variablelist>
  577. <varlistentry>
  578. <term>--prefix</term>
  579. <listitem>
  580. <simpara>Define the installation location (the
  581. default is <filename>/usr/local/</filename>).
  582. </simpara>
  583. </listitem>
  584. </varlistentry>
  585. <varlistentry>
  586. <term>--with-boost-include</term>
  587. <listitem>
  588. <simpara>Define the path to find the Boost headers.
  589. </simpara>
  590. </listitem>
  591. </varlistentry>
  592. <varlistentry>
  593. <term>--with-pythonpath</term>
  594. <listitem>
  595. <simpara>Define the path to Python 3.1 if it is not in the
  596. standard execution path.
  597. </simpara>
  598. </listitem>
  599. </varlistentry>
  600. <varlistentry>
  601. <term>--with-gtest</term>
  602. <listitem>
  603. <simpara>Enable building the C++ Unit Tests using the
  604. Google Tests framework. Optionally this can define the
  605. path to the gtest header files and library.
  606. </simpara>
  607. </listitem>
  608. </varlistentry>
  609. <varlistentry>
  610. <term>--without-werror</term>
  611. <listitem>
  612. <simpara>Disable the default use of the
  613. <option>-Werror</option> compiler flag so that
  614. compiler warnings aren't build failures.
  615. </simpara>
  616. </listitem>
  617. </varlistentry>
  618. </variablelist>
  619. <note>
  620. <para>
  621. For additional instructions concerning the building and installation of
  622. Kea for various databases, see <xref linkend="dhcp-install-configure"/>.
  623. For additional instructions concerning configuration backends, see
  624. <xref linkend="dhcp-config-backend" />.
  625. </para>
  626. </note>
  627. </para>
  628. <!-- TODO: lcov -->
  629. <para>
  630. For example, the following configures it to
  631. find the Boost headers, find the
  632. Python interpreter, and sets the installation location:
  633. <screen>$ <userinput>./configure \
  634. --with-boost-include=/usr/pkg/include \
  635. --with-pythonpath=/usr/pkg/bin/python3.1 \
  636. --prefix=/opt/bind10</userinput></screen>
  637. </para>
  638. <para>
  639. If the configure fails, it may be due to missing or old
  640. dependencies.
  641. </para>
  642. </section>
  643. <section>
  644. <title>Build</title>
  645. <para>
  646. After the configure step is complete, to build the executables
  647. from the C++ code and prepare the Python scripts, run:
  648. <screen>$ <userinput>make</userinput></screen>
  649. </para>
  650. </section>
  651. <section>
  652. <title>Install</title>
  653. <para>
  654. To install the Kea executables, support files,
  655. and documentation, run:
  656. <screen>$ <userinput>make install</userinput></screen>
  657. </para>
  658. <para>
  659. Please don't use any form of parallel or job server options
  660. (such as GNU make's <command>-j</command> option) when
  661. performing this step. Doing so may cause errors.
  662. </para>
  663. <note>
  664. <para>The install step may require superuser privileges.</para>
  665. </note>
  666. <para>
  667. If required, run <command>ldconfig</command> as root with
  668. <filename>/usr/local/lib</filename> (or with ${prefix}/lib if
  669. configured with --prefix) in
  670. <filename>/etc/ld.so.conf</filename> (or the relevant linker
  671. cache configuration file for your OS):
  672. <screen>$ <userinput>ldconfig</userinput></screen>
  673. </para>
  674. <note>
  675. <para>
  676. If you do not run <command>ldconfig</command> where it is
  677. required, you may see errors like the following:
  678. <screen>
  679. program: error while loading shared libraries: libkea-something.so.1:
  680. cannot open shared object file: No such file or directory
  681. </screen>
  682. </para>
  683. </note>
  684. </section>
  685. <!-- TODO: tests -->
  686. </section>
  687. <!--
  688. <section id="install.troubleshooting">
  689. <title>Troubleshooting</title>
  690. <para>
  691. </para>
  692. </section>
  693. -->
  694. </chapter>
  695. <chapter id="bind10">
  696. <title>Starting Kea with <command>bind10</command></title>
  697. <para>
  698. Kea is started with the <command>bind10</command> command.
  699. It runs the <command>b10-init</command> daemon which
  700. starts up the required processes, and
  701. will also restart some processes that exit unexpectedly.
  702. <command>bind10</command> is the only command needed to start Kea.
  703. </para>
  704. <para>
  705. After starting the <command>b10-msgq</command> communications channel,
  706. <command>b10-init</command> connects to it,
  707. runs the configuration manager, and reads its own configuration.
  708. Then it starts the other modules.
  709. </para>
  710. <para>
  711. The <command>b10-sockcreator</command>, <command>b10-msgq</command> and
  712. <command>b10-cfgmgr</command>
  713. services make up the core. The <command>b10-msgq</command> daemon
  714. provides the communication channel between every part of the system.
  715. The <command>b10-cfgmgr</command> daemon is always needed by every
  716. module, if only to send information about themselves somewhere,
  717. but more importantly to ask about their own settings, and
  718. about other modules. The <command>b10-sockcreator</command> daemon
  719. can allocate Internet addresses and ports needed by network services
  720. but is currently unused by DHCP servers.
  721. </para>
  722. <para>
  723. In its default configuration, the <command>b10-init</command>
  724. master process will also start up
  725. <command>b10-cmdctl</command> for administration tools to
  726. communicate with the system, and
  727. <command>b10-stats</command> for statistics collection.
  728. The DHCP servers are not started by default.
  729. The configuration of components to start is covered in
  730. <xref linkend="kea.components"/>.
  731. </para>
  732. <section id="start">
  733. <title>Starting Kea</title>
  734. <para>
  735. To start the BIND 10 service, simply run <command>bind10</command>
  736. as root.
  737. It will run in the foreground and your shell prompt will not
  738. be available. It will output various log messages as it starts up
  739. and is used.
  740. Run it with the <option>--verbose</option> switch to
  741. get additional debugging or diagnostic output.
  742. </para>
  743. <!-- TODO: user switch -->
  744. <!-- TODO: example: nohup /usr/local/sbin/bind10 1>bind10.log 2>&1 -->
  745. <note>
  746. <para>
  747. If the setproctitle Python module is detected at start up,
  748. the process names for the Python-based daemons will be renamed
  749. to better identify them instead of just <quote>python</quote>.
  750. This is not needed on some operating systems.
  751. </para>
  752. </note>
  753. </section>
  754. </chapter>
  755. <chapter id="msgq">
  756. <title>Command channel</title>
  757. <para>
  758. The BIND 10 components use the <command>b10-msgq</command>
  759. message routing daemon to communicate with Kea components.
  760. The <command>b10-msgq</command> implements what is called the
  761. <quote>Command Channel</quote>.
  762. Processes intercommunicate by sending messages on the command
  763. channel.
  764. Example messages include shutdown, get configurations, and set
  765. configurations.
  766. This Command Channel is not used for DNS message passing.
  767. It is used only to control and monitor the BIND 10 system.
  768. </para>
  769. <para>
  770. Administrators do not communicate directly with the
  771. <command>b10-msgq</command> daemon.
  772. By default, BIND 10 uses a UNIX domain socket file named
  773. <filename>/usr/local/var/bind10/msg_socket</filename>
  774. for this interprocess communication.
  775. </para>
  776. </chapter>
  777. <chapter id="cfgmgr">
  778. <title>Configuration manager</title>
  779. <para>
  780. The configuration manager, <command>b10-cfgmgr</command>,
  781. handles all system configuration. It provides
  782. persistent storage for configuration, and notifies running
  783. modules of configuration changes.
  784. </para>
  785. <para>
  786. The <command>b10-dhcp6</command>, <command>b10-dhcp4</command> and
  787. <command>b10-dhcp-ddns</command> daemons receive their configurations
  788. from the configuration manager over the <command>b10-msgq</command>
  789. command channel.
  790. </para>
  791. <para>The administrator doesn't connect to it directly, but
  792. uses a user interface to communicate with the configuration
  793. manager via <command>b10-cmdctl</command>'s REST-ful interface.
  794. <command>b10-cmdctl</command> is covered in <xref linkend="cmdctl"/>.
  795. </para>
  796. <!-- TODO -->
  797. <note>
  798. <para>
  799. In future releases of Kea, the architecture which originates in
  800. the BIND 10 project will be replaced by the new mechanisms to start
  801. and configure Kea. The new mechanisms will use a file based
  802. configuration.
  803. </para>
  804. </note>
  805. <para>
  806. The <command>b10-cfgmgr</command> daemon can send all
  807. specifications and all current settings to the
  808. <command>bindctl</command> client (via
  809. <command>b10-cmdctl</command>).
  810. <command>b10-cfgmgr</command> relays configurations received
  811. from <command>b10-cmdctl</command> to the appropriate modules.
  812. </para>
  813. <!-- TODO:
  814. Configuration settings for itself are defined as ConfigManager.
  815. TODO: show examples
  816. -->
  817. <!-- TODO:
  818. config changes are actually commands to cfgmgr
  819. -->
  820. <!-- TODO: what about run time config to change this? -->
  821. <!-- jelte: > config set cfgmgr/config_database <file> -->
  822. <!-- TODO: what about command line switch to change this? -->
  823. <para>
  824. The stored configuration file is at
  825. <filename>/usr/local/var/bind10/b10-config.db</filename>.
  826. (The directory is what was defined at build configure time for
  827. <option>--localstatedir</option>.
  828. The default is <filename>/usr/local/var/</filename>.)
  829. The format is loosely based on JSON and is directly parseable
  830. python, but this may change in a future version.
  831. This configuration data file is not manually edited by the
  832. administrator.
  833. </para>
  834. <!--
  835. Well the specfiles have a more fixed format (they must contain specific
  836. stuff), but those are also directly parseable python structures (and
  837. 'coincidentally', our data::element string representation is the same)
  838. loosely based on json, tweaked to be directly parseable in python, but a
  839. subset of that.
  840. wiki page is http://bind10.isc.org/wiki/DataElementDesign
  841. nope, spec files are written by module developers, and db should be done
  842. through bindctl and friends
  843. -->
  844. <para>
  845. The configuration manager does not have any command line arguments.
  846. Normally it is not started manually, but is automatically
  847. started using the <command>b10-init</command> master process
  848. (as covered in <xref linkend="bind10"/>).
  849. </para>
  850. <!-- TODO: upcoming plans:
  851. configuration for configuration manager itself. And perhaps we might
  852. change the messaging protocol, but an admin should never see any of that
  853. -->
  854. <!-- TODO: show examples, test this -->
  855. <!--
  856. , so an admin can simply run bindctl,
  857. do config show, and it shows all modules; config show >module> shows all
  858. options for that module
  859. -->
  860. </chapter>
  861. <chapter id="cmdctl">
  862. <title>Remote control daemon</title>
  863. <para>
  864. <command>b10-cmdctl</command> is the gateway between
  865. administrators and the BIND 10 system.
  866. It is a HTTPS server that uses standard HTTP Digest
  867. Authentication for username and password validation.
  868. It provides a REST-ful interface for accessing and controlling
  869. BIND 10.
  870. </para>
  871. <!-- TODO: copy examples from wiki, try with wget -->
  872. <para>
  873. When <command>b10-cmdctl</command> starts, it firsts
  874. asks <command>b10-cfgmgr</command> about what modules are
  875. running and what their configuration is (over the
  876. <command>b10-msgq</command> channel). Then it will start listening
  877. on HTTPS for clients &mdash; the user interface &mdash; such
  878. as <command>bindctl</command>.
  879. </para>
  880. <para>
  881. <command>b10-cmdctl</command> directly sends commands
  882. (received from the user interface) to the specified component.
  883. Configuration changes are actually commands to
  884. <command>b10-cfgmgr</command> so are sent there.
  885. </para>
  886. <!--
  887. TODO:
  888. "For bindctl to list a module's available configurations and
  889. available commands, it communicates over the cmdctl REST interface.
  890. cmdctl then asks cfgmgr over the msgq command channel. Then cfgmgr
  891. asks the module for its specification and also cfgmgr looks in its
  892. own configuration database for current values."
  893. (05:32:03) jelte: i think cmdctl doesn't request it upon a incoming
  894. GET, but rather requests it once and then listens in for updates,
  895. but you might wanna check with likun
  896. -->
  897. <!-- TODO: replace /usr/local -->
  898. <!-- TODO: permissions -->
  899. <para>The HTTPS server requires a private key,
  900. such as a RSA PRIVATE KEY.
  901. The default location is at
  902. <filename>/usr/local/etc/bind10/cmdctl-keyfile.pem</filename>.
  903. (A sample key is at
  904. <filename>/usr/local/share/bind10/cmdctl-keyfile.pem</filename>.)
  905. It also uses a certificate located at
  906. <filename>/usr/local/etc/bind10/cmdctl-certfile.pem</filename>.
  907. (A sample certificate is at
  908. <filename>/usr/local/share/bind10/cmdctl-certfile.pem</filename>.)
  909. This may be a self-signed certificate or purchased from a
  910. certification authority.
  911. </para>
  912. <note><para>
  913. The HTTPS server doesn't support a certificate request from a
  914. client (at this time).
  915. <!-- TODO: maybe allow request from server side -->
  916. The <command>b10-cmdctl</command> daemon does not provide a
  917. public service. If any client wants to control BIND 10, then
  918. a certificate needs to be first received from the BIND 10
  919. administrator.
  920. The Kea installation provides a sample PEM bundle that matches
  921. the sample key and certificate.
  922. </para></note>
  923. <!-- TODO: cross-ref -->
  924. <!-- TODO
  925. openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes
  926. but that is a single file, maybe this should go back to that format?
  927. -->
  928. <!--
  929. <para>
  930. (08:20:56) shane: It is in theory possible to run without cmdctl.
  931. (08:21:02) shane: I think we discussed this.
  932. </para>
  933. -->
  934. <!-- TODO: Please check https://bind10.isc.org/wiki/cmd-ctrld -->
  935. <para>
  936. The <command>b10-cmdctl</command> daemon also requires
  937. the user account file located at
  938. <filename>/usr/local/etc/bind10/cmdctl-accounts.csv</filename>.
  939. This comma-delimited file lists the accounts with a user name,
  940. hashed password, and salt.
  941. </para>
  942. <para>
  943. The administrator may create a user account with the
  944. <command>b10-cmdctl-usermgr</command> tool.
  945. </para>
  946. <!-- TODO: show example -->
  947. <!-- TODO: does cmdctl need to be restarted to change cert or key
  948. or accounts database -->
  949. <para>
  950. By default the HTTPS server listens on the localhost port 8080.
  951. The port can be set by using the <option>--port</option> command line option.
  952. The address to listen on can be set using the <option>--address</option> command
  953. line argument.
  954. Each HTTPS connection is stateless and times out in 1200 seconds
  955. by default. This can be
  956. redefined by using the <option>--idle-timeout</option> command line argument.
  957. </para>
  958. <section id="cmdctl.spec">
  959. <title>Configuration specification for b10-cmdctl</title>
  960. <para>
  961. The configuration items for <command>b10-cmdctl</command> are:
  962. <varname>accounts_file</varname> which defines the path to the
  963. user accounts database (the default is
  964. <filename>/usr/local/etc/bind10/cmdctl-accounts.csv</filename>);
  965. <varname>cert_file</varname> which defines the path to the
  966. PEM certificate file (the default is
  967. <filename>/usr/local/etc/bind10/cmdctl-certfile.pem</filename>);
  968. and
  969. <varname>key_file</varname> which defines the path to the
  970. PEM private key file (the default is
  971. <filename>/usr/local/etc/bind10/cmdctl-keyfile.pem</filename>).
  972. </para>
  973. </section>
  974. <!--
  975. TODO
  976. (12:21:30) jinmei: I'd like to have sample session using a command line www client such as wget
  977. -->
  978. </chapter>
  979. <chapter id="bindctl">
  980. <title>Control and configure user interface</title>
  981. <note><para>
  982. <command>bindctl</command> has an internal command history, as
  983. well as tab-completion for most of the commands and arguments.
  984. However, these are only enabled if the python readline module
  985. is available on the system. If not, neither of these
  986. features will be supported.
  987. </para></note>
  988. <para>
  989. The <command>bindctl</command> tool provides an interactive
  990. prompt for configuring, controlling, and querying the Kea
  991. components.
  992. It communicates directly with a REST-ful interface over HTTPS
  993. provided by <command>b10-cmdctl</command>. It doesn't
  994. communicate to any other components directly.
  995. </para>
  996. <section id="bindctl_commandline_options">
  997. <title>bindctl command-line options</title>
  998. <variablelist>
  999. <varlistentry>
  1000. <term>-a <replaceable>&lt;address&gt;</replaceable>, --address=<replaceable>&lt;address&gt;</replaceable></term>
  1001. <listitem>
  1002. <simpara>
  1003. IP address that BIND 10's <command>b10-cmdctl</command>
  1004. module is listening on. By default, this is 127.0.0.1.
  1005. </simpara>
  1006. </listitem>
  1007. </varlistentry>
  1008. <varlistentry>
  1009. <term>-c <replaceable>&lt;certificate file&gt;</replaceable>, --certificate-chain=<replaceable>&lt;certificate file&gt;</replaceable></term>
  1010. <listitem>
  1011. <simpara>
  1012. PEM-formatted server certificate file. When this option is
  1013. given, <command>bindctl</command> will verify the server
  1014. certificate using the given file as the root of the
  1015. certificate chain. If not specified, <command>bindctl
  1016. </command> does not validate the certificate.
  1017. </simpara>
  1018. </listitem>
  1019. </varlistentry>
  1020. <varlistentry>
  1021. <term>--csv-file-dir=<replaceable>&lt;csv file&gt;</replaceable></term>
  1022. <listitem>
  1023. <simpara>
  1024. <command>bindctl</command> stores the username and
  1025. password for logging in in a file called
  1026. <filename>default_user.csv</filename>;
  1027. this option specifies the directory where this file is
  1028. stored and read from. When not specified,
  1029. <filename>~/.bind10/</filename> is used.
  1030. <note>Currently, this file contains an unencrypted password.</note>
  1031. </simpara>
  1032. </listitem>
  1033. </varlistentry>
  1034. <varlistentry>
  1035. <term>-h, --help</term>
  1036. <listitem>
  1037. <simpara>
  1038. Shows a short overview of the command-line options of
  1039. <command>bindctl</command>, and exits.
  1040. </simpara>
  1041. </listitem>
  1042. </varlistentry>
  1043. <varlistentry>
  1044. <term>--version</term>
  1045. <listitem>
  1046. <simpara>
  1047. Shows the version of <command>bindctl</command>, and exits.
  1048. </simpara>
  1049. </listitem>
  1050. </varlistentry>
  1051. <varlistentry>
  1052. <term>-p <replaceable>&lt;port number&gt;</replaceable>, --port=<replaceable>&lt;port number&gt;</replaceable></term>
  1053. <listitem>
  1054. <simpara>
  1055. Port number that BIND 10's <command>b10-cmdctl</command>
  1056. module is listening on. By default, this is port 8080.
  1057. </simpara>
  1058. </listitem>
  1059. </varlistentry>
  1060. </variablelist>
  1061. </section>
  1062. <section id="bindctl_general_syntax">
  1063. <title>General syntax of bindctl commands</title>
  1064. The <command>bindctl</command> tool is an interactive
  1065. command-line tool, with dynamic commands depending on the
  1066. BIND 10 modules that are running. There are a number of
  1067. fixed commands that have no module and that are always
  1068. available.
  1069. The general syntax of a command is
  1070. <screen><userinput>&lt;module&gt; &lt;command&gt; <replaceable>[argument(s)]</replaceable></userinput></screen>
  1071. For example, the Init module has a 'shutdown' command to shut down
  1072. BIND 10, with an optional argument 'help':
  1073. <screen>&gt; <userinput>Init shutdown help</userinput>
  1074. Command shutdown (Shut down BIND 10 and Kea)
  1075. help (Get help for command)
  1076. This command has no parameters
  1077. </screen>
  1078. There are no mandatory arguments, only the optional 'help'.
  1079. </section>
  1080. <section id="bindctl_help">
  1081. <title>Bindctl help</title>
  1082. <command>help</command> is both a command and an option that is available to all other commands. When run as a command directly, it shows the available modules.
  1083. <screen>&gt; <userinput>help</userinput>
  1084. usage: &lt;module name&gt; &lt;command name&gt; [param1 = value1 [, param2 = value2]]
  1085. Type Tab character to get the hint of module/command/parameters.
  1086. Type "help(? h)" for help on bindctl.
  1087. Type "&lt;module_name&gt; help" for help on the specific module.
  1088. Type "&lt;module_name&gt; &lt;command_name&gt; help" for help on the specific command.
  1089. Available module names:
  1090. <emphasis>(list of modules)</emphasis>
  1091. </screen>
  1092. When 'help' is used as a command to a module, it shows the supported commands for the module; for example:
  1093. <screen>&gt; <userinput>Init help</userinput>
  1094. Module Init Master process
  1095. Available commands:
  1096. help Get help for module.
  1097. shutdown Shut down BIND10 and Kea
  1098. ping Ping the Init process
  1099. show_processes
  1100. List the running BIND10 and Kea processes
  1101. </screen>
  1102. And when added to a module command, it shows the description and parameters of that specific command; for example:
  1103. <screen>&gt; <userinput>DhcpDdns shutdown help</userinput>
  1104. Command shutdown (Shuts down b10-dhcp-ddns module server.)
  1105. help (Get help for command)
  1106. Parameters:
  1107. type (string, optional)
  1108. values: normal (default), now, or drain_first
  1109. </screen>
  1110. </section>
  1111. <section id="bindctl_command_arguments">
  1112. <title>Command arguments</title>
  1113. <simpara>
  1114. Commands can have arguments, which can be either optional or
  1115. mandatory. They can be specified by name
  1116. (e.g. <command><replaceable>&lt;command&gt;</replaceable> <replaceable>&lt;argument name&gt;=&lt;argument value&gt;</replaceable></command>), or positionally,
  1117. (e.g. <command><replaceable>&lt;command&gt;</replaceable> <replaceable>&lt;argument value 1&gt;</replaceable> <replaceable>&lt;argument value 2&gt;</replaceable></command>).
  1118. </simpara>
  1119. <simpara>
  1120. <command><replaceable>&lt;command&gt;</replaceable> <replaceable>help</replaceable></command>
  1121. shows the arguments a command supports and which of those are
  1122. mandatory, and in which order the arguments are expected if
  1123. positional arguments are used.
  1124. </simpara>
  1125. <simpara>
  1126. For example, the <command>shutdown</command> command of the DhcpDdns
  1127. module, as shown in the last example of the previous section, has
  1128. one optional argument which is appended right after the command:
  1129. <screen>&gt; <userinput>DhcpDdns shutdown now</userinput></screen>
  1130. But since the class is optional (defaulting to normal), leaving it out
  1131. works as well:
  1132. <screen>&gt; <userinput>DhcpDdns shutdown</userinput></screen>
  1133. </simpara>
  1134. <simpara>
  1135. The arguments can also be provided with their names:
  1136. <screen>&gt; <userinput>DhcpDdns shutdown type="now"</userinput></screen>
  1137. </simpara>
  1138. </section>
  1139. <section id="bindctl_module_commands">
  1140. <title>Module commands</title>
  1141. Each module has its own set of commands (if any), which will only be
  1142. available if the module is running.
  1143. </section>
  1144. <section>
  1145. <title>Configuration commands</title>
  1146. Configuration commands are used to view and change the configuration
  1147. of BIND 10 and its modules. Module configuration is only shown if
  1148. that module is running, but similar to commands, there are a number
  1149. of top-level configuration items that are always available (for
  1150. instance <varname>tsig_keys</varname> and
  1151. <varname>data_sources</varname>).
  1152. Configuration changes (set, unset, add and remove) are done locally
  1153. first, and have no immediate effect. The changes can be viewed with
  1154. <command>config diff</command>, and either reverted
  1155. (<command>config revert</command>), or committed
  1156. (<command>config commit</command>).
  1157. In the latter case, all local changes are submitted
  1158. to the configuration manager, which verifies them, and if they are
  1159. accepted, applied and saved in persistent storage.
  1160. When identifying items in configuration commands, the format is
  1161. <screen><userinput>Module/example/item</userinput></screen>
  1162. Sub-elements of names, lists and sets (see <xref linkend=
  1163. "bindctl_configuration_data_types"/>) are separated with the '/'
  1164. character, and list indices are identified with [<replaceable>&lt;index&gt;</replaceable>]; for example:
  1165. <screen><userinput>Module/example/list[2]/foo</userinput></screen>
  1166. <section id="bindctl_configuration_command_list">
  1167. <title>List of configuration commands</title>
  1168. The following configuration commands are available:
  1169. <variablelist>
  1170. <varlistentry>
  1171. <term>show [all] [item name]</term>
  1172. <listitem>
  1173. <simpara>
  1174. Shows the current configuration of the given item. If 'all'
  1175. is given, it will recurse through the entire set, and show
  1176. every nested value.
  1177. </simpara>
  1178. </listitem>
  1179. </varlistentry>
  1180. <varlistentry>
  1181. <term>show_json [item name]</term>
  1182. <listitem>
  1183. <simpara>
  1184. Shows the full configuration of the given item in JSON format.
  1185. </simpara>
  1186. </listitem>
  1187. </varlistentry>
  1188. <varlistentry>
  1189. <term>add &lt;item name&gt; [value]</term>
  1190. <listitem>
  1191. <simpara>
  1192. Add an entry to configuration list or a named set (see <xref
  1193. linkend="bindctl_configuration_data_types"/>).
  1194. When adding to a list, the command has one optional
  1195. argument, a value to add to the list. The value must
  1196. be in correct JSON and complete. When adding to a
  1197. named set, it has one mandatory parameter (the name to
  1198. add), and an optional parameter value, similar to when
  1199. adding to a list. In either case, when no value is
  1200. given, an entry will be constructed with default
  1201. values.
  1202. </simpara>
  1203. </listitem>
  1204. </varlistentry>
  1205. <varlistentry>
  1206. <term>remove</term>
  1207. <listitem>
  1208. <simpara>
  1209. Remove an item from a configuration list or a named set.
  1210. When removing an item for a list, either the index needs to
  1211. be specified, or the complete value of the element to remove
  1212. must be specified (in JSON format).
  1213. </simpara>
  1214. </listitem>
  1215. </varlistentry>
  1216. <varlistentry>
  1217. <term>set &lt;item name&gt; &lt;value&gt;</term>
  1218. <listitem>
  1219. <simpara>
  1220. Directly set the value of the given item to the given value.
  1221. </simpara>
  1222. </listitem>
  1223. </varlistentry>
  1224. <varlistentry>
  1225. <term>unset &lt;item name&gt;</term>
  1226. <listitem>
  1227. <simpara>
  1228. Remove any user-specified value for the given item.
  1229. </simpara>
  1230. </listitem>
  1231. </varlistentry>
  1232. <varlistentry>
  1233. <term>diff</term>
  1234. <listitem>
  1235. <simpara>
  1236. Show all current local changes that have not been
  1237. committed yet.
  1238. </simpara>
  1239. </listitem>
  1240. </varlistentry>
  1241. <varlistentry>
  1242. <term>revert</term>
  1243. <listitem>
  1244. <simpara>
  1245. Revert all local changes without committing them.
  1246. </simpara>
  1247. </listitem>
  1248. </varlistentry>
  1249. <varlistentry>
  1250. <term>commit</term>
  1251. <listitem>
  1252. <simpara>
  1253. Send all local changes to the configuration manager, which
  1254. will validate them, and apply them if validation succeeds.
  1255. </simpara>
  1256. </listitem>
  1257. </varlistentry>
  1258. <varlistentry>
  1259. <term>go</term>
  1260. <listitem>
  1261. <simpara>
  1262. Go to a specific configuration part, similar to the 'cd'
  1263. command in a shell.
  1264. <note>There are a number of problems with the current
  1265. implementation of go within <command>bindctl</command>,
  1266. and we recommend not using it for general cases.</note>
  1267. </simpara>
  1268. </listitem>
  1269. </varlistentry>
  1270. </variablelist>
  1271. </section>
  1272. <section id="bindctl_configuration_data_types">
  1273. <title>Configuration data types</title>
  1274. Configuration data can be of different types, which can be modified
  1275. in ways that depend on the types. There are a few syntax
  1276. restrictions on these types, but only basic ones. Modules may impose
  1277. additional restrictions on the values of elements.
  1278. <variablelist>
  1279. <varlistentry>
  1280. <term>integer</term>
  1281. <listitem>
  1282. <simpara>
  1283. A basic integer; can be set directly with
  1284. <command>config set</command>, to any integer
  1285. value. The value must not be quoted, or else, it
  1286. will be parsed as a string.
  1287. </simpara>
  1288. </listitem>
  1289. </varlistentry>
  1290. <varlistentry>
  1291. <term>real</term>
  1292. <listitem>
  1293. <simpara>
  1294. A basic floating point number; can be set
  1295. directly with <command>config set</command>, to
  1296. any floating point value. The value must not be
  1297. quoted, or else, it will be parsed as a string.
  1298. </simpara>
  1299. </listitem>
  1300. </varlistentry>
  1301. <varlistentry>
  1302. <term>boolean</term>
  1303. <listitem>
  1304. <simpara>
  1305. A basic boolean value; can be set directly with
  1306. <command>config set</command>, to either
  1307. <command>true</command> or
  1308. <command>false</command>. The value must not be
  1309. quoted, or else, it will be parsed as a
  1310. string. Integer values are not allowed.
  1311. </simpara>
  1312. </listitem>
  1313. </varlistentry>
  1314. <varlistentry>
  1315. <term>string</term>
  1316. <listitem>
  1317. <simpara>
  1318. A basic string value; can be set directly with
  1319. <command>config set</command> to any
  1320. string. Double quotation marks are optional.
  1321. </simpara>
  1322. </listitem>
  1323. </varlistentry>
  1324. <varlistentry>
  1325. <term>null</term>
  1326. <listitem>
  1327. <simpara>
  1328. This is a special type representing 'no value at all'; usable in compound structures that have optional elements that are not set.
  1329. </simpara>
  1330. </listitem>
  1331. </varlistentry>
  1332. <varlistentry>
  1333. <term>maps</term>
  1334. <listitem>
  1335. <simpara>
  1336. Maps are (pre-defined) compound collections of other
  1337. elements of any other type. They are not usually
  1338. modified directly, but their elements are. Every
  1339. top-level element for a module is a map containing
  1340. the configuration values for that map, which can
  1341. themselves be maps again.
  1342. </simpara>
  1343. <simpara>
  1344. Some map entries are optional. If they are, and
  1345. currently have a value, the value can be unset by
  1346. using either <command>config unset
  1347. <replaceable>&lt;item name&gt;</replaceable>
  1348. </command> or <command>config set
  1349. <replaceable>&lt;item name&gt;</replaceable>
  1350. null</command>.
  1351. </simpara>
  1352. <simpara>
  1353. Maps <emphasis>can</emphasis> be modified as a whole,
  1354. but using the full JSON representation of
  1355. the entire map to set.
  1356. Since this involves a lot of text, this is usually
  1357. not recommended.
  1358. </simpara>
  1359. <simpara>
  1360. Another example is the Logging virtual module, which
  1361. is, like any module, a map, but it only contains one
  1362. element: a list of loggers. Normally, an
  1363. administrator would only modify that list (or its
  1364. elements) directly, but it is possible to set the
  1365. entire map in one command; for example:
  1366. <command> config set Logging { "loggers": [] } </command>
  1367. </simpara>
  1368. </listitem>
  1369. </varlistentry>
  1370. <varlistentry>
  1371. <term>list</term>
  1372. <listitem>
  1373. <simpara>
  1374. A list is a compound list of other elements of the
  1375. same type. Elements can be added with <command>config
  1376. add <replaceable>&lt;list name&gt; [value]</replaceable></command>, and removed with
  1377. <command>config remove <replaceable>&lt;list name&gt; [value]</replaceable></command> or
  1378. <command>config remove <replaceable>&lt;list name&gt;</replaceable><replaceable>&lt;index&gt;</replaceable></command>.
  1379. The index is of the form <emphasis>square bracket, number,
  1380. square bracket</emphasis> (e.g.
  1381. <command>[0]</command>), and it immediately follows
  1382. the list name (there is no separator or space
  1383. between them). List indices start with 0 for the
  1384. first element.
  1385. </simpara>
  1386. <simpara>
  1387. For addition, if the value is omitted, an entry with
  1388. default values will be added. For removal, either
  1389. the index or the full value (in JSON format) needs
  1390. to be specified.
  1391. </simpara>
  1392. <simpara>
  1393. Lists can also be used with
  1394. <command>config set</command>,
  1395. but like maps, only by specifying the
  1396. entire list value in JSON format.
  1397. </simpara>
  1398. <simpara>
  1399. For example, this command shows the renew-timer used for the second element of the list <varname>subnet4</varname> in the Dhcp4 module:
  1400. <command>config show Dhcp4/subnet4[1]/renew-timer</command>
  1401. </simpara>
  1402. </listitem>
  1403. </varlistentry>
  1404. <varlistentry>
  1405. <term>named set</term>
  1406. <listitem>
  1407. <simpara>
  1408. Named sets are similar to lists, in that they are
  1409. sets of elements of the same type, but they are not
  1410. indexed by numbers, but by strings.
  1411. </simpara>
  1412. <simpara>
  1413. Values can be added with
  1414. <command>config add <replaceable>&lt;item name&gt; &lt;string&gt; [value]</replaceable></command>
  1415. where 'string' is the name of the element. If 'value'
  1416. is ommitted, default values will be used. Elements
  1417. can be removed with <command>config remove
  1418. <replaceable>&lt;item
  1419. name&gt; &lt;string&gt;</replaceable></command>
  1420. </simpara>
  1421. <simpara>
  1422. Elements in a named set can be addressed similarly
  1423. to maps.
  1424. </simpara>
  1425. <simpara>
  1426. For example, the <command>Init/components</command>
  1427. elements is a named set;
  1428. adding, showing, and then removing an element
  1429. can be done with the following three commands (note
  1430. the '/'-character versus the space before
  1431. 'example_module'):
  1432. </simpara>
  1433. <simpara>
  1434. <command>config add Init/components example_module</command>
  1435. </simpara>
  1436. <simpara>
  1437. <command>config show Init/components/example_module</command>
  1438. </simpara>
  1439. <simpara>
  1440. <command>config remove Init/components example_module</command>
  1441. </simpara>
  1442. </listitem>
  1443. </varlistentry>
  1444. <varlistentry>
  1445. <term>any</term>
  1446. <listitem>
  1447. <simpara>
  1448. The 'any' type is a special type that can have any
  1449. form. Apart from that, it must consist of elements as
  1450. described in this chapter, there is no restriction
  1451. on which element types are used. This type is used
  1452. in places where different data formats could be
  1453. used. Element modification commands depend on the
  1454. actual type of the value. For instance, if the value
  1455. of an 'any' element is a list, <command>config add
  1456. </command> and <command>config remove</command> work
  1457. as for other lists.
  1458. </simpara>
  1459. </listitem>
  1460. </varlistentry>
  1461. </variablelist>
  1462. </section>
  1463. </section>
  1464. <section>
  1465. <title>The execute command</title>
  1466. The <command>execute</command> command executes a set of commands,
  1467. either from a file
  1468. or from a pre-defined set. Currently, there are no pre-defined sets
  1469. available.
  1470. <screen>&gt; <userinput>execute file /tmp/example_commands</userinput></screen>
  1471. The optional <command>show</command> argument may be used when
  1472. executing a script from a file; for example:
  1473. <screen>&gt; <userinput>execute file /tmp/example_commands show</userinput></screen>
  1474. <section id="bindctl_execute_directives">
  1475. <title>Execute directives</title>
  1476. Within sets of commands to be run with the <command>execute</command>
  1477. command, a number of directives are supported:
  1478. <variablelist>
  1479. <varlistentry>
  1480. <term>!echo <replaceable>&lt;string&gt;</replaceable></term>
  1481. <listitem>
  1482. <simpara>
  1483. Prints the given string to <command>bindctl</command>'s
  1484. output.
  1485. </simpara>
  1486. </listitem>
  1487. </varlistentry>
  1488. <varlistentry>
  1489. <term>!verbose on</term>
  1490. <listitem>
  1491. <simpara>
  1492. Enables verbose mode; all following commands that are to
  1493. be executed are also printed.
  1494. </simpara>
  1495. </listitem>
  1496. </varlistentry>
  1497. <varlistentry>
  1498. <term>!verbose off</term>
  1499. <listitem>
  1500. <simpara>
  1501. Disables verbose mode; following commands that are to
  1502. be executed are no longer printed.
  1503. </simpara>
  1504. </listitem>
  1505. </varlistentry>
  1506. </variablelist>
  1507. </section>
  1508. <section id="bindctl_execute_notes">
  1509. <title>Notes on execute scripts</title>
  1510. Within scripts, you can add or remove modules with the normal
  1511. configuration commands for <command>Init/components</command>.
  1512. However, as module
  1513. configuration and commands do not show up until the module is
  1514. running, it is currently not possible to add a module and set
  1515. its configuration in one script. This will be addressed in the
  1516. future, but for now the only option is to add and configure
  1517. modules in separate commands and execute scripts.
  1518. </section>
  1519. </section>
  1520. </chapter>
  1521. <chapter id="bind10.config">
  1522. <title>bind10 Control and Configuration</title>
  1523. <para>
  1524. This chapter explains how to control and configure the
  1525. <command>b10-init</command> parent.
  1526. The startup of this resident process that runs the BIND 10
  1527. daemons is covered in <xref linkend="bind10"/>.
  1528. </para>
  1529. <section id="bind10.shutdown">
  1530. <title>Stopping bind10</title>
  1531. <para>
  1532. The BIND 10 suite may be shut down by stopping the
  1533. parent <command>b10-init</command> process. This may be done
  1534. by running the <userinput>Init shutdown</userinput> command
  1535. at the <command>bindctl</command> prompt.
  1536. </para>
  1537. </section>
  1538. <section id="kea.components">
  1539. <title>Configuration to start processes</title>
  1540. <para>
  1541. The processes to be used can be configured for
  1542. <command>b10-init</command> to start, with the exception
  1543. of the required <command>b10-sockcreator</command>,
  1544. <command>b10-msgq</command> and <command>b10-cfgmgr</command>
  1545. components.
  1546. The configuration is in the <varname>Init/components</varname>
  1547. section. Each element represents one component, which is
  1548. an abstraction of a process.
  1549. </para>
  1550. <para>
  1551. To add a process to the set, let's say the DHCPv6 server (which
  1552. is not started by default), you would do this:
  1553. <screen>&gt; <userinput>config add Init/components b10-dhcp6</userinput>
  1554. &gt; <userinput>config set Init/components/b10-dhcp6/kind needed</userinput>
  1555. &gt; <userinput>config set Init/components/b10-dhcp6/priority 10</userinput>
  1556. &gt; <userinput>config commit</userinput></screen></para>
  1557. <para>
  1558. Now, what it means. We add an entry called
  1559. <quote>b10-dhcp6</quote>. It is both a name used to
  1560. reference this component in the configuration and the name
  1561. of the process to start. Then we set some parameters on
  1562. how to start it.
  1563. </para>
  1564. <para>
  1565. The <varname>special</varname> (not used in the example above), was introduced
  1566. to be used for the components which require some kind of special care
  1567. during startup. One such component is the b10-cmdctl, which is always started
  1568. by default. No other components use this setting and it should be left unset
  1569. for them.
  1570. </para>
  1571. <para>
  1572. The <varname>kind</varname> specifies how a failure of the
  1573. component should be handled. If it is set to
  1574. <quote>dispensable</quote> (the default unless you set
  1575. something else), it will get started again if it fails. If
  1576. it is set to <quote>needed</quote> and it fails at startup,
  1577. the whole <command>b10-init</command> shuts down and exits
  1578. with an error exit code. But if it fails some time later, it
  1579. is just started again. If you set it to <quote>core</quote>,
  1580. you indicate that the system is not usable without the
  1581. component and if such component fails, the system shuts
  1582. down no matter when the failure happened. This is the
  1583. behavior of the core components (the ones you can't turn
  1584. off), but you can declare any other components as core as
  1585. well if you wish (but you can turn these off, they just
  1586. can't fail).
  1587. </para>
  1588. <para>
  1589. The <varname>priority</varname> defines order in which the
  1590. components should start. The ones with higher numbers are
  1591. started sooner than the ones with lower ones. If you don't
  1592. set it, 0 (zero) is used as the priority. Usually, leaving
  1593. it at the default is enough.
  1594. </para>
  1595. <para>
  1596. There are other parameters we didn't use in our example.
  1597. One of them is <varname>address</varname>. It is the address
  1598. used by the component on the <command>b10-msgq</command>
  1599. message bus. The special components already know their
  1600. address, but the usual ones don't. The address is by
  1601. convention the thing after <emphasis>b10-</emphasis>, with
  1602. the first letter capitalized (eg. <command>b10-stats</command>
  1603. would have <quote>Stats</quote> as its address).
  1604. <!-- TODO: this should be simplified so we don't even have to document it -->
  1605. </para>
  1606. <!-- TODO: what does "The special components already know their
  1607. address, but the usual ones don't." mean? -->
  1608. <!-- TODO: document params when is enabled -->
  1609. <para>
  1610. The last one is <varname>process</varname>. It is the name
  1611. of the process to be started. It defaults to the name of
  1612. the component if not set, but you can use this to override
  1613. it. (The special components also already know their
  1614. executable name.)
  1615. </para>
  1616. <!-- TODO Add parameters when they work, not implemented yet-->
  1617. <note>
  1618. <para>
  1619. The configuration is quite powerful, but that includes
  1620. a lot of space for mistakes. You could turn off the
  1621. <command>b10-cmdctl</command>, but then you couldn't
  1622. change it back the usual way, as it would require it to
  1623. be running (you would have to find and edit the configuration
  1624. directly).
  1625. </para>
  1626. <para>
  1627. In short, you should think twice before disabling something here.
  1628. </para>
  1629. </note>
  1630. <para>
  1631. The running processes started by <command>b10-init</command>
  1632. may be listed by running <userinput>Init show_processes</userinput>
  1633. using <command>bindctl</command>.
  1634. </para>
  1635. </section>
  1636. </chapter>
  1637. <chapter id="dhcp">
  1638. <title>DHCP</title>
  1639. <para>The Dynamic Host Configuration Protocol for IPv4 (DHCP or
  1640. DHCPv4) and Dynamic Host Configuration Protocol for IPv6 (DHCPv6)
  1641. are protocols that allow one node (server) to provision
  1642. configuration parameters to many hosts and devices (clients). To
  1643. ease deployment in larger networks, additional nodes (relays) may
  1644. be deployed that facilitate communication between servers and
  1645. clients. Even though principles of both DHCPv4 and DHCPv6 are
  1646. somewhat similar, these are two radically different
  1647. protocols. Kea offers two server implementations, one for DHCPv4
  1648. and one for DHCPv6. The DHCPv4 component is colloquially referred to
  1649. as Kea4 and its DHCPv6 counterpart is called Kea6.</para>
  1650. <para> In addition to providing lease management services, both Kea4 and
  1651. Kea6 can provide dynamic DNS (DDNS) updates driven by the lease changes they
  1652. make. These updates are carried out with the assistance of the
  1653. DHCP-DDNS server, colloquially referred to as D2. When configured
  1654. to do so, Kea servers will notify D2 of lease changes. D2 will match
  1655. them to the appropriate DNS servers and instruct those severs to add or
  1656. delete the requisite DNS entries.
  1657. </para>
  1658. <para>This chapter covers those parts of Kea that are common to
  1659. both servers. DHCPv4-specific details are covered in <xref linkend="dhcp4"/>,
  1660. while those details specific to DHCPv6 are described in <xref linkend="dhcp6"/>.
  1661. The DHCP-DDNS server details are covered in <xref linkend="dhcp-ddns-server"/>
  1662. </para>
  1663. <section id="dhcp-config-backend">
  1664. <title>Selecting configuration backend</title>
  1665. <para>Kea 0.9 introduces configuration backends that are switchable during
  1666. compilation phase. There is a new parameter for configure script:
  1667. --with-kea-config. It currently supports two values: BIND10 and
  1668. JSON. This is currently only supported by DHCPv6 component.</para>
  1669. <variablelist>
  1670. <varlistentry>
  1671. <term>BIND10</term>
  1672. <listitem>
  1673. <simpara>BIND10 (which is the default value as of April 2014) means
  1674. that Kea6 is linked with the BIND10 configuration backend that
  1675. connects to the BIND10 framework and in general works exactly the
  1676. same as Kea 0.8 and earlier versions. The benefits of that backend
  1677. are uniform integration with BIND10 framework, easy on-line
  1678. reconfiguration using bindctl, available RESTful API. On the other
  1679. hand, it requires the whole heavy BIND10 framework that requires
  1680. Python3 to be present. That backend is likely to go away with the
  1681. release of Kea 0.9.</simpara>
  1682. </listitem>
  1683. </varlistentry>
  1684. <varlistentry>
  1685. <term>JSON</term>
  1686. <listitem>
  1687. <simpara>JSON is a new configuration backend that causes Kea to read
  1688. JSON configuration file from disk. It does not require any framework
  1689. and thus is considered more lightweight. It will allow dynamic
  1690. on-line reconfiguration, but will lack remote capabilities (i.e. no
  1691. RESTful API). This configuration backend is expected to be the
  1692. default for upcoming Kea 0.9.</simpara>
  1693. </listitem>
  1694. </varlistentry>
  1695. </variablelist>
  1696. </section>
  1697. <section id="dhcp-install-configure">
  1698. <title>DHCP Database Installation and Configuration</title>
  1699. <para>
  1700. Kea stores its leases in a lease database. The software has been written in
  1701. a way that makes it possible to choose which database product should be used to
  1702. store the lease information. At present, Kea supports 3 database backends: MySQL,
  1703. PostgreSQL and Memfile. To limit external dependencies, both MySQL and PostgreSQL
  1704. support are disabled by default and only Memfile (which is implemented in pure C++)
  1705. is available. Support for a given database backend must be explicitly included when
  1706. Kea is built. This section covers the building of Kea with MySQL and/or PostgreSQL
  1707. and the creation of the lease database.
  1708. </para>
  1709. <section>
  1710. <title>Building with MySQL support</title>
  1711. <para>
  1712. Install MySQL according to the instructions for your system. The client development
  1713. libraries must be installed.
  1714. </para>
  1715. <para>
  1716. Build and install Kea as described in <xref linkend="installation"/>, with
  1717. the following modification: to enable the MySQL database code, at the
  1718. "configure" step (see <xref linkend="configure"/>), specify the location of the
  1719. MySQL configuration program "mysql_config" with the "--with-dhcp-mysql" switch,
  1720. i.e.
  1721. <screen><userinput>./configure [other-options] --with-dhcp-mysql</userinput></screen>
  1722. ...if MySQL was installed in the default location, or:
  1723. <screen><userinput>./configure [other-options] --with-dhcp-mysql=<replaceable>path-to-mysql_config</replaceable></userinput></screen>
  1724. ...if not.
  1725. </para>
  1726. </section>
  1727. <section id="dhcp-mysql-database-create">
  1728. <title>Create MySQL Database and Kea User</title>
  1729. <para>
  1730. The next task is to create both the lease database and the user under which the servers will
  1731. access it. A number of steps are required:
  1732. </para>
  1733. <para>
  1734. 1. Log into MySQL as "root":
  1735. <screen>$ <userinput>mysql -u root -p</userinput>
  1736. Enter password:<userinput/>
  1737. :<userinput/>
  1738. mysql></screen>
  1739. </para>
  1740. <para>
  1741. 2. Create the database:
  1742. <screen>mysql> <userinput>CREATE DATABASE <replaceable>database-name</replaceable>;</userinput></screen>
  1743. ... <replaceable>database-name</replaceable> is the name you have chosen for the database.
  1744. </para>
  1745. <para>
  1746. 3. Create the database tables:
  1747. <screen>mysql> <userinput>CONNECT <replaceable>database-name</replaceable>;</userinput>
  1748. mysql> <userinput>SOURCE <replaceable>path-to-bind10</replaceable>/share/bind10/dhcpdb_create.mysql</userinput></screen>
  1749. </para>
  1750. <para>
  1751. 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:
  1752. <screen>mysql> <userinput>CREATE USER '<replaceable>user-name</replaceable>'@'localhost' IDENTIFIED BY '<replaceable>password</replaceable>';</userinput>
  1753. mysql> <userinput>GRANT ALL ON <replaceable>database-name</replaceable>.* TO '<replaceable>user-name</replaceable>'@'localhost';</userinput></screen>
  1754. </para>
  1755. <para>
  1756. 5. Exit MySQL:
  1757. <screen>mysql> <userinput>quit</userinput>
  1758. Bye<userinput/>
  1759. $</screen>
  1760. </para>
  1761. </section>
  1762. <section>
  1763. <title>Building with PostgreSQL support</title>
  1764. <para>
  1765. Install PostgreSQL according to the instructions for your system. The client development
  1766. libraries must be installed. Client development libraries are often packaged as &quot;libpq&quot;.
  1767. </para>
  1768. <para>
  1769. Build and install Kea as described in <xref linkend="installation"/>, with
  1770. the following modification: to enable the PostgreSQL database code, at the
  1771. "configure" step (see <xref linkend="configure"/>), specify the location of the
  1772. PostgreSQL configuration program "pg_config" with the "--with-dhcp-pgsql" switch,
  1773. i.e.
  1774. <screen><userinput>./configure [other-options] --with-dhcp-pgsql</userinput></screen>
  1775. ...if PostgreSQL was installed in the default location, or:
  1776. <screen><userinput>./configure [other-options] --with-dhcp-pgsql=<replaceable>path-to-pg_config</replaceable></userinput></screen>
  1777. ...if not.
  1778. </para>
  1779. </section>
  1780. <section id="dhcp-pgsql-database-create">
  1781. <title>Create PostgreSQL Database and Kea User</title>
  1782. <para>
  1783. The next task is to create both the lease database and the user under which the servers will
  1784. access it. A number of steps are required:
  1785. </para>
  1786. <para>
  1787. 1. Log into PostgreSQL as "root":
  1788. <screen>$ <userinput>sudo -u postgres psql postgres</userinput>
  1789. Enter password:<userinput/>
  1790. :<userinput/>
  1791. postgres=#</screen>
  1792. </para>
  1793. <para>
  1794. 2. Create the database:
  1795. <screen>
  1796. postgres=#<userinput> CREATE DATABASE <replaceable>database-name</replaceable>;</userinput>
  1797. CREATE DATABASE
  1798. postgres=#
  1799. </screen>
  1800. ... <replaceable>database-name</replaceable> is the name you have chosen for the database.
  1801. </para>
  1802. <para>
  1803. 3. Create the user under which Kea will access the database (and give it a password), then grant it access to the database:
  1804. <screen>postgres=#<userinput> CREATE USER <replaceable>user-name</replaceable> WITH PASSWORD '<replaceable>password</replaceable>';</userinput>
  1805. CREATE ROLE
  1806. postgres=#
  1807. postgres=#<userinput> GRANT ALL PRIVILEGES ON DATABASE <replaceable>database-name</replaceable> TO <replaceable>user-name</replaceable>;</userinput>
  1808. GRANT
  1809. postgres=#
  1810. </screen>
  1811. </para>
  1812. <para>
  1813. 4. Exit PostgreSQL:
  1814. <screen>postgres=# <userinput>\q</userinput>
  1815. Bye<userinput/>
  1816. $</screen>
  1817. </para>
  1818. <para>
  1819. 5. Create the database tables using the new user's credentials.
  1820. After entering the following command, you will be prompted for the new
  1821. user's password. When the command completes you will be returned to
  1822. the shell prompt. You should see output similar to following:
  1823. <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>
  1824. Password for user <replaceable>user-name</replaceable>:
  1825. CREATE TABLE
  1826. CREATE INDEX
  1827. CREATE INDEX
  1828. CREATE TABLE
  1829. CREATE INDEX
  1830. CREATE TABLE
  1831. START TRANSACTION
  1832. INSERT 0 1
  1833. INSERT 0 1
  1834. INSERT 0 1
  1835. COMMIT
  1836. CREATE TABLE
  1837. START TRANSACTION
  1838. INSERT 0 1
  1839. COMMIT
  1840. $
  1841. </screen>
  1842. </para>
  1843. <para>
  1844. If instead you encounter an error such as shown below:
  1845. </para>
  1846. <screen>
  1847. psql: FATAL: no pg_hba.conf entry for host "[local]", user "<replaceable>user-name</replaceable>", database "<replaceable>database-name</replaceable>", SSL off
  1848. </screen>
  1849. <para>
  1850. This indicates that the PostgreSQL configuration needs to be modified.
  1851. Kea uses password authentication when connecting to the database and must
  1852. have the appropriate entries added to PostgreSQL's pg_hba.conf file. This
  1853. file is normally located in the primary data directory for your PostgreSQL
  1854. server. The precise path may vary but the default location for PostgreSQL 9.3
  1855. on Centos 6.5 is:
  1856. <filename>/var/lib/pgsql/9.3/data/pg_hba.conf</filename>.
  1857. Assuming Kea is running on the same host as PostgreSQL, adding lines similar
  1858. to following should be sufficient to provide password-authenticated access to
  1859. Kea's database:
  1860. </para>
  1861. <screen>
  1862. local <replaceable>database-name</replaceable> <replaceable>user-name</replaceable> password
  1863. host <replaceable>database-name</replaceable> <replaceable>user-name</replaceable> 127.0.0.1/32 password
  1864. host <replaceable>database-name</replaceable> <replaceable>user-name</replaceable> ::1/128 password
  1865. </screen>
  1866. <para>
  1867. Please consult your PostgreSQL user manual before making these changes as they
  1868. may expose your other databases that you run on the same system.
  1869. </para>
  1870. </section>
  1871. </section>
  1872. </chapter>
  1873. <chapter id="dhcp4">
  1874. <title>The DHCPv4 Server</title>
  1875. <section id="dhcp4-start-stop">
  1876. <title>Starting and Stopping the DHCPv4 Server</title>
  1877. <para>
  1878. <command>b10-dhcp4</command> is the Kea DHCPv4 server and is configured
  1879. through the <command>bindctl</command> program.
  1880. </para>
  1881. <para>
  1882. After starting <command>bind10</command> and entering bindctl, the first step
  1883. in configuring the server is to add it to the list of running services.
  1884. <screen>
  1885. &gt; <userinput>config add Init/components b10-dhcp4</userinput>
  1886. &gt; <userinput>config set Init/components/b10-dhcp4/kind dispensable</userinput>
  1887. &gt; <userinput>config commit</userinput>
  1888. </screen>
  1889. </para>
  1890. <para>
  1891. To remove <command>b10-dhcp4</command> from the set of running services,
  1892. the <command>b10-dhcp4</command> is removed from list of Init components:
  1893. <screen>
  1894. &gt; <userinput>config remove Init/components b10-dhcp4</userinput>
  1895. &gt; <userinput>config commit</userinput>
  1896. </screen>
  1897. </para>
  1898. <para>
  1899. Note that the server was only removed from the list, so BIND10 will not
  1900. restart it, but the server itself is still running. Hence it is usually
  1901. desired to stop it:
  1902. <screen>
  1903. &gt; <userinput>Dhcp4 shutdown</userinput>
  1904. </screen>
  1905. </para>
  1906. <para>
  1907. On start-up, the server will detect available network interfaces
  1908. and will attempt to open UDP sockets on all interfaces that
  1909. are up, running, are not loopback, and have IPv4 address
  1910. assigned.
  1911. The server will then listen to incoming traffic. Currently
  1912. supported client messages are DISCOVER and REQUEST. The server
  1913. will respond to them with OFFER and ACK, respectively.
  1914. Since the DHCPv4 server opens privileged ports, it requires root
  1915. access. Make sure you run this daemon as root.
  1916. </para>
  1917. </section>
  1918. <section id="dhcp4-configuration">
  1919. <title>Configuring the DHCPv4 Server</title>
  1920. <para>
  1921. Once the server is started, it can be configured. To view the
  1922. current configuration, use the following command in <command>bindctl</command>:
  1923. <screen>
  1924. &gt; <userinput>config show Dhcp4</userinput></screen>
  1925. When starting the DHCPv4 daemon for the first time, the default configuration
  1926. will be available. It will look similar to this:
  1927. <screen>
  1928. &gt; <userinput>config show Dhcp4</userinput>
  1929. Dhcp4/hooks-libraries [] list (default)
  1930. Dhcp4/interfaces/ list
  1931. Dhcp4/renew-timer 1800 integer
  1932. Dhcp4/rebind-timer 2000 integer (default)
  1933. Dhcp4/valid-lifetime 4000 integer (default)
  1934. Dhcp4/next-server "" string (default)
  1935. Dhcp4/echo-client-id true boolean (default)
  1936. Dhcp4/option-def [] list (default)
  1937. Dhcp4/option-data [] list (default)
  1938. Dhcp4/lease-database/type "" string (default)
  1939. Dhcp4/lease-database/name "" string (default)
  1940. Dhcp4/lease-database/user "" string (default)
  1941. Dhcp4/lease-database/host "" string (default)
  1942. Dhcp4/lease-database/password "" string (default)
  1943. Dhcp4/subnet4/ list
  1944. Dhcp4/dhcp-ddns/enable-updates true boolean
  1945. Dhcp4/dhcp-ddns/server-ip "127.0.0.1" string
  1946. Dhcp4/dhcp-ddns/server-port 53001 integer
  1947. Dhcp4/dhcp-ddns/ncr-protocol "UDP" string
  1948. Dhcp4/dhcp-ddns/ncr-format "JSON" string
  1949. Dhcp4/dhcp-ddns/override-no-update false boolean
  1950. Dhcp4/dhcp-ddns/override-client-update false boolean
  1951. Dhcp4/dhcp-ddns/replace-client-name false boolean
  1952. Dhcp4/dhcp-ddns/generated-prefix "myhost" string
  1953. Dhcp4/dhcp-ddns/qualifying-suffix "example.com" string
  1954. </screen>
  1955. </para>
  1956. <para>
  1957. To change one of the parameters, simply follow
  1958. the usual <command>bindctl</command> procedure. For example, to make the
  1959. leases longer, change their valid-lifetime parameter:
  1960. <screen>
  1961. &gt; <userinput>config set Dhcp4/valid-lifetime 7200</userinput>
  1962. &gt; <userinput>config commit</userinput></screen>
  1963. Please note that most Dhcp4 parameters are of global scope
  1964. and apply to all defined subnets, unless they are overridden on a
  1965. per-subnet basis.
  1966. </para>
  1967. <section>
  1968. <title>Default storage for leases</title>
  1969. <para>
  1970. The server is able to store lease data in different repositories. Larger deployments
  1971. may elect to store leases in a database.
  1972. <xref linkend="database-configuration4"/> describes one way to do it.
  1973. By default, the server will use a CSV file rather than a database to store
  1974. lease information. One of the advantages of using a file is that it eliminates
  1975. dependency on third party database software.
  1976. </para>
  1977. <para>
  1978. The configuration of the file backend (Memfile)
  1979. is controlled through the Dhcp4/lease-database parameters. When default
  1980. parameters are used, the Memfile backend will write leases to a disk in the
  1981. [bind10-install-dir]/var/bind10/kea-leases4.csv.
  1982. </para>
  1983. <para>
  1984. It is possible to alter the default location of the lease file. The following
  1985. configuration:
  1986. <screen>
  1987. &gt; <userinput>config set Dhcp4/lease-database/type "memfile"</userinput>
  1988. &gt; <userinput>config set Dhcp4/lease-database/persist true</userinput>
  1989. &gt; <userinput>config set Dhcp4/lease-database/name "/tmp/kea-leases4.csv"</userinput>
  1990. &gt; <userinput>config commit</userinput>
  1991. </screen>
  1992. will change the default location of the lease file to /tmp/kea-leases4.csv.
  1993. </para>
  1994. <para>
  1995. The "persist" parameter controls whether the leases are written to disk.
  1996. It is strongly recommended that this parameter is set to "true" at all times
  1997. during the normal operation of the server
  1998. </para>
  1999. </section>
  2000. <section id="database-configuration4">
  2001. <title>Database Configuration</title>
  2002. <para>
  2003. All leases issued by the server are stored in the lease database. Currently
  2004. there are 3 database backends available: MySQL, PostgreSQL and memfile.
  2005. <footnote>
  2006. <para>
  2007. The server comes with an in-memory database ("memfile") configured as the default
  2008. database. This is used for internal testing and is not supported. In addition,
  2009. it does not store lease information on disk: lease information will be lost if the
  2010. server is restarted.
  2011. </para>
  2012. </footnote>, and so the server must be configured to
  2013. access the correct database with the appropriate credentials.
  2014. </para>
  2015. <note>
  2016. <para>
  2017. Database access information must be configured for the DHCPv4 server, even if
  2018. it has already been configured for the DHCPv6 server. The servers store their
  2019. information independently, so each server can use a separate
  2020. database or both servers can use the same database.
  2021. </para>
  2022. </note>
  2023. <para>
  2024. Database configuration is controlled through the Dhcp4/lease-database parameters.
  2025. The type of the database must be set to "mysql", "postgresql" or "memfile":
  2026. <screen>
  2027. &gt; <userinput>config set Dhcp4/lease-database/type "mysql"</userinput>
  2028. </screen>
  2029. Next, the name of the database is to hold the leases must be set: this is the
  2030. name used when the lease database was created (see <xref linkend="dhcp-mysql-database-create"/>
  2031. or <xref linkend="dhcp-pgsql-database-create"/>).
  2032. <screen>
  2033. &gt; <userinput>config set Dhcp4/lease-database/name "<replaceable>database-name</replaceable>"</userinput>
  2034. </screen>
  2035. If the database is located on a different system to the DHCPv4 server, the
  2036. database host name must also be specified (although note that this configuration
  2037. may have a severe impact on server performance):
  2038. <screen>
  2039. &gt; <userinput>config set Dhcp4/lease-database/host "<replaceable>remote-host-name</replaceable>"</userinput>
  2040. </screen>
  2041. The usual state of affairs will be to have the database on the same machine as the
  2042. DHCPv4 server. In this case, set the value to the empty string (this is the default):
  2043. <screen>
  2044. &gt; <userinput>config set Dhcp4/lease-database/host ""</userinput>
  2045. </screen>
  2046. </para>
  2047. <para>
  2048. Finally, the credentials of the account under which the server will access the database
  2049. should be set:
  2050. <screen>
  2051. &gt; <userinput>config set Dhcp4/lease-database/user "<replaceable>user-name</replaceable>"</userinput>
  2052. &gt; <userinput>config set Dhcp4/lease-database/password "<replaceable>password</replaceable>"</userinput>
  2053. </screen>
  2054. If there is no password to the account, set the password to the empty string "". (This is also the default.)
  2055. </para>
  2056. <note>
  2057. <para>The password is echoed when entered and is stored in clear text in the configuration
  2058. database. Improved password security will be added in a future version of Kea.</para>
  2059. </note>
  2060. </section>
  2061. <section id="dhcp4-interface-selection">
  2062. <title>Interface selection</title>
  2063. <para>
  2064. When DHCPv4 server starts up, by default it will listen to the DHCP
  2065. traffic and respond to it on all interfaces detected during startup.
  2066. However, in many cases it is desired to configure the server to listen and
  2067. respond on selected interfaces only. The sample commands in this section
  2068. show how to make interface selection using bindctl.
  2069. </para>
  2070. <para>
  2071. The default configuration can be presented with the following command:
  2072. <screen>
  2073. &gt; <userinput>config show Dhcp4/interfaces</userinput>
  2074. <userinput>Dhcp4/interfaces[0] "*" string</userinput></screen>
  2075. An asterisk sign plays a role of the wildcard and means "listen on all interfaces".
  2076. </para>
  2077. <para>
  2078. In order to override the default configuration, the existing entry can be replaced
  2079. with the actual interface name:
  2080. <screen>
  2081. &gt; <userinput>config set Dhcp4/interfaces[0] eth1</userinput>
  2082. &gt; <userinput>config commit</userinput></screen>
  2083. Other interface names can be added on one-by-one basis:
  2084. <screen>
  2085. &gt; <userinput>config add Dhcp4/interfaces eth2</userinput>
  2086. &gt; <userinput>config commit</userinput></screen>
  2087. Configuration will now contain two interfaces which can be presented as follows:
  2088. <screen>
  2089. &gt; <userinput>config show Dhcp4/interfaces</userinput>
  2090. <userinput>Dhcp4/interfaces[0] "eth1" string</userinput>
  2091. <userinput>Dhcp4/interfaces[1] "eth2" string</userinput></screen>
  2092. When configuration gets committed, the server will start to listen on
  2093. eth1 and eth2 interfaces only.
  2094. </para>
  2095. <para>
  2096. It is possible to use wildcard interface name (asterisk) concurrently with explicit
  2097. interface names:
  2098. <screen>
  2099. &gt; <userinput>config add Dhcp4/interfaces *</userinput>
  2100. &gt; <userinput>config commit</userinput></screen>
  2101. This will result in the following configuration:
  2102. <screen>
  2103. &gt; <userinput>config show Dhcp4/interfaces</userinput>
  2104. <userinput>Dhcp4/interfaces[0] "eth1" string</userinput>
  2105. <userinput>Dhcp4/interfaces[1] "eth2" string</userinput>
  2106. <userinput>Dhcp4/interfaces[2] "*" string</userinput></screen>
  2107. The presence of the wildcard name implies that server will listen on all interfaces.
  2108. In order to fall back to the previous configuration when server listens on eth1 and eth2:
  2109. <screen>
  2110. &gt; <userinput>config remove Dhcp4/interfaces[2]</userinput>
  2111. &gt; <userinput>config commit</userinput></screen>
  2112. </para>
  2113. </section>
  2114. <section id="ipv4-subnet-id">
  2115. <title>IPv4 Subnet Identifier</title>
  2116. <para>
  2117. Subnet identifier is a unique number associated with a particular subnet.
  2118. In principle, it is used to associate clients' leases with respective subnets.
  2119. When subnet identifier is not specified for a subnet being configured, it will
  2120. be automatically assigned by the configuration mechanism. The identifiers
  2121. are assigned from 1 and are monotonically increased for each subsequent
  2122. subnet: 1, 2, 3 ....
  2123. </para>
  2124. <para>
  2125. If there are multiple subnets configured with auto-generated identifiers and
  2126. one of them is removed, the subnet identifiers may be renumbered. For example:
  2127. if there are 4 subnets and 3rd is removed the last subnet will be assigned
  2128. identifier that the 3rd subnet had before removal. As a result, the leases
  2129. stored in the lease database for subnet 3 are now associated with the
  2130. subnet 4, which may have unexpected consequences. In the future it is planned
  2131. to implement the mechanism to preserve auto-generated subnet ids upon removal
  2132. of one of the subnets. Currently, the only remedy for this issue is to
  2133. manually specify the unique subnet identifier for each subnet.
  2134. </para>
  2135. <para>
  2136. The following configuration:
  2137. <screen>
  2138. &gt; <userinput>config add Dhcp4/subnet4</userinput>
  2139. &gt; <userinput>config set Dhcp4/subnet4[0]/subnet "192.0.2.0/24"</userinput>
  2140. &gt; <userinput>config set Dhcp4/subnet4[0]/id 1024</userinput>
  2141. &gt; <userinput>config commit</userinput>
  2142. </screen>
  2143. will assign the arbitrary subnet identifier to the newly configured subnet.
  2144. This identifier will not change for this subnet until "id" parameter is
  2145. removed or set to 0. The value of 0 forces auto-generation of subnet
  2146. identifier.
  2147. </para>
  2148. </section>
  2149. <section id="dhcp4-address-config">
  2150. <title>Configuration of IPv4 Address Pools</title>
  2151. <para>
  2152. The essential role of DHCPv4 server is address assignment. The server
  2153. has to be configured with at least one subnet and one pool of dynamic
  2154. addresses to be managed. For example, assume that the server
  2155. is connected to a network segment that uses the 192.0.2.0/24
  2156. prefix. The Administrator of that network has decided that addresses from range
  2157. 192.0.2.10 to 192.0.2.20 are going to be managed by the Dhcp4
  2158. server. Such a configuration can be achieved in the following way:
  2159. <screen>
  2160. &gt; <userinput>config add Dhcp4/subnet4</userinput>
  2161. &gt; <userinput>config set Dhcp4/subnet4[0]/subnet "192.0.2.0/24"</userinput>
  2162. &gt; <userinput>config set Dhcp4/subnet4[0]/pool [ "192.0.2.10 - 192.0.2.20" ]</userinput>
  2163. &gt; <userinput>config commit</userinput></screen>
  2164. Note that subnet is defined as a simple string, but the pool parameter
  2165. is actually a list of pools: for this reason, the pool definition is
  2166. enclosed in square brackets, even though only one range of addresses
  2167. is specified.</para>
  2168. <para>It is possible to define more than one pool in a
  2169. subnet: continuing the previous example, further assume that
  2170. 192.0.2.64/26 should be also be managed by the server. It could be written as
  2171. 192.0.2.64 to 192.0.2.127. Alternatively, it can be expressed more simply as
  2172. 192.0.2.64/26. Both formats are supported by Dhcp4 and can be mixed in the pool list.
  2173. For example, one could define the following pools:
  2174. <screen>
  2175. &gt; <userinput>config set Dhcp4/subnet4[0]/pool [ "192.0.2.10-192.0.2.20", "192.0.2.64/26" ]</userinput>
  2176. &gt; <userinput>config commit</userinput></screen>
  2177. The number of pools is not limited, but for performance reasons it is recommended to
  2178. use as few as possible. Space and tabulations in pool definitions are ignored, so
  2179. spaces before and after hyphen are optional. They can be used to improve readability.
  2180. </para>
  2181. <para>
  2182. The server may be configured to serve more than one subnet. To add a second subnet,
  2183. use a command similar to the following:
  2184. <screen>
  2185. &gt; <userinput>config add Dhcp4/subnet4</userinput>
  2186. &gt; <userinput>config set Dhcp4/subnet4[1]/subnet "192.0.3.0/24"</userinput>
  2187. &gt; <userinput>config set Dhcp4/subnet4[1]/pool [ "192.0.3.0/24" ]</userinput>
  2188. &gt; <userinput>config commit</userinput></screen>
  2189. Arrays are counted from 0. subnet[0] refers to the subnet defined in the
  2190. previous example. The <command>config add Dhcp4/subnet4</command> command adds
  2191. another (second) subnet. It can be referred to as
  2192. <command>Dhcp4/subnet4[1]</command>. In this example, we allow server to
  2193. dynamically assign all addresses available in the whole subnet.
  2194. </para>
  2195. <para>
  2196. When configuring a DHCPv4 server using prefix/length notation, please pay
  2197. attention to the boundary values. When specifying that the server should use
  2198. a given pool, it will be able to allocate also first (typically network
  2199. address) and the last (typically broadcast address) address from that pool.
  2200. In the aforementioned example of pool 192.0.3.0/24, both 192.0.3.0 and
  2201. 192.0.3.255 addresses may be assigned as well. This may be invalid in some
  2202. network configurations. If you want to avoid this, please use the "min-max" notation.
  2203. </para>
  2204. </section>
  2205. <section id="dhcp4-std-options">
  2206. <title>Standard DHCPv4 options</title>
  2207. <para>
  2208. One of the major features of DHCPv4 server is to provide configuration
  2209. options to clients. Although there are several options that require
  2210. special behavior, most options are sent by the server only if the client
  2211. explicitly requested them. The following example shows how to
  2212. configure DNS servers, which is one of the most frequently used
  2213. options. Options specified in this way are considered global and apply
  2214. to all configured subnets.
  2215. <screen>
  2216. &gt; <userinput>config add Dhcp4/option-data</userinput>
  2217. &gt; <userinput>config set Dhcp4/option-data[0]/name "domain-name-servers"</userinput>
  2218. &gt; <userinput>config set Dhcp4/option-data[0]/code 6</userinput>
  2219. &gt; <userinput>config set Dhcp4/option-data[0]/space "dhcp4"</userinput>
  2220. &gt; <userinput>config set Dhcp4/option-data[0]/csv-format true</userinput>
  2221. &gt; <userinput>config set Dhcp4/option-data[0]/data "192.0.3.1, 192.0.3.2"</userinput>
  2222. &gt; <userinput>config commit</userinput>
  2223. </screen>
  2224. </para>
  2225. <para>
  2226. The first line creates new entry in option-data table. It
  2227. contains information on all global options that the server is
  2228. supposed to configure in all subnets. The second line specifies
  2229. option name. For a complete list of currently supported names,
  2230. see <xref linkend="dhcp4-std-options-list"/> below.
  2231. The third line specifies option code, which must match one of the
  2232. values from that list. Line 4 specifies option space, which must always
  2233. be set to "dhcp4" as these are standard DHCPv4 options. For
  2234. other option spaces, including custom option spaces, see <xref
  2235. linkend="dhcp4-option-spaces"/>. The fifth line specifies the format in
  2236. which the data will be entered: use of CSV (comma
  2237. separated values) is recommended. The sixth line gives the actual value to
  2238. be sent to clients. Data is specified as a normal text, with
  2239. values separated by commas if more than one value is
  2240. allowed.
  2241. </para>
  2242. <para>
  2243. Options can also be configured as hexadecimal values. If csv-format is
  2244. set to false, option data must be specified as a hex string. The
  2245. following commands configure the domain-name-servers option for all
  2246. subnets with the following addresses: 192.0.3.1 and 192.0.3.2.
  2247. Note that csv-format is set to false.
  2248. <screen>
  2249. &gt; <userinput>config add Dhcp4/option-data</userinput>
  2250. &gt; <userinput>config set Dhcp4/option-data[0]/name "domain-name-servers"</userinput>
  2251. &gt; <userinput>config set Dhcp4/option-data[0]/code 6</userinput>
  2252. &gt; <userinput>config set Dhcp4/option-data[0]/space "dhcp4"</userinput>
  2253. &gt; <userinput>config set Dhcp4/option-data[0]/csv-format false</userinput>
  2254. &gt; <userinput>config set Dhcp4/option-data[0]/data "C0 00 03 01 C0 00 03 02"</userinput>
  2255. &gt; <userinput>config commit</userinput>
  2256. </screen>
  2257. </para>
  2258. <para>
  2259. It is possible to override options on a per-subnet basis. If
  2260. clients connected to most of your subnets are expected to get the
  2261. same values of a given option, you should use global options: you
  2262. can then override specific values for a small number of subnets.
  2263. On the other hand, if you use different values in each subnet,
  2264. it does not make sense to specify global option values
  2265. (Dhcp4/option-data), rather you should set only subnet-specific values
  2266. (Dhcp4/subnet[X]/option-data[Y]).
  2267. </para>
  2268. <para>
  2269. The following commands override the global
  2270. DNS servers option for a particular subnet, setting a single DNS
  2271. server with address 192.0.2.3.
  2272. <screen>
  2273. &gt; <userinput>config add Dhcp4/subnet4[0]/option-data</userinput>
  2274. &gt; <userinput>config set Dhcp4/subnet4[0]/option-data[0]/name "domain-name-servers"</userinput>
  2275. &gt; <userinput>config set Dhcp4/subnet4[0]/option-data[0]/code 6</userinput>
  2276. &gt; <userinput>config set Dhcp4/subnet4[0]/option-data[0]/space "dhcp4"</userinput>
  2277. &gt; <userinput>config set Dhcp4/subnet4[0]/option-data[0]/csv-format true</userinput>
  2278. &gt; <userinput>config set Dhcp4/subnet4[0]/option-data[0]/data "192.0.2.3"</userinput>
  2279. &gt; <userinput>config commit</userinput></screen>
  2280. </para>
  2281. <note>
  2282. <para>In a future version of Kea, it will not be necessary to specify
  2283. the option code, space and csv-format fields as they will be set
  2284. automatically.</para>
  2285. </note>
  2286. <para>
  2287. The currently supported standard DHCPv4 options are
  2288. listed in <xref linkend="dhcp4-std-options-list"/>
  2289. and <xref linkend="dhcp4-std-options-list-part2"/>.
  2290. The "Name" and "Code"
  2291. are the values that should be used as a name in the option-data
  2292. structures. "Type" designates the format of the data: the meanings of
  2293. the various types is given in <xref linkend="dhcp-types"/>.
  2294. </para>
  2295. <para>
  2296. Some options are designated as arrays, which means that more than one
  2297. value is allowed in such an option. For example the option time-servers
  2298. allows the specification of more than one IPv4 address, so allowing
  2299. clients to obtain the the addresses of multiple NTP servers.
  2300. </para>
  2301. <!-- @todo: describe record types -->
  2302. <para>
  2303. The <xref linkend="dhcp4-custom-options"/> describes the configuration
  2304. syntax to create custom option definitions (formats). It is generally not
  2305. allowed to create custom definitions for standard options, even if the
  2306. definition being created matches the actual option format defined in the
  2307. RFCs. There is an exception from this rule for standard options for which
  2308. Kea does not provide a definition yet. In order to use such options,
  2309. a server administrator must create a definition as described in
  2310. <xref linkend="dhcp4-custom-options"/> in the 'dhcp4' option space. This
  2311. definition should match the option format described in the relevant
  2312. RFC but configuration mechanism would allow any option format as it has
  2313. no means to validate it at the moment.
  2314. </para>
  2315. <para>
  2316. <table frame="all" id="dhcp4-std-options-list">
  2317. <title>List of standard DHCPv4 options</title>
  2318. <tgroup cols='4'>
  2319. <colspec colname='name'/>
  2320. <colspec colname='code'/>
  2321. <colspec colname='type'/>
  2322. <colspec colname='array'/>
  2323. <thead>
  2324. <row>
  2325. <entry>Name</entry>
  2326. <entry>Code</entry>
  2327. <entry>Type</entry>
  2328. <entry>Array?</entry>
  2329. </row>
  2330. </thead>
  2331. <tbody>
  2332. <row><entry>subnet-mask</entry><entry>1</entry><entry>ipv4-address</entry><entry>false</entry></row>
  2333. <row><entry>time-offset</entry><entry>2</entry><entry>int32</entry><entry>false</entry></row>
  2334. <row><entry>routers</entry><entry>3</entry><entry>ipv4-address</entry><entry>true</entry></row>
  2335. <row><entry>time-servers</entry><entry>4</entry><entry>ipv4-address</entry><entry>true</entry></row>
  2336. <row><entry>name-servers</entry><entry>5</entry><entry>ipv4-address</entry><entry>false</entry></row>
  2337. <row><entry>domain-name-servers</entry><entry>6</entry><entry>ipv4-address</entry><entry>true</entry></row>
  2338. <row><entry>log-servers</entry><entry>7</entry><entry>ipv4-address</entry><entry>true</entry></row>
  2339. <row><entry>cookie-servers</entry><entry>8</entry><entry>ipv4-address</entry><entry>true</entry></row>
  2340. <row><entry>lpr-servers</entry><entry>9</entry><entry>ipv4-address</entry><entry>true</entry></row>
  2341. <row><entry>impress-servers</entry><entry>10</entry><entry>ipv4-address</entry><entry>true</entry></row>
  2342. <row><entry>resource-location-servers</entry><entry>11</entry><entry>ipv4-address</entry><entry>true</entry></row>
  2343. <row><entry>host-name</entry><entry>12</entry><entry>string</entry><entry>false</entry></row>
  2344. <row><entry>boot-size</entry><entry>13</entry><entry>uint16</entry><entry>false</entry></row>
  2345. <row><entry>merit-dump</entry><entry>14</entry><entry>string</entry><entry>false</entry></row>
  2346. <row><entry>domain-name</entry><entry>15</entry><entry>fqdn</entry><entry>false</entry></row>
  2347. <row><entry>swap-server</entry><entry>16</entry><entry>ipv4-address</entry><entry>false</entry></row>
  2348. <row><entry>root-path</entry><entry>17</entry><entry>string</entry><entry>false</entry></row>
  2349. <row><entry>extensions-path</entry><entry>18</entry><entry>string</entry><entry>false</entry></row>
  2350. <row><entry>ip-forwarding</entry><entry>19</entry><entry>boolean</entry><entry>false</entry></row>
  2351. <row><entry>non-local-source-routing</entry><entry>20</entry><entry>boolean</entry><entry>false</entry></row>
  2352. <row><entry>policy-filter</entry><entry>21</entry><entry>ipv4-address</entry><entry>true</entry></row>
  2353. <row><entry>max-dgram-reassembly</entry><entry>22</entry><entry>uint16</entry><entry>false</entry></row>
  2354. <row><entry>default-ip-ttl</entry><entry>23</entry><entry>uint8</entry><entry>false</entry></row>
  2355. <row><entry>path-mtu-aging-timeout</entry><entry>24</entry><entry>uint32</entry><entry>false</entry></row>
  2356. <row><entry>path-mtu-plateau-table</entry><entry>25</entry><entry>uint16</entry><entry>true</entry></row>
  2357. <row><entry>interface-mtu</entry><entry>26</entry><entry>uint16</entry><entry>false</entry></row>
  2358. <row><entry>all-subnets-local</entry><entry>27</entry><entry>boolean</entry><entry>false</entry></row>
  2359. <row><entry>broadcast-address</entry><entry>28</entry><entry>ipv4-address</entry><entry>false</entry></row>
  2360. <row><entry>perform-mask-discovery</entry><entry>29</entry><entry>boolean</entry><entry>false</entry></row>
  2361. <row><entry>mask-supplier</entry><entry>30</entry><entry>boolean</entry><entry>false</entry></row>
  2362. <row><entry>router-discovery</entry><entry>31</entry><entry>boolean</entry><entry>false</entry></row>
  2363. <row><entry>router-solicitation-address</entry><entry>32</entry><entry>ipv4-address</entry><entry>false</entry></row>
  2364. <row><entry>static-routes</entry><entry>33</entry><entry>ipv4-address</entry><entry>true</entry></row>
  2365. <row><entry>trailer-encapsulation</entry><entry>34</entry><entry>boolean</entry><entry>false</entry></row>
  2366. <row><entry>arp-cache-timeout</entry><entry>35</entry><entry>uint32</entry><entry>false</entry></row>
  2367. <row><entry>ieee802-3-encapsulation</entry><entry>36</entry><entry>boolean</entry><entry>false</entry></row>
  2368. <row><entry>default-tcp-ttl</entry><entry>37</entry><entry>uint8</entry><entry>false</entry></row>
  2369. <row><entry>tcp-keepalive-internal</entry><entry>38</entry><entry>uint32</entry><entry>false</entry></row>
  2370. <row><entry>tcp-keepalive-garbage</entry><entry>39</entry><entry>boolean</entry><entry>false</entry></row>
  2371. </tbody>
  2372. </tgroup>
  2373. </table>
  2374. </para>
  2375. <para>
  2376. <table frame="all" id="dhcp4-std-options-list-part2">
  2377. <title>List of standard DHCPv4 options (continued)</title>
  2378. <tgroup cols='4'>
  2379. <colspec colname='name'/>
  2380. <colspec colname='code'/>
  2381. <colspec colname='type'/>
  2382. <colspec colname='array'/>
  2383. <thead>
  2384. <row>
  2385. <entry>Name</entry>
  2386. <entry>Code</entry>
  2387. <entry>Type</entry>
  2388. <entry>Array?</entry>
  2389. </row>
  2390. </thead>
  2391. <tbody>
  2392. <row><entry>nis-domain</entry><entry>40</entry><entry>string</entry><entry>false</entry></row>
  2393. <row><entry>nis-servers</entry><entry>41</entry><entry>ipv4-address</entry><entry>true</entry></row>
  2394. <row><entry>ntp-servers</entry><entry>42</entry><entry>ipv4-address</entry><entry>true</entry></row>
  2395. <row><entry>vendor-encapsulated-options</entry><entry>43</entry><entry>empty</entry><entry>false</entry></row>
  2396. <row><entry>netbios-name-servers</entry><entry>44</entry><entry>ipv4-address</entry><entry>true</entry></row>
  2397. <row><entry>netbios-dd-server</entry><entry>45</entry><entry>ipv4-address</entry><entry>true</entry></row>
  2398. <row><entry>netbios-node-type</entry><entry>46</entry><entry>uint8</entry><entry>false</entry></row>
  2399. <row><entry>netbios-scope</entry><entry>47</entry><entry>string</entry><entry>false</entry></row>
  2400. <row><entry>font-servers</entry><entry>48</entry><entry>ipv4-address</entry><entry>true</entry></row>
  2401. <row><entry>x-display-manager</entry><entry>49</entry><entry>ipv4-address</entry><entry>true</entry></row>
  2402. <row><entry>dhcp-requested-address</entry><entry>50</entry><entry>ipv4-address</entry><entry>false</entry></row>
  2403. <!-- Lease time should not be configured by a user.
  2404. <row><entry>dhcp-lease-time</entry><entry>51</entry><entry>uint32</entry><entry>false</entry></row>
  2405. -->
  2406. <row><entry>dhcp-option-overload</entry><entry>52</entry><entry>uint8</entry><entry>false</entry></row>
  2407. <!-- Message Type, Server Identifier and Parameter Request List should not be configured by a user.
  2408. <row><entry>dhcp-message-type</entry><entry>53</entry><entry>uint8</entry><entry>false</entry></row>
  2409. <row><entry>dhcp-server-identifier</entry><entry>54</entry><entry>ipv4-address</entry><entry>false</entry></row>
  2410. <row><entry>dhcp-parameter-request-list</entry><entry>55</entry><entry>uint8</entry><entry>true</entry></row>
  2411. -->
  2412. <row><entry>dhcp-message</entry><entry>56</entry><entry>string</entry><entry>false</entry></row>
  2413. <row><entry>dhcp-max-message-size</entry><entry>57</entry><entry>uint16</entry><entry>false</entry></row>
  2414. <!-- Renewal and rebinding time should not be configured by a user.
  2415. <row><entry>dhcp-renewal-time</entry><entry>58</entry><entry>uint32</entry><entry>false</entry></row>
  2416. <row><entry>dhcp-rebinding-time</entry><entry>59</entry><entry>uint32</entry><entry>false</entry></row>
  2417. -->
  2418. <row><entry>vendor-class-identifier</entry><entry>60</entry><entry>binary</entry><entry>false</entry></row>
  2419. <!-- Client identifier should not be configured by a user.
  2420. <row><entry>dhcp-client-identifier</entry><entry>61</entry><entry>binary</entry><entry>false</entry></row>
  2421. -->
  2422. <row><entry>nwip-domain-name</entry><entry>62</entry><entry>string</entry><entry>false</entry></row>
  2423. <row><entry>nwip-suboptions</entry><entry>63</entry><entry>binary</entry><entry>false</entry></row>
  2424. <row><entry>tftp-server-name</entry><entry>66</entry><entry>string</entry><entry>false</entry></row>
  2425. <row><entry>boot-file-name</entry><entry>67</entry><entry>string</entry><entry>false</entry></row>
  2426. <row><entry>user-class</entry><entry>77</entry><entry>binary</entry><entry>false</entry></row>
  2427. <row><entry>fqdn</entry><entry>81</entry><entry>record</entry><entry>false</entry></row>
  2428. <row><entry>dhcp-agent-options</entry><entry>82</entry><entry>empty</entry><entry>false</entry></row>
  2429. <row><entry>authenticate</entry><entry>90</entry><entry>binary</entry><entry>false</entry></row>
  2430. <row><entry>client-last-transaction-time</entry><entry>91</entry><entry>uint32</entry><entry>false</entry></row>
  2431. <row><entry>associated-ip</entry><entry>92</entry><entry>ipv4-address</entry><entry>true</entry></row>
  2432. <row><entry>subnet-selection</entry><entry>118</entry><entry>ipv4-address</entry><entry>false</entry></row>
  2433. <row><entry>domain-search</entry><entry>119</entry><entry>binary</entry><entry>false</entry></row>
  2434. <row><entry>vivco-suboptions</entry><entry>124</entry><entry>binary</entry><entry>false</entry></row>
  2435. <row><entry>vivso-suboptions</entry><entry>125</entry><entry>binary</entry><entry>false</entry></row>
  2436. </tbody>
  2437. </tgroup>
  2438. </table>
  2439. </para>
  2440. <para>
  2441. <table frame="all" id="dhcp-types">
  2442. <title>List of standard DHCP option types</title>
  2443. <tgroup cols='2'>
  2444. <colspec colname='name'/>
  2445. <colspec colname='meaning'/>
  2446. <thead>
  2447. <row><entry>Name</entry><entry>Meaning</entry></row>
  2448. </thead>
  2449. <tbody>
  2450. <row><entry>binary</entry><entry>An arbitrary string of bytes, specified as a set of hexadecimal digits.</entry></row>
  2451. <row><entry>boolean</entry><entry>Boolean value with allowed values true or false</entry></row>
  2452. <row><entry>empty</entry><entry>No value, data is carried in suboptions</entry></row>
  2453. <row><entry>fqdn</entry><entry>Fully qualified domain name (e.g. www.example.com)</entry></row>
  2454. <row><entry>ipv4-address</entry><entry>IPv4 address in the usual dotted-decimal notation (e.g. 192.0.2.1)</entry></row>
  2455. <row><entry>ipv6-address</entry><entry>IPv6 address in the usual colon notation (e.g. 2001:db8::1)</entry></row>
  2456. <row><entry>record</entry><entry>Structured data that may comprise any types (except "record" and "empty")</entry></row>
  2457. <row><entry>string</entry><entry>Any text</entry></row>
  2458. <row><entry>uint8</entry><entry>8 bit unsigned integer with allowed values 0 to 255</entry></row>
  2459. <row><entry>uint16</entry><entry>16 bit unsinged integer with allowed values 0 to 65535</entry></row>
  2460. <row><entry>uint32</entry><entry>32 bit unsigned integer with allowed values 0 to 4294967295</entry></row>
  2461. </tbody>
  2462. </tgroup>
  2463. </table>
  2464. </para>
  2465. </section>
  2466. <section id="dhcp4-custom-options">
  2467. <title>Custom DHCPv4 options</title>
  2468. <para>It is also possible to define options other than the standard ones.
  2469. Assume that we want to define a new DHCPv4 option called "foo" which will have
  2470. code 222 and will convey a single unsigned 32 bit integer value. We can define
  2471. such an option by using the following commands:
  2472. <screen>
  2473. &gt; <userinput>config add Dhcp4/option-def</userinput>
  2474. &gt; <userinput>config set Dhcp4/option-def[0]/name "foo"</userinput>
  2475. &gt; <userinput>config set Dhcp4/option-def[0]/code 222</userinput>
  2476. &gt; <userinput>config set Dhcp4/option-def[0]/type "uint32"</userinput>
  2477. &gt; <userinput>config set Dhcp4/option-def[0]/array false</userinput>
  2478. &gt; <userinput>config set Dhcp4/option-def[0]/record-types ""</userinput>
  2479. &gt; <userinput>config set Dhcp4/option-def[0]/space "dhcp4"</userinput>
  2480. &gt; <userinput>config set Dhcp4/option-def[0]/encapsulate ""</userinput>
  2481. &gt; <userinput>config commit</userinput></screen>
  2482. The "false" value of the "array" parameter determines that the option
  2483. does NOT comprise an array of "uint32" values but rather a single value.
  2484. Two other parameters have been left blank: "record-types" and "encapsulate".
  2485. The former specifies the comma separated list of option data fields if the
  2486. option comprises a record of data fields. The "record-fields" value should
  2487. be non-empty if the "type" is set to "record". Otherwise it must be left
  2488. blank. The latter parameter specifies the name of the option space being
  2489. encapsulated by the particular option. If the particular option does not
  2490. encapsulate any option space it should be left blank.
  2491. Note that the above set of comments define the format of the new option and do not
  2492. set its values.
  2493. </para>
  2494. <note>
  2495. <para>
  2496. In the current release the default values are not propagated to the
  2497. parser when the new configuration is being set. Therefore, all
  2498. parameters must be specified at all times, even if their values are
  2499. left blank.
  2500. </para>
  2501. </note>
  2502. <para>Once the new option format is defined, its value is set
  2503. in the same way as for a standard option. For example the following
  2504. commands set a global value that applies to all subnets.
  2505. <screen>
  2506. &gt; <userinput>config add Dhcp4/option-data</userinput>
  2507. &gt; <userinput>config set Dhcp4/option-data[0]/name "foo"</userinput>
  2508. &gt; <userinput>config set Dhcp4/option-data[0]/code 222</userinput>
  2509. &gt; <userinput>config set Dhcp4/option-data[0]/space "dhcp4"</userinput>
  2510. &gt; <userinput>config set Dhcp4/option-data[0]/csv-format true</userinput>
  2511. &gt; <userinput>config set Dhcp4/option-data[0]/data "12345"</userinput>
  2512. &gt; <userinput>config commit</userinput></screen>
  2513. </para>
  2514. <para>New options can take more complex forms than simple use of
  2515. primitives (uint8, string, ipv4-address etc): it is possible to
  2516. define an option comprising a number of existing primitives.
  2517. </para>
  2518. <para>Assume we want to define a new option that will consist of
  2519. an IPv4 address, followed by unsigned 16 bit integer, followed by
  2520. a boolean value, followed by a text string. Such an option could
  2521. be defined in the following way:
  2522. <screen>
  2523. &gt; <userinput>config add Dhcp4/option-def</userinput>
  2524. &gt; <userinput>config set Dhcp4/option-def[0]/name "bar"</userinput>
  2525. &gt; <userinput>config set Dhcp4/option-def[0]/code 223</userinput>
  2526. &gt; <userinput>config set Dhcp4/option-def[0]/space "dhcp4"</userinput>
  2527. &gt; <userinput>config set Dhcp4/option-def[0]/type "record"</userinput>
  2528. &gt; <userinput>config set Dhcp4/option-def[0]/array false</userinput>
  2529. &gt; <userinput>config set Dhcp4/option-def[0]/record-types "ipv4-address, uint16, boolean, string"</userinput>
  2530. &gt; <userinput>config set Dhcp4/option-def[0]/encapsulate ""</userinput>
  2531. </screen>
  2532. The "type" is set to "record" to indicate that the option contains
  2533. multiple values of different types. These types are given as a comma-separated
  2534. list in the "record-types" field and should be those listed in <xref linkend="dhcp-types"/>.
  2535. </para>
  2536. <para>
  2537. The values of the option are set as follows:
  2538. <screen>
  2539. &gt; <userinput>config add Dhcp4/option-data</userinput>
  2540. &gt; <userinput>config set Dhcp4/option-data[0]/name "bar"</userinput>
  2541. &gt; <userinput>config set Dhcp4/option-data[0]/space "dhcp4"</userinput>
  2542. &gt; <userinput>config set Dhcp4/option-data[0]/code 223</userinput>
  2543. &gt; <userinput>config set Dhcp4/option-data[0]/csv-format true</userinput>
  2544. &gt; <userinput>config set Dhcp4/option-data[0]/data "192.0.2.100, 123, true, Hello World"</userinput>
  2545. &gt; <userinput>config commit</userinput></screen>
  2546. "csv-format" is set "true" to indicate that the "data" field comprises a command-separated
  2547. list of values. The values in the "data" must correspond to the types set in
  2548. the "record-types" field of the option definition.
  2549. </para>
  2550. <note>
  2551. <para>
  2552. It is recommended that boolean values are specified using "true" and "false"
  2553. strings. This helps to prevent errors when typing multiple comma separated
  2554. values, as it make it easier to identify the type of the value being typed,
  2555. and compare it with the order of data fields. Nevertheless, it is possible
  2556. to use integer values: "1" and "0", instead of "true" and "false"
  2557. accordingly. If other integer value is specified, the configuration is
  2558. rejected.
  2559. </para>
  2560. </note>
  2561. </section>
  2562. <section id="dhcp4-vendor-opts">
  2563. <title>DHCPv4 vendor specific options</title>
  2564. <para>
  2565. Currently there are three option spaces defined: dhcp4 (to
  2566. be used in DHCPv4 daemon) and dhcp6 (for the DHCPv6 daemon); there
  2567. is also vendor-encapsulated-options-space, which is empty by default, but options
  2568. can be defined in it. Those options are called vendor-specific
  2569. information options. The following examples show how to define
  2570. an option "foo" with code 1 that consists of an IPv4 address, an
  2571. unsigned 16 bit integer and a string. The "foo" option is conveyed
  2572. in a vendor specific information option.
  2573. </para>
  2574. <para>
  2575. The first step is to define the format of the option:
  2576. <screen>
  2577. &gt; <userinput>config add Dhcp4/option-def</userinput>
  2578. &gt; <userinput>config set Dhcp4/option-def[0]/name "foo"</userinput>
  2579. &gt; <userinput>config set Dhcp4/option-def[0]/code 1</userinput>
  2580. &gt; <userinput>config set Dhcp4/option-def[0]/space "vendor-encapsulated-options-space"</userinput>
  2581. &gt; <userinput>config set Dhcp4/option-def[0]/type "record"</userinput>
  2582. &gt; <userinput>config set Dhcp4/option-def[0]/array false</userinput>
  2583. &gt; <userinput>config set Dhcp4/option-def[0]/record-types "ipv4-address, uint16, string"</userinput>
  2584. &gt; <userinput>config set Dhcp4/option-def[0]/encapsulates ""</userinput>
  2585. &gt; <userinput>config commit</userinput>
  2586. </screen>
  2587. (Note that the option space is set to "vendor-encapsulated-options-space".)
  2588. Once the option format is defined, the next step is to define actual values
  2589. for that option:
  2590. <screen>
  2591. &gt; <userinput>config add Dhcp4/option-data</userinput>
  2592. &gt; <userinput>config set Dhcp4/option-data[0]/name "foo"</userinput>
  2593. &gt; <userinput>config set Dhcp4/option-data[0]/space "vendor-encapsulated-options-space"</userinput>
  2594. &gt; <userinput>config set Dhcp4/option-data[0]/code 1</userinput>
  2595. &gt; <userinput>config set Dhcp4/option-data[0]/csv-format true</userinput>
  2596. &gt; <userinput>config set Dhcp4/option-data[0]/data "192.0.2.3, 123, Hello World"</userinput>
  2597. &gt; <userinput>config commit</userinput></screen>
  2598. We also set up a dummy value for vendor-opts, the option that conveys our sub-option "foo".
  2599. This is required else the option will not be included in messages sent to the client.
  2600. <screen>
  2601. &gt; <userinput>config add Dhcp4/option-data</userinput>
  2602. &gt; <userinput>config set Dhcp4/option-data[1]/name "vendor-encapsulated-options"</userinput>
  2603. &gt; <userinput>config set Dhcp4/option-data[1]/space "dhcp4"</userinput>
  2604. &gt; <userinput>config set Dhcp4/option-data[1]/code 43</userinput>
  2605. &gt; <userinput>config set Dhcp4/option-data[1]/csv-format false</userinput>
  2606. &gt; <userinput>config set Dhcp4/option-data[1]/data ""</userinput>
  2607. &gt; <userinput>config commit</userinput></screen>
  2608. </para>
  2609. <note>
  2610. <para>
  2611. With this version of Kea, the "vendor-encapsulated-options" option
  2612. must be specified in the configuration although it has no configurable
  2613. parameters. If it is not specified, the server will assume that it is
  2614. not configured and will not send it to a client. In the future there
  2615. will be no need to include this option in the configuration.
  2616. </para>
  2617. </note>
  2618. </section>
  2619. <section id="dhcp4-option-spaces">
  2620. <title>Nested DHCPv4 options (custom option spaces)</title>
  2621. <para>It is sometimes useful to define completely new option
  2622. space. This is the case when user creates new option in the
  2623. standard option space ("dhcp4 or "dhcp6") and wants this option
  2624. to convey sub-options. Thanks to being in the separate space,
  2625. sub-option codes will have a separate numbering scheme and may
  2626. overlap with codes of standard options.
  2627. </para>
  2628. <para>Note that creation of a new option space when defining
  2629. sub-options for a standard option is not required, because it is
  2630. created by default if the standard option is meant to convey any
  2631. sub-options (see <xref linkend="dhcp4-vendor-opts"/>).
  2632. </para>
  2633. <para>
  2634. Assume that we want to have a DHCPv4 option called "container" with
  2635. code 222 that conveys two sub-options with codes 1 and 2.
  2636. First we need to define the new sub-options:
  2637. <screen>
  2638. &gt; <userinput>config add Dhcp4/option-def</userinput>
  2639. &gt; <userinput>config set Dhcp4/option-def[0]/name "subopt1"</userinput>
  2640. &gt; <userinput>config set Dhcp4/option-def[0]/code 1</userinput>
  2641. &gt; <userinput>config set Dhcp4/option-def[0]/space "isc"</userinput>
  2642. &gt; <userinput>config set Dhcp4/option-def[0]/type "ipv4-address"</userinput>
  2643. &gt; <userinput>config set Dhcp4/option-def[0]/record-types ""</userinput>
  2644. &gt; <userinput>config set Dhcp4/option-def[0]/array false</userinput>
  2645. &gt; <userinput>config set Dhcp4/option-def[0]/encapsulate ""</userinput>
  2646. &gt; <userinput>config commit</userinput>
  2647. &gt; <userinput>config add Dhcp4/option-def</userinput>
  2648. &gt; <userinput>config set Dhcp4/option-def[1]/name "subopt2"</userinput>
  2649. &gt; <userinput>config set Dhcp4/option-def[1]/code 2</userinput>
  2650. &gt; <userinput>config set Dhcp4/option-def[1]/space "isc"</userinput>
  2651. &gt; <userinput>config set Dhcp4/option-def[1]/type "string"</userinput>
  2652. &gt; <userinput>config set Dhcp4/option-def[1]/record-types ""</userinput>
  2653. &gt; <userinput>config set Dhcp4/option-def[1]/array false</userinput>
  2654. &gt; <userinput>config set Dhcp4/option-def[1]/encapsulate ""</userinput>
  2655. &gt; <userinput>config commit</userinput>
  2656. </screen>
  2657. Note that we have defined the options to belong to a new option space
  2658. (in this case, "isc").
  2659. </para>
  2660. <para>
  2661. The next step is to define a regular DHCPv4 option with our desired
  2662. code and specify that it should include options from the new option space:
  2663. <screen>
  2664. &gt; <userinput>add Dhcp4/option-def</userinput>
  2665. &gt; <userinput>set Dhcp4/option-def[2]/name "container"</userinput>
  2666. &gt; <userinput>set Dhcp4/option-def[2]/code 222</userinput>
  2667. &gt; <userinput>set Dhcp4/option-def[2]/space "dhcp4"</userinput>
  2668. &gt; <userinput>set Dhcp4/option-def[2]/type "empty"</userinput>
  2669. &gt; <userinput>set Dhcp4/option-def[2]/array false</userinput>
  2670. &gt; <userinput>set Dhcp4/option-def[2]/record-types ""</userinput>
  2671. &gt; <userinput>set Dhcp4/option-def[2]/encapsulate "isc"</userinput>
  2672. &gt; <userinput>commit</userinput>
  2673. </screen>
  2674. The name of the option space in which the sub-options are defined
  2675. is set in the "encapsulate" field. The "type" field is set to "empty"
  2676. to indicate that this option does not carry any data other than
  2677. sub-options.
  2678. </para>
  2679. <para>
  2680. Finally, we can set values for the new options:
  2681. <screen>
  2682. &gt; <userinput>config add Dhcp4/option-data</userinput>
  2683. &gt; <userinput>config set Dhcp4/option-data[0]/name "subopt1"</userinput>
  2684. &gt; <userinput>config set Dhcp4/option-data[0]/space "isc"</userinput>
  2685. &gt; <userinput>config set Dhcp4/option-data[0]/code 1</userinput>
  2686. &gt; <userinput>config set Dhcp4/option-data[0]/csv-format true</userinput>
  2687. &gt; <userinput>config set Dhcp4/option-data[0]/data "192.0.2.3"</userinput>
  2688. &gt; <userinput>config commit</userinput>
  2689. <userinput></userinput>
  2690. &gt; <userinput>config add Dhcp4/option-data</userinput>
  2691. &gt; <userinput>config set Dhcp4/option-data[1]/name "subopt2"</userinput>
  2692. &gt; <userinput>config set Dhcp4/option-data[1]/space "isc"</userinput>
  2693. &gt; <userinput>config set Dhcp4/option-data[1]/code 2</userinput>
  2694. &gt; <userinput>config set Dhcp4/option-data[1]/csv-format true</userinput>
  2695. &gt; <userinput>config set Dhcp4/option-data[1]/data "Hello world"</userinput>
  2696. &gt; <userinput>config commit</userinput>
  2697. <userinput></userinput>
  2698. &gt; <userinput>config add Dhcp4/option-data</userinput>
  2699. &gt; <userinput>config set Dhcp4/option-data[2]/name "container"</userinput>
  2700. &gt; <userinput>config set Dhcp4/option-data[2]/space "dhcp4"</userinput>
  2701. &gt; <userinput>config set Dhcp4/option-data[2]/code 222</userinput>
  2702. &gt; <userinput>config set Dhcp4/option-data[2]/csv-format true</userinput>
  2703. &gt; <userinput>config set Dhcp4/option-data[2]/data ""</userinput>
  2704. &gt; <userinput>config commit</userinput>
  2705. </screen>
  2706. Even though the "container" option does not carry any data except
  2707. sub-options, the "data" field must be explicitly set to an empty value.
  2708. This is required because in the current version of BIND 10 DHCP, the
  2709. default configuration values are not propagated to the configuration parsers:
  2710. if the "data" is not set the parser will assume that this
  2711. parameter is not specified and an error will be reported.
  2712. </para>
  2713. <para>Note that it is possible to create an option which carries some data
  2714. in addition to the sub-options defined in the encapsulated option space. For example,
  2715. if the "container" option from the previous example was required to carry an uint16
  2716. value as well as the sub-options, the "type" value would have to be set to "uint16" in
  2717. the option definition. (Such an option would then have the following
  2718. data structure: DHCP header, uint16 value, sub-options.) The value specified
  2719. with the "data" parameter - which should be a valid integer enclosed in quotes,
  2720. e.g. "123" - would then be assigned to the uint16 field in the "container" option.
  2721. </para>
  2722. </section>
  2723. <section id="dhcp4-client-classifier">
  2724. <title>Client Classification in DHCPv4</title>
  2725. <note>
  2726. <para>
  2727. DHCPv4 server has been extended to support limited client classification.
  2728. Although the current capability is modest, it is expected to be expanded
  2729. in the future. It is envisaged that the majority of client classification
  2730. extensions will be using hooks extensions.
  2731. </para>
  2732. </note>
  2733. <para>In certain cases it is useful to differentiate between different
  2734. types of clients and treat them differently. The process of doing
  2735. classification is conducted in two steps. The first step is to assess
  2736. incoming packet and assign it to zero or more classes. This classification
  2737. is currently simple, but is expected to grow in capability soon. Currently
  2738. the server checks whether incoming packet has vendor class identifier
  2739. option (60). If it has, content of that option is prepended with
  2740. &quot;VENDOR_CLASS_&quot; then is interpreted as a class. For example,
  2741. modern cable modems will send this option with value &quot;docsis3.0&quot;
  2742. and as a result the packet will belong to class &quot;VENDOR_CLASS_docsis3.0&quot;.
  2743. </para>
  2744. <para>It is envisaged that the client classification will be used for changing
  2745. behavior of almost any part of the DHCP message processing, including assigning
  2746. leases from different pools, assigning different option (or different values of
  2747. the same options) etc. For now, there are only two mechanisms that are taking
  2748. advantage of client classification: specific processing for cable modems and
  2749. subnet selection.</para>
  2750. <para>
  2751. For clients that belong to the VENDOR_CLASS_docsis3.0 class, the siaddr
  2752. field is set to the value of next-server (if specified in a subnet). If
  2753. there is boot-file-name option specified, its value is also set in the
  2754. file field in the DHCPv4 packet. For eRouter1.0 class, the siaddr is
  2755. always set to 0.0.0.0. That capability is expected to be moved to
  2756. external hook library that will be dedicated to cable modems.
  2757. </para>
  2758. <para>
  2759. Kea can be instructed to limit access to given subnets based on class information.
  2760. This is particularly useful for cases where two types of devices share the
  2761. same link and are expected to be served from two different subnets. The
  2762. primary use case for such a scenario is cable networks. There are two
  2763. classes of devices: cable modem itself, which should be handled a lease
  2764. from subnet A and all other devices behind modems that should get a lease
  2765. from subnet B. That segregation is essential to prevent overly curious
  2766. users from playing with their cable modems. For details on how to set up
  2767. class restrictions on subnets, see <xref linkend="dhcp4-subnet-class"/>.
  2768. </para>
  2769. </section>
  2770. <section id="dhcp4-subnet-class">
  2771. <title>Limiting access to IPv4 subnet to certain classes</title>
  2772. <para>
  2773. In certain cases it beneficial to restrict access to certain subnets
  2774. only to clients that belong to a given subnet. For details on client
  2775. classes, see <xref linkend="dhcp4-client-classifier"/>. This is an
  2776. extension of a previous example from <xref linkend="dhcp4-address-config"/>.
  2777. Let's assume that the server is connected to a network segment that uses
  2778. the 192.0.2.0/24 prefix. The Administrator of that network has decided
  2779. that addresses from range 192.0.2.10 to 192.0.2.20 are going to be
  2780. managed by the Dhcp4 server. Only clients belonging to client class
  2781. VENDOR_CLASS_docsis3.0 are allowed to use this subnet. Such a
  2782. configuration can be achieved in the following way:
  2783. <screen>
  2784. &gt; <userinput>config add Dhcp4/subnet4</userinput>
  2785. &gt; <userinput>config set Dhcp4/subnet4[0]/subnet "192.0.2.0/24"</userinput>
  2786. &gt; <userinput>config set Dhcp4/subnet4[0]/pool [ "192.0.2.10 - 192.0.2.20" ]</userinput>
  2787. &gt; <userinput>config set Dhcp4/subnet4[0]/client-class "VENDOR_CLASS_docsis3.0"</userinput>
  2788. &gt; <userinput>config commit</userinput></screen>
  2789. </para>
  2790. <para>
  2791. Care should be taken with client classification as it is easy to prevent
  2792. clients that do not meet class criteria to be denied any service altogether.
  2793. </para>
  2794. </section>
  2795. <section id="dhcp4-ddns-config">
  2796. <title>Configuring DHCPv4 for DDNS</title>
  2797. <para>
  2798. As mentioned earlier, DHCPv4 can be configured to generate requests to the
  2799. DHCP-DDNS server to update DNS entries. These requests are known as
  2800. NameChangeRequests or NCRs. Each NCR contains the following information:
  2801. <orderedlist>
  2802. <listitem><para>
  2803. Whether it is a request to add (update) or remove DNS entries
  2804. </para></listitem>
  2805. <listitem><para>
  2806. Whether the change requests forward DNS updates (A records), reverse
  2807. DNS updates (PTR records), or both.
  2808. </para></listitem>
  2809. <listitem><para>
  2810. The FQDN, lease address, and DHCID
  2811. </para></listitem>
  2812. </orderedlist>
  2813. The parameters for controlling the generation of NCRs for submission to D2
  2814. are contained in the "dhcp-ddns" section of the DHCPv4 server
  2815. configuration. The default values for this section appears as follows:
  2816. <screen>
  2817. &gt; <userinput>config show Dhcp4/dhcp-ddns</userinput>
  2818. Dhcp4/dhcp-ddns/enable-updates true boolean
  2819. Dhcp4/dhcp-ddns/server-ip "127.0.0.1" string
  2820. Dhcp4/dhcp-ddns/server-port 53001 integer
  2821. Dhcp4/dhcp-ddns/ncr-protocol "UDP" string
  2822. Dhcp4/dhcp-ddns/ncr-format "JSON" string
  2823. Dhcp4/dhcp-ddns/override-no-update false boolean
  2824. Dhcp4/dhcp-ddns/override-client-update false boolean
  2825. Dhcp4/dhcp-ddns/replace-client-name false boolean
  2826. Dhcp4/dhcp-ddns/generated-prefix "myhost" string
  2827. Dhcp4/dhcp-ddns/qualifying-suffix "example.com" string
  2828. </screen>
  2829. </para>
  2830. <para>
  2831. The "enable-updates" parameter determines whether or not DHCPv4 will
  2832. generate NCRs. By default, this value is false hence DDNS updates are
  2833. disabled. To enable DDNS updates set this value to true:
  2834. </para>
  2835. <screen>
  2836. &gt; <userinput>config set Dhcp4/dhcp-ddns/enable-updates true</userinput>
  2837. &gt; <userinput>config commit</userinput>
  2838. </screen>
  2839. <section id="dhcpv4-d2-io-config">
  2840. <title>DHCP-DDNS Server Connectivity</title>
  2841. <para>
  2842. In order for NCRs to reach the D2 server, DHCPv4 must be able
  2843. to communicate with it and so the relevant parameters must be set
  2844. appropriately. The parameters, "server-ip" and "server-port", specify
  2845. the address of the D2 server. By default, D2 is assumed to running
  2846. on the same machine as DHCPv4, and the default values for these two
  2847. parameters should be sufficient. However, if D2 has been configured
  2848. to listen on a different address or port, these values must altered
  2849. accordingly. For example, if D2 has been configured to listen on
  2850. 198.162.1.10 port 900, the following commands would be required:
  2851. <screen>
  2852. &gt; <userinput>config set Dhcp4/dhcp-ddns/server-ip "198.162.1.10"</userinput>
  2853. &gt; <userinput>config set Dhcp4/dhcp-ddns/server-port 900</userinput>
  2854. &gt; <userinput>config commit</userinput>
  2855. </screen>
  2856. D2 can be configured to listen over IPv4 or IPv6, therefore server-ip
  2857. may be either an IPv4 or IPv6 address.
  2858. </para>
  2859. <para>
  2860. The socket protocol that DHCPv4 should use to communicate with D2 is
  2861. specified with the "ncr-protocol" parameter. Currently only UDP is
  2862. supported.
  2863. </para>
  2864. <para>
  2865. The internal format for DDNS update requests sent by DHCPv4 is specified
  2866. with the "ncr-format" parameter. Currently only JSON is supported.
  2867. </para>
  2868. </section>
  2869. <section id="dhcpv4-d2-rules-config">
  2870. <title>When does the DHCPv4 server generate DDNS requests?</title>
  2871. DHCPv4 follows the behavior prescribed for DHCP servers in RFC 4702.
  2872. It is important to keep in mind that DHCPv4 provides the initial decision
  2873. making of when and what to update and forwards that information to D2 in
  2874. the form of NCRs. Carrying out the actual DNS updates and dealing with
  2875. such things as conflict resolution are the purview of D2 (<xref linkend="dhcp-ddns-server"/>).
  2876. <para>
  2877. This section describes when DHCPv4 will generate NCRs and the
  2878. configuration parameters that can be used to influence this decision.
  2879. It assumes that the "enable-updates" parameter is true.
  2880. </para>
  2881. <para>
  2882. In general, DHCPv4 will generate DDNS update requests when:
  2883. <orderedlist>
  2884. <listitem><para>
  2885. A new lease is granted in response to a DHCP REQUEST
  2886. </para></listitem>
  2887. <listitem><para>
  2888. An existing lease is renewed but the FQDN associated with it has
  2889. changed.
  2890. </para></listitem>
  2891. <listitem><para>
  2892. An existing lease is released in response to a DHCP RELEASE
  2893. </para></listitem>
  2894. </orderedlist>
  2895. In the second case, lease renewal, two DDNS requests will be issued: one
  2896. request to remove entries for the previous FQDN and a second request to
  2897. add entries for the new FQDN. In the last case, a lease release, a
  2898. single DDNS request to remove its entries will be made. The decision
  2899. making involved when granting a new lease (the first case) is more
  2900. involved and is discussed next.
  2901. </para>
  2902. <para>
  2903. When a new lease is granted, the DHCPv4 server will generate a DDNS
  2904. update request if the DHCP REQUEST contains either the FQDN option
  2905. (code 81) or the Host Name option (code 12). If both are present,
  2906. the server will use the FQDN option. By default the DHCPv4 server
  2907. will respect the FQDN N and S flags specified by the client as shown
  2908. in the following table:
  2909. </para>
  2910. <table id="fqdn-flag-table">
  2911. <title>Default FQDN Flag Behavior</title>
  2912. <tgroup cols='4' align='left'>
  2913. <colspec colname='cflags'/>
  2914. <colspec colname='meaning'/>
  2915. <colspec colname='response'/>
  2916. <colspec colname='sflags'/>
  2917. <thead>
  2918. <row>
  2919. <entry>Client Flags:N-S</entry>
  2920. <entry>Client Intent</entry>
  2921. <entry>Server Response</entry>
  2922. <entry>Server Flags:N-S-O</entry>
  2923. </row>
  2924. </thead>
  2925. <tbody>
  2926. <row>
  2927. <entry>0-0</entry>
  2928. <entry>
  2929. Client wants to do forward updates, server should do reverse updates
  2930. </entry>
  2931. <entry>Server generates reverse-only request</entry>
  2932. <entry>1-0-0</entry>
  2933. </row>
  2934. <row>
  2935. <entry>0-1</entry>
  2936. <entry>Server should do both forward and reverse updates</entry>
  2937. <entry>Server generates request to update both directions</entry>
  2938. <entry>0-1-0</entry>
  2939. </row>
  2940. <row>
  2941. <entry>1-0</entry>
  2942. <entry>Client wants no updates done</entry>
  2943. <entry>Server does not generate a request</entry>
  2944. <entry>1-0-0</entry>
  2945. </row>
  2946. </tbody>
  2947. </tgroup>
  2948. </table>
  2949. <para>
  2950. The first row in the table above represents "client delegation". Here
  2951. the DHCP client states that it intends to do the forward DNS updates and
  2952. the server should do the reverse updates. By default, DHCPv4 will honor
  2953. the client's wishes and generate a DDNS request to D2 to update only
  2954. reverse DNS data. The parameter, "override-client-update", can be used
  2955. to instruct the server to override client delegation requests. When
  2956. this parameter is true, DHCPv4 will disregard requests for client
  2957. delegation and generate a DDNS request to update both forward and
  2958. reverse DNS data. In this case, the N-S-O flags in the server's
  2959. response to the client will be 0-1-1 respectively.
  2960. </para>
  2961. <para>
  2962. (Note that the flag combination N=1, S=1 is prohibited according to
  2963. RFC 4702. If such a combination is received from the client, the packet
  2964. will be dropped by the DHCPv4 server.)
  2965. </para>
  2966. <para>
  2967. To override client delegation, issue the following commands:
  2968. </para>
  2969. <screen>
  2970. &gt; <userinput>config set Dhcp4/dhcp-ddns/override-client-update true</userinput>
  2971. &gt; <userinput>config commit</userinput>
  2972. </screen>
  2973. <para>
  2974. The third row in the table above describes the case in which the client
  2975. requests that no DNS updates be done. The parameter, "override-no-update",
  2976. can be used to instruct the server to disregard the client's wishes. When
  2977. this parameter is true, DHCPv4 will generate DDNS update request to D2
  2978. even if the client requests no updates be done. The N-S-O flags in the
  2979. server's response to the client will be 0-1-1.
  2980. </para>
  2981. <para>
  2982. To override client delegation, issue the following commands:
  2983. </para>
  2984. <screen>
  2985. &gt; <userinput>config set Dhcp4/dhcp-ddns/override-no-update true</userinput>
  2986. &gt; <userinput>config commit</userinput>
  2987. </screen>
  2988. <para>
  2989. DHCPv4 will always generate DDNS update requests if the client request
  2990. only contains the Host Name option. In addition it will include an FQDN
  2991. option in the response to the client with the FQDN N-S-O flags set to
  2992. 0-1-0 respectively. The domain name portion of the FQDN option will be
  2993. the name submitted to D2 in the DDNS update request.
  2994. </para>
  2995. </section>
  2996. <section id="dhcpv4-fqdn-name-generation">
  2997. <title>DHCPv4 name generation for DDNS update requests</title>
  2998. Each NameChangeRequest must of course include the fully qualified domain
  2999. name whose DNS entries are to be affected. DHCPv4 can be configured to
  3000. supply a portion or all of that name based upon what it receives from
  3001. the client in the DHCP REQUEST.
  3002. <para>
  3003. The rules for determining the FQDN option are as follows:
  3004. <orderedlist>
  3005. <listitem><para>
  3006. If configured to do, so ignore the REQUEST contents and generate a
  3007. FQDN using a configurable prefix and suffix.
  3008. </para></listitem>
  3009. <listitem><para>
  3010. If the REQUEST contains the client FQDN option, the candidate
  3011. name is taken from there, otherwise it is taken from the Host Name option.
  3012. The candiate name may then be modified:
  3013. <orderedlist>
  3014. <listitem><para>
  3015. If the candidate name is a fully qualified domain name, use it.
  3016. </para></listitem>
  3017. <listitem><para>
  3018. If the candidate name is a partial (i.e. unqualified) name then
  3019. add a configurable suffix to the name and use the result as the FQDN.
  3020. </para></listitem>
  3021. <listitem><para>
  3022. If the candidate name is a empty, generate a FQDN using a
  3023. configurable prefix and suffix.
  3024. </para></listitem>
  3025. </orderedlist>
  3026. </para></listitem>
  3027. </orderedlist>
  3028. To instruct DHCPv4 to always generate the FQDN for a client, set the
  3029. parameter "replace-client-name" to true as follows:
  3030. </para>
  3031. <screen>
  3032. &gt; <userinput>config set Dhcp4/dhcp-ddns/replace-client-name true</userinput>
  3033. &gt; <userinput>config commit</userinput>
  3034. </screen>
  3035. <para>
  3036. The prefix used in the generation of a FQDN is specified by the
  3037. "generated-prefix" parameter. The default value is "myhost". To alter
  3038. its value simply set it to the desired string:
  3039. </para>
  3040. <screen>
  3041. &gt; <userinput>config set Dhcp4/dhcp-ddns/generated-prefix "another.host"</userinput>
  3042. &gt; <userinput>config commit</userinput>
  3043. </screen>
  3044. <para>
  3045. The suffix used when generating a FQDN or when qualifying a partial
  3046. name is specified by the "qualifying-suffix" parameter. The default
  3047. value is "example.com". To alter its value simply set it to the desired
  3048. string:
  3049. </para>
  3050. <screen>
  3051. &gt; <userinput>config set Dhcp4/dhcp-ddns/generated-prefix "our.net"</userinput>
  3052. &gt; <userinput>config commit</userinput>
  3053. </screen>
  3054. </section>
  3055. <para>
  3056. When generating a name, DHCPv4 will construct name of the format:
  3057. </para>
  3058. <para>
  3059. [generated-prefix]-[address-text].[qualifying-suffix].
  3060. </para>
  3061. <para>
  3062. where address-text is simply the lease IP address converted to a
  3063. hyphenated string. For example, if lease address is 172.16.1.10 and
  3064. assuming default values for generated-prefix and qualifying-suffix, the
  3065. generated FQDN would be:
  3066. </para>
  3067. <para>
  3068. myhost-172-16-1-10.example.com.
  3069. </para>
  3070. </section>
  3071. </section> <!-- end of configuring DHCPv4 server section with many subsections -->
  3072. <section id="dhcp4-serverid">
  3073. <title>Server Identifier in DHCPv4</title>
  3074. <para>
  3075. The DHCPv4 protocol uses a "server identifier" for clients to be able
  3076. to discriminate between several servers present on the same link: this
  3077. value is an IPv4 address of the server. The server chooses the IPv4 address
  3078. of the interface on which the message from the client (or relay) has been
  3079. received. A single server instance will use multiple server identifiers
  3080. if it is receiving queries on multiple interfaces.
  3081. </para>
  3082. <para>
  3083. Currently there is no mechanism to override the default server identifiers
  3084. by an administrator. In the future, the configuration mechanism will be used
  3085. to specify the custom server identifier.
  3086. </para>
  3087. </section>
  3088. <section id="dhcp4-next-server">
  3089. <title>Next server (siaddr)</title>
  3090. <para>In some cases, clients want to obtain configuration from the TFTP server.
  3091. Although there is a dedicated option for it, some devices may use siaddr field
  3092. in the DHCPv4 packet for that purpose. That specific field can be configured
  3093. using next-server directive. It is possible to define it in global scope or
  3094. for a given subnet only. If both are defined, subnet value takes precedence.
  3095. The value in subnet can be set to 0.0.0.0, which means that next-server should
  3096. not be sent. It may also be set to empty string, which means the same as if
  3097. it was not defined at all - use global value.
  3098. </para>
  3099. <screen>
  3100. &gt; <userinput>config add Dhcp4/next-server</userinput>
  3101. &gt; <userinput>config set Dhcp4/next-server "192.0.2.123"</userinput>
  3102. &gt; <userinput>config commit</userinput>
  3103. <userinput></userinput>
  3104. &gt; <userinput>config add Dhcp4/subnet[0]/next-server</userinput>
  3105. &gt; <userinput>config set Dhcp4/subnet[0]/next-server "192.0.2.234"</userinput>
  3106. &gt; <userinput>config commit</userinput>
  3107. </screen>
  3108. </section>
  3109. <section id="dhcp4-echo-client-id">
  3110. <title>Echoing client-id (RFC6842)</title>
  3111. <para>Original DHCPv4 spec (RFC2131) states that the DHCPv4
  3112. server must not send back client-id options when responding to
  3113. clients. However, in some cases that confused clients that did
  3114. not have MAC address or client-id. See RFC6842 for details. That
  3115. behavior has changed with the publication of RFC6842 which
  3116. updated RFC2131. That update now states that the server must
  3117. send client-id if client sent it. That is the default behaviour
  3118. that Kea offers. However, in some cases older devices that do
  3119. not support RFC6842 may refuse to accept responses that include
  3120. client-id option. To enable backward compatibility, an optional
  3121. configuration parameter has been introduced. To configure it,
  3122. use the following commands:</para>
  3123. <screen>
  3124. &gt; <userinput>config add Dhcp4/echo-client-id</userinput>
  3125. &gt; <userinput>config set Dhcp4/echo-client-id False</userinput>
  3126. &gt; <userinput>config commit</userinput>
  3127. </screen>
  3128. </section>
  3129. <section id="dhcp4-subnet-selection">
  3130. <title>How DHCPv4 server selects subnet for a client</title>
  3131. <para>
  3132. The DHCPv4 server differentiates between the directly connected clients,
  3133. clients trying to renew leases and clients sending their messages through
  3134. relays. For the directly connected clients the server will check the
  3135. configuration of the interface on which the message has been received, and
  3136. if the server configuration doesn't match any configured subnet the
  3137. message is discarded.</para>
  3138. <para>Assuming that the server's interface is configured with the 192.0.2.3
  3139. IPv4 address, the server will only process messages received through
  3140. this interface from the directly connected client, if there is a subnet
  3141. configured, to which this IPv4 address belongs, e.g. 192.0.2.0/24.
  3142. The server will use this subnet to assign IPv4 address for the client.
  3143. </para>
  3144. <para>
  3145. The rule above does not apply when the client unicasts its message, i.e.
  3146. is trying to renew its lease. Such message is accepted through any
  3147. interface. The renewing client sets ciaddr to the currently used IPv4
  3148. address. The server uses this address to select the subnet for the client
  3149. (in particular, to extend the lease using this address).
  3150. </para>
  3151. <para>
  3152. If the message is relayed it is accepted through any interface. The giaddr
  3153. set by the relay agent is used to select the subnet for the client.
  3154. </para>
  3155. <para>
  3156. It is also possible to specify a relay IPv4 address for a given subnet. It
  3157. can be used to match incoming packets into a subnet in uncommon configurations,
  3158. e.g. shared subnets. See <xref linkend="dhcp4-relay-override"/> for details.
  3159. </para>
  3160. <note>
  3161. <para>The subnet selection mechanism described in this section is based
  3162. on the assumption that client classification is not used. The classification
  3163. mechanism alters the way in which subnet is selected for the client,
  3164. depending on the classes that the client belongs to.</para>
  3165. </note>
  3166. </section>
  3167. <section id="dhcp4-relay-override">
  3168. <title>Using specific relay agent for a subnet</title>
  3169. <para>
  3170. The relay has to have an interface connected to the link on which
  3171. the clients are being configured. Typically the relay has an IPv4
  3172. address configured on that interface that belongs to the subnet that
  3173. the server will assign addresses from. In such typical case, the
  3174. server is able to use IPv4 address inserted by the relay (in GIADDR
  3175. field of the DHCPv4 packet) to select appropriate subnet.
  3176. </para>
  3177. <para>
  3178. However, that is not always the case. In certain uncommon, but
  3179. valid deployments, the relay address may not match the subnet. This
  3180. usually means that there is more than one subnet allocated for a given
  3181. link. Two most common examples where this is the case are long lasting
  3182. network renumbering (where both old and new address space is still being
  3183. used) and a cable network. In a cable network both cable modems and the
  3184. devices behind them are physically connected to the same link, yet
  3185. they use distinct addressing. In such case, the DHCPv4 server needs
  3186. additional information (IPv4 address of the relay) to properly select
  3187. an appropriate subnet.
  3188. </para>
  3189. <para>
  3190. The following example assumes that there is a subnet 192.0.2.0/24
  3191. that is accessible via relay that uses 10.0.0.1 as its IPv4 address.
  3192. The server will be able to select this subnet for any incoming packets
  3193. that came from a relay that has an address in 192.0.2.0/24 subnet.
  3194. It will also select that subnet for a relay with address 10.0.0.1.
  3195. <screen>
  3196. &gt; <userinput>config add Dhcp4/subnet4</userinput>
  3197. &gt; <userinput>config set Dhcp4/subnet4[0]/subnet "192.0.2.0/24"</userinput>
  3198. &gt; <userinput>config set Dhcp4/subnet4[0]/pool [ "192.0.2.10 - 192.0.2.20" ]</userinput>
  3199. &gt; <userinput>config set Dhcp4/subnet4[0]/relay/ip-address "10.0.0.1"</userinput>
  3200. &gt; <userinput>config commit</userinput></screen>
  3201. </para>
  3202. </section>
  3203. <section id="dhcp4-srv-example-client-class-relay">
  3204. <title>Segregating IPv4 clients in a cable network</title>
  3205. <para>
  3206. In certain cases, it is useful to mix relay address information,
  3207. introduced in <xref linkend="dhcp4-relay-override"/> with client
  3208. classification, explained in <xref linkend="dhcp4-subnet-class"/>.
  3209. One specific example is cable network, where typically modems
  3210. get addresses from a different subnet than all devices connected
  3211. behind them.
  3212. </para>
  3213. <para>
  3214. Let's assume that there is one CMTS (Cable Modem Termination System)
  3215. with one CM MAC (a physical link that modems are connected to).
  3216. We want the modems to get addresses from the 10.1.1.0/24 subnet, while
  3217. everything connected behind modems should get addresses from another
  3218. subnet (192.0.2.0/24). The CMTS that acts as a relay an uses address
  3219. 10.1.1.1. The following configuration can serve that configuration:
  3220. <screen>
  3221. &gt; <userinput>config add Dhcp4/subnet4</userinput>
  3222. &gt; <userinput>config set Dhcp4/subnet4[0]/subnet "10.1.1.0/24"</userinput>
  3223. &gt; <userinput>config set Dhcp4/subnet4[0]/pool [ "10.1.1.2 - 10.1.1.20" ]</userinput>
  3224. &gt; <userinput>config set Dhcp4/subnet4[0]/client-class "docsis3.0"</userinput>
  3225. &gt; <userinput>config set Dhcp4/subnet4[0]/relay/ip-address "10.1.1.1"</userinput>
  3226. &gt; <userinput>config add Dhcp4/subnet4</userinput>
  3227. &gt; <userinput>config set Dhcp4/subnet4[1]/subnet "192.0.2.0/24"</userinput>
  3228. &gt; <userinput>config set Dhcp4/subnet4[1]/pool [ "192.0.2.10 - 192.0.2.20" ]</userinput>
  3229. &gt; <userinput>config set Dhcp4/subnet4[1]/relay/ip-address "10.1.1.1"</userinput>
  3230. &gt; <userinput>config commit</userinput></screen>
  3231. </para>
  3232. </section>
  3233. <section id="dhcp4-std">
  3234. <title>Supported Standards</title>
  3235. <para>The following standards and draft standards are currently
  3236. supported:</para>
  3237. <itemizedlist>
  3238. <listitem>
  3239. <simpara><ulink url="http://tools.ietf.org/html/rfc2131">RFC 2131</ulink>: Supported messages are DISCOVER, OFFER,
  3240. REQUEST, RELEASE, ACK, and NAK.</simpara>
  3241. </listitem>
  3242. <listitem>
  3243. <simpara><ulink url="http://tools.ietf.org/html/rfc2132">RFC 2132</ulink>:
  3244. Supported options are: PAD (0),
  3245. END(255), Message Type(53), DHCP Server Identifier (54),
  3246. Domain Name (15), DNS Servers (6), IP Address Lease Time
  3247. (51), Subnet mask (1), and Routers (3).</simpara>
  3248. </listitem>
  3249. <listitem>
  3250. <simpara><ulink url="http://tools.ietf.org/html/rfc3046">RFC 3046</ulink>:
  3251. Relay Agent Information option is supported.</simpara>
  3252. </listitem>
  3253. <listitem>
  3254. <simpara><ulink url="http://tools.ietf.org/html/rfc3925">RFC 3925</ulink>:
  3255. Vendor-Identifying Vendor Class and Vendor-Identifying Vendor-Specific
  3256. Information option are supported.</simpara>
  3257. </listitem>
  3258. <listitem>
  3259. <simpara><ulink url="http://tools.ietf.org/html/rfc6842">RFC 6842</ulink>:
  3260. Server by default sends back client-id option. That capability may be
  3261. disabled. See <xref linkend="dhcp4-echo-client-id"/> for details.
  3262. </simpara>
  3263. </listitem>
  3264. </itemizedlist>
  3265. </section>
  3266. <section id="dhcp4-limit">
  3267. <title>DHCPv4 Server Limitations</title>
  3268. <para>These are the current limitations of the DHCPv4 server
  3269. software. Most of them are reflections of the current stage of
  3270. development and should be treated as <quote>not implemented
  3271. yet</quote>, rather than actual limitations.</para>
  3272. <itemizedlist>
  3273. <listitem> <!-- see tickets #3234, #3281 -->
  3274. <simpara>
  3275. Removal of a subnet during server reconfiguration may cause renumbering
  3276. of auto-generated subnet identifiers, as described in section
  3277. <xref linkend="ipv4-subnet-id"/>.
  3278. </simpara>
  3279. </listitem>
  3280. <listitem>
  3281. <simpara>
  3282. BOOTP (<ulink url="http://tools.ietf.org/html/rfc951">RFC 951</ulink>)
  3283. is not supported.
  3284. </simpara>
  3285. </listitem>
  3286. <listitem>
  3287. <simpara>Raw sockets operation is working on Linux
  3288. only. See <xref linkend="iface-detect"/> for details.</simpara>
  3289. </listitem>
  3290. <listitem>
  3291. <simpara>The DHCPv4 server does not verify that
  3292. assigned address is unused. According to <ulink url="http://tools.ietf.org/html/rfc2131">RFC 2131</ulink>, the
  3293. allocating server should verify that address is not used by
  3294. sending ICMP echo request.</simpara>
  3295. </listitem>
  3296. <listitem>
  3297. <simpara>Address duplication report (DECLINE) is not supported yet.</simpara>
  3298. </listitem>
  3299. <listitem>
  3300. <simpara>
  3301. The server doesn't act upon expired leases. In particular,
  3302. when a lease expires, the server doesn't request the removal
  3303. of the DNS records associated with it.
  3304. </simpara>
  3305. </listitem>
  3306. </itemizedlist>
  3307. </section>
  3308. <!--
  3309. <section id="dhcp4-srv-examples">
  3310. <title>Kea DHCPv4 server examples</title>
  3311. <para>
  3312. This section provides easy to use example. Each example can be read
  3313. separately. It is not intended to be read sequentially as there will
  3314. be many repetitions between examples. They are expected to serve as
  3315. easy to use copy-paste solutions to many common deployments.
  3316. </para>
  3317. @todo: add simple configuration for direct clients
  3318. @todo: add configuration for relayed clients
  3319. @todo: add client classification example
  3320. </section> -->
  3321. </chapter>
  3322. <chapter id="dhcp6">
  3323. <title>The DHCPv6 Server</title>
  3324. <section id="dhcp6-start-stop">
  3325. <title>Starting and Stopping the DHCPv6 Server</title>
  3326. <para>
  3327. <command>b10-dhcp6</command> is the Kea DHCPv6 server and is configured
  3328. through the <command>bindctl</command> program.
  3329. </para>
  3330. <para>
  3331. After starting <command>bind10</command> and starting <command>bindctl</command>, the first step
  3332. in configuring the server is to add <command>b10-dhcp6</command> to the list of running services.
  3333. <screen>
  3334. &gt; <userinput>config add Init/components b10-dhcp6</userinput>
  3335. &gt; <userinput>config set Init/components/b10-dhcp6/kind dispensable</userinput>
  3336. &gt; <userinput>config commit</userinput>
  3337. </screen>
  3338. </para>
  3339. <para>
  3340. To remove <command>b10-dhcp6</command> from the set of running services,
  3341. the <command>b10-dhcp6</command> is removed from list of Init components:
  3342. <screen>
  3343. &gt; <userinput>config remove Init/components b10-dhcp6</userinput>
  3344. &gt; <userinput>config commit</userinput>
  3345. </screen>
  3346. </para>
  3347. <para>
  3348. Note that the server was only removed from the list, so BIND10 will not
  3349. restart it, but the server itself is still running. Hence it is usually
  3350. desired to stop it:
  3351. <screen>
  3352. &gt; <userinput>Dhcp6 shutdown</userinput>
  3353. </screen>
  3354. </para>
  3355. <para>
  3356. During start-up the server will detect available network interfaces
  3357. and will attempt to open UDP sockets on all interfaces that
  3358. are up, running, are not loopback, are multicast-capable, and
  3359. have IPv6 address assigned. It will then listen to incoming traffic.
  3360. </para>
  3361. </section>
  3362. <section id="dhcp6-configuration">
  3363. <title>DHCPv6 Server Configuration</title>
  3364. <para>
  3365. Once the server has been started, it can be configured. To view the
  3366. current configuration, use the following command in <command>bindctl</command>:
  3367. <screen>&gt; <userinput>config show Dhcp6</userinput></screen>
  3368. When starting the Dhcp6 daemon for the first time, the default configuration
  3369. will be available. It will look similar to this:
  3370. <screen>
  3371. &gt; <userinput>config show Dhcp6</userinput>
  3372. Dhcp6/hooks-libraries [] list (default)
  3373. Dhcp6/interfaces/ list (default)
  3374. Dhcp6/renew-timer 1000 integer (default)
  3375. Dhcp6/rebind-timer 2000 integer (default)
  3376. Dhcp6/preferred-lifetime 3000 integer (default)
  3377. Dhcp6/valid-lifetime 4000 integer (default)
  3378. Dhcp6/option-def [] list (default)
  3379. Dhcp6/option-data [] list (default)
  3380. Dhcp6/lease-database/type "" string (default)
  3381. Dhcp6/lease-database/name "" string (default)
  3382. Dhcp6/lease-database/user "" string (default)
  3383. Dhcp6/lease-database/host "" string (default)
  3384. Dhcp6/lease-database/password "" string (default)
  3385. Dhcp6/subnet6/ list
  3386. Dhcp6/dhcp-ddns/enable-updates true boolean
  3387. Dhcp6/dhcp-ddns/server-ip "127.0.0.1" string
  3388. Dhcp6/dhcp-ddns/server-port 53001 integer
  3389. Dhcp6/dhcp-ddns/ncr-protocol "UDP" string
  3390. Dhcp6/dhcp-ddns/ncr-format "JSON" string
  3391. Dhcp6/dhcp-ddns/always-include-fqdn false boolean
  3392. Dhcp6/dhcp-ddns/override-no-update false boolean
  3393. Dhcp6/dhcp-ddns/override-client-update false boolean
  3394. Dhcp6/dhcp-ddns/replace-client-name false boolean
  3395. Dhcp6/dhcp-ddns/generated-prefix "myhost" string
  3396. Dhcp6/dhcp-ddns/qualifying-suffix "example.com" string
  3397. </screen>
  3398. </para>
  3399. <para>
  3400. To change one of the parameters, simply follow
  3401. the usual <command>bindctl</command> procedure. For example, to make the
  3402. leases longer, change their valid-lifetime parameter:
  3403. <screen>
  3404. &gt; <userinput>config set Dhcp6/valid-lifetime 7200</userinput>
  3405. &gt; <userinput>config commit</userinput></screen>
  3406. Most Dhcp6 parameters are of global scope
  3407. and apply to all defined subnets, unless they are overridden on a
  3408. per-subnet basis.
  3409. </para>
  3410. <note>
  3411. <para>
  3412. With this version of Kea, there are a number of known limitations
  3413. and problems in the DHCPv6 server. See <xref linkend="dhcp6-limit"/>.
  3414. </para>
  3415. </note>
  3416. <section>
  3417. <title>Default storage for leases</title>
  3418. <para>
  3419. The server is able to store lease data in different repositories. Larger deployments
  3420. may elect to store leases in a database.
  3421. <xref linkend="database-configuration6"/> describes one way to do it.
  3422. By default, the server will use a CSV file rather than a database to store
  3423. lease information. One of the advantages of using a file is that it eliminates
  3424. dependency on third party database software.
  3425. </para>
  3426. <para>
  3427. The configuration of the file backend (Memfile)
  3428. is controlled through the Dhcp6/lease-database parameters. When default
  3429. parameters are left, the Memfile backend will write leases to a disk in the
  3430. [bind10-install-dir]/var/bind10/kea-leases6.csv.
  3431. </para>
  3432. <para>
  3433. It is possible to alter the default location of the lease file. The following
  3434. configuration:
  3435. <screen>
  3436. &gt; <userinput>config set Dhcp4/lease-database/type "memfile"</userinput>
  3437. &gt; <userinput>config set Dhcp4/lease-database/persist true</userinput>
  3438. &gt; <userinput>config set Dhcp4/lease-database/leasefile "/tmp/kea-leases6.csv"</userinput>
  3439. &gt; <userinput>config commit</userinput>
  3440. </screen>
  3441. will change the default location of the lease file to /tmp/kea-leases6.csv.
  3442. </para>
  3443. <para>
  3444. The "persist" parameter controls whether the leases are written to disk.
  3445. It is strongly recommended that this parameter is set to "true" at all times
  3446. during the normal operation of the server.
  3447. </para>
  3448. </section>
  3449. <section id="database-configuration6">
  3450. <title>Database Configuration</title>
  3451. <para>
  3452. All leases issued by the server are stored in the lease database. Currently
  3453. there are 3 database backends available: MySQL, PostgreSQL and memfile.
  3454. <footnote>
  3455. <para>
  3456. The server comes with an in-memory database ("memfile") configured as the default
  3457. database. This is used for internal testing and is not supported. In addition,
  3458. it does not store lease information on disk: lease information will be lost if the
  3459. server is restarted.
  3460. </para>
  3461. </footnote>, and so the server must be configured to
  3462. access the correct database with the appropriate credentials.
  3463. </para>
  3464. <note>
  3465. <para>
  3466. Database access information must be configured for the DHCPv6 server, even if
  3467. it has already been configured for the DHCPv4 server. The servers store their
  3468. information independently, so each server can use a separate
  3469. database or both servers can use the same database.
  3470. </para>
  3471. </note>
  3472. <para>
  3473. Database configuration is controlled through the Dhcp6/lease-database parameters.
  3474. The type of the database must be set to "mysql", "postgresql" or "memfile":
  3475. <screen>
  3476. &gt; <userinput>config set Dhcp6/lease-database/type "mysql"</userinput>
  3477. </screen>
  3478. Next, the name of the database is to hold the leases must be set: this is the
  3479. name used when the lease database was created (see <xref linkend="dhcp-mysql-database-create"/>
  3480. or <xref linkend="dhcp-pgsql-database-create"/>).
  3481. <screen>
  3482. &gt; <userinput>config set Dhcp6/lease-database/name "<replaceable>database-name</replaceable>"</userinput>
  3483. </screen>
  3484. If the database is located on a different system to the DHCPv6 server, the
  3485. database host name must also be specified (although note that this configuration
  3486. may have a severe impact on server performance):
  3487. <screen>
  3488. &gt; <userinput>config set Dhcp6/lease-database/host "<replaceable>remote-host-name</replaceable>"</userinput>
  3489. </screen>
  3490. The usual state of affairs will be to have the database on the same machine as the
  3491. DHCPv6 server. In this case, set the value to the empty string (this is the default):
  3492. <screen>
  3493. &gt; <userinput>config set Dhcp6/lease-database/host ""</userinput>
  3494. </screen>
  3495. </para>
  3496. <para>
  3497. Finally, the credentials of the account under which the server will access the database
  3498. should be set:
  3499. <screen>
  3500. &gt; <userinput>config set Dhcp6/lease-database/user "<replaceable>user-name</replaceable>"</userinput>
  3501. &gt; <userinput>config set Dhcp6/lease-database/password "<replaceable>password</replaceable>"</userinput>
  3502. </screen>
  3503. If there is no password to the account, set the password to the empty string "". (This is also the default.)
  3504. </para>
  3505. <note>
  3506. <para>The password is echoed when entered and is stored in clear text in the configuration
  3507. database. Improved password security will be added in a future version of Kea.</para>
  3508. </note>
  3509. </section>
  3510. <section id="dhcp6-interface-selection">
  3511. <title>Interface selection</title>
  3512. <para>
  3513. When DHCPv6 server starts up, by default it will listen to the DHCP
  3514. traffic and respond to it on all interfaces detected during startup.
  3515. However, in many cases it is desired to configure the server to listen and
  3516. respond on selected interfaces only. The sample commands in this section
  3517. show how to make interface selection using bindctl.
  3518. </para>
  3519. <para>
  3520. The default configuration can be presented with the following command:
  3521. <screen>
  3522. &gt; <userinput>config show Dhcp6/interfaces</userinput>
  3523. <userinput>Dhcp6/interfaces[0] "*" string</userinput></screen>
  3524. An asterisk sign plays a role of the wildcard and means "listen on all interfaces".
  3525. </para>
  3526. <para>
  3527. In order to override the default configuration, the existing entry can be replaced
  3528. with the actual interface name:
  3529. <screen>
  3530. &gt; <userinput>config set Dhcp6/interfaces[0] eth1</userinput>
  3531. &gt; <userinput>config commit</userinput></screen>
  3532. Other interface names can be added on one-by-one basis:
  3533. <screen>
  3534. &gt; <userinput>config add Dhcp6/interfaces eth2</userinput>
  3535. &gt; <userinput>config commit</userinput></screen>
  3536. Configuration will now contain two interfaces which can be presented as follows:
  3537. <screen>
  3538. &gt; <userinput>config show Dhcp6/interfaces</userinput>
  3539. <userinput>Dhcp6/interfaces[0] "eth1" string</userinput>
  3540. <userinput>Dhcp6/interfaces[1] "eth2" string</userinput></screen>
  3541. When configuration gets committed, the server will start to listen on
  3542. eth1 and eth2 interfaces only.
  3543. </para>
  3544. <para>
  3545. It is possible to use wildcard interface name (asterisk) concurrently with explicit
  3546. interface names:
  3547. <screen>
  3548. &gt; <userinput>config add Dhcp6/interfaces *</userinput>
  3549. &gt; <userinput>config commit</userinput></screen>
  3550. This will result in the following configuration:
  3551. <screen>
  3552. &gt; <userinput>config show Dhcp6/interfaces</userinput>
  3553. <userinput>Dhcp6/interfaces[0] "eth1" string</userinput>
  3554. <userinput>Dhcp6/interfaces[1] "eth2" string</userinput>
  3555. <userinput>Dhcp6/interfaces[2] "*" string</userinput></screen>
  3556. The presence of the wildcard name implies that server will listen on all interfaces.
  3557. In order to fall back to the previous configuration when server listens on eth1 and eth2:
  3558. <screen>
  3559. &gt; <userinput>config remove Dhcp6/interfaces[2]</userinput>
  3560. &gt; <userinput>config commit</userinput></screen>
  3561. </para>
  3562. </section>
  3563. <section id="ipv6-subnet-id">
  3564. <title>IPv6 Subnet Identifier</title>
  3565. <para>
  3566. Subnet identifier is a unique number associated with a particular subnet.
  3567. In principle, it is used to associate clients' leases with respective subnets.
  3568. When subnet identifier is not specified for a subnet being configured, it will
  3569. be automatically assigned by the configuration mechanism. The identifiers
  3570. are assigned from 1 and are monotonically increased for each subsequent
  3571. subnet: 1, 2, 3 ....
  3572. </para>
  3573. <para>
  3574. If there are multiple subnets configured with auto-generated identifiers and
  3575. one of them is removed, the subnet identifiers may be renumbered. For example:
  3576. if there are 4 subnets and 3rd is removed the last subnet will be assigned
  3577. identifier that the 3rd subnet had before removal. As a result, the leases
  3578. stored in the lease database for subnet 3 are now associated with the
  3579. subnet 4, which may have unexpected consequences. In the future it is planned
  3580. to implement the mechanism to preserve auto-generated subnet ids upon removal
  3581. of one of the subnets. Currently, the only remedy for this issue is to
  3582. manually specify the unique subnet identifier for each subnet.
  3583. </para>
  3584. <para>
  3585. The following configuration:
  3586. <screen>
  3587. &gt; <userinput>config add Dhcp6/subnet6</userinput>
  3588. &gt; <userinput>config set Dhcp6/subnet6[0]/subnet "2001:db8:1::/64"</userinput>
  3589. &gt; <userinput>config set Dhcp6/subnet6[0]/id 1024</userinput>
  3590. &gt; <userinput>config commit</userinput>
  3591. </screen>
  3592. will assign the arbitrary subnet identifier to the newly configured subnet.
  3593. This identifier will not change for this subnet until "id" parameter is
  3594. removed or set to 0. The value of 0 forces auto-generation of subnet
  3595. identifier.
  3596. </para>
  3597. </section>
  3598. <section id="dhcp6-unicast">
  3599. <title>Unicast traffic support</title>
  3600. <para>
  3601. When DHCPv6 server starts up, by default it listens to the DHCP traffic
  3602. sent to multicast address ff02::1:2 on each interface that it is
  3603. configured to listen on (see <xref linkend="dhcp6-interface-selection"/>).
  3604. In some cases it is useful to configure a server to handle incoming
  3605. traffic sent to the global unicast addresses as well. The most common
  3606. reason for that is to have relays send their traffic to the server
  3607. directly. To configure server to listen on specific unicast address, a
  3608. notation to specify interfaces has been extended. Interface name can be
  3609. optionally followed by a slash, followed by global unicast address that
  3610. server should listen on. That will be done in addition to normal
  3611. link-local binding + listening on ff02::1:2 address. The sample commands
  3612. listed below show how to listen on 2001:db8::1 (a global address)
  3613. configured on the eth1 interface.
  3614. </para>
  3615. <para>
  3616. <screen>
  3617. &gt; <userinput>config set Dhcp6/interfaces[0] eth1/2001:db8::1</userinput>
  3618. &gt; <userinput>config commit</userinput></screen>
  3619. When configuration gets committed, the server will start to listen on
  3620. eth1 on link-local address, multicast group (ff02::1:2) and 2001:db8::1.
  3621. </para>
  3622. <para>
  3623. It is possible to mix interface names, wildcards and interface name/addresses
  3624. on the Dhcp6/interface list. It is not possible to specify more than one
  3625. unicast address on a given interface.
  3626. </para>
  3627. <para>
  3628. Care should be taken to specify proper unicast addresses. The server will
  3629. attempt to bind to those addresses specified, without any additional checks.
  3630. That approach is selected on purpose, so in the software can be used to
  3631. communicate over uncommon addresses if the administrator desires so.
  3632. </para>
  3633. </section>
  3634. <section id="dhcp6-address-config">
  3635. <title>Subnet and Address Pool</title>
  3636. <para>
  3637. The essential role of a DHCPv6 server is address assignment. For this,
  3638. the server has to be configured with at least one subnet and one pool of dynamic
  3639. addresses to be managed. For example, assume that the server
  3640. is connected to a network segment that uses the 2001:db8:1::/64
  3641. prefix. The Administrator of that network has decided that addresses from range
  3642. 2001:db8:1::1 to 2001:db8:1::ffff are going to be managed by the Dhcp6
  3643. server. Such a configuration can be achieved in the following way:
  3644. <screen>
  3645. &gt; <userinput>config add Dhcp6/subnet6</userinput>
  3646. &gt; <userinput>config set Dhcp6/subnet6[0]/subnet "2001:db8:1::/64"</userinput>
  3647. &gt; <userinput>config set Dhcp6/subnet6[0]/pool [ "2001:db8:1::0 - 2001:db8:1::ffff" ]</userinput>
  3648. &gt; <userinput>config commit</userinput></screen>
  3649. Note that subnet is defined as a simple string, but the pool parameter
  3650. is actually a list of pools: for this reason, the pool definition is
  3651. enclosed in square brackets, even though only one range of addresses
  3652. is specified.</para>
  3653. <para>It is possible to define more than one pool in a
  3654. subnet: continuing the previous example, further assume that
  3655. 2001:db8:1:0:5::/80 should be also be managed by the server. It could be written as
  3656. 2001:db8:1:0:5:: to 2001:db8:1::5:ffff:ffff:ffff, but typing so many 'f's
  3657. is cumbersome. It can be expressed more simply as 2001:db8:1:0:5::/80. Both
  3658. formats are supported by Dhcp6 and can be mixed in the pool list.
  3659. For example, one could define the following pools:
  3660. <screen>
  3661. &gt; <userinput>config set Dhcp6/subnet6[0]/pool [ "2001:db8:1::1 - 2001:db8:1::ffff", "2001:db8:1:0:5::/80" ]</userinput>
  3662. &gt; <userinput>config commit</userinput></screen>
  3663. The number of pools is not limited, but for performance reasons it is recommended to
  3664. use as few as possible.
  3665. </para>
  3666. <para>
  3667. The server may be configured to serve more than one subnet. To add a second subnet,
  3668. use a command similar to the following:
  3669. <screen>
  3670. &gt; <userinput>config add Dhcp6/subnet6</userinput>
  3671. &gt; <userinput>config set Dhcp6/subnet6[1]/subnet "2001:db8:beef::/48"</userinput>
  3672. &gt; <userinput>config set Dhcp6/subnet6[1]/pool [ "2001:db8:beef::/48" ]</userinput>
  3673. &gt; <userinput>config commit</userinput></screen>
  3674. Arrays are counted from 0. subnet[0] refers to the subnet defined in the
  3675. previous example. The <command>config add Dhcp6/subnet6</command> command adds
  3676. another (second) subnet. It can be referred to as
  3677. <command>Dhcp6/subnet6[1]</command>. In this example, we allow server to
  3678. dynamically assign all addresses available in the whole subnet. Although
  3679. very wasteful, it is certainly a valid configuration to dedicate the
  3680. whole /48 subnet for that purpose.
  3681. </para>
  3682. <para>
  3683. When configuring a DHCPv6 server using prefix/length notation, please pay
  3684. attention to the boundary values. When specifying that the server should use
  3685. a given pool, it will be able to allocate also first (typically network
  3686. address) address from that pool. For example for pool 2001:db8::/64 the
  3687. 2001:db8:: address may be assigned as well. If you want to avoid this,
  3688. please use the "min-max" notation.
  3689. </para>
  3690. </section>
  3691. <section>
  3692. <!-- @todo: add real meat to the prefix delegation config this is just place holder stuff -->
  3693. <title>Subnet and Prefix Delegation Pools</title>
  3694. <para>
  3695. Subnets may also be configured to delegate address prefixes....
  3696. A subnet may have one or more prefix delegation pools. Each pool has
  3697. a prefixed address, which is specified as a prefix and a prefix length,
  3698. as well as a delegated prefix length. A sample configuration is shown
  3699. below:
  3700. <screen>
  3701. &gt; <userinput>config add Dhcp6/subnet6</userinput>
  3702. &gt; <userinput>config set Dhcp6/subnet6[0]/subnet "2001:db8:1::/64"</userinput>
  3703. &gt; <userinput>config show Dhcp6/subnet6[0]</userinput>
  3704. &gt; <userinput>config add Dhcp6/subnet6[0]/pd-pools</userinput>
  3705. &gt; <userinput>config set Dhcp6/subnet6[0]/pd-pools[0]/prefix "2001:db8:1::"</userinput>
  3706. &gt; <userinput>config set Dhcp6/subnet6[0]/pd-pools[0]/prefix-len 64</userinput>
  3707. &gt; <userinput>config set Dhcp6/subnet6[0]/pd-pools[0]/delegated-len 96</userinput>
  3708. &gt; <userinput>config commit</userinput></screen>
  3709. </para>
  3710. </section>
  3711. <section id="dhcp6-std-options">
  3712. <title>Standard DHCPv6 options</title>
  3713. <para>
  3714. One of the major features of DHCPv6 server is to provide configuration
  3715. options to clients. Although there are several options that require
  3716. special behavior, most options are sent by the server only if the client
  3717. explicitly requested them. The following example shows how to
  3718. configure DNS servers, which is one of the most frequently used
  3719. options. Numbers in the first column are added for easier reference and
  3720. will not appear on screen. Options specified in this way are considered
  3721. global and apply to all configured subnets.
  3722. <screen>
  3723. 1. &gt; <userinput>config add Dhcp6/option-data</userinput>
  3724. 2. &gt; <userinput>config set Dhcp6/option-data[0]/name "dns-servers"</userinput>
  3725. 3. &gt; <userinput>config set Dhcp6/option-data[0]/code 23</userinput>
  3726. 4. &gt; <userinput>config set Dhcp6/option-data[0]/space "dhcp6"</userinput>
  3727. 5. &gt; <userinput>config set Dhcp6/option-data[0]/csv-format true</userinput>
  3728. 6. &gt; <userinput>config set Dhcp6/option-data[0]/data "2001:db8::cafe, 2001:db8::babe"</userinput>
  3729. 7. &gt; <userinput>config commit</userinput>
  3730. </screen>
  3731. </para>
  3732. <para>
  3733. The first line creates new entry in option-data table. It
  3734. contains information on all global options that the server is
  3735. supposed to configure in all subnets. The second line specifies
  3736. option name. For a complete list of currently supported names,
  3737. see <xref linkend="dhcp6-std-options-list"/>.
  3738. The third line specifies option code, which must match one of the
  3739. values from that
  3740. list. Line 4 specifies option space, which must always
  3741. be set to "dhcp6" as these are standard DHCPv6 options. For
  3742. other name spaces, including custom option spaces, see <xref
  3743. linkend="dhcp6-option-spaces"/>. The fifth line specifies the format in
  3744. which the data will be entered: use of CSV (comma
  3745. separated values) is recommended. The sixth line gives the actual value to
  3746. be sent to clients. Data is specified as a normal text, with
  3747. values separated by commas if more than one value is
  3748. allowed.
  3749. </para>
  3750. <para>
  3751. Options can also be configured as hexadecimal values. If csv-format is
  3752. set to false, the option data must be specified as a string of hexadecimal
  3753. numbers. The
  3754. following commands configure the DNS-SERVERS option for all
  3755. subnets with the following addresses: 2001:db8:1::cafe and
  3756. 2001:db8:1::babe.
  3757. <screen>
  3758. &gt; <userinput>config add Dhcp6/option-data</userinput>
  3759. &gt; <userinput>config set Dhcp6/option-data[0]/name "dns-servers"</userinput>
  3760. &gt; <userinput>config set Dhcp6/option-data[0]/code 23</userinput>
  3761. &gt; <userinput>config set Dhcp6/option-data[0]/space "dhcp6"</userinput>
  3762. &gt; <userinput>config set Dhcp6/option-data[0]/csv-format false</userinput>
  3763. &gt; <userinput>config set Dhcp6/option-data[0]/data "2001 0DB8 0001 0000 0000 0000</userinput>
  3764. <userinput>0000 CAFE 2001 0DB8 0001 0000 0000 0000 0000 BABE"</userinput>
  3765. &gt; <userinput>config commit</userinput>
  3766. </screen>
  3767. (The value for the setting of the "data" element is split across two
  3768. lines in this document for clarity: when entering the command, the
  3769. whole string should be entered on the same line.)
  3770. </para>
  3771. <para>
  3772. It is possible to override options on a per-subnet basis. If
  3773. clients connected to most of your subnets are expected to get the
  3774. same values of a given option, you should use global options: you
  3775. can then override specific values for a small number of subnets.
  3776. On the other hand, if you use different values in each subnet,
  3777. it does not make sense to specify global option values
  3778. (Dhcp6/option-data), rather you should set only subnet-specific values
  3779. (Dhcp6/subnet[X]/option-data[Y]).
  3780. </para>
  3781. <para>
  3782. The following commands override the global
  3783. DNS servers option for a particular subnet, setting a single DNS
  3784. server with address 2001:db8:1::3.
  3785. <screen>
  3786. &gt; <userinput>config add Dhcp6/subnet6[0]/option-data</userinput>
  3787. &gt; <userinput>config set Dhcp6/subnet6[0]/option-data[0]/name "dns-servers"</userinput>
  3788. &gt; <userinput>config set Dhcp6/subnet6[0]/option-data[0]/code 23</userinput>
  3789. &gt; <userinput>config set Dhcp6/subnet6[0]/option-data[0]/space "dhcp6"</userinput>
  3790. &gt; <userinput>config set Dhcp6/subnet6[0]/option-data[0]/csv-format true</userinput>
  3791. &gt; <userinput>config set Dhcp6/subnet6[0]/option-data[0]/data "2001:db8:1::3"</userinput>
  3792. &gt; <userinput>config commit</userinput></screen>
  3793. </para>
  3794. <note>
  3795. <para>
  3796. In future versions of BIND 10 DHCP, it will not be necessary to specify
  3797. option code, space and csv-format fields, as those fields will be set
  3798. automatically.
  3799. </para>
  3800. </note>
  3801. <para>
  3802. The currently supported standard DHCPv6 options are
  3803. listed in <xref linkend="dhcp6-std-options-list"/>.
  3804. The "Name" and "Code"
  3805. are the values that should be used as a name in the option-data
  3806. structures. "Type" designates the format of the data: the meanings of
  3807. the various types is given in <xref linkend="dhcp-types"/>.
  3808. </para>
  3809. <para>
  3810. Some options are designated as arrays, which means that more than one
  3811. value is allowed in such an option. For example the option dns-servers
  3812. allows the specification of more than one IPv6 address, so allowing
  3813. clients to obtain the the addresses of multiple DNS servers.
  3814. </para>
  3815. <!-- @todo: describe record types -->
  3816. <para>
  3817. The <xref linkend="dhcp6-custom-options"/> describes the configuration
  3818. syntax to create custom option definitions (formats). It is generally not
  3819. allowed to create custom definitions for standard options, even if the
  3820. definition being created matches the actual option format defined in the
  3821. RFCs. There is an exception from this rule for standard options for which
  3822. Kea does not provide a definition yet. In order to use such options,
  3823. a server administrator must create a definition as described in
  3824. <xref linkend="dhcp6-custom-options"/> in the 'dhcp6' option space. This
  3825. definition should match the option format described in the relevant
  3826. RFC but configuration mechanism would allow any option format as it has
  3827. no means to validate it at the moment.
  3828. </para>
  3829. <para>
  3830. <table frame="all" id="dhcp6-std-options-list">
  3831. <title>List of standard DHCPv6 options</title>
  3832. <tgroup cols='4'>
  3833. <colspec colname='name'/>
  3834. <colspec colname='code'/>
  3835. <colspec colname='type'/>
  3836. <colspec colname='array'/>
  3837. <thead>
  3838. <row><entry>Name</entry><entry>Code</entry><entry>Type</entry><entry>Array?</entry></row>
  3839. </thead>
  3840. <tbody>
  3841. <!-- Our engine uses those options on its own, admin must not configure them on his own
  3842. <row><entry>clientid</entry><entry>1</entry><entry>binary</entry><entry>false</entry></row>
  3843. <row><entry>serverid</entry><entry>2</entry><entry>binary</entry><entry>false</entry></row>
  3844. <row><entry>ia-na</entry><entry>3</entry><entry>record</entry><entry>false</entry></row>
  3845. <row><entry>ia-ta</entry><entry>4</entry><entry>uint32</entry><entry>false</entry></row>
  3846. <row><entry>iaaddr</entry><entry>5</entry><entry>record</entry><entry>false</entry></row>
  3847. <row><entry>oro</entry><entry>6</entry><entry>uint16</entry><entry>true</entry></row> -->
  3848. <row><entry>preference</entry><entry>7</entry><entry>uint8</entry><entry>false</entry></row>
  3849. <!-- Our engine uses those options on its own, admin must not configure them on his own
  3850. <row><entry>elapsed-time</entry><entry>8</entry><entry>uint16</entry><entry>false</entry></row>
  3851. <row><entry>relay-msg</entry><entry>9</entry><entry>binary</entry><entry>false</entry></row>
  3852. <row><entry>auth</entry><entry>11</entry><entry>binary</entry><entry>false</entry></row>
  3853. <row><entry>unicast</entry><entry>12</entry><entry>ipv6-address</entry><entry>false</entry></row>
  3854. <row><entry>status-code</entry><entry>13</entry><entry>record</entry><entry>false</entry></row>
  3855. <row><entry>rapid-commit</entry><entry>14</entry><entry>empty</entry><entry>false</entry></row>
  3856. <row><entry>user-class</entry><entry>15</entry><entry>binary</entry><entry>false</entry></row>
  3857. <row><entry>vendor-class</entry><entry>16</entry><entry>record</entry><entry>false</entry></row>
  3858. <row><entry>vendor-opts</entry><entry>17</entry><entry>uint32</entry><entry>false</entry></row>
  3859. <row><entry>interface-id</entry><entry>18</entry><entry>binary</entry><entry>false</entry></row>
  3860. <row><entry>reconf-msg</entry><entry>19</entry><entry>uint8</entry><entry>false</entry></row>
  3861. <row><entry>reconf-accept</entry><entry>20</entry><entry>empty</entry><entry>false</entry></row> -->
  3862. <row><entry>sip-server-dns</entry><entry>21</entry><entry>fqdn</entry><entry>true</entry></row>
  3863. <row><entry>sip-server-addr</entry><entry>22</entry><entry>ipv6-address</entry><entry>true</entry></row>
  3864. <row><entry>dns-servers</entry><entry>23</entry><entry>ipv6-address</entry><entry>true</entry></row>
  3865. <row><entry>domain-search</entry><entry>24</entry><entry>fqdn</entry><entry>true</entry></row>
  3866. <!-- <row><entry>ia-pd</entry><entry>25</entry><entry>record</entry><entry>false</entry></row> -->
  3867. <!-- <row><entry>iaprefix</entry><entry>26</entry><entry>record</entry><entry>false</entry></row> -->
  3868. <row><entry>nis-servers</entry><entry>27</entry><entry>ipv6-address</entry><entry>true</entry></row>
  3869. <row><entry>nisp-servers</entry><entry>28</entry><entry>ipv6-address</entry><entry>true</entry></row>
  3870. <row><entry>nis-domain-name</entry><entry>29</entry><entry>fqdn</entry><entry>true</entry></row>
  3871. <row><entry>nisp-domain-name</entry><entry>30</entry><entry>fqdn</entry><entry>true</entry></row>
  3872. <row><entry>sntp-servers</entry><entry>31</entry><entry>ipv6-address</entry><entry>true</entry></row>
  3873. <row><entry>information-refresh-time</entry><entry>32</entry><entry>uint32</entry><entry>false</entry></row>
  3874. <row><entry>bcmcs-server-dns</entry><entry>33</entry><entry>fqdn</entry><entry>true</entry></row>
  3875. <row><entry>bcmcs-server-addr</entry><entry>34</entry><entry>ipv6-address</entry><entry>true</entry></row>
  3876. <row><entry>geoconf-civic</entry><entry>36</entry><entry>record</entry><entry>false</entry></row>
  3877. <row><entry>remote-id</entry><entry>37</entry><entry>record</entry><entry>false</entry></row>
  3878. <row><entry>subscriber-id</entry><entry>38</entry><entry>binary</entry><entry>false</entry></row>
  3879. <row><entry>client-fqdn</entry><entry>39</entry><entry>record</entry><entry>false</entry></row>
  3880. <row><entry>pana-agent</entry><entry>40</entry><entry>ipv6-address</entry><entry>true</entry></row>
  3881. <row><entry>new-posix-timezone</entry><entry>41</entry><entry>string</entry><entry>false</entry></row>
  3882. <row><entry>new-tzdb-timezone</entry><entry>42</entry><entry>string</entry><entry>false</entry></row>
  3883. <row><entry>ero</entry><entry>43</entry><entry>uint16</entry><entry>true</entry></row>
  3884. <row><entry>lq-query</entry><entry>44</entry><entry>record</entry><entry>false</entry></row>
  3885. <row><entry>client-data</entry><entry>45</entry><entry>empty</entry><entry>false</entry></row>
  3886. <row><entry>clt-time</entry><entry>46</entry><entry>uint32</entry><entry>false</entry></row>
  3887. <row><entry>lq-relay-data</entry><entry>47</entry><entry>record</entry><entry>false</entry></row>
  3888. <row><entry>lq-client-link</entry><entry>48</entry><entry>ipv6-address</entry><entry>true</entry></row>
  3889. </tbody>
  3890. </tgroup>
  3891. </table>
  3892. </para>
  3893. </section>
  3894. <section id="dhcp6-custom-options">
  3895. <title>Custom DHCPv6 options</title>
  3896. <para>It is also possible to define options other than the standard ones.
  3897. Assume that we want to define a new DHCPv6 option called "foo" which will have
  3898. code 100 and will convey a single unsigned 32 bit integer value. We can define
  3899. such an option by using the following commands:
  3900. <screen>
  3901. &gt; <userinput>config add Dhcp6/option-def</userinput>
  3902. &gt; <userinput>config set Dhcp6/option-def[0]/name "foo"</userinput>
  3903. &gt; <userinput>config set Dhcp6/option-def[0]/code 100</userinput>
  3904. &gt; <userinput>config set Dhcp6/option-def[0]/type "uint32"</userinput>
  3905. &gt; <userinput>config set Dhcp6/option-def[0]/array false</userinput>
  3906. &gt; <userinput>config set Dhcp6/option-def[0]/record-types ""</userinput>
  3907. &gt; <userinput>config set Dhcp6/option-def[0]/space "dhcp6"</userinput>
  3908. &gt; <userinput>config set Dhcp6/option-def[0]/encapsulate ""</userinput>
  3909. &gt; <userinput>config commit</userinput></screen>
  3910. The "false" value of the "array" parameter determines that the option
  3911. does NOT comprise an array of "uint32" values but rather a single value.
  3912. Two other parameters have been left blank: "record-types" and "encapsulate".
  3913. The former specifies the comma separated list of option data fields if the
  3914. option comprises a record of data fields. The "record-fields" value should
  3915. be non-empty if the "type" is set to "record". Otherwise it must be left
  3916. blank. The latter parameter specifies the name of the option space being
  3917. encapsulated by the particular option. If the particular option does not
  3918. encapsulate any option space it should be left blank.
  3919. Note that the above set of comments define the format of the new option and do not
  3920. set its values.
  3921. </para>
  3922. <para>Once the new option format is defined, its value is set
  3923. in the same way as for a standard option. For example the following
  3924. commands set a global value that applies to all subnets.
  3925. <screen>
  3926. &gt; <userinput>config add Dhcp6/option-data</userinput>
  3927. &gt; <userinput>config set Dhcp6/option-data[0]/name "foo"</userinput>
  3928. &gt; <userinput>config set Dhcp6/option-data[0]/code 100</userinput>
  3929. &gt; <userinput>config set Dhcp6/option-data[0]/space "dhcp6"</userinput>
  3930. &gt; <userinput>config set Dhcp6/option-data[0]/csv-format true</userinput>
  3931. &gt; <userinput>config set Dhcp6/option-data[0]/data "12345"</userinput>
  3932. &gt; <userinput>config commit</userinput></screen>
  3933. </para>
  3934. <para>New options can take more complex forms than simple use of
  3935. primitives (uint8, string, ipv6-address etc): it is possible to
  3936. define an option comprising a number of existing primitives.
  3937. </para>
  3938. <para>
  3939. Assume we want to define a new option that will consist of an IPv6
  3940. address, followed by an unsigned 16 bit integer, followed by a
  3941. boolean value, followed by a text string. Such an option could
  3942. be defined in the following way:
  3943. <screen>
  3944. &gt; <userinput>config add Dhcp6/option-def</userinput>
  3945. &gt; <userinput>config set Dhcp6/option-def[0]/name "bar"</userinput>
  3946. &gt; <userinput>config set Dhcp6/option-def[0]/code 101</userinput>
  3947. &gt; <userinput>config set Dhcp6/option-def[0]/space "dhcp6"</userinput>
  3948. &gt; <userinput>config set Dhcp6/option-def[0]/type "record"</userinput>
  3949. &gt; <userinput>config set Dhcp6/option-def[0]/array false</userinput>
  3950. &gt; <userinput>config set Dhcp6/option-def[0]/record-types "ipv6-address, uint16, boolean, string"</userinput>
  3951. &gt; <userinput>config set Dhcp6/option-def[0]/encapsulate ""</userinput>
  3952. </screen>
  3953. The "type" is set to "record" to indicate that the option contains
  3954. multiple values of different types. These types are given as a comma-separated
  3955. list in the "record-types" field and should be those listed in <xref linkend="dhcp-types"/>.
  3956. </para>
  3957. <para>
  3958. The values of the option are set as follows:
  3959. <screen>
  3960. &gt; <userinput>config add Dhcp6/option-data</userinput>
  3961. &gt; <userinput>config set Dhcp6/option-data[0]/name "bar"</userinput>
  3962. &gt; <userinput>config set Dhcp6/option-data[0]/space "dhcp6"</userinput>
  3963. &gt; <userinput>config set Dhcp6/option-data[0]/code 101</userinput>
  3964. &gt; <userinput>config set Dhcp6/option-data[0]/csv-format true</userinput>
  3965. &gt; <userinput>config set Dhcp6/option-data[0]/data "2001:db8:1::10, 123, false, Hello World"</userinput>
  3966. &gt; <userinput>config commit</userinput></screen>
  3967. "csv-format" is set "true" to indicate that the "data" field comprises a command-separated
  3968. list of values. The values in the "data" must correspond to the types set in
  3969. the "record-types" field of the option definition.
  3970. </para>
  3971. <note>
  3972. <para>
  3973. It is recommended that boolean values are specified using "true" and "false"
  3974. strings. This helps to prevent errors when typing multiple comma separated
  3975. values, as it make it easier to identify the type of the value being typed,
  3976. and compare it with the order of data fields. Nevertheless, it is possible
  3977. to use integer values: "1" and "0", instead of "true" and "false"
  3978. accordingly. If other integer value is specified, the configuration is
  3979. rejected.
  3980. </para>
  3981. </note>
  3982. </section>
  3983. <section id="dhcp6-vendor-opts">
  3984. <title>DHCPv6 vendor specific options</title>
  3985. <para>
  3986. Currently there are three option spaces defined: dhcp4 (to be used
  3987. in DHCPv4 daemon) and dhcp6 (for the DHCPv6 daemon); there is also
  3988. vendor-opts-space, which is empty by default, but options can be
  3989. defined in it. Those options are called vendor-specific information
  3990. options. The following examples show how to define an option "foo"
  3991. with code 1 that consists of an IPv6 address, an unsigned 16 bit integer
  3992. and a string. The "foo" option is conveyed in a vendor specific
  3993. information option. This option comprises a single uint32 value
  3994. that is set to "12345". The sub-option "foo" follows the data
  3995. field holding this value.
  3996. <screen>
  3997. &gt; <userinput>config add Dhcp6/option-def</userinput>
  3998. &gt; <userinput>config set Dhcp6/option-def[0]/name "foo"</userinput>
  3999. &gt; <userinput>config set Dhcp6/option-def[0]/code 1</userinput>
  4000. &gt; <userinput>config set Dhcp6/option-def[0]/space "vendor-opts-space"</userinput>
  4001. &gt; <userinput>config set Dhcp6/option-def[0]/type "record"</userinput>
  4002. &gt; <userinput>config set Dhcp6/option-def[0]/array false</userinput>
  4003. &gt; <userinput>config set Dhcp6/option-def[0]/record-types "ipv6-address, uint16, string"</userinput>
  4004. &gt; <userinput>config set Dhcp6/option-def[0]/encapsulates ""</userinput>
  4005. &gt; <userinput>config commit</userinput>
  4006. </screen>
  4007. (Note that the option space is set to "vendor-opts-space".)
  4008. Once the option format is defined, the next step is to define actual values
  4009. for that option:
  4010. <screen>
  4011. &gt; <userinput>config add Dhcp6/option-data</userinput>
  4012. &gt; <userinput>config set Dhcp6/option-data[0]/name "foo"</userinput>
  4013. &gt; <userinput>config set Dhcp6/option-data[0]/space "vendor-opts-space"</userinput>
  4014. &gt; <userinput>config set Dhcp6/option-data[0]/code 1</userinput>
  4015. &gt; <userinput>config set Dhcp6/option-data[0]/csv-format true</userinput>
  4016. &gt; <userinput>config set Dhcp6/option-data[0]/data "2001:db8:1::10, 123, Hello World"</userinput>
  4017. &gt; <userinput>config commit</userinput></screen>
  4018. We should also define values for the vendor-opts, that will convey our option foo.
  4019. <screen>
  4020. &gt; <userinput>config add Dhcp6/option-data</userinput>
  4021. &gt; <userinput>config set Dhcp6/option-data[1]/name "vendor-opts"</userinput>
  4022. &gt; <userinput>config set Dhcp6/option-data[1]/space "dhcp6"</userinput>
  4023. &gt; <userinput>config set Dhcp6/option-data[1]/code 17</userinput>
  4024. &gt; <userinput>config set Dhcp6/option-data[1]/csv-format true</userinput>
  4025. &gt; <userinput>config set Dhcp6/option-data[1]/data "12345"</userinput>
  4026. &gt; <userinput>config commit</userinput></screen>
  4027. </para>
  4028. </section>
  4029. <section id="dhcp6-option-spaces">
  4030. <title>Nested DHCPv6 options (custom option spaces)</title>
  4031. <para>It is sometimes useful to define completely new option
  4032. spaces. This is useful if the user wants his new option to
  4033. convey sub-options that use separate numbering scheme, for
  4034. example sub-options with codes 1 and 2. Those option codes
  4035. conflict with standard DHCPv6 options, so a separate option
  4036. space must be defined.
  4037. </para>
  4038. <para>Note that it is not required to create new option space when
  4039. defining sub-options for a standard option because it is by
  4040. default created if the standard option is meant to convey
  4041. any sub-options (see <xref linkend="dhcp6-vendor-opts"/>).
  4042. </para>
  4043. <para>
  4044. Assume that we want to have a DHCPv6 option called "container"
  4045. with code 102 that conveys two sub-options with codes 1 and 2.
  4046. First we need to define the new sub-options:
  4047. <screen>
  4048. &gt; <userinput>config add Dhcp6/option-def</userinput>
  4049. &gt; <userinput>config set Dhcp6/option-def[0]/name "subopt1"</userinput>
  4050. &gt; <userinput>config set Dhcp6/option-def[0]/code 1</userinput>
  4051. &gt; <userinput>config set Dhcp6/option-def[0]/space "isc"</userinput>
  4052. &gt; <userinput>config set Dhcp6/option-def[0]/type "ipv6-address"</userinput>
  4053. &gt; <userinput>config set Dhcp6/option-def[0]/record-types ""</userinput>
  4054. &gt; <userinput>config set Dhcp6/option-def[0]/array false</userinput>
  4055. &gt; <userinput>config set Dhcp6/option-def[0]/encapsulate ""</userinput>
  4056. &gt; <userinput>config commit</userinput>
  4057. &gt; <userinput></userinput>
  4058. &gt; <userinput>config add Dhcp6/option-def</userinput>
  4059. &gt; <userinput>config set Dhcp6/option-def[1]/name "subopt2"</userinput>
  4060. &gt; <userinput>config set Dhcp6/option-def[1]/code 2</userinput>
  4061. &gt; <userinput>config set Dhcp6/option-def[1]/space "isc"</userinput>
  4062. &gt; <userinput>config set Dhcp6/option-def[1]/type "string"</userinput>
  4063. &gt; <userinput>config set Dhcp6/option-def[1]/record-types ""</userinput>
  4064. &gt; <userinput>config set Dhcp6/option-def[1]/array false</userinput>
  4065. &gt; <userinput>config set Dhcp6/option-def[1]/encapsulate ""</userinput>
  4066. &gt; <userinput>config commit</userinput>
  4067. </screen>
  4068. Note that we have defined the options to belong to a new option space
  4069. (in this case, "isc").
  4070. </para>
  4071. <para>
  4072. The next step is to define a regular DHCPv6 option and specify that it
  4073. should include options from the isc option space:
  4074. <screen>
  4075. &gt; <userinput>config add Dhcp6/option-def</userinput>
  4076. &gt; <userinput>config set Dhcp6/option-def[2]/name "container"</userinput>
  4077. &gt; <userinput>config set Dhcp6/option-def[2]/code 102</userinput>
  4078. &gt; <userinput>config set Dhcp6/option-def[2]/space "dhcp6"</userinput>
  4079. &gt; <userinput>config set Dhcp6/option-def[2]/type "empty"</userinput>
  4080. &gt; <userinput>config set Dhcp6/option-def[2]/array false</userinput>
  4081. &gt; <userinput>config set Dhcp6/option-def[2]/record-types ""</userinput>
  4082. &gt; <userinput>config set Dhcp6/option-def[2]/encapsulate "isc"</userinput>
  4083. &gt; <userinput>config commit</userinput>
  4084. </screen>
  4085. The name of the option space in which the sub-options are defined
  4086. is set in the "encapsulate" field. The "type" field is set to "empty"
  4087. which imposes that this option does not carry any data other than
  4088. sub-options.
  4089. </para>
  4090. <para>
  4091. Finally, we can set values for the new options:
  4092. <screen>
  4093. &gt; <userinput>config add Dhcp6/option-data</userinput>
  4094. &gt; <userinput>config set Dhcp6/option-data[0]/name "subopt1"</userinput>
  4095. &gt; <userinput>config set Dhcp6/option-data[0]/space "isc"</userinput>
  4096. &gt; <userinput>config set Dhcp6/option-data[0]/code 1</userinput>
  4097. &gt; <userinput>config set Dhcp6/option-data[0]/csv-format true</userinput>
  4098. &gt; <userinput>config set Dhcp6/option-data[0]/data "2001:db8::abcd"</userinput>
  4099. &gt; <userinput>config commit</userinput>
  4100. &gt; <userinput></userinput>
  4101. &gt; <userinput>config add Dhcp6/option-data</userinput>
  4102. &gt; <userinput>config set Dhcp6/option-data[1]/name "subopt2"</userinput>
  4103. &gt; <userinput>config set Dhcp6/option-data[1]/space "isc"</userinput>
  4104. &gt; <userinput>config set Dhcp6/option-data[1]/code 2</userinput>
  4105. &gt; <userinput>config set Dhcp6/option-data[1]/csv-format true</userinput>
  4106. &gt; <userinput>config set Dhcp6/option-data[1]/data "Hello world"</userinput>
  4107. &gt; <userinput>config commit</userinput>
  4108. &gt; <userinput></userinput>
  4109. &gt; <userinput>config add Dhcp6/option-data</userinput>
  4110. &gt; <userinput>config set Dhcp6/option-data[2]/name "container"</userinput>
  4111. &gt; <userinput>config set Dhcp6/option-data[2]/space "dhcp6"</userinput>
  4112. &gt; <userinput>config set Dhcp6/option-data[2]/code 102</userinput>
  4113. &gt; <userinput>config set Dhcp6/option-data[2]/csv-format true</userinput>
  4114. &gt; <userinput>config set Dhcp6/option-data[2]/data ""</userinput>
  4115. &gt; <userinput>config commit</userinput>
  4116. </screen>
  4117. Even though the "container" option does not carry any data except
  4118. sub-options, the "data" field must be explicitly set to an empty value.
  4119. This is required because in the current version of BIND 10 DHCP, the
  4120. default configuration values are not propagated to the configuration parsers:
  4121. if the "data" is not set the parser will assume that this
  4122. parameter is not specified and an error will be reported.
  4123. </para>
  4124. <para>Note that it is possible to create an option which carries some data
  4125. in addition to the sub-options defined in the encapsulated option space. For example,
  4126. if the "container" option from the previous example was required to carry an uint16
  4127. value as well as the sub-options, the "type" value would have to be set to "uint16" in
  4128. the option definition. (Such an option would then have the following
  4129. data structure: DHCP header, uint16 value, sub-options.) The value specified
  4130. with the "data" parameter - which should be a valid integer enclosed in quotes,
  4131. e.g. "123" - would then be assigned to the uint16 field in the "container" option.
  4132. </para>
  4133. </section>
  4134. <section id="dhcp6-config-subnets">
  4135. <title>IPv6 Subnet Selection</title>
  4136. <para>
  4137. The DHCPv6 server may receive requests from local (connected to the
  4138. same subnet as the server) and remote (connecting via relays) clients.
  4139. As server may have many subnet configurations defined, it must select
  4140. appropriate subnet for a given request.
  4141. </para>
  4142. <para>
  4143. The server can not assume which of configured subnets are local. It is
  4144. possible in IPv4, where there is reasonable expectation that the
  4145. server will have a (global) IPv4 address configured on the interface,
  4146. and can use that information to detect whether a subnet is local or
  4147. not. That assumption is not true in IPv6, as the DHCPv6 must be able
  4148. to operate with having link-local addresses only. Therefore an optional
  4149. &quot;interface&quot; parameter is available within a subnet definition
  4150. to designate that a given subnet is local, i.e. reachable directly over
  4151. specified interface. For example the server that is intended to serve
  4152. a local subnet over eth0 may be configured as follows:
  4153. <screen>
  4154. &gt; <userinput>config add Dhcp6/subnet6</userinput>
  4155. &gt; <userinput>config set Dhcp6/subnet6[1]/subnet "2001:db8:beef::/48"</userinput>
  4156. &gt; <userinput>config set Dhcp6/subnet6[1]/pool [ "2001:db8:beef::/48" ]</userinput>
  4157. &gt; <userinput>config set Dhcp6/subnet6[1]/interface "eth0"</userinput>
  4158. &gt; <userinput>config commit</userinput>
  4159. </screen>
  4160. </para>
  4161. </section>
  4162. <section id="dhcp6-relays">
  4163. <title>DHCPv6 Relays</title>
  4164. <para>
  4165. A DHCPv6 server with multiple subnets defined must select the
  4166. appropriate subnet when it receives a request from client. For clients
  4167. connected via relays, two mechanisms are used:
  4168. </para>
  4169. <para>
  4170. The first uses the linkaddr field in the RELAY_FORW message. The name
  4171. of this field is somewhat misleading in that it does not contain a link-layer
  4172. address: instead, it holds an address (typically a global address) that is
  4173. used to identify a link. The DHCPv6 server checks if the address belongs
  4174. to a defined subnet and, if it does, that subnet is selected for the client's
  4175. request.
  4176. </para>
  4177. <para>
  4178. The second mechanism is based on interface-id options. While forwarding a client's
  4179. message, relays may insert an interface-id option into the message that
  4180. identifies the interface on the relay that received the message. (Some
  4181. relays allow configuration of that parameter, but it is sometimes
  4182. hardcoded and may range from the very simple (e.g. "vlan100") to the very cryptic:
  4183. one example seen on real hardware was "ISAM144|299|ipv6|nt:vp:1:110"). The
  4184. server can use this information to select the appropriate subnet.
  4185. The information is also returned to the relay which then knows the
  4186. interface to use to transmit the response to the client. In order for
  4187. this to work successfully, the relay interface IDs must be unique within
  4188. the network and the server configuration must match those values.
  4189. </para>
  4190. <para>
  4191. When configuring the DHCPv6 server, it should be noted that two
  4192. similarly-named parameters can be configured for a subnet:
  4193. <itemizedlist>
  4194. <listitem><simpara>
  4195. "interface" defines which local network interface can be used
  4196. to access a given subnet.
  4197. </simpara></listitem>
  4198. <listitem><simpara>
  4199. "interface-id" specifies the content of the interface-id option
  4200. used by relays to identify the interface on the relay to which
  4201. the response packet is sent.
  4202. </simpara></listitem>
  4203. </itemizedlist>
  4204. The two are mutually exclusive: a subnet cannot be both reachable locally
  4205. (direct traffic) and via relays (remote traffic). Specifying both is a
  4206. configuration error and the DHCPv6 server will refuse such a configuration.
  4207. </para>
  4208. <para>
  4209. To specify interface-id with value "vlan123", the following commands can
  4210. be used:
  4211. <screen>
  4212. &gt; <userinput>config add Dhcp6/subnet6</userinput>
  4213. &gt; <userinput>config set Dhcp6/subnet6[0]/subnet "2001:db8:beef::/48"</userinput>
  4214. &gt; <userinput>config set Dhcp6/subnet6[0]/pool [ "2001:db8:beef::/48" ]</userinput>
  4215. &gt; <userinput>config set Dhcp6/subnet6[0]/interface-id "vland123"</userinput>
  4216. &gt; <userinput>config commit</userinput>
  4217. </screen>
  4218. </para>
  4219. </section>
  4220. <section id="dhcp6-client-classifier">
  4221. <title>Client Classification in DHCPv6</title>
  4222. <note>
  4223. <para>
  4224. DHCPv6 server has been extended to support limited client classification.
  4225. Although the current capability is modest, it is expected to be expanded
  4226. in the future. It is envisaged that the majority of client classification
  4227. extensions will be using hooks extensions.
  4228. </para>
  4229. </note>
  4230. <para>In certain cases it is useful to differentiate between different types
  4231. of clients and treat them differently. The process of doing classification
  4232. is conducted in two steps. The first step is to assess incoming packet and
  4233. assign it to zero or more classes. This classification is currently simple,
  4234. but is expected to grow in capability soon. Currently the server checks whether
  4235. incoming packet has vendor class option (16). If it has, content
  4236. of that option is prepended with &quot;VENDOR_CLASS_&quot; interpreted as a
  4237. class. For example, modern cable modems will send this option with value
  4238. &quot;docsis3.0&quot; and as a result the packet will belong to class
  4239. &quot;VENDOR_CLASS_docsis3.0&quot;.
  4240. </para>
  4241. <para>It is envisaged that the client classification will be used for changing
  4242. behavior of almost any part of the DHCP engine processing, including assigning
  4243. leases from different pools, assigning different option (or different values of
  4244. the same options) etc. For now, there is only one mechanism that is taking
  4245. advantage of client classification: subnet selection.</para>
  4246. <para>
  4247. Kea can be instructed to limit access to given subnets based on class information.
  4248. This is particularly useful for cases where two types of devices share the
  4249. same link and are expected to be served from two different subnets. The
  4250. primary use case for such a scenario are cable networks. There are two
  4251. classes of devices: cable modem itself, which should be handled a lease
  4252. from subnet A and all other devices behind modems that should get a lease
  4253. from subnet B. That segregation is essential to prevent overly curious
  4254. users from playing with their cable modems. For details on how to set up
  4255. class restrictions on subnets, see <xref linkend="dhcp6-subnet-class"/>.
  4256. </para>
  4257. </section>
  4258. <section id="dhcp6-subnet-class">
  4259. <title>Limiting access to IPv6 subnet to certain classes</title>
  4260. <para>
  4261. In certain cases it beneficial to restrict access to certains subnets
  4262. only to clients that belong to a given subnet. For details on client
  4263. classes, see <xref linkend="dhcp6-client-classifier"/>. This is an
  4264. extension of a previous example from <xref linkend="dhcp6-address-config"/>.
  4265. Let's assume that the server is connected to a network segment that uses
  4266. the 2001:db8:1::/64 prefix. The Administrator of that network has
  4267. decided that addresses from range 2001:db8:1::1 to 2001:db8:1::ffff are
  4268. going to be managed by the Dhcp6 server. Only clients belonging to the
  4269. eRouter1.0 client class are allowed to use that pool. Such a
  4270. configuration can be achieved in the following way:
  4271. <screen>
  4272. &gt; <userinput>config add Dhcp6/subnet6</userinput>
  4273. &gt; <userinput>config set Dhcp6/subnet6[0]/subnet "2001:db8:1::/64"</userinput>
  4274. &gt; <userinput>config set Dhcp6/subnet6[0]/pool [ "2001:db8:1::0 - 2001:db8:1::ffff" ]</userinput>
  4275. &gt; <userinput>config set Dhcp6/subnet6[0]/client-class "eRouter1.0"</userinput>
  4276. &gt; <userinput>config commit</userinput></screen>
  4277. </para>
  4278. <para>
  4279. Care should be taken with client classification as it is easy to prevent
  4280. clients that do not meet class criteria to be denied any service altogether.
  4281. </para>
  4282. </section>
  4283. <section id="dhcp6-ddns-config">
  4284. <title>Configuring DHCPv6 for DDNS</title>
  4285. <para>
  4286. As mentioned earlier, DHCPv6 can be configured to generate requests to
  4287. the DHCP-DDNS server (referred to here as the "D2" server) to update
  4288. DNS entries. These requests are known as NameChangeRequests or NCRs.
  4289. Each NCR contains the following information:
  4290. <orderedlist>
  4291. <listitem><para>
  4292. Whether it is a request to add (update) or remove DNS entries
  4293. </para></listitem>
  4294. <listitem><para>
  4295. Whether the change requests forward DNS updates (AAAA records), reverse
  4296. DNS updates (PTR records), or both.
  4297. </para></listitem>
  4298. <listitem><para>
  4299. The FQDN, lease address, and DHCID
  4300. </para></listitem>
  4301. </orderedlist>
  4302. The parameters controlling the generation of NCRs for submission to D2
  4303. are contained in the "dhcp-ddns" section of the DHCPv6 server
  4304. configuration. The default values for this section appears as follows:
  4305. <screen>
  4306. &gt; <userinput>config show Dhcp6/dhcp-ddns</userinput>
  4307. Dhcp6/dhcp-ddns/enable-updates true boolean
  4308. Dhcp6/dhcp-ddns/server-ip "127.0.0.1" string
  4309. Dhcp6/dhcp-ddns/server-port 53001 integer
  4310. Dhcp6/dhcp-ddns/ncr-protocol "UDP" string
  4311. Dhcp6/dhcp-ddns/ncr-format "JSON" string
  4312. Dhcp6/dhcp-ddns/override-no-update false boolean
  4313. Dhcp6/dhcp-ddns/override-client-update false boolean
  4314. Dhcp6/dhcp-ddns/replace-client-name false boolean
  4315. Dhcp6/dhcp-ddns/generated-prefix "myhost" string
  4316. Dhcp6/dhcp-ddns/qualifying-suffix "example.com" string
  4317. </screen>
  4318. </para>
  4319. <para>
  4320. The "enable-updates" parameter determines whether or not DHCPv6 will
  4321. generate NCRs. By default, this value is false hence DDNS updates are
  4322. disabled. To enable DDNS updates set this value to true as follows:
  4323. </para>
  4324. <screen>
  4325. &gt; <userinput>config set Dhcp6/dhcp-ddns/enable-updates true</userinput>
  4326. &gt; <userinput>config commit</userinput>
  4327. </screen>
  4328. <section id="dhcpv6-d2-io-config">
  4329. <title>DHCP-DDNS Server Connectivity</title>
  4330. In order for NCRs to reach D2, DHCPv6 must be able to communicate with it.
  4331. The following parameters are used to establish connectivty between DHCPv6
  4332. and D2.
  4333. <para>
  4334. The parameters, "server-ip" and "server-port", specify the address of the
  4335. D2 server. By default, D2 is assumed to running on the same machine as
  4336. DHCPv6, and the default values for these two parameters should be
  4337. sufficient. However, if D2 has been configured to listen on a different
  4338. address or port, these values must altered accordingly. For example, if
  4339. D2 has been configured to listen on 198.162.1.10 port 900, the following
  4340. commands would be required:
  4341. </para>
  4342. <screen>
  4343. &gt; <userinput>config set Dhcp6/dhcp-ddns/server-ip "198.162.1.10"</userinput>
  4344. &gt; <userinput>config set Dhcp6/dhcp-ddns/server-port 900</userinput>
  4345. &gt; <userinput>config commit</userinput>
  4346. </screen>
  4347. D2 can be configured to listen over IPv4 or IPv6, therefore server-ip
  4348. may be either an IPv4 or IPv6 address.
  4349. <para>
  4350. The socket protocol that DHCPv6 should use to communicate with D2 is
  4351. specified with the "ncr-protocol" parameter. Currently only UDP is
  4352. supported.
  4353. </para>
  4354. <para>
  4355. The internal format for DDNS update requests sent by DHCPv6 is specified
  4356. with the "ncr-format" parameter. Currently only JSON is supported.
  4357. </para>
  4358. </section>
  4359. <section id="dhcpv6-d2-rules-config">
  4360. <title>When does DHCPv6 generate DDNS request</title>
  4361. DHCPv6 follows the behavior prescribed for DHCP servers in RFC 4704.
  4362. It is important to keep in mind that DHCPv6 provides the initial decision
  4363. making of when and what to update and forwards that information to D2 in
  4364. the form of NCRs. Carrying out the actual DNS updates and dealing with
  4365. such things as conflict resolution are the purview of D2 (<xref linkend="dhcp-ddns-server"/>).
  4366. <para>
  4367. This section describes when DHCPv6 will generate NCRs and the
  4368. configuration parameters that can be used to influence this decision.
  4369. It assumes that the "enable-updates" parameter is true.
  4370. </para>
  4371. <note>
  4372. <para>
  4373. Currently the interface between DHCPv6 and D2 only supports requests
  4374. which update DNS entries for a single IP address. If a lease grants
  4375. more than one address, DHCPv6 will create the DDNS update request for
  4376. only the first of these addresses. Support for multiple address
  4377. mappings may be provided in a future release.
  4378. </para>
  4379. </note>
  4380. <para>
  4381. In general, DHCPv6 will generate DDNS update requests when:
  4382. <orderedlist>
  4383. <listitem><para>
  4384. A new lease is granted in response to a DHCP REQUEST
  4385. </para></listitem>
  4386. <listitem><para>
  4387. An existing lease is renewed but the FQDN associated with it has
  4388. changed.
  4389. </para></listitem>
  4390. <listitem><para>
  4391. An existing lease is released in response to a DHCP RELEASE
  4392. </para></listitem>
  4393. </orderedlist>
  4394. In the second case, lease renewal, two DDNS requests will be issued: one
  4395. request to remove entries for the previous FQDN and a second request to
  4396. add entries for the new FQDN. In the last case, a lease release, a
  4397. single DDNS request to remove its entries will be made. The decision
  4398. making involved when granting a new lease is more involved and is
  4399. discussed next.
  4400. </para>
  4401. <para>
  4402. DHCPv6 will generate a DDNS update request only if the DHCP REQUEST
  4403. contains the FQDN option (code 39). By default the DHCPv6 server will
  4404. respect the FQDN N and S flags specified by the client as shown in the
  4405. following table:
  4406. </para>
  4407. <table id="dhcp6-fqdn-flag-table">
  4408. <title>Default FQDN Flag Behavior</title>
  4409. <tgroup cols='4' align='left'>
  4410. <colspec colname='cflags'/>
  4411. <colspec colname='meaning'/>
  4412. <colspec colname='response'/>
  4413. <colspec colname='sflags'/>
  4414. <thead>
  4415. <row>
  4416. <entry>Client Flags:N-S</entry>
  4417. <entry>Client Intent</entry>
  4418. <entry>Server Response</entry>
  4419. <entry>Server Flags:N-S-O</entry>
  4420. </row>
  4421. </thead>
  4422. <tbody>
  4423. <row>
  4424. <entry>0-0</entry>
  4425. <entry>
  4426. Client wants to do forward updates, server should do reverse updates
  4427. </entry>
  4428. <entry>Server generates reverse-only request</entry>
  4429. <entry>1-0-0</entry>
  4430. </row>
  4431. <row>
  4432. <entry>0-1</entry>
  4433. <entry>Server should do both forward and reverse updates</entry>
  4434. <entry>Server generates request to update both directions</entry>
  4435. <entry>0-1-0</entry>
  4436. </row>
  4437. <row>
  4438. <entry>1-0</entry>
  4439. <entry>Client wants no updates done</entry>
  4440. <entry>Server does not generate a request</entry>
  4441. <entry>1-0-0</entry>
  4442. </row>
  4443. </tbody>
  4444. </tgroup>
  4445. </table>
  4446. <para>
  4447. The first row in the table above represents "client delegation". Here
  4448. the DHCP client states that it intends to do the forward DNS updates and
  4449. the server should do the reverse updates. By default, DHCPv6 will honor
  4450. the client's wishes and generate a DDNS request to D2 to update only
  4451. reverse DNS data. The parameter, "override-client-update", can be used
  4452. to instruct the server to override client delegation requests. When
  4453. this parameter is true, DHCPv6 will disregard requests for client
  4454. delegation and generate a DDNS request to update both forward and
  4455. reverse DNS data. In this case, the N-S-O flags in the server's
  4456. response to the client will be 0-1-1 respectively.
  4457. </para>
  4458. <para>
  4459. (Note that the flag combination N=1, S=1 is prohibited according to
  4460. RFC 4702. If such a combination is received from the client, the packet
  4461. will be dropped by the DHCPv6 server.)
  4462. </para>
  4463. <para>
  4464. To override client delegation, issue the following commands:
  4465. </para>
  4466. <screen>
  4467. &gt; <userinput>config set Dhcp6/dhcp-ddns/override-client-update true</userinput>
  4468. &gt; <userinput>config commit</userinput>
  4469. </screen>
  4470. <para>
  4471. The third row in the table above describes the case in which the client
  4472. requests that no DNS updates be done. The parameter, "override-no-update",
  4473. can be used to instruct the server to disregard the client's wishes. When
  4474. this parameter is true, DHCPv6 will generate DDNS update request to D2
  4475. even if the client requests no updates be done. The N-S-O flags in the
  4476. server's response to the client will be 0-1-1.
  4477. </para>
  4478. <para>
  4479. To override client delegation, issue the following commands:
  4480. </para>
  4481. <screen>
  4482. &gt; <userinput>config set Dhcp6/dhcp-ddns/override-no-update true</userinput>
  4483. &gt; <userinput>config commit</userinput>
  4484. </screen>
  4485. </section>
  4486. <section id="dhcpv6-fqdn-name-generation">
  4487. <title>DHCPv6 name generation for DDNS update requests</title>
  4488. Each NameChangeRequest must of course include the fully qualified domain
  4489. name whose DNS entries are to be affected. DHCPv6 can be configured to
  4490. supply a portion or all of that name based upon what it receives from
  4491. the client in the DHCP REQUEST.
  4492. <para>
  4493. The rules for determining the FQDN option are as follows:
  4494. <orderedlist>
  4495. <listitem><para>
  4496. If configured to do so ignore the REQUEST contents and generate a
  4497. FQDN using a configurable prefix and suffix.
  4498. </para></listitem>
  4499. <listitem><para>
  4500. Otherwise, using is the domain name value from the client FQDN option as
  4501. the candidate name:
  4502. <orderedlist>
  4503. <listitem><para>
  4504. If the candidate name is a fully qualified domain name then use it.
  4505. </para></listitem>
  4506. <listitem><para>
  4507. If the candidate name is a partial (i.e. unqualified) name then
  4508. add a configurable suffix to the name and use the result as the FQDN.
  4509. </para></listitem>
  4510. <listitem><para>
  4511. If the candidate name is a empty then generate a FQDN using a
  4512. configurable prefix and suffix.
  4513. </para></listitem>
  4514. </orderedlist>
  4515. </para></listitem>
  4516. </orderedlist>
  4517. To instruct DHCPv6 to always generate a FQDN, set the parameter
  4518. "replace-client-name" to true:
  4519. </para>
  4520. <screen>
  4521. &gt; <userinput>config set Dhcp6/dhcp-ddns/replace-client-name true</userinput>
  4522. &gt; <userinput>config commit</userinput>
  4523. </screen>
  4524. <para>
  4525. The prefix used when generating a FQDN is specified by the
  4526. "generated-prefix" parameter. The default value is "myhost". To alter
  4527. its value, simply set it to the desired string:
  4528. </para>
  4529. <screen>
  4530. &gt; <userinput>config set Dhcp6/dhcp-ddns/generated-prefix "another.host"</userinput>
  4531. &gt; <userinput>config commit</userinput>
  4532. </screen>
  4533. <para>
  4534. The suffix used when generating a FQDN or when qualifying a partial
  4535. name is specified by the "qualifying-suffix" parameter. The default
  4536. value is "example.com". To alter its value simply set it to the desired
  4537. string:
  4538. </para>
  4539. <screen>
  4540. &gt; <userinput>config set Dhcp6/dhcp-ddns/generated-prefix "our.net"</userinput>
  4541. &gt; <userinput>config commit</userinput>
  4542. </screen>
  4543. </section>
  4544. <para>
  4545. When qualifying a partial name, DHCPv6 will construct a name with the
  4546. format:
  4547. </para>
  4548. <para>
  4549. [candidate-name].[qualifying-suffix].
  4550. </para>
  4551. <para>
  4552. where candidate-name is the partial name supplied in the REQUEST.
  4553. For example, if FQDN domain name value was "some-computer" and assuming
  4554. the default value for qualifying-suffix, the generated FQDN would be:
  4555. </para>
  4556. <para>
  4557. some-computer.example.com.
  4558. </para>
  4559. <para>
  4560. When generating a the entire name, DHCPv6 will construct name of the
  4561. format:
  4562. </para>
  4563. <para>
  4564. [generated-prefix]-[address-text].[qualifying-suffix].
  4565. </para>
  4566. <para>
  4567. where address-text is simply the lease IP address converted to a
  4568. hyphenated string. For example, if lease address is 3001:1::70E and
  4569. assuming default values for generated-prefix and qualifying-suffix, the
  4570. generated FQDN would be:
  4571. </para>
  4572. <para>
  4573. myhost-3001-1--70E.example.com.
  4574. </para>
  4575. </section>
  4576. </section>
  4577. <section id="dhcp6-serverid">
  4578. <title>Server Identifier in DHCPv6</title>
  4579. <para>The DHCPv6 protocol uses a "server identifier" (also known
  4580. as a DUID) for clients to be able to discriminate between several
  4581. servers present on the same link. There are several types of
  4582. DUIDs defined, but <ulink url="http://tools.ietf.org/html/rfc3315">RFC 3315</ulink> instructs servers to use DUID-LLT if
  4583. possible. This format consists of a link-layer (MAC) address and a
  4584. timestamp. When started for the first time, the DHCPv6 server will
  4585. automatically generate such a DUID and store the chosen value to
  4586. a file. That file is read by the server
  4587. and the contained value used whenever the server is subsequently started.
  4588. </para>
  4589. <para>
  4590. It is unlikely that this parameter should ever need to be changed.
  4591. However, if such a need arises, stop the server, edit the file and restart
  4592. the server. (The file is named b10-dhcp6-serverid and by default is
  4593. stored in the "var" subdirectory of the directory in which BIND 10 is installed.
  4594. This can be changed when BIND 10 is built by using "--localstatedir"
  4595. on the "configure" command line.) The file is a text file that contains
  4596. double digit hexadecimal values
  4597. separated by colons. This format is similar to typical MAC address
  4598. format. Spaces are ignored. No extra characters are allowed in this
  4599. file.
  4600. </para>
  4601. </section>
  4602. <section id="dhcp6-relay-override">
  4603. <title>Using specific relay agent for a subnet</title>
  4604. <para>
  4605. The relay has to have an interface connected to the link on which
  4606. the clients are being configured. Typically the relay has a global IPv6
  4607. address configured on that interface that belongs to the subnet that
  4608. the server will assign addresses from. In such typical case, the
  4609. server is able to use IPv6 address inserted by the relay (in link-addr
  4610. field in RELAY-FORW message) to select appropriate subnet.
  4611. </para>
  4612. <para>
  4613. However, that is not always the case. The relay
  4614. address may not match the subnet in certain deployments. This
  4615. usually means that there is more than one subnet allocated for a given
  4616. link. Two most common examples where this is the case are long lasting
  4617. network renumbering (where both old and new address space is still being
  4618. used) and a cable network. In a cable network both cable modems and the
  4619. devices behind them are physically connected to the same link, yet
  4620. they use distinct addressing. In such case, the DHCPv6 server needs
  4621. additional information (like the value of interface-id option or IPv6
  4622. address inserted in the link-addr field in RELAY-FORW message) to
  4623. properly select an appropriate subnet.
  4624. </para>
  4625. <para>
  4626. The following example assumes that there is a subnet 2001:db8:1::/64
  4627. that is accessible via relay that uses 3000::1 as its IPv6 address.
  4628. The server will be able to select this subnet for any incoming packets
  4629. that came from a relay that has an address in 2001:db8:1::/64 subnet.
  4630. It will also select that subnet for a relay with address 3000::1.
  4631. <screen>
  4632. &gt; <userinput>config add Dhcp6/subnet6</userinput>
  4633. &gt; <userinput>config set Dhcp6/subnet6[0]/subnet "2001:db8:1::/64"</userinput>
  4634. &gt; <userinput>config set Dhcp6/subnet6[0]/pool [ "2001:db8:1::2 - 2001:db8:1::ffff" ]</userinput>
  4635. &gt; <userinput>config set Dhcp6/subnet6[0]/relay/ip-address "3000::1"</userinput>
  4636. &gt; <userinput>config commit</userinput></screen>
  4637. </para>
  4638. </section>
  4639. <section id="dhcp6-client-class-relay">
  4640. <title>Segregating IPv6 clients in a cable network</title>
  4641. <para>
  4642. In certain cases, it is useful to mix relay address information,
  4643. introduced in <xref linkend="dhcp6-relay-override"/> with client
  4644. classification, explained in <xref linkend="dhcp6-subnet-class"/>.
  4645. One specific example is cable network, where typically modems
  4646. get addresses from a different subnet than all devices connected
  4647. behind them.
  4648. </para>
  4649. <para>
  4650. Let's assume that there is one CMTS (Cable Modem Termination System)
  4651. with one CM MAC (a physical link that modems are connected to).
  4652. We want the modems to get addresses from the 3000::/64 subnet,
  4653. while everything connected behind modems should get addresses from
  4654. another subnet (2001:db8:1::/64). The CMTS that acts as a relay
  4655. an uses address 3000::1. The following configuration can serve
  4656. that configuration:
  4657. <screen>
  4658. &gt; <userinput>config add Dhcp6/subnet6</userinput>
  4659. &gt; <userinput>config set Dhcp6/subnet6[0]/subnet "3000::/64"</userinput>
  4660. &gt; <userinput>config set Dhcp6/subnet6[0]/pool [ "3000::2 - 3000::ffff" ]</userinput>
  4661. &gt; <userinput>config set Dhcp6/subnet6[0]/client-class "docsis3.0"</userinput>
  4662. &gt; <userinput>config set Dhcp6/subnet6[0]/relay/ip-address "3000::1"</userinput>
  4663. &gt; <userinput>config add Dhcp6/subnet6</userinput>
  4664. &gt; <userinput>config set Dhcp6/subnet6[1]/subnet "2001:db8:1::/64"</userinput>
  4665. &gt; <userinput>config set Dhcp6/subnet6[1]/pool [ "2001:db8:1::1 - 2001:db8:1::ffff" ]</userinput>
  4666. &gt; <userinput>config set Dhcp6/subnet6[1]/relay/ip-address "3000::1"</userinput>
  4667. &gt; <userinput>config commit</userinput></screen>
  4668. </para>
  4669. </section>
  4670. <section id="dhcp6-std">
  4671. <title>Supported Standards</title>
  4672. <para>The following standards and draft standards are currently
  4673. supported:</para>
  4674. <itemizedlist>
  4675. <listitem>
  4676. <simpara><ulink url="http://tools.ietf.org/html/rfc3315">RFC 3315</ulink>: Supported messages are SOLICIT,
  4677. ADVERTISE, REQUEST, RELEASE, RENEW, REBIND and REPLY.</simpara>
  4678. </listitem>
  4679. <listitem>
  4680. <simpara><ulink url="http://tools.ietf.org/html/rfc3633">RFC 3633</ulink>: Supported options are IA_PD and
  4681. IA_PREFIX. Also supported is the status code NoPrefixAvail.</simpara>
  4682. </listitem>
  4683. <listitem>
  4684. <simpara><ulink url="http://tools.ietf.org/html/rfc3646">RFC 3646</ulink>: Supported option is DNS_SERVERS.</simpara>
  4685. </listitem>
  4686. <listitem>
  4687. <simpara><ulink url="http://tools.ietf.org/html/rfc4704">RFC 4704</ulink>: Supported option is CLIENT_FQDN.</simpara>
  4688. </listitem>
  4689. </itemizedlist>
  4690. </section>
  4691. <section id="dhcp6-limit">
  4692. <title>DHCPv6 Server Limitations</title>
  4693. <para> These are the current limitations and known problems
  4694. with the DHCPv6 server
  4695. software. Most of them are reflections of the early stage of
  4696. development and should be treated as <quote>not implemented
  4697. yet</quote>, rather than actual limitations.</para>
  4698. <itemizedlist>
  4699. <listitem> <!-- see tickets #3234, #3281 -->
  4700. <para>
  4701. On-line configuration has some limitations. Adding new subnets or
  4702. modifying existing ones work, as is removing the last subnet from
  4703. the list. However, removing non-last (e.g. removing subnet 1,2 or 3 if
  4704. there are 4 subnets configured) will cause issues. The problem is
  4705. caused by simplistic subnet-id assignment. The subnets are always
  4706. numbered, starting from 1. That subnet-id is then used in leases
  4707. that are stored in the lease database. Removing non-last subnet will
  4708. cause the configuration information to mismatch data in the lease
  4709. database. It is possible to manually update subnet-id fields in
  4710. MySQL or PostgreSQL database, but it is awkward and error prone
  4711. process. A better reconfiguration support is planned.
  4712. </para>
  4713. </listitem>
  4714. <listitem>
  4715. <para>
  4716. On startup, the DHCPv6 server does not get the full configuration from
  4717. BIND 10. To remedy this, after starting BIND 10, modify any parameter
  4718. and commit the changes, e.g.
  4719. <screen>
  4720. &gt; <userinput>config show Dhcp6/renew-timer</userinput>
  4721. Dhcp6/renew-timer 1000 integer (default)
  4722. &gt; <userinput>config set Dhcp6/renew-timer 1001</userinput>
  4723. &gt; <userinput>config commit</userinput></screen>
  4724. </para>
  4725. </listitem>
  4726. <listitem>
  4727. <simpara>Temporary addresses are not supported.</simpara>
  4728. </listitem>
  4729. <listitem>
  4730. <simpara>
  4731. The server will allocate, renew or rebind a maximum of one lease
  4732. for a particular IA option (IA_NA or IA_PD) sent by a client.
  4733. <ulink url="http://tools.ietf.org/html/rfc3315">RFC 3315</ulink> and
  4734. <ulink url="http://tools.ietf.org/html/rfc3633">RFC 3633</ulink> allow
  4735. for multiple addresses or prefixes to be allocated for a single IA.
  4736. </simpara>
  4737. </listitem>
  4738. <listitem>
  4739. <simpara>Temporary addresses are not supported.</simpara>
  4740. </listitem>
  4741. <listitem>
  4742. <simpara>
  4743. Confirmation (CONFIRM), duplication report (DECLINE),
  4744. stateless configuration (INFORMATION-REQUEST) and client
  4745. reconfiguration (RECONFIGURE) are not yet supported.
  4746. </simpara>
  4747. </listitem>
  4748. <listitem>
  4749. <simpara>
  4750. The server doesn't act upon expired leases. In particular,
  4751. when a lease expires, the server doesn't request removal of
  4752. the DNS records associated with it.
  4753. </simpara>
  4754. </listitem>
  4755. </itemizedlist>
  4756. </section>
  4757. <!--
  4758. <section id="dhcp6-srv-examples">
  4759. <title>Kea DHCPv6 server examples</title>
  4760. <para>
  4761. This section provides easy to use example. Each example can be read
  4762. separately. It is not intended to be read sequentially as there will
  4763. be many repetitions between examples. They are expected to serve as
  4764. easy to use copy-paste solutions to many common deployments.
  4765. </para>
  4766. @todo: add simple configuration for direct clients
  4767. @todo: add configuration for relayed clients
  4768. @todo: add client classification example
  4769. </section> -->
  4770. </chapter>
  4771. <chapter id="dhcp-ddns-server">
  4772. <title>The DHCP-DDNS Server</title>
  4773. <para>
  4774. The DHCP-DDNS Server (known informally as D2) conducts the client side of
  4775. the DDNS protocol (defined in RFC 2136) on behalf of the DHCPv4 and DHCPv6
  4776. servers. The DHCP servers construct
  4777. DDNS update requests, known as NameChangeRequests (NCRs), based upon DHCP
  4778. lease change events and then post these to D2. D2 attempts to match
  4779. each such request to the appropriate DNS server(s) and carry out the
  4780. necessary conversation with those servers to update the DNS data.
  4781. </para>
  4782. <para>
  4783. In order to match a request to appropriate DNS servers, D2 must have a
  4784. catalog of servers from which to select. In fact, D2 has two such catalogs,
  4785. one for forward DNS and one for reverse DNS; these catalogs are referred
  4786. to as DDNS Domain Lists. Each list consists of one or more named DDNS
  4787. Domains. Further, each DDNS Domain has a list of of one or more DNS
  4788. servers that publish the DNS data for that domain.
  4789. </para>
  4790. <para>
  4791. When conducting forward domain matching, D2 will compare the FQDN in
  4792. the request against the name of each forward DDNS Domain. The domain
  4793. whose name matches the longest portion of the FQDN is considered the
  4794. best match. For example, if the FQDN is "myhost.sample.example.com.",
  4795. and there are two forward domains in the catalog: "sample.example.com."
  4796. and "example.com.", the former is regarded as the best match. In some
  4797. cases, it may not be possible to find a suitable match. Given the same two
  4798. forward domains there would be no match for the FQDN, "bogus.net", so the
  4799. request would be rejected. Finally, if there are no forward DDNS Domains
  4800. defined, D2 will simply disregard the forward update portion of requests.
  4801. </para>
  4802. <para>
  4803. When conducting reverse domain matching, D2 constructs a reverse
  4804. FQDN from the lease address in the request and compare that against
  4805. the name of each reverse DDNS Domain. Again, the domain whose name matches
  4806. the longest portion of the FQDN is considered the best match. For instance,
  4807. if the lease address is "172.16.1.40" and there are two reverse domains in
  4808. the catalog: "1.16.172.in-addr.arpa." and "16.172.in-addr.arpa", the
  4809. former is the best match. As with forward matching, it is possible to not
  4810. find a suitable match. Given the same two domains, there would be no
  4811. match for the lease address, "192.168.1.50", and the request would be
  4812. rejected. Finally, if there are no reverse DDNS Domains defined, D2 will
  4813. simply disregard the reverse update portion of requests.
  4814. </para>
  4815. <section id="dhcp-ddns-server-start-stop">
  4816. <title>Starting and Stopping the DHCP-DDNS Server</title>
  4817. <para>
  4818. <command>b10-dhcp-ddns</command> is the BIND 10 DHCP-DDNS server and,
  4819. like other parts of BIND 10, is configured through the
  4820. <command>bindctl</command> program.
  4821. </para>
  4822. <para>
  4823. After starting BIND 10 and entering bindctl, the first step in
  4824. configuring the server is to add it to the list of running BIND 10
  4825. services.
  4826. <screen>
  4827. &gt; <userinput>config add Init/components b10-dhcp-ddns</userinput>
  4828. &gt; <userinput>config set Init/components/b10-dhcp-ddns/kind dispensable</userinput>
  4829. &gt; <userinput>config commit</userinput>
  4830. </screen>
  4831. </para>
  4832. <para>
  4833. To remove <command>b10-dhcp-ddns</command> from the set of running services,
  4834. the <command>b10-dhcp-ddns</command> is removed from list of Init components:
  4835. <screen>
  4836. &gt; <userinput>config remove Init/components b10-dhcp-ddns</userinput>
  4837. &gt; <userinput>config commit</userinput>
  4838. </screen>
  4839. </para>
  4840. <para>
  4841. Note that the server was only removed from the list, so it will not be
  4842. automatically restarted, but the server itself is still running. Hence it
  4843. is usually desired to stop it:
  4844. </para>
  4845. <screen>
  4846. &gt; <userinput>DhcpDdns shutdown</userinput>
  4847. </screen>
  4848. <para>
  4849. Upon start up the module will load its configuration and begin listening
  4850. for NCRs based on that configuration.
  4851. </para>
  4852. </section> <!-- end start-stop -->
  4853. <section id="d2-configuration">
  4854. <title>Configuring the DHCP-DDNS Server</title>
  4855. <para>
  4856. Once the server is started, it can be configured. To view the
  4857. current configuration, use the following command in <command>bindctl</command>:
  4858. <screen>
  4859. &gt; <userinput>config show DhcpDdns</userinput></screen>
  4860. When starting b10-dhcp-ddns module for the first time, the default
  4861. configuration will be available. It will look similar to this:
  4862. <screen>
  4863. &gt; <userinput>config show DhcpDdns</userinput>
  4864. DhcpDdns/interface "eth0" string (default)
  4865. DhcpDdns/ip_address "127.0.0.1" string (default)
  4866. DhcpDdns/port 53001 integer (default)
  4867. DhcpDdns/tsig_keys [] list (default)
  4868. DhcpDdns/forward_ddns/ddns_domains [] list (default)
  4869. DhcpDdns/reverse_ddns/ddns_domains [] list (default)
  4870. </screen>
  4871. <para>
  4872. (While displayed, the parameter "interface" is not implemented, and
  4873. will be removed in the near future.)
  4874. </para>
  4875. </para>
  4876. <para>
  4877. The configuration can be divided as follows, each of which is described
  4878. in its own section:
  4879. </para>
  4880. <itemizedlist>
  4881. <listitem>
  4882. <simpara>
  4883. <command>General Server Parameters</command> &mdash;
  4884. values which control connectivity and global server behavior
  4885. </simpara>
  4886. </listitem>
  4887. <listitem>
  4888. <simpara>
  4889. <command>TSIG Key Info</command> &mdash;
  4890. defines the TSIG keys used for secure traffic with DNS servers
  4891. </simpara>
  4892. </listitem>
  4893. <listitem>
  4894. <simpara>
  4895. <command>Forward DDNS</command> &mdash;
  4896. defines the catalog of Forward DDNS Domains
  4897. </simpara>
  4898. </listitem>
  4899. <listitem>
  4900. <simpara>
  4901. <command>Reverse DDNS</command> &mdash;
  4902. defines the catalog of Forward DDNS Domains
  4903. </simpara>
  4904. </listitem>
  4905. </itemizedlist>
  4906. <section id="d2-server-parameter-config">
  4907. <title>General Server Parameters</title>
  4908. <para>
  4909. The DHCP-DDNS server must listen for requests on a known address and
  4910. port. By default, it will listen at 127.0.0.1 on port 53001. This is
  4911. governed by the parameters, "ip-address" and "port". Either value
  4912. may be changed using config set/commit. For example to change the
  4913. server to listen at 192.168.1.10 port 900:
  4914. <screen>
  4915. &gt; <userinput>config set DhcpDdns/ip_address "192.168.1.10"</userinput>
  4916. &gt; <userinput>config set DhcpDdns/port 900</userinput>
  4917. &gt; <userinput>config commit</userinput>
  4918. </screen>
  4919. The server may be configured to listen over IPv4 or IPv6, therefore
  4920. ip-address may an IPv4 or IPv6 address.
  4921. </para>
  4922. <warning>
  4923. <simpara>
  4924. When the DHCP-DDNS server is configured to listen at an address
  4925. other than the loopback address (127.0.0.1 or ::1), it is possible
  4926. for a malicious attacker to send bogus NameChangeRequests to it
  4927. and change entries in the DNS. For this reason, addresses other
  4928. than the IPv4 or IPv6 loopback addresses should only be used
  4929. for testing purposes. A future version of Kea will implement
  4930. authentication to guard against such attacks.
  4931. </simpara>
  4932. </warning>
  4933. <note>
  4934. <simpara>
  4935. If the ip_address and port are changed, it will be necessary to change the
  4936. corresponding values in the DHCP servers' "dhcp-ddns" configuration section.
  4937. </simpara>
  4938. </note>
  4939. </section> <!-- "d2-server-parameter-config" -->
  4940. <section id="d2-tsig-key-list-config">
  4941. <title>TSIG Key List</title>
  4942. <note>
  4943. <simpara>
  4944. While this section may be displayed and edited using bindctl, the use
  4945. of TSIG in actual communications between D2 and DNS servers is not yet
  4946. implemented.
  4947. </simpara>
  4948. </note>
  4949. <para>
  4950. DDNS protocol can be conducted with or without TSIG as defined in
  4951. RFC 2845. This configuration section allows the administrator to
  4952. define the dictionary of TSIG keys to may be used. To use TSIG
  4953. when working with a specific DDNS Domain that key must be defined in
  4954. the TSIG Key List and referenced by name in that domain's entry in
  4955. the DDNS catalog.
  4956. </para>
  4957. <para>
  4958. As one might gather from its name, this section is a list of
  4959. TSIG keys. Each key has three parameters:
  4960. <itemizedlist>
  4961. <listitem>
  4962. <simpara>
  4963. <command>name</command> &mdash;
  4964. is a unique text label used to identify the this key within the
  4965. list. It is this value that is used to specify which key (if any)
  4966. should be used with a specific DNS server. So long as it is
  4967. unique, its content is arbitrary. It cannot be blank.
  4968. </simpara>
  4969. </listitem>
  4970. <listitem>
  4971. <simpara>
  4972. <command>algorithm</command> &mdash;
  4973. specifies which hashing algorithm should be used with this
  4974. key. This value is not currently used.
  4975. </simpara>
  4976. </listitem>
  4977. <listitem>
  4978. <simpara>
  4979. <command>secret</command> &mdash;
  4980. is used to specify the shared secret key code for this key. This
  4981. value is not currently used.
  4982. </simpara>
  4983. </listitem>
  4984. </itemizedlist>
  4985. </para>
  4986. <para>
  4987. By default, the TSIG Key list is empty:
  4988. <screen>
  4989. <userinput>> config show DhcpDdns/tsig_keys</userinput>
  4990. DhcpDdns/tsig_keys [] list (default)
  4991. </screen>
  4992. To create a new key in the list, one must first add a new key element:
  4993. <screen>
  4994. <userinput>> config add DhcpDdns/tsig_keys</userinput>
  4995. </screen>
  4996. Displaying the new element, reveals this:
  4997. <screen>
  4998. <userinput>> config show DhcpDdns/tsig_keys[0]</userinput>
  4999. DhcpDdns/tsig_keys[0]/name "" string (default)
  5000. DhcpDdns/tsig_keys[0]/algorithm "hmac_md5" string (modified)
  5001. DhcpDdns/tsig_keys[0]/secret "" string (default)
  5002. </screen>
  5003. Populating the key name and secret, while accepting the default value
  5004. for alogorithm:
  5005. <screen>
  5006. <userinput>> config set DhcpDdns/tsig_keys[0]/name "key1.example.com"</userinput>
  5007. <userinput>> config set DhcpDdns/tsig_keys[0]/secret "123456789"</userinput>
  5008. <userinput>> config commit</userinput>
  5009. </screen>
  5010. </para>
  5011. </section> <!-- "d2-tsig-key-list-config" -->
  5012. <section id="d2-forward-ddns-config">
  5013. <title>Forward DDNS</title>
  5014. <para>
  5015. The Forward DDNS section is used to configure D2's forward update
  5016. behavior. Currently it contains a single parameter, the catalog of
  5017. forward DDNS Domains:
  5018. <screen>
  5019. <userinput>> config show DhcpDdns/forward_ddns/</userinput>
  5020. DhcpDdns/forward_ddns/ddns_domains [] list (default)
  5021. </screen>
  5022. By default, this list is empty, which will cause the server to ignore
  5023. the forward update portions of requests.
  5024. </para>
  5025. <section id="add-forward-ddns-domain">
  5026. <title>Adding Forward DDNS Domains</title>
  5027. <para>
  5028. A forward DDNS Domain maps a forward DNS zone to a set of DNS servers
  5029. which maintain the forward DNS data for that zone. You will need one
  5030. forward DDNS Domain for each zone you wish to service. It may very
  5031. well be that some or all of your zones are maintained by the same
  5032. servers. You will still need one DDNS Domain per zone. Remember that
  5033. matching a request to the appropriate server(s) is done by zone and
  5034. a DDNS Domain only defines a single zone.
  5035. </para>
  5036. <para>
  5037. The section describes how to add Forward DDNS Domains. Repeat these
  5038. steps for each Forward DDNS Domain desired. Each Forward DDNS Domain
  5039. has the following parameters:
  5040. <itemizedlist>
  5041. <listitem>
  5042. <simpara>
  5043. <command>name</command> &mdash;
  5044. The fully qualified domain name (or zone) that this DDNS Domain
  5045. can update. This is value used to compare against the request
  5046. FQDN during forward matching. It must be unique within the
  5047. catalog.
  5048. </simpara>
  5049. </listitem>
  5050. <listitem>
  5051. <simpara>
  5052. <command>key_name</command> &mdash;
  5053. If TSIG is used with this domain's servers, this
  5054. value should be the name of the key from within the TSIG Key List
  5055. to use. If the value is blank (the default), TSIG will not be
  5056. used in DDNS conversations with this domain's servers. Currently
  5057. TSIG has not been implemented, so this value is ignored.
  5058. </simpara>
  5059. </listitem>
  5060. <listitem>
  5061. <simpara>
  5062. <command>dns_servers</command> &mdash;
  5063. A list of one or more DNS servers which can conduct the server
  5064. side of the DDNS protocol for this domain. The servers
  5065. are used in a first to last preference. In other words, when D2
  5066. begins to process a request for this domain it will pick the
  5067. first server in this list and attempt to communicate with it.
  5068. If that attempt fails, it will move to next one in the list and
  5069. so on until the it achieves success or the list is exhausted.
  5070. </simpara>
  5071. </listitem>
  5072. </itemizedlist>
  5073. To create a new forward DDNS Domain, one must first add a new domain
  5074. element:
  5075. <screen>
  5076. <userinput>> config add DhcpDdns/forward_ddns/ddns_domains</userinput>
  5077. </screen>
  5078. Displaying the DDNS Domain reveals this:
  5079. <screen>
  5080. <userinput>> config show DhcpDdns/forward_ddns/ddns_domains[0]</userinput>
  5081. DhcpDdns/forward_ddns/ddns_domains[0]/name "" string (default)
  5082. DhcpDdns/forward_ddns/ddns_domains[0]/key_name "" string (default)
  5083. DhcpDdns/forward_ddns/ddns_domains[0]/dns_servers [] list (default)
  5084. </screen>
  5085. To set the domain's name to "other.example.com":
  5086. <screen>
  5087. <userinput>> config set DhcpDdns/forward_ddns/ddns_domains[1]/name "other.example.com"</userinput>
  5088. <userinput>> config commit</userinput>
  5089. </screen>
  5090. It is permissible to add a domain without any servers. If that domain
  5091. should be matched to a request, however, the request will fail. In
  5092. order to make the domain useful though, we must add at least one DNS
  5093. server to it.
  5094. </para>
  5095. <section id="add-forward-dns-servers">
  5096. <title>Adding Forward DNS Servers</title>
  5097. <para>
  5098. The section describes how to add DNS servers to a Forward DDNS Domain.
  5099. Repeat them for as many servers as desired for a each domain.
  5100. </para>
  5101. <para>
  5102. Forward DNS Server entries represent actual DNS servers which
  5103. support the server side of the DDNS protocol. Each Forward DNS Server
  5104. has the following parameters:
  5105. <itemizedlist>
  5106. <listitem>
  5107. <simpara>
  5108. <command>hostname</command> &mdash;
  5109. The resolvable host name of the DNS server. This value is not
  5110. yet implemented.
  5111. </simpara>
  5112. </listitem>
  5113. <listitem>
  5114. <simpara>
  5115. <command>ip_address</command> &mdash;
  5116. The IP address at which the server listens for DDNS requests.
  5117. This may be either an IPv4 or an IPv6 address.
  5118. </simpara>
  5119. </listitem>
  5120. <listitem>
  5121. <simpara>
  5122. <command>port</command> &mdash;
  5123. The port on which the server listens for DDNS requests. It
  5124. defaults to the standard DNS service port of 53.
  5125. </simpara>
  5126. </listitem>
  5127. </itemizedlist>
  5128. To create a new forward DNS Server, one must first add a new server
  5129. element to the domain:
  5130. <screen>
  5131. <userinput>> config add DhcpDdns/forward_ddns/ddns_domains[0]/dns_servers</userinput>
  5132. </screen>
  5133. Displaying the DNS Server element should appear as follows:
  5134. <screen>
  5135. <userinput>> config show DhcpDdns/forward_ddns/ddns_domains[0]/dns_servers[0]</userinput>
  5136. DhcpDdns/forward_ddns/ddns_domains[0]/dns_servers[0]/hostname "" string (default)
  5137. DhcpDdns/forward_ddns/ddns_domains[0]/dns_servers[0]/ip_address "" string (default)
  5138. DhcpDdns/forward_ddns/ddns_domains[0]/dns_servers[0]/port 53 integer(default)
  5139. </screen>
  5140. As stated earlier, "hostname" is not yet supported so, the parameter
  5141. "ip_address" must be set to the address of the DNS server. If for
  5142. example the service is running at "172.88.99.10", then set it as
  5143. follows:
  5144. <screen>
  5145. <userinput>> config set DhcpDdns/forward_ddns/ddns_domains[0]/dns_servers[0]/ip_address "172.88.99.10"</userinput>
  5146. <userinput>> config commit</userinput>
  5147. </screen>
  5148. </para>
  5149. </section> <!-- "add-forward-dns-servers" -->
  5150. </section> <!-- "add-forward-ddns-domains" -->
  5151. </section> <!-- "d2-forward-ddns-config" -->
  5152. <section id="d2-reverse-ddns-config">
  5153. <title>Reverse DDNS</title>
  5154. <para>
  5155. The Reverse DDNS section is used to configure D2's reverse update
  5156. behavior, and the concepts are the same as for the forward DDNS
  5157. section. Currently it contains a single parameter, the catalog of
  5158. reverse DDNS Domains:
  5159. <screen>
  5160. <userinput>> config show DhcpDdns/reverse_ddns/</userinput>
  5161. DhcpDdns/reverse_ddns/ddns_domains [] list (default)
  5162. </screen>
  5163. By default, this list is empty, which will cause the server to ignore
  5164. the reverse update portions of requests.
  5165. </para>
  5166. <section id="add-reverse-ddns-domain">
  5167. <title>Adding Reverse DDNS Domains</title>
  5168. <para>
  5169. A reverse DDNS Domain maps a reverse DNS zone to a set of DNS servers
  5170. which maintain the reverse DNS data for that zone. You will need one
  5171. reverse DDNS Domain for each zone you wish to service. It may very
  5172. well be that some or all of your zones are maintained by the same
  5173. servers; even then, you will still need one DDNS Domain entry for each
  5174. zone. Remember that
  5175. matching a request to the appropriate server(s) is done by zone and
  5176. a DDNS Domain only defines a single zone.
  5177. </para>
  5178. <para>
  5179. The section describes how to add Reverse DDNS Domains. Repeat these
  5180. steps for each Reverse DDNS Domain desired. Each Reverse DDNS Domain
  5181. has the following parameters:
  5182. <itemizedlist>
  5183. <listitem>
  5184. <simpara>
  5185. <command>name</command> &mdash;
  5186. The fully qualified reverse zone that this DDNS Domain
  5187. can update. This is the value used during reverse matching
  5188. which will compare it with a reversed version of the request's
  5189. lease address. The zone name should follow the appropriate
  5190. standards: for example, to to support the IPv4 subnet 172.16.1,
  5191. the name should be. "1.16.172.in-addr.arpa.". Similarly,
  5192. to support an IPv6 subent of 2001:db8:1, the name should be
  5193. "1.0.0.0.8.B.D.0.1.0.0.2.ip6.arpa."
  5194. Whatever the name, it must be unique within the catalog.
  5195. </simpara>
  5196. </listitem>
  5197. <listitem>
  5198. <simpara>
  5199. <command>key_name</command> &mdash;
  5200. If TSIG should be used with this domain's servers, then this
  5201. value should be the name of the key from within the TSIG Key List
  5202. to use. If the value is blank (the default), TSIG will not be
  5203. used in DDNS conversations with this domain's servers. Currently
  5204. this value is not used as TSIG has not been implemented.
  5205. </simpara>
  5206. </listitem>
  5207. <listitem>
  5208. <simpara>
  5209. <command>dns_servers</command> &mdash;
  5210. a list of one or more DNS servers which can conduct the server
  5211. side of the DDNS protocol for this domain. Currently the servers
  5212. are used in a first to last preference. In other words, when D2
  5213. begins to process a request for this domain it will pick the
  5214. first server in this list and attempt to communicate with it.
  5215. If that attempt fails, it will move to next one in the list and
  5216. so on until the it achieves success or the list is exhausted.
  5217. </simpara>
  5218. </listitem>
  5219. </itemizedlist>
  5220. To create a new reverse DDNS Domain, one must first add a new domain
  5221. element:
  5222. <screen>
  5223. <userinput>> config add DhcpDdns/reverse_ddns/ddns_domains</userinput>
  5224. </screen>
  5225. Displaying the DDNS Domain reveals this:
  5226. <screen>
  5227. <userinput>> config show DhcpDdns/reverse_ddns/ddns_domains[0]</userinput>
  5228. DhcpDdns/reverse_ddns/ddns_domains[0]/name "" string (default)
  5229. DhcpDdns/reverse_ddns/ddns_domains[0]/key_name "" string (default)
  5230. DhcpDdns/reverse_ddns/ddns_domains[0]/dns_servers [] list (default)
  5231. </screen>
  5232. For domain supporting the subnet 2001:db8:1::, we would set the
  5233. domain's name as follows:
  5234. <screen>
  5235. <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>
  5236. <userinput>> config commit</userinput>
  5237. </screen>
  5238. It is permissible to add a domain without any servers. If that domain
  5239. should be matched to a request, however, the request will fail. In
  5240. order to make the domain useful though, we must add at least one DNS
  5241. server to it.
  5242. </para>
  5243. <section id="add-reverse-dns-servers">
  5244. <title>Adding Reverse DNS Servers</title>
  5245. <para>
  5246. The section describes how to add DNS servers to a Reverse DDNS Domain.
  5247. Repeat them for as many servers as desired for a each domain.
  5248. </para>
  5249. <para>
  5250. Reverse DNS Server entries represents a actual DNS servers which
  5251. support the server side of the DDNS protocol. Each Reverse DNS Server
  5252. has the following parameters:
  5253. <itemizedlist>
  5254. <listitem>
  5255. <simpara>
  5256. <command>hostname</command> &mdash;
  5257. The resolvable host name of the DNS server. This value is
  5258. currently ignored.
  5259. </simpara>
  5260. </listitem>
  5261. <listitem>
  5262. <simpara>
  5263. <command>ip_address</command> &mdash;
  5264. The IP address at which the server listens for DDNS requests.
  5265. </simpara>
  5266. </listitem>
  5267. <listitem>
  5268. <simpara>
  5269. <command>port</command> &mdash;
  5270. The port on which the server listens for DDNS requests. It
  5271. defaults to the standard DNS service port of 53.
  5272. </simpara>
  5273. </listitem>
  5274. </itemizedlist>
  5275. To create a new reverse DNS Server, one must first add a new server
  5276. element to the domain:
  5277. <screen>
  5278. <userinput>> config add DhcpDdns/reverse_ddns/ddns_domains[0]/dns_servers</userinput>
  5279. </screen>
  5280. Displaying the DNS Server element should appear as follows:
  5281. <screen>
  5282. <userinput>> config show DhcpDdns/reverse_ddns/ddns_domains[0]/dns_servers[0]</userinput>
  5283. DhcpDdns/reverse_ddns/ddns_domains[0]/dns_servers[0]/hostname "" string (default)
  5284. DhcpDdns/reverse_ddns/ddns_domains[0]/dns_servers[0]/ip_address "" string (default)
  5285. DhcpDdns/reverse_ddns/ddns_domains[0]/dns_servers[0]/port 53 integer(default)
  5286. </screen>
  5287. As stated earlier, "hostname" is not yet supported so, the parameter
  5288. "ip_address" must be set to the address of the DNS server. If for
  5289. example the service is running at "172.88.99.10", then set it as
  5290. follows:
  5291. <screen>
  5292. <userinput>> config set DhcpDdns/reverse_ddns/ddns_domains[0]/dns_servers[0]/ip_address "172.88.99.10"</userinput>
  5293. <userinput>> config commit</userinput>
  5294. </screen>
  5295. </para>
  5296. </section> <!-- "add-reverse-dns-servers" -->
  5297. </section> <!-- "add-reverse-ddns-domains" -->
  5298. </section> <!-- "d2-reverse-ddns-config" -->
  5299. <section id="d2-exmaple-config">
  5300. <title>Example DHCP-DDNS Server Configuration</title>
  5301. <para>
  5302. This section provides an example DHCP-DDNS server configuration based
  5303. on a small example network. Let's suppose our example network has
  5304. three domains, each with their own subnet.
  5305. <table>
  5306. <title>Our example network</title>
  5307. <tgroup cols='4' align='left'>
  5308. <colspec colname='domain'/>
  5309. <colspec colname='subnet'/>
  5310. <colspec colname='fservers'/>
  5311. <colspec colname='rservers'/>
  5312. <thead>
  5313. <row>
  5314. <entry>Domain</entry>
  5315. <entry>Subnet</entry>
  5316. <entry>Forward DNS Servers</entry>
  5317. <entry>Reverse DNS Servers</entry>
  5318. </row>
  5319. </thead>
  5320. <tbody>
  5321. <row>
  5322. <entry>four.example.com</entry>
  5323. <entry>192.0.2.0/24</entry>
  5324. <entry>172.16.1.5, 172.16.2.5</entry>
  5325. <entry>172.16.1.5, 172.16.2.5</entry>
  5326. </row>
  5327. <row>
  5328. <entry>six.example.com</entry>
  5329. <entry>2001:db8:1::/64</entry>
  5330. <entry>3001:1::50</entry>
  5331. <entry>3001:1::51</entry>
  5332. </row>
  5333. <row>
  5334. <entry>example.com</entry>
  5335. <entry>192.0.0.0/16</entry>
  5336. <entry>172.16.2.5</entry>
  5337. <entry>172.16.2.5</entry>
  5338. </row>
  5339. </tbody>
  5340. </tgroup>
  5341. </table>
  5342. </para>
  5343. <para>
  5344. We need to construct three forward DDNS Domains:
  5345. <table>
  5346. <title>Forward DDNS Domains Needed</title>
  5347. <tgroup cols='3' align='left'>
  5348. <colspec colname='num'/>
  5349. <colspec colname='name'/>
  5350. <colspec colname='servers'/>
  5351. <thead>
  5352. <row>
  5353. <entry>#</entry>
  5354. <entry>DDNS Domain Name</entry>
  5355. <entry>DNS Servers</entry>
  5356. </row>
  5357. </thead>
  5358. <tbody>
  5359. <row>
  5360. <entry>1.</entry>
  5361. <entry>four.example.com.</entry>
  5362. <entry>172.16.1.5, 172.16.2.5</entry>
  5363. </row>
  5364. <row>
  5365. <entry>2.</entry>
  5366. <entry>six.example.com.</entry>
  5367. <entry>3001:1::50</entry>
  5368. </row>
  5369. <row>
  5370. <entry>3.</entry>
  5371. <entry>example.com.</entry>
  5372. <entry>172.16.2.5</entry>
  5373. </row>
  5374. </tbody>
  5375. </tgroup>
  5376. </table>
  5377. As discussed earlier, FQDN to domain matching is based on the longest
  5378. match. The FQDN, "myhost.four.example.com.", will match the first
  5379. domain ("four.example.com") while "admin.example.com." will match the
  5380. third domain ("example.com"). The
  5381. FQDN, "other.example.net." will fail to match any domain and would
  5382. be rejected.
  5383. </para>
  5384. <para>
  5385. The following series of commands in bindctl will create the Forward
  5386. DDNS Domains.
  5387. <screen>
  5388. <userinput>
  5389. > config add DhcpDdns/forward_ddns/ddns_domains
  5390. > config set DhcpDdns/forward_ddns/ddns_domains[0]/name "four.example.com."
  5391. > config add DhcpDdns/forward_ddns/ddns_domains[0]/dns_servers
  5392. > config set DhcpDdns/forward_ddns/ddns_domains[0]/dns_servers[0]/ip_address "172.16.1.5"
  5393. > config add DhcpDdns/forward_ddns/ddns_domains[0]/dns_servers
  5394. > config set DhcpDdns/forward_ddns/ddns_domains[0]/dns_servers[1]/ip_address "172.16.2.5"
  5395. >
  5396. > config add DhcpDdns/forward_ddns/ddns_domains
  5397. > config set DhcpDdns/forward_ddns/ddns_domains[1]/name "six.example.com."
  5398. > config add DhcpDdns/forward_ddns/ddns_domains[1]/dns_servers
  5399. > config set DhcpDdns/forward_ddns/ddns_domains[1]/dns_servers[0]/ip_address "3001:1::50:"
  5400. >
  5401. > config add DhcpDdns/forward_ddns/ddns_domains
  5402. > config set DhcpDdns/forward_ddns/ddns_domains[2]/name "example.com."
  5403. > config add DhcpDdns/forward_ddns/ddns_domains[2]/dns_servers
  5404. > config set DhcpDdns/forward_ddns/ddns_domains[2]/dns_servers[0]/ip_address "172.16.2.5"
  5405. >
  5406. > config commit
  5407. </userinput>
  5408. </screen>
  5409. </para>
  5410. <para>
  5411. Similarly, we need to construct the three reverse DDNS Domains:
  5412. <table>
  5413. <title>Reverse DDNS Domains Needed</title>
  5414. <tgroup cols='3' align='left'>
  5415. <colspec colname='num'/>
  5416. <colspec colname='DDNS Domain name'/>
  5417. <colspec colname='DDNS Domain DNS Servers'/>
  5418. <thead>
  5419. <row>
  5420. <entry>#</entry>
  5421. <entry>DDNS Domain Name</entry>
  5422. <entry>DNS Servers</entry>
  5423. </row>
  5424. </thead>
  5425. <tbody>
  5426. <row>
  5427. <entry>1.</entry>
  5428. <entry>2.0.192.in-addr.arpa.</entry>
  5429. <entry>172.16.1.5, 172.16.2.5</entry>
  5430. </row>
  5431. <row>
  5432. <entry>2.</entry>
  5433. <entry>1.0.0.0.8.d.b.0.1.0.0.2.ip6.arpa.</entry>
  5434. <entry>3001:1::50</entry>
  5435. </row>
  5436. <row>
  5437. <entry>3.</entry>
  5438. <entry>0.182.in-addr.arpa.</entry>
  5439. <entry>172.16.2.5</entry>
  5440. </row>
  5441. </tbody>
  5442. </tgroup>
  5443. </table>
  5444. An address of "192.0.2.150" will match the first domain,
  5445. "2001:db8:1::10" will match the second domain, and "192.0.50.77"
  5446. the third domain.
  5447. </para>
  5448. <para>
  5449. The following series of commands in bindctl will create our Reverse
  5450. DDNS Domains.
  5451. <screen>
  5452. <userinput>
  5453. > config add DhcpDdns/reverse_ddns/ddns_domains
  5454. > config set DhcpDdns/reverse_ddns/ddns_domains[0]/name "2.0.192.in-addr.arpa."
  5455. > config add DhcpDdns/reverse_ddns/ddns_domains[0]/dns_servers
  5456. > config set DhcpDdns/reverse_ddns/ddns_domains[0]/dns_servers[0]/ip_address "172.16.1.5"
  5457. > config add DhcpDdns/reverse_ddns/ddns_domains[0]/dns_servers
  5458. > config set DhcpDdns/reverse_ddns/ddns_domains[0]/dns_servers[1]/ip_address "172.16.2.5"
  5459. >
  5460. > config add DhcpDdns/reverse_ddns/ddns_domains
  5461. > config set DhcpDdns/reverse_ddns/ddns_domains[1]/name "1.0.0.0.8.d.b.0.1.0.0.2.ip6.arpa."
  5462. > config add DhcpDdns/reverse_ddns/ddns_domains[1]/dns_servers
  5463. > config set DhcpDdns/reverse_ddns/ddns_domains[1]/dns_servers[0]/ip_address "3001:1::50:"
  5464. >
  5465. > config add DhcpDdns/reverse_ddns/ddns_domains
  5466. > config set DhcpDdns/reverse_ddns/ddns_domains[2]/name "0.192.in-addr.arpa."
  5467. > config add DhcpDdns/reverse_ddns/ddns_domains[2]/dns_servers
  5468. > config set DhcpDdns/reverse_ddns/ddns_domains[2]/dns_servers[0]/ip_address "172.16.2.5"
  5469. >
  5470. > config commit
  5471. </userinput>
  5472. </screen>
  5473. </para>
  5474. </section> <!-- end of "d2-example" -->
  5475. </section> <!-- end of section "d2-configuration" -->
  5476. <section>
  5477. <title>DHCP-DDNS Server Limitations</title>
  5478. <para>The following are the current limitations of the DHCP-DDNS Server.</para>
  5479. <itemizedlist>
  5480. <listitem>
  5481. <simpara>
  5482. Requests received from the DHCP servers are placed in a
  5483. queue until they are processed. Currently all queued requests
  5484. are lost when the server shuts down.
  5485. </simpara>
  5486. </listitem>
  5487. <listitem>
  5488. <simpara>
  5489. TSIG Authentication (<ulink
  5490. url="http://tools.ietf.org/html/rfc2845">RFC 2845</ulink>)
  5491. is not supported yet.
  5492. </simpara>
  5493. </listitem>
  5494. </itemizedlist>
  5495. </section>
  5496. </chapter> <!-- DHCP-DDNS Server -->
  5497. <chapter id="libdhcp">
  5498. <title>libdhcp++ library</title>
  5499. <para>
  5500. libdhcp++ is a common library written in C++ that handles
  5501. many DHCP-related tasks, including:
  5502. <itemizedlist>
  5503. <listitem>
  5504. <simpara>DHCPv4 and DHCPv6 packets parsing, manipulation and assembly</simpara>
  5505. </listitem>
  5506. <listitem>
  5507. <simpara>Option parsing, manipulation and assembly</simpara>
  5508. </listitem>
  5509. <listitem>
  5510. <simpara>Network interface detection</simpara>
  5511. </listitem>
  5512. <listitem>
  5513. <simpara>Socket operations such as creation, data transmission and reception and socket closing.</simpara>
  5514. </listitem>
  5515. </itemizedlist>
  5516. </para>
  5517. <para>
  5518. While this library is currently used by Kea, it is designed to
  5519. be a portable, universal library, useful for any kind of DHCP-related software.
  5520. </para>
  5521. <!-- TODO: point to doxygen docs -->
  5522. <section id="iface-detect">
  5523. <title>Interface detection and Socket handling</title>
  5524. <para>Both the DHCPv4 and DHCPv6 components share network
  5525. interface detection routines. Interface detection is
  5526. currently supported on Linux, all BSD family (FreeBSD, NetBSD,
  5527. OpenBSD), Mac OS X and Solaris 11 systems.</para>
  5528. <para>DHCPv4 requires special raw socket processing to send and receive
  5529. packets from hosts that do not have IPv4 address assigned yet. Support
  5530. for this operation is implemented on Linux only, so it is likely that
  5531. DHCPv4 component will not work in certain cases on systems other than
  5532. Linux.</para>
  5533. </section>
  5534. <!--
  5535. <section id="packet-handling">
  5536. <title>DHCPv4/DHCPv6 packet handling</title>
  5537. <para>TODO: Describe packet handling here, with pointers to wiki</para>
  5538. </section>
  5539. -->
  5540. </chapter>
  5541. <chapter id="statistics">
  5542. <title>Statistics</title>
  5543. <para>
  5544. The <command>b10-stats</command> process is started by
  5545. <command>b10-init</command>.
  5546. It periodically collects statistics data from various modules
  5547. and aggregates it.
  5548. <!-- TODO -->
  5549. </para>
  5550. <para>
  5551. This stats daemon provides commands to identify if it is
  5552. running, show specified or all statistics data, and show specified
  5553. or all statistics data schema.
  5554. For example, using <command>bindctl</command>:
  5555. <screen>
  5556. &gt; <userinput>Stats show</userinput>
  5557. {
  5558. "Auth": {
  5559. "opcode.iquery": 0,
  5560. "opcode.notify": 10,
  5561. "opcode.query": 869617,
  5562. ...
  5563. "queries.tcp": 1749,
  5564. "queries.udp": 867868
  5565. },
  5566. "Init": {
  5567. "boot_time": "2011-01-20T16:59:03Z"
  5568. },
  5569. "Stats": {
  5570. "boot_time": "2011-01-20T16:59:05Z",
  5571. "last_update_time": "2011-01-20T17:04:05Z",
  5572. "lname": "4d3869d9_a@jreed.example.net",
  5573. "report_time": "2011-01-20T17:04:06Z",
  5574. "timestamp": 1295543046.823504
  5575. }
  5576. }
  5577. </screen>
  5578. </para>
  5579. </chapter>
  5580. <chapter id="logging">
  5581. <title>Logging</title>
  5582. <section>
  5583. <title>Logging configuration</title>
  5584. <para>
  5585. The logging system in Kea is configured through the
  5586. Logging module. All modules will look at the
  5587. configuration in Logging to see what should be logged and
  5588. to where.
  5589. <!-- TODO: what is context of Logging module for readers of this guide? -->
  5590. </para>
  5591. <section>
  5592. <title>Loggers</title>
  5593. <para>
  5594. Within Kea, a message is logged through a component
  5595. called a "logger". Different parts of log messages
  5596. through different loggers, and each logger can be configured
  5597. independently of one another.
  5598. </para>
  5599. <para>
  5600. In the Logging module, you can specify the configuration
  5601. for zero or more loggers; any that are not specified will
  5602. take appropriate default values.
  5603. </para>
  5604. <para>
  5605. The three most important elements of a logger configuration
  5606. are the <option>name</option> (the component that is
  5607. generating the messages), the <option>severity</option>
  5608. (what to log), and the <option>output_options</option>
  5609. (where to log).
  5610. </para>
  5611. <section>
  5612. <title>name (string)</title>
  5613. <para>
  5614. Each logger in the system has a name, the name being that
  5615. of the component using it to log messages. For instance,
  5616. if you want to configure logging for the Dhcp4 module,
  5617. you add an entry for a logger named <quote>Dhcp4</quote>. This
  5618. configuration will then be used by the loggers in the
  5619. Dhcp4 module, and all the libraries used by it.
  5620. </para>
  5621. <!-- TODO: later we will have a way to know names of all modules
  5622. Right now you can only see what their names are if they are running
  5623. (a simple 'help' without anything else in bindctl for instance).
  5624. -->
  5625. <para>
  5626. If you want to specify logging for one specific library
  5627. within the module, you set the name to
  5628. <replaceable>module.library</replaceable>. For example, the
  5629. logger used by the nameserver address store component
  5630. has the full name of <quote>Dhcp4.dhcpsrv</quote>. If
  5631. there is no entry in Logging for a particular library,
  5632. it will use the configuration given for the module.
  5633. </para>
  5634. <para>
  5635. To illustrate this, suppose you want the dhcpsrv library
  5636. to log messages of severity DEBUG, and the rest of the
  5637. Dhcp4 code to log messages of severity INFO. To achieve
  5638. this you specify two loggers, one with the name
  5639. <quote>Dhcp4</quote> and severity INFO, and one with
  5640. the name <quote>Dhcp4.dhcpsrv</quote> with severity
  5641. DEBUG. As there are no entries for other libraries,
  5642. they will use the configuration for the module
  5643. (<quote>Dhcp4</quote>), so giving the desired behavior.
  5644. </para>
  5645. <para>
  5646. One special case is that of a module name of <quote>*</quote>
  5647. (asterisks), which is interpreted as <emphasis>any</emphasis>
  5648. module. You can set global logging options by using this,
  5649. including setting the logging configuration for a library
  5650. that is used by multiple modules (e.g. <quote>*.config</quote>
  5651. specifies the configuration library code in whatever
  5652. module is using it).
  5653. </para>
  5654. <para>
  5655. If there are multiple logger specifications in the
  5656. configuration that might match a particular logger, the
  5657. specification with the more specific logger name takes
  5658. precedence. For example, if there are entries for
  5659. both <quote>*</quote> and <quote>Dhcp4</quote>, the
  5660. Dhcp4 module &mdash; and all libraries it uses &mdash;
  5661. will log messages according to the configuration in the
  5662. second entry (<quote>Dhcp4</quote>). All other modules
  5663. will use the configuration of the first entry
  5664. (<quote>*</quote>).
  5665. </para>
  5666. <para>
  5667. One final note about the naming. When specifying the
  5668. module name within a logger, use the name of the module
  5669. as specified in <command>bindctl</command>, e.g.
  5670. <quote>Dhcp4</quote> for the Dhcp4 module,
  5671. <quote>Dhcp6</quote> for the Dhcp6 module, etc. When
  5672. the message is logged, the message will include the name
  5673. of the logger generating the message, but with the module
  5674. name replaced by the name of the process implementing
  5675. the module (so for example, a message generated by the
  5676. <quote>Dhcp4</quote> logger will appear in the output
  5677. with a logger name of <quote>b10-dhcp4</quote>).
  5678. </para>
  5679. </section>
  5680. <section>
  5681. <title>severity (string)</title>
  5682. <para>
  5683. This specifies the category of messages logged.
  5684. Each message is logged with an associated severity which
  5685. may be one of the following (in descending order of
  5686. severity):
  5687. </para>
  5688. <itemizedlist>
  5689. <listitem>
  5690. <simpara> FATAL </simpara>
  5691. </listitem>
  5692. <listitem>
  5693. <simpara> ERROR </simpara>
  5694. </listitem>
  5695. <listitem>
  5696. <simpara> WARN </simpara>
  5697. </listitem>
  5698. <listitem>
  5699. <simpara> INFO </simpara>
  5700. </listitem>
  5701. <listitem>
  5702. <simpara> DEBUG </simpara>
  5703. </listitem>
  5704. </itemizedlist>
  5705. <para>
  5706. When the severity of a logger is set to one of these
  5707. values, it will only log messages of that severity, and
  5708. the severities above it. The severity may also be set to
  5709. NONE, in which case all messages from that logger are
  5710. inhibited.
  5711. <!-- TODO: worded wrong? If I set to INFO, why would it show DEBUG which is literally below in that list? -->
  5712. </para>
  5713. </section>
  5714. <section>
  5715. <title>output_options (list)</title>
  5716. <para>
  5717. Each logger can have zero or more
  5718. <option>output_options</option>. These specify where log
  5719. messages are sent to. These are explained in detail below.
  5720. </para>
  5721. <para>
  5722. The other options for a logger are:
  5723. </para>
  5724. </section>
  5725. <section>
  5726. <title>debuglevel (integer)</title>
  5727. <para>
  5728. When a logger's severity is set to DEBUG, this value
  5729. specifies what debug messages should be printed. It ranges
  5730. from 0 (least verbose) to 99 (most verbose).
  5731. </para>
  5732. <!-- TODO: complete this sentence:
  5733. The general classification of debug message types is
  5734. TODO; there's a ticket to determine these levels, see #1074
  5735. -->
  5736. <para>
  5737. If severity for the logger is not DEBUG, this value is ignored.
  5738. </para>
  5739. </section>
  5740. <section>
  5741. <title>additive (true or false)</title>
  5742. <para>
  5743. If this is true, the <option>output_options</option> from
  5744. the parent will be used. For example, if there are two
  5745. loggers configured; <quote>Dhcp4</quote> and
  5746. <quote>Dhcp4.dhcpsrv</quote>, and <option>additive</option>
  5747. is true in the second, it will write the log messages
  5748. not only to the destinations specified for
  5749. <quote>Dhcp4.dhcpsrv</quote>, but also to the destinations
  5750. as specified in the <option>output_options</option> in
  5751. the logger named <quote>Dhcp4</quote>.
  5752. </para>
  5753. </section>
  5754. </section>
  5755. <section>
  5756. <title>Output Options</title>
  5757. <para>
  5758. The main settings for an output option are the
  5759. <option>destination</option> and a value called
  5760. <option>output</option>, the meaning of which depends on
  5761. the destination that is set.
  5762. </para>
  5763. <section>
  5764. <title>destination (string)</title>
  5765. <para>
  5766. The destination is the type of output. It can be one of:
  5767. </para>
  5768. <itemizedlist>
  5769. <listitem>
  5770. <simpara> console </simpara>
  5771. </listitem>
  5772. <listitem>
  5773. <simpara> file </simpara>
  5774. </listitem>
  5775. <listitem>
  5776. <simpara> syslog </simpara>
  5777. </listitem>
  5778. </itemizedlist>
  5779. </section>
  5780. <section>
  5781. <title>output (string)</title>
  5782. <para>
  5783. Depending on what is set as the output destination, this
  5784. value is interpreted as follows:
  5785. </para>
  5786. <variablelist>
  5787. <varlistentry>
  5788. <term><option>destination</option> is <quote>console</quote></term>
  5789. <listitem>
  5790. <para>
  5791. The value of output must be one of <quote>stdout</quote>
  5792. (messages printed to standard output) or
  5793. <quote>stderr</quote> (messages printed to standard
  5794. error).
  5795. </para>
  5796. <para>
  5797. Note: if output is set to <quote>stderr</quote> and a lot of
  5798. messages are produced in a short time (e.g. if the logging
  5799. level is set to DEBUG), you may occasionally see some messages
  5800. jumbled up together. This is due to a combination of the way
  5801. that messages are written to the screen and the unbuffered
  5802. nature of the standard error stream. If this occurs, it is
  5803. recommended that output be set to <quote>stdout</quote>.
  5804. </para>
  5805. </listitem>
  5806. </varlistentry>
  5807. <varlistentry>
  5808. <term><option>destination</option> is <quote>file</quote></term>
  5809. <listitem>
  5810. <para>
  5811. The value of output is interpreted as a file name;
  5812. log messages will be appended to this file.
  5813. </para>
  5814. </listitem>
  5815. </varlistentry>
  5816. <varlistentry>
  5817. <term><option>destination</option> is <quote>syslog</quote></term>
  5818. <listitem>
  5819. <para>
  5820. The value of output is interpreted as the
  5821. <command>syslog</command> facility (e.g.
  5822. <emphasis>local0</emphasis>) that should be used
  5823. for log messages.
  5824. </para>
  5825. </listitem>
  5826. </varlistentry>
  5827. </variablelist>
  5828. <para>
  5829. The other options for <option>output_options</option> are:
  5830. </para>
  5831. <section>
  5832. <title>flush (true of false)</title>
  5833. <para>
  5834. Flush buffers after each log message. Doing this will
  5835. reduce performance but will ensure that if the program
  5836. terminates abnormally, all messages up to the point of
  5837. termination are output.
  5838. </para>
  5839. </section>
  5840. <section>
  5841. <title>maxsize (integer)</title>
  5842. <para>
  5843. Only relevant when destination is file, this is maximum
  5844. file size of output files in bytes. When the maximum
  5845. size is reached, the file is renamed and a new file opened.
  5846. (For example, a ".1" is appended to the name &mdash;
  5847. if a ".1" file exists, it is renamed ".2",
  5848. etc.)
  5849. </para>
  5850. <para>
  5851. If this is 0, no maximum file size is used.
  5852. </para>
  5853. <note>
  5854. <simpara>
  5855. Due to a limitation of the underlying logging library
  5856. (log4cplus), rolling over the log files (from ".1" to
  5857. ".2", etc) may show odd results: There can be
  5858. multiple small files at the timing of roll over. This
  5859. can happen when multiple processes try to roll
  5860. over the files simultaneously.
  5861. Version 1.1.0 of log4cplus solved this problem, so if
  5862. this or higher version of log4cplus is used to build
  5863. Kea, it shouldn't happen. Even for older versions
  5864. it is normally expected to happen rarely unless the log
  5865. messages are produced very frequently by multiple
  5866. different processes.
  5867. </simpara>
  5868. </note>
  5869. </section>
  5870. <section>
  5871. <title>maxver (integer)</title>
  5872. <para>
  5873. Maximum number of old log files to keep around when
  5874. rolling the output file. Only relevant when
  5875. <option>destination</option> is <quote>file</quote>.
  5876. </para>
  5877. </section>
  5878. </section>
  5879. </section>
  5880. <section>
  5881. <title>Example session</title>
  5882. <para>
  5883. In this example we want to set the global logging to
  5884. write to the file <filename>/var/log/my_bind10.log</filename>,
  5885. at severity WARN. We want the authoritative server to
  5886. log at DEBUG with debuglevel 40, to a different file
  5887. (<filename>/tmp/debug_messages</filename>).
  5888. </para>
  5889. <para>
  5890. Start <command>bindctl</command>.
  5891. </para>
  5892. <para>
  5893. <screen>["login success "]
  5894. &gt; <userinput>config show Logging</userinput>
  5895. Logging/loggers [] list
  5896. </screen>
  5897. </para>
  5898. <para>
  5899. By default, no specific loggers are configured, in which
  5900. case the severity defaults to INFO and the output is
  5901. written to stderr.
  5902. </para>
  5903. <para>
  5904. Let's first add a default logger:
  5905. </para>
  5906. <!-- TODO: adding the empty loggers makes no sense -->
  5907. <para>
  5908. <screen>&gt; <userinput>config add Logging/loggers</userinput>
  5909. &gt; <userinput>config show Logging</userinput>
  5910. Logging/loggers/ list (modified)
  5911. </screen>
  5912. </para>
  5913. <para>
  5914. The loggers value line changed to indicate that it is no
  5915. longer an empty list:
  5916. </para>
  5917. <para>
  5918. <screen>&gt; <userinput>config show Logging/loggers</userinput>
  5919. Logging/loggers[0]/name "" string (default)
  5920. Logging/loggers[0]/severity "INFO" string (default)
  5921. Logging/loggers[0]/debuglevel 0 integer (default)
  5922. Logging/loggers[0]/additive false boolean (default)
  5923. Logging/loggers[0]/output_options [] list (default)
  5924. </screen>
  5925. </para>
  5926. <para>
  5927. The name is mandatory, so we must set it. We will also
  5928. change the severity as well. Let's start with the global
  5929. logger.
  5930. </para>
  5931. <para>
  5932. <screen>&gt; <userinput>config set Logging/loggers[0]/name *</userinput>
  5933. &gt; <userinput>config set Logging/loggers[0]/severity WARN</userinput>
  5934. &gt; <userinput>config show Logging/loggers</userinput>
  5935. Logging/loggers[0]/name "*" string (modified)
  5936. Logging/loggers[0]/severity "WARN" string (modified)
  5937. Logging/loggers[0]/debuglevel 0 integer (default)
  5938. Logging/loggers[0]/additive false boolean (default)
  5939. Logging/loggers[0]/output_options [] list (default)
  5940. </screen>
  5941. </para>
  5942. <para>
  5943. Of course, we need to specify where we want the log
  5944. messages to go, so we add an entry for an output option.
  5945. </para>
  5946. <para>
  5947. <screen>&gt; <userinput> config add Logging/loggers[0]/output_options</userinput>
  5948. &gt; <userinput> config show Logging/loggers[0]/output_options</userinput>
  5949. Logging/loggers[0]/output_options[0]/destination "console" string (default)
  5950. Logging/loggers[0]/output_options[0]/output "stdout" string (default)
  5951. Logging/loggers[0]/output_options[0]/flush false boolean (default)
  5952. Logging/loggers[0]/output_options[0]/maxsize 0 integer (default)
  5953. Logging/loggers[0]/output_options[0]/maxver 0 integer (default)
  5954. </screen>
  5955. </para>
  5956. <para>
  5957. These aren't the values we are looking for.
  5958. </para>
  5959. <para>
  5960. <screen>&gt; <userinput> config set Logging/loggers[0]/output_options[0]/destination file</userinput>
  5961. &gt; <userinput> config set Logging/loggers[0]/output_options[0]/output /var/log/kea.log</userinput>
  5962. &gt; <userinput> config set Logging/loggers[0]/output_options[0]/maxsize 204800</userinput>
  5963. &gt; <userinput> config set Logging/loggers[0]/output_options[0]/maxver 8</userinput>
  5964. </screen>
  5965. </para>
  5966. <para>
  5967. Which would make the entire configuration for this logger
  5968. look like:
  5969. </para>
  5970. <para>
  5971. <screen>&gt; <userinput> config show all Logging/loggers</userinput>
  5972. Logging/loggers[0]/name "*" string (modified)
  5973. Logging/loggers[0]/severity "WARN" string (modified)
  5974. Logging/loggers[0]/debuglevel 0 integer (default)
  5975. Logging/loggers[0]/additive false boolean (default)
  5976. Logging/loggers[0]/output_options[0]/destination "file" string (modified)
  5977. Logging/loggers[0]/output_options[0]/output "/var/log/kea.log" string (modified)
  5978. Logging/loggers[0]/output_options[0]/flush false boolean (default)
  5979. Logging/loggers[0]/output_options[0]/maxsize 204800 integer (modified)
  5980. Logging/loggers[0]/output_options[0]/maxver 8 integer (modified)
  5981. </screen>
  5982. </para>
  5983. <para>
  5984. That looks OK, so let's commit it before we add the
  5985. configuration for the authoritative server's logger.
  5986. </para>
  5987. <para>
  5988. <screen>&gt; <userinput> config commit</userinput></screen>
  5989. </para>
  5990. <para>
  5991. Now that we have set it, and checked each value along
  5992. the way, adding a second entry is quite similar.
  5993. </para>
  5994. <para>
  5995. <screen>&gt; <userinput> config add Logging/loggers</userinput>
  5996. &gt; <userinput> config set Logging/loggers[1]/name Dhcp4</userinput>
  5997. &gt; <userinput> config set Logging/loggers[1]/severity DEBUG</userinput>
  5998. &gt; <userinput> config set Logging/loggers[1]/debuglevel 40</userinput>
  5999. &gt; <userinput> config add Logging/loggers[1]/output_options</userinput>
  6000. &gt; <userinput> config set Logging/loggers[1]/output_options[0]/destination file</userinput>
  6001. &gt; <userinput> config set Logging/loggers[1]/output_options[0]/output /tmp/dhcp4_debug.log</userinput>
  6002. &gt; <userinput> config commit</userinput>
  6003. </screen>
  6004. </para>
  6005. <para>
  6006. And that's it. Once we have found whatever it was we
  6007. needed the debug messages for, we can simply remove the
  6008. second logger to let the DHCP server use the
  6009. same settings as the rest.
  6010. </para>
  6011. <para>
  6012. <screen>&gt; <userinput> config remove Logging/loggers[1]</userinput>
  6013. &gt; <userinput> config commit</userinput>
  6014. </screen>
  6015. </para>
  6016. <para>
  6017. And every module will now be using the values from the
  6018. logger named <quote>*</quote>.
  6019. </para>
  6020. </section>
  6021. </section>
  6022. <section>
  6023. <title>Logging Message Format</title>
  6024. <para>
  6025. Each message written to the configured logging
  6026. destinations comprises a number of components that identify
  6027. the origin of the message and, if the message indicates
  6028. a problem, information about the problem that may be
  6029. useful in fixing it.
  6030. </para>
  6031. <para>
  6032. Consider the message below logged to a file:
  6033. <screen>2014-04-11 12:58:01.005 INFO [b10-dhcp4.dhcpsrv/27456]
  6034. DHCPSRV_MEMFILE_DB opening memory file lease database: type=memfile universe=4</screen>
  6035. </para>
  6036. <para>
  6037. Note: the layout of messages written to the system logging
  6038. file (syslog) may be slightly different. This message has
  6039. been split across two lines here for display reasons; in the
  6040. logging file, it will appear on one line.)
  6041. </para>
  6042. <para>
  6043. The log message comprises a number of components:
  6044. <variablelist>
  6045. <varlistentry>
  6046. <term>2014-04-11 12:58:01.005</term>
  6047. <!-- TODO: timestamp repeated even if using syslog? -->
  6048. <listitem><para>
  6049. The date and time at which the message was generated.
  6050. </para></listitem>
  6051. </varlistentry>
  6052. <varlistentry>
  6053. <term>INFO</term>
  6054. <listitem><para>
  6055. The severity of the message.
  6056. </para></listitem>
  6057. </varlistentry>
  6058. <varlistentry>
  6059. <term>[b10-dhcp4.dhcpsrv/27456]</term>
  6060. <listitem><para>
  6061. The source of the message. This comprises two components:
  6062. the BIND 10 process generating the message (in this
  6063. case, <command>b10-dhcp4</command>) and the module
  6064. within the program from which the message originated
  6065. (which is the name of the common library used by DHCP server
  6066. implementations).
  6067. </para></listitem>
  6068. </varlistentry>
  6069. <varlistentry>
  6070. <term>DHCPSRV_MEMFILE_DB</term>
  6071. <listitem><para>
  6072. The message identification. Every message in Kea
  6073. has a unique identification, which can be used as an
  6074. index into the <ulink
  6075. url="bind10-messages.html"><citetitle>Kea Messages
  6076. Manual</citetitle></ulink> (<ulink
  6077. url="http://kea.isc.org/docs/bind10-messages.html"
  6078. />) from which more information can be obtained.
  6079. </para></listitem>
  6080. </varlistentry>
  6081. <varlistentry>
  6082. <term>opening memory file lease database: type=memfile universe=4</term>
  6083. <listitem><para>
  6084. A brief description.
  6085. Within this text, information relating to the condition
  6086. that caused the message to be logged will be included.
  6087. In this example, the information is logged that the in-memory
  6088. lease database backend will be used to store DHCP leases.
  6089. </para></listitem>
  6090. </varlistentry>
  6091. </variablelist>
  6092. </para>
  6093. </section>
  6094. </chapter>
  6095. <chapter id="acknowledgements">
  6096. <title>Acknowledgements</title>
  6097. <para>Kea was initially implemented as a collection of applications
  6098. within the BIND 10 framework. Hence, Kea development would not be
  6099. possible without the generous support of BIND 10 project sponsors.</para>
  6100. <para><ulink url="http://jprs.co.jp/">JPRS</ulink> and
  6101. <ulink url="http://cira.ca/">CIRA</ulink> are Patron Level
  6102. sponsors.</para>
  6103. <para><ulink url="https://www.afnic.fr/">AFNIC</ulink>,
  6104. <ulink url="https://www.cnnic.net.cn/">CNNIC</ulink>,
  6105. <ulink url="https://www.nic.cz/">CZ.NIC</ulink>,
  6106. <ulink url="http://www.denic.de/">DENIC eG</ulink>,
  6107. <ulink url="https://www.google.com/">Google</ulink>,
  6108. <ulink url="https://www.ripe.net/">RIPE NCC</ulink>,
  6109. <ulink url="https://registro.br/">Registro.br</ulink>,
  6110. <ulink url="https://nzrs.net.nz/">.nz Registry Services</ulink>, and
  6111. <ulink url="https://www.tcinet.ru/">Technical Center of Internet</ulink>
  6112. are current sponsors.</para>
  6113. <para><ulink url="https://www.afilias.info/">Afilias</ulink>,
  6114. <ulink url="https://www.iis.se/">IIS.SE</ulink>,
  6115. <ulink url="http://www.nominet.org.uk/">Nominet</ulink>, and
  6116. <ulink url="https://www.sidn.nl/">SIDN</ulink> were founding
  6117. sponsors of the project.</para>
  6118. <!-- DHCP sponsorship by Comcast -->
  6119. <para>Support for the development of the DHCPv4, DHCPv6 and
  6120. DHCP-DDNS components is provided by
  6121. <ulink url="http://www.comcast.com/">Comcast</ulink>.</para>
  6122. </chapter>
  6123. <!-- TODO: Add bibliography section (mostly RFCs, probably) -->
  6124. <!-- TODO: how to help: run unit tests, join lists, review trac tickets -->
  6125. <!-- <index> <title>Index</title> </index> -->
  6126. </book>
  6127. <!--
  6128. TODO:
  6129. Overview
  6130. Getting BIND 10 Installed
  6131. Basics
  6132. Dependencies
  6133. Optional
  6134. Advanced
  6135. How Does Everything Work Together?
  6136. Need Help?
  6137. -->