bind10-guide.xml 297 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857
  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/sender-ip "" string
  1948. Dhcp4/dhcp-ddns/sender-port 0 integer
  1949. Dhcp4/dhcp-ddns/max-queue-size 1024 integer
  1950. Dhcp4/dhcp-ddns/ncr-protocol "UDP" string
  1951. Dhcp4/dhcp-ddns/ncr-format "JSON" string
  1952. Dhcp4/dhcp-ddns/override-no-update false boolean
  1953. Dhcp4/dhcp-ddns/override-client-update false boolean
  1954. Dhcp4/dhcp-ddns/replace-client-name false boolean
  1955. Dhcp4/dhcp-ddns/generated-prefix "myhost" string
  1956. Dhcp4/dhcp-ddns/qualifying-suffix "example.com" string
  1957. </screen>
  1958. </para>
  1959. <para>
  1960. To change one of the parameters, simply follow
  1961. the usual <command>bindctl</command> procedure. For example, to make the
  1962. leases longer, change their valid-lifetime parameter:
  1963. <screen>
  1964. &gt; <userinput>config set Dhcp4/valid-lifetime 7200</userinput>
  1965. &gt; <userinput>config commit</userinput></screen>
  1966. Please note that most Dhcp4 parameters are of global scope
  1967. and apply to all defined subnets, unless they are overridden on a
  1968. per-subnet basis.
  1969. </para>
  1970. <para>
  1971. The renew-timer and rebind-timer are optional. If they are not specified,
  1972. the DHCPv4 options 58 and 59 are not sent in the server's response to the
  1973. client.
  1974. </para>
  1975. <section>
  1976. <title>Default storage for leases</title>
  1977. <para>
  1978. The server is able to store lease data in different repositories. Larger deployments
  1979. may elect to store leases in a database.
  1980. <xref linkend="database-configuration4"/> describes one way to do it.
  1981. By default, the server will use a CSV file rather than a database to store
  1982. lease information. One of the advantages of using a file is that it eliminates
  1983. dependency on third party database software.
  1984. </para>
  1985. <para>
  1986. The configuration of the file backend (Memfile)
  1987. is controlled through the Dhcp4/lease-database parameters. When default
  1988. parameters are used, the Memfile backend will write leases to a disk in the
  1989. [bind10-install-dir]/var/bind10/kea-leases4.csv.
  1990. </para>
  1991. <para>
  1992. It is possible to alter the default location of the lease file. The following
  1993. configuration:
  1994. <screen>
  1995. &gt; <userinput>config set Dhcp4/lease-database/type "memfile"</userinput>
  1996. &gt; <userinput>config set Dhcp4/lease-database/persist true</userinput>
  1997. &gt; <userinput>config set Dhcp4/lease-database/name "/tmp/kea-leases4.csv"</userinput>
  1998. &gt; <userinput>config commit</userinput>
  1999. </screen>
  2000. will change the default location of the lease file to /tmp/kea-leases4.csv.
  2001. </para>
  2002. <para>
  2003. The "persist" parameter controls whether the leases are written to disk.
  2004. It is strongly recommended that this parameter is set to "true" at all times
  2005. during the normal operation of the server
  2006. </para>
  2007. </section>
  2008. <section id="database-configuration4">
  2009. <title>Database Configuration</title>
  2010. <para>
  2011. All leases issued by the server are stored in the lease database. Currently
  2012. there are 3 database backends available: MySQL, PostgreSQL and memfile.
  2013. <footnote>
  2014. <para>
  2015. The server comes with an in-memory database ("memfile") configured as the default
  2016. database. This is used for internal testing and is not supported. In addition,
  2017. it does not store lease information on disk: lease information will be lost if the
  2018. server is restarted.
  2019. </para>
  2020. </footnote>, and so the server must be configured to
  2021. access the correct database with the appropriate credentials.
  2022. </para>
  2023. <note>
  2024. <para>
  2025. Database access information must be configured for the DHCPv4 server, even if
  2026. it has already been configured for the DHCPv6 server. The servers store their
  2027. information independently, so each server can use a separate
  2028. database or both servers can use the same database.
  2029. </para>
  2030. </note>
  2031. <para>
  2032. Database configuration is controlled through the Dhcp4/lease-database parameters.
  2033. The type of the database must be set to "mysql", "postgresql" or "memfile":
  2034. <screen>
  2035. &gt; <userinput>config set Dhcp4/lease-database/type "mysql"</userinput>
  2036. </screen>
  2037. Next, the name of the database is to hold the leases must be set: this is the
  2038. name used when the lease database was created (see <xref linkend="dhcp-mysql-database-create"/>
  2039. or <xref linkend="dhcp-pgsql-database-create"/>).
  2040. <screen>
  2041. &gt; <userinput>config set Dhcp4/lease-database/name "<replaceable>database-name</replaceable>"</userinput>
  2042. </screen>
  2043. If the database is located on a different system to the DHCPv4 server, the
  2044. database host name must also be specified (although note that this configuration
  2045. may have a severe impact on server performance):
  2046. <screen>
  2047. &gt; <userinput>config set Dhcp4/lease-database/host "<replaceable>remote-host-name</replaceable>"</userinput>
  2048. </screen>
  2049. The usual state of affairs will be to have the database on the same machine as the
  2050. DHCPv4 server. In this case, set the value to the empty string (this is the default):
  2051. <screen>
  2052. &gt; <userinput>config set Dhcp4/lease-database/host ""</userinput>
  2053. </screen>
  2054. </para>
  2055. <para>
  2056. Finally, the credentials of the account under which the server will access the database
  2057. should be set:
  2058. <screen>
  2059. &gt; <userinput>config set Dhcp4/lease-database/user "<replaceable>user-name</replaceable>"</userinput>
  2060. &gt; <userinput>config set Dhcp4/lease-database/password "<replaceable>password</replaceable>"</userinput>
  2061. </screen>
  2062. If there is no password to the account, set the password to the empty string "". (This is also the default.)
  2063. </para>
  2064. <note>
  2065. <para>The password is echoed when entered and is stored in clear text in the configuration
  2066. database. Improved password security will be added in a future version of Kea.</para>
  2067. </note>
  2068. </section>
  2069. <section id="dhcp4-interface-selection">
  2070. <title>Interface selection</title>
  2071. <para>
  2072. When DHCPv4 server starts up, by default it will listen to the DHCP
  2073. traffic and respond to it on all interfaces detected during startup.
  2074. However, in many cases it is desired to configure the server to listen and
  2075. respond on selected interfaces only. The sample commands in this section
  2076. show how to make interface selection using bindctl.
  2077. </para>
  2078. <para>
  2079. The default configuration can be presented with the following command:
  2080. <screen>
  2081. &gt; <userinput>config show Dhcp4/interfaces</userinput>
  2082. <userinput>Dhcp4/interfaces[0] "*" string</userinput></screen>
  2083. An asterisk sign plays a role of the wildcard and means "listen on all interfaces".
  2084. </para>
  2085. <para>
  2086. In order to override the default configuration, the existing entry can be replaced
  2087. with the actual interface name:
  2088. <screen>
  2089. &gt; <userinput>config set Dhcp4/interfaces[0] eth1</userinput>
  2090. &gt; <userinput>config commit</userinput></screen>
  2091. Other interface names can be added on one-by-one basis:
  2092. <screen>
  2093. &gt; <userinput>config add Dhcp4/interfaces eth2</userinput>
  2094. &gt; <userinput>config commit</userinput></screen>
  2095. Configuration will now contain two interfaces which can be presented as follows:
  2096. <screen>
  2097. &gt; <userinput>config show Dhcp4/interfaces</userinput>
  2098. <userinput>Dhcp4/interfaces[0] "eth1" string</userinput>
  2099. <userinput>Dhcp4/interfaces[1] "eth2" string</userinput></screen>
  2100. When configuration gets committed, the server will start to listen on
  2101. eth1 and eth2 interfaces only.
  2102. </para>
  2103. <para>
  2104. It is possible to use wildcard interface name (asterisk) concurrently with explicit
  2105. interface names:
  2106. <screen>
  2107. &gt; <userinput>config add Dhcp4/interfaces *</userinput>
  2108. &gt; <userinput>config commit</userinput></screen>
  2109. This will result in the following configuration:
  2110. <screen>
  2111. &gt; <userinput>config show Dhcp4/interfaces</userinput>
  2112. <userinput>Dhcp4/interfaces[0] "eth1" string</userinput>
  2113. <userinput>Dhcp4/interfaces[1] "eth2" string</userinput>
  2114. <userinput>Dhcp4/interfaces[2] "*" string</userinput></screen>
  2115. The presence of the wildcard name implies that server will listen on all interfaces.
  2116. In order to fall back to the previous configuration when server listens on eth1 and eth2:
  2117. <screen>
  2118. &gt; <userinput>config remove Dhcp4/interfaces[2]</userinput>
  2119. &gt; <userinput>config commit</userinput></screen>
  2120. </para>
  2121. </section>
  2122. <section id="ipv4-subnet-id">
  2123. <title>IPv4 Subnet Identifier</title>
  2124. <para>
  2125. Subnet identifier is a unique number associated with a particular subnet.
  2126. In principle, it is used to associate clients' leases with respective subnets.
  2127. When subnet identifier is not specified for a subnet being configured, it will
  2128. be automatically assigned by the configuration mechanism. The identifiers
  2129. are assigned from 1 and are monotonically increased for each subsequent
  2130. subnet: 1, 2, 3 ....
  2131. </para>
  2132. <para>
  2133. If there are multiple subnets configured with auto-generated identifiers and
  2134. one of them is removed, the subnet identifiers may be renumbered. For example:
  2135. if there are 4 subnets and 3rd is removed the last subnet will be assigned
  2136. identifier that the 3rd subnet had before removal. As a result, the leases
  2137. stored in the lease database for subnet 3 are now associated with the
  2138. subnet 4, which may have unexpected consequences. In the future it is planned
  2139. to implement the mechanism to preserve auto-generated subnet ids upon removal
  2140. of one of the subnets. Currently, the only remedy for this issue is to
  2141. manually specify the unique subnet identifier for each subnet.
  2142. </para>
  2143. <para>
  2144. The following configuration:
  2145. <screen>
  2146. &gt; <userinput>config add Dhcp4/subnet4</userinput>
  2147. &gt; <userinput>config set Dhcp4/subnet4[0]/subnet "192.0.2.0/24"</userinput>
  2148. &gt; <userinput>config set Dhcp4/subnet4[0]/id 1024</userinput>
  2149. &gt; <userinput>config commit</userinput>
  2150. </screen>
  2151. will assign the arbitrary subnet identifier to the newly configured subnet.
  2152. This identifier will not change for this subnet until "id" parameter is
  2153. removed or set to 0. The value of 0 forces auto-generation of subnet
  2154. identifier.
  2155. </para>
  2156. </section>
  2157. <section id="dhcp4-address-config">
  2158. <title>Configuration of IPv4 Address Pools</title>
  2159. <para>
  2160. The essential role of DHCPv4 server is address assignment. The server
  2161. has to be configured with at least one subnet and one pool of dynamic
  2162. addresses to be managed. For example, assume that the server
  2163. is connected to a network segment that uses the 192.0.2.0/24
  2164. prefix. The Administrator of that network has decided that addresses from range
  2165. 192.0.2.10 to 192.0.2.20 are going to be managed by the Dhcp4
  2166. server. Such a configuration can be achieved in the following way:
  2167. <screen>
  2168. &gt; <userinput>config add Dhcp4/subnet4</userinput>
  2169. &gt; <userinput>config set Dhcp4/subnet4[0]/subnet "192.0.2.0/24"</userinput>
  2170. &gt; <userinput>config set Dhcp4/subnet4[0]/pool [ "192.0.2.10 - 192.0.2.20" ]</userinput>
  2171. &gt; <userinput>config commit</userinput></screen>
  2172. Note that subnet is defined as a simple string, but the pool parameter
  2173. is actually a list of pools: for this reason, the pool definition is
  2174. enclosed in square brackets, even though only one range of addresses
  2175. is specified.</para>
  2176. <para>It is possible to define more than one pool in a
  2177. subnet: continuing the previous example, further assume that
  2178. 192.0.2.64/26 should be also be managed by the server. It could be written as
  2179. 192.0.2.64 to 192.0.2.127. Alternatively, it can be expressed more simply as
  2180. 192.0.2.64/26. Both formats are supported by Dhcp4 and can be mixed in the pool list.
  2181. For example, one could define the following pools:
  2182. <screen>
  2183. &gt; <userinput>config set Dhcp4/subnet4[0]/pool [ "192.0.2.10-192.0.2.20", "192.0.2.64/26" ]</userinput>
  2184. &gt; <userinput>config commit</userinput></screen>
  2185. The number of pools is not limited, but for performance reasons it is recommended to
  2186. use as few as possible. Space and tabulations in pool definitions are ignored, so
  2187. spaces before and after hyphen are optional. They can be used to improve readability.
  2188. </para>
  2189. <para>
  2190. The server may be configured to serve more than one subnet. To add a second subnet,
  2191. use a command similar to the following:
  2192. <screen>
  2193. &gt; <userinput>config add Dhcp4/subnet4</userinput>
  2194. &gt; <userinput>config set Dhcp4/subnet4[1]/subnet "192.0.3.0/24"</userinput>
  2195. &gt; <userinput>config set Dhcp4/subnet4[1]/pool [ "192.0.3.0/24" ]</userinput>
  2196. &gt; <userinput>config commit</userinput></screen>
  2197. Arrays are counted from 0. subnet[0] refers to the subnet defined in the
  2198. previous example. The <command>config add Dhcp4/subnet4</command> command adds
  2199. another (second) subnet. It can be referred to as
  2200. <command>Dhcp4/subnet4[1]</command>. In this example, we allow server to
  2201. dynamically assign all addresses available in the whole subnet.
  2202. </para>
  2203. <para>
  2204. When configuring a DHCPv4 server using prefix/length notation, please pay
  2205. attention to the boundary values. When specifying that the server should use
  2206. a given pool, it will be able to allocate also first (typically network
  2207. address) and the last (typically broadcast address) address from that pool.
  2208. In the aforementioned example of pool 192.0.3.0/24, both 192.0.3.0 and
  2209. 192.0.3.255 addresses may be assigned as well. This may be invalid in some
  2210. network configurations. If you want to avoid this, please use the "min-max" notation.
  2211. </para>
  2212. </section>
  2213. <section id="dhcp4-std-options">
  2214. <title>Standard DHCPv4 options</title>
  2215. <para>
  2216. One of the major features of DHCPv4 server is to provide configuration
  2217. options to clients. Although there are several options that require
  2218. special behavior, most options are sent by the server only if the client
  2219. explicitly requested them. The following example shows how to
  2220. configure DNS servers, which is one of the most frequently used
  2221. options. Options specified in this way are considered global and apply
  2222. to all configured subnets.
  2223. <screen>
  2224. &gt; <userinput>config add Dhcp4/option-data</userinput>
  2225. &gt; <userinput>config set Dhcp4/option-data[0]/name "domain-name-servers"</userinput>
  2226. &gt; <userinput>config set Dhcp4/option-data[0]/code 6</userinput>
  2227. &gt; <userinput>config set Dhcp4/option-data[0]/space "dhcp4"</userinput>
  2228. &gt; <userinput>config set Dhcp4/option-data[0]/csv-format true</userinput>
  2229. &gt; <userinput>config set Dhcp4/option-data[0]/data "192.0.3.1, 192.0.3.2"</userinput>
  2230. &gt; <userinput>config commit</userinput>
  2231. </screen>
  2232. </para>
  2233. <para>
  2234. The first line creates new entry in option-data table. It
  2235. contains information on all global options that the server is
  2236. supposed to configure in all subnets. The second line specifies
  2237. option name. For a complete list of currently supported names,
  2238. see <xref linkend="dhcp4-std-options-list"/> below.
  2239. The third line specifies option code, which must match one of the
  2240. values from that list. Line 4 specifies option space, which must always
  2241. be set to "dhcp4" as these are standard DHCPv4 options. For
  2242. other option spaces, including custom option spaces, see <xref
  2243. linkend="dhcp4-option-spaces"/>. The fifth line specifies the format in
  2244. which the data will be entered: use of CSV (comma
  2245. separated values) is recommended. The sixth line gives the actual value to
  2246. be sent to clients. Data is specified as a normal text, with
  2247. values separated by commas if more than one value is
  2248. allowed.
  2249. </para>
  2250. <para>
  2251. Options can also be configured as hexadecimal values. If csv-format is
  2252. set to false, option data must be specified as a hex string. The
  2253. following commands configure the domain-name-servers option for all
  2254. subnets with the following addresses: 192.0.3.1 and 192.0.3.2.
  2255. Note that csv-format is set to false.
  2256. <screen>
  2257. &gt; <userinput>config add Dhcp4/option-data</userinput>
  2258. &gt; <userinput>config set Dhcp4/option-data[0]/name "domain-name-servers"</userinput>
  2259. &gt; <userinput>config set Dhcp4/option-data[0]/code 6</userinput>
  2260. &gt; <userinput>config set Dhcp4/option-data[0]/space "dhcp4"</userinput>
  2261. &gt; <userinput>config set Dhcp4/option-data[0]/csv-format false</userinput>
  2262. &gt; <userinput>config set Dhcp4/option-data[0]/data "C0 00 03 01 C0 00 03 02"</userinput>
  2263. &gt; <userinput>config commit</userinput>
  2264. </screen>
  2265. </para>
  2266. <para>
  2267. It is possible to override options on a per-subnet basis. If
  2268. clients connected to most of your subnets are expected to get the
  2269. same values of a given option, you should use global options: you
  2270. can then override specific values for a small number of subnets.
  2271. On the other hand, if you use different values in each subnet,
  2272. it does not make sense to specify global option values
  2273. (Dhcp4/option-data), rather you should set only subnet-specific values
  2274. (Dhcp4/subnet[X]/option-data[Y]).
  2275. </para>
  2276. <para>
  2277. The following commands override the global
  2278. DNS servers option for a particular subnet, setting a single DNS
  2279. server with address 192.0.2.3.
  2280. <screen>
  2281. &gt; <userinput>config add Dhcp4/subnet4[0]/option-data</userinput>
  2282. &gt; <userinput>config set Dhcp4/subnet4[0]/option-data[0]/name "domain-name-servers"</userinput>
  2283. &gt; <userinput>config set Dhcp4/subnet4[0]/option-data[0]/code 6</userinput>
  2284. &gt; <userinput>config set Dhcp4/subnet4[0]/option-data[0]/space "dhcp4"</userinput>
  2285. &gt; <userinput>config set Dhcp4/subnet4[0]/option-data[0]/csv-format true</userinput>
  2286. &gt; <userinput>config set Dhcp4/subnet4[0]/option-data[0]/data "192.0.2.3"</userinput>
  2287. &gt; <userinput>config commit</userinput></screen>
  2288. </para>
  2289. <note>
  2290. <para>In a future version of Kea, it will not be necessary to specify
  2291. the option code, space and csv-format fields as they will be set
  2292. automatically.</para>
  2293. </note>
  2294. <para>
  2295. The currently supported standard DHCPv4 options are
  2296. listed in <xref linkend="dhcp4-std-options-list"/>
  2297. and <xref linkend="dhcp4-std-options-list-part2"/>.
  2298. The "Name" and "Code"
  2299. are the values that should be used as a name in the option-data
  2300. structures. "Type" designates the format of the data: the meanings of
  2301. the various types is given in <xref linkend="dhcp-types"/>.
  2302. </para>
  2303. <para>
  2304. Some options are designated as arrays, which means that more than one
  2305. value is allowed in such an option. For example the option time-servers
  2306. allows the specification of more than one IPv4 address, so allowing
  2307. clients to obtain the the addresses of multiple NTP servers.
  2308. </para>
  2309. <!-- @todo: describe record types -->
  2310. <para>
  2311. The <xref linkend="dhcp4-custom-options"/> describes the configuration
  2312. syntax to create custom option definitions (formats). It is generally not
  2313. allowed to create custom definitions for standard options, even if the
  2314. definition being created matches the actual option format defined in the
  2315. RFCs. There is an exception from this rule for standard options for which
  2316. Kea does not provide a definition yet. In order to use such options,
  2317. a server administrator must create a definition as described in
  2318. <xref linkend="dhcp4-custom-options"/> in the 'dhcp4' option space. This
  2319. definition should match the option format described in the relevant
  2320. RFC but configuration mechanism would allow any option format as it has
  2321. no means to validate it at the moment.
  2322. </para>
  2323. <para>
  2324. <table frame="all" id="dhcp4-std-options-list">
  2325. <title>List of standard DHCPv4 options</title>
  2326. <tgroup cols='4'>
  2327. <colspec colname='name'/>
  2328. <colspec colname='code'/>
  2329. <colspec colname='type'/>
  2330. <colspec colname='array'/>
  2331. <thead>
  2332. <row>
  2333. <entry>Name</entry>
  2334. <entry>Code</entry>
  2335. <entry>Type</entry>
  2336. <entry>Array?</entry>
  2337. </row>
  2338. </thead>
  2339. <tbody>
  2340. <row><entry>subnet-mask</entry><entry>1</entry><entry>ipv4-address</entry><entry>false</entry></row>
  2341. <row><entry>time-offset</entry><entry>2</entry><entry>int32</entry><entry>false</entry></row>
  2342. <row><entry>routers</entry><entry>3</entry><entry>ipv4-address</entry><entry>true</entry></row>
  2343. <row><entry>time-servers</entry><entry>4</entry><entry>ipv4-address</entry><entry>true</entry></row>
  2344. <row><entry>name-servers</entry><entry>5</entry><entry>ipv4-address</entry><entry>false</entry></row>
  2345. <row><entry>domain-name-servers</entry><entry>6</entry><entry>ipv4-address</entry><entry>true</entry></row>
  2346. <row><entry>log-servers</entry><entry>7</entry><entry>ipv4-address</entry><entry>true</entry></row>
  2347. <row><entry>cookie-servers</entry><entry>8</entry><entry>ipv4-address</entry><entry>true</entry></row>
  2348. <row><entry>lpr-servers</entry><entry>9</entry><entry>ipv4-address</entry><entry>true</entry></row>
  2349. <row><entry>impress-servers</entry><entry>10</entry><entry>ipv4-address</entry><entry>true</entry></row>
  2350. <row><entry>resource-location-servers</entry><entry>11</entry><entry>ipv4-address</entry><entry>true</entry></row>
  2351. <row><entry>host-name</entry><entry>12</entry><entry>string</entry><entry>false</entry></row>
  2352. <row><entry>boot-size</entry><entry>13</entry><entry>uint16</entry><entry>false</entry></row>
  2353. <row><entry>merit-dump</entry><entry>14</entry><entry>string</entry><entry>false</entry></row>
  2354. <row><entry>domain-name</entry><entry>15</entry><entry>fqdn</entry><entry>false</entry></row>
  2355. <row><entry>swap-server</entry><entry>16</entry><entry>ipv4-address</entry><entry>false</entry></row>
  2356. <row><entry>root-path</entry><entry>17</entry><entry>string</entry><entry>false</entry></row>
  2357. <row><entry>extensions-path</entry><entry>18</entry><entry>string</entry><entry>false</entry></row>
  2358. <row><entry>ip-forwarding</entry><entry>19</entry><entry>boolean</entry><entry>false</entry></row>
  2359. <row><entry>non-local-source-routing</entry><entry>20</entry><entry>boolean</entry><entry>false</entry></row>
  2360. <row><entry>policy-filter</entry><entry>21</entry><entry>ipv4-address</entry><entry>true</entry></row>
  2361. <row><entry>max-dgram-reassembly</entry><entry>22</entry><entry>uint16</entry><entry>false</entry></row>
  2362. <row><entry>default-ip-ttl</entry><entry>23</entry><entry>uint8</entry><entry>false</entry></row>
  2363. <row><entry>path-mtu-aging-timeout</entry><entry>24</entry><entry>uint32</entry><entry>false</entry></row>
  2364. <row><entry>path-mtu-plateau-table</entry><entry>25</entry><entry>uint16</entry><entry>true</entry></row>
  2365. <row><entry>interface-mtu</entry><entry>26</entry><entry>uint16</entry><entry>false</entry></row>
  2366. <row><entry>all-subnets-local</entry><entry>27</entry><entry>boolean</entry><entry>false</entry></row>
  2367. <row><entry>broadcast-address</entry><entry>28</entry><entry>ipv4-address</entry><entry>false</entry></row>
  2368. <row><entry>perform-mask-discovery</entry><entry>29</entry><entry>boolean</entry><entry>false</entry></row>
  2369. <row><entry>mask-supplier</entry><entry>30</entry><entry>boolean</entry><entry>false</entry></row>
  2370. <row><entry>router-discovery</entry><entry>31</entry><entry>boolean</entry><entry>false</entry></row>
  2371. <row><entry>router-solicitation-address</entry><entry>32</entry><entry>ipv4-address</entry><entry>false</entry></row>
  2372. <row><entry>static-routes</entry><entry>33</entry><entry>ipv4-address</entry><entry>true</entry></row>
  2373. <row><entry>trailer-encapsulation</entry><entry>34</entry><entry>boolean</entry><entry>false</entry></row>
  2374. <row><entry>arp-cache-timeout</entry><entry>35</entry><entry>uint32</entry><entry>false</entry></row>
  2375. <row><entry>ieee802-3-encapsulation</entry><entry>36</entry><entry>boolean</entry><entry>false</entry></row>
  2376. <row><entry>default-tcp-ttl</entry><entry>37</entry><entry>uint8</entry><entry>false</entry></row>
  2377. <row><entry>tcp-keepalive-internal</entry><entry>38</entry><entry>uint32</entry><entry>false</entry></row>
  2378. <row><entry>tcp-keepalive-garbage</entry><entry>39</entry><entry>boolean</entry><entry>false</entry></row>
  2379. </tbody>
  2380. </tgroup>
  2381. </table>
  2382. </para>
  2383. <para>
  2384. <table frame="all" id="dhcp4-std-options-list-part2">
  2385. <title>List of standard DHCPv4 options (continued)</title>
  2386. <tgroup cols='4'>
  2387. <colspec colname='name'/>
  2388. <colspec colname='code'/>
  2389. <colspec colname='type'/>
  2390. <colspec colname='array'/>
  2391. <thead>
  2392. <row>
  2393. <entry>Name</entry>
  2394. <entry>Code</entry>
  2395. <entry>Type</entry>
  2396. <entry>Array?</entry>
  2397. </row>
  2398. </thead>
  2399. <tbody>
  2400. <row><entry>nis-domain</entry><entry>40</entry><entry>string</entry><entry>false</entry></row>
  2401. <row><entry>nis-servers</entry><entry>41</entry><entry>ipv4-address</entry><entry>true</entry></row>
  2402. <row><entry>ntp-servers</entry><entry>42</entry><entry>ipv4-address</entry><entry>true</entry></row>
  2403. <row><entry>vendor-encapsulated-options</entry><entry>43</entry><entry>empty</entry><entry>false</entry></row>
  2404. <row><entry>netbios-name-servers</entry><entry>44</entry><entry>ipv4-address</entry><entry>true</entry></row>
  2405. <row><entry>netbios-dd-server</entry><entry>45</entry><entry>ipv4-address</entry><entry>true</entry></row>
  2406. <row><entry>netbios-node-type</entry><entry>46</entry><entry>uint8</entry><entry>false</entry></row>
  2407. <row><entry>netbios-scope</entry><entry>47</entry><entry>string</entry><entry>false</entry></row>
  2408. <row><entry>font-servers</entry><entry>48</entry><entry>ipv4-address</entry><entry>true</entry></row>
  2409. <row><entry>x-display-manager</entry><entry>49</entry><entry>ipv4-address</entry><entry>true</entry></row>
  2410. <row><entry>dhcp-requested-address</entry><entry>50</entry><entry>ipv4-address</entry><entry>false</entry></row>
  2411. <!-- Lease time should not be configured by a user.
  2412. <row><entry>dhcp-lease-time</entry><entry>51</entry><entry>uint32</entry><entry>false</entry></row>
  2413. -->
  2414. <row><entry>dhcp-option-overload</entry><entry>52</entry><entry>uint8</entry><entry>false</entry></row>
  2415. <!-- Message Type, Server Identifier and Parameter Request List should not be configured by a user.
  2416. <row><entry>dhcp-message-type</entry><entry>53</entry><entry>uint8</entry><entry>false</entry></row>
  2417. <row><entry>dhcp-server-identifier</entry><entry>54</entry><entry>ipv4-address</entry><entry>false</entry></row>
  2418. <row><entry>dhcp-parameter-request-list</entry><entry>55</entry><entry>uint8</entry><entry>true</entry></row>
  2419. -->
  2420. <row><entry>dhcp-message</entry><entry>56</entry><entry>string</entry><entry>false</entry></row>
  2421. <row><entry>dhcp-max-message-size</entry><entry>57</entry><entry>uint16</entry><entry>false</entry></row>
  2422. <!-- Renewal and rebinding time should not be configured by a user.
  2423. <row><entry>dhcp-renewal-time</entry><entry>58</entry><entry>uint32</entry><entry>false</entry></row>
  2424. <row><entry>dhcp-rebinding-time</entry><entry>59</entry><entry>uint32</entry><entry>false</entry></row>
  2425. -->
  2426. <row><entry>vendor-class-identifier</entry><entry>60</entry><entry>binary</entry><entry>false</entry></row>
  2427. <!-- Client identifier should not be configured by a user.
  2428. <row><entry>dhcp-client-identifier</entry><entry>61</entry><entry>binary</entry><entry>false</entry></row>
  2429. -->
  2430. <row><entry>nwip-domain-name</entry><entry>62</entry><entry>string</entry><entry>false</entry></row>
  2431. <row><entry>nwip-suboptions</entry><entry>63</entry><entry>binary</entry><entry>false</entry></row>
  2432. <row><entry>tftp-server-name</entry><entry>66</entry><entry>string</entry><entry>false</entry></row>
  2433. <row><entry>boot-file-name</entry><entry>67</entry><entry>string</entry><entry>false</entry></row>
  2434. <row><entry>user-class</entry><entry>77</entry><entry>binary</entry><entry>false</entry></row>
  2435. <row><entry>fqdn</entry><entry>81</entry><entry>record</entry><entry>false</entry></row>
  2436. <row><entry>dhcp-agent-options</entry><entry>82</entry><entry>empty</entry><entry>false</entry></row>
  2437. <row><entry>authenticate</entry><entry>90</entry><entry>binary</entry><entry>false</entry></row>
  2438. <row><entry>client-last-transaction-time</entry><entry>91</entry><entry>uint32</entry><entry>false</entry></row>
  2439. <row><entry>associated-ip</entry><entry>92</entry><entry>ipv4-address</entry><entry>true</entry></row>
  2440. <row><entry>subnet-selection</entry><entry>118</entry><entry>ipv4-address</entry><entry>false</entry></row>
  2441. <row><entry>domain-search</entry><entry>119</entry><entry>binary</entry><entry>false</entry></row>
  2442. <row><entry>vivco-suboptions</entry><entry>124</entry><entry>binary</entry><entry>false</entry></row>
  2443. <row><entry>vivso-suboptions</entry><entry>125</entry><entry>binary</entry><entry>false</entry></row>
  2444. </tbody>
  2445. </tgroup>
  2446. </table>
  2447. </para>
  2448. <para>
  2449. <table frame="all" id="dhcp-types">
  2450. <title>List of standard DHCP option types</title>
  2451. <tgroup cols='2'>
  2452. <colspec colname='name'/>
  2453. <colspec colname='meaning'/>
  2454. <thead>
  2455. <row><entry>Name</entry><entry>Meaning</entry></row>
  2456. </thead>
  2457. <tbody>
  2458. <row><entry>binary</entry><entry>An arbitrary string of bytes, specified as a set of hexadecimal digits.</entry></row>
  2459. <row><entry>boolean</entry><entry>Boolean value with allowed values true or false</entry></row>
  2460. <row><entry>empty</entry><entry>No value, data is carried in suboptions</entry></row>
  2461. <row><entry>fqdn</entry><entry>Fully qualified domain name (e.g. www.example.com)</entry></row>
  2462. <row><entry>ipv4-address</entry><entry>IPv4 address in the usual dotted-decimal notation (e.g. 192.0.2.1)</entry></row>
  2463. <row><entry>ipv6-address</entry><entry>IPv6 address in the usual colon notation (e.g. 2001:db8::1)</entry></row>
  2464. <row><entry>record</entry><entry>Structured data that may comprise any types (except "record" and "empty")</entry></row>
  2465. <row><entry>string</entry><entry>Any text</entry></row>
  2466. <row><entry>uint8</entry><entry>8 bit unsigned integer with allowed values 0 to 255</entry></row>
  2467. <row><entry>uint16</entry><entry>16 bit unsinged integer with allowed values 0 to 65535</entry></row>
  2468. <row><entry>uint32</entry><entry>32 bit unsigned integer with allowed values 0 to 4294967295</entry></row>
  2469. </tbody>
  2470. </tgroup>
  2471. </table>
  2472. </para>
  2473. </section>
  2474. <section id="dhcp4-custom-options">
  2475. <title>Custom DHCPv4 options</title>
  2476. <para>It is also possible to define options other than the standard ones.
  2477. Assume that we want to define a new DHCPv4 option called "foo" which will have
  2478. code 222 and will convey a single unsigned 32 bit integer value. We can define
  2479. such an option by using the following commands:
  2480. <screen>
  2481. &gt; <userinput>config add Dhcp4/option-def</userinput>
  2482. &gt; <userinput>config set Dhcp4/option-def[0]/name "foo"</userinput>
  2483. &gt; <userinput>config set Dhcp4/option-def[0]/code 222</userinput>
  2484. &gt; <userinput>config set Dhcp4/option-def[0]/type "uint32"</userinput>
  2485. &gt; <userinput>config set Dhcp4/option-def[0]/array false</userinput>
  2486. &gt; <userinput>config set Dhcp4/option-def[0]/record-types ""</userinput>
  2487. &gt; <userinput>config set Dhcp4/option-def[0]/space "dhcp4"</userinput>
  2488. &gt; <userinput>config set Dhcp4/option-def[0]/encapsulate ""</userinput>
  2489. &gt; <userinput>config commit</userinput></screen>
  2490. The "false" value of the "array" parameter determines that the option
  2491. does NOT comprise an array of "uint32" values but rather a single value.
  2492. Two other parameters have been left blank: "record-types" and "encapsulate".
  2493. The former specifies the comma separated list of option data fields if the
  2494. option comprises a record of data fields. The "record-fields" value should
  2495. be non-empty if the "type" is set to "record". Otherwise it must be left
  2496. blank. The latter parameter specifies the name of the option space being
  2497. encapsulated by the particular option. If the particular option does not
  2498. encapsulate any option space it should be left blank.
  2499. Note that the above set of comments define the format of the new option and do not
  2500. set its values.
  2501. </para>
  2502. <note>
  2503. <para>
  2504. In the current release the default values are not propagated to the
  2505. parser when the new configuration is being set. Therefore, all
  2506. parameters must be specified at all times, even if their values are
  2507. left blank.
  2508. </para>
  2509. </note>
  2510. <para>Once the new option format is defined, its value is set
  2511. in the same way as for a standard option. For example the following
  2512. commands set a global value that applies to all subnets.
  2513. <screen>
  2514. &gt; <userinput>config add Dhcp4/option-data</userinput>
  2515. &gt; <userinput>config set Dhcp4/option-data[0]/name "foo"</userinput>
  2516. &gt; <userinput>config set Dhcp4/option-data[0]/code 222</userinput>
  2517. &gt; <userinput>config set Dhcp4/option-data[0]/space "dhcp4"</userinput>
  2518. &gt; <userinput>config set Dhcp4/option-data[0]/csv-format true</userinput>
  2519. &gt; <userinput>config set Dhcp4/option-data[0]/data "12345"</userinput>
  2520. &gt; <userinput>config commit</userinput></screen>
  2521. </para>
  2522. <para>New options can take more complex forms than simple use of
  2523. primitives (uint8, string, ipv4-address etc): it is possible to
  2524. define an option comprising a number of existing primitives.
  2525. </para>
  2526. <para>Assume we want to define a new option that will consist of
  2527. an IPv4 address, followed by unsigned 16 bit integer, followed by
  2528. a boolean value, followed by a text string. Such an option could
  2529. be defined in the following way:
  2530. <screen>
  2531. &gt; <userinput>config add Dhcp4/option-def</userinput>
  2532. &gt; <userinput>config set Dhcp4/option-def[0]/name "bar"</userinput>
  2533. &gt; <userinput>config set Dhcp4/option-def[0]/code 223</userinput>
  2534. &gt; <userinput>config set Dhcp4/option-def[0]/space "dhcp4"</userinput>
  2535. &gt; <userinput>config set Dhcp4/option-def[0]/type "record"</userinput>
  2536. &gt; <userinput>config set Dhcp4/option-def[0]/array false</userinput>
  2537. &gt; <userinput>config set Dhcp4/option-def[0]/record-types "ipv4-address, uint16, boolean, string"</userinput>
  2538. &gt; <userinput>config set Dhcp4/option-def[0]/encapsulate ""</userinput>
  2539. </screen>
  2540. The "type" is set to "record" to indicate that the option contains
  2541. multiple values of different types. These types are given as a comma-separated
  2542. list in the "record-types" field and should be those listed in <xref linkend="dhcp-types"/>.
  2543. </para>
  2544. <para>
  2545. The values of the option are set as follows:
  2546. <screen>
  2547. &gt; <userinput>config add Dhcp4/option-data</userinput>
  2548. &gt; <userinput>config set Dhcp4/option-data[0]/name "bar"</userinput>
  2549. &gt; <userinput>config set Dhcp4/option-data[0]/space "dhcp4"</userinput>
  2550. &gt; <userinput>config set Dhcp4/option-data[0]/code 223</userinput>
  2551. &gt; <userinput>config set Dhcp4/option-data[0]/csv-format true</userinput>
  2552. &gt; <userinput>config set Dhcp4/option-data[0]/data "192.0.2.100, 123, true, Hello World"</userinput>
  2553. &gt; <userinput>config commit</userinput></screen>
  2554. "csv-format" is set "true" to indicate that the "data" field comprises a command-separated
  2555. list of values. The values in the "data" must correspond to the types set in
  2556. the "record-types" field of the option definition.
  2557. </para>
  2558. <note>
  2559. <para>
  2560. It is recommended that boolean values are specified using "true" and "false"
  2561. strings. This helps to prevent errors when typing multiple comma separated
  2562. values, as it make it easier to identify the type of the value being typed,
  2563. and compare it with the order of data fields. Nevertheless, it is possible
  2564. to use integer values: "1" and "0", instead of "true" and "false"
  2565. accordingly. If other integer value is specified, the configuration is
  2566. rejected.
  2567. </para>
  2568. </note>
  2569. </section>
  2570. <section id="dhcp4-vendor-opts">
  2571. <title>DHCPv4 vendor specific options</title>
  2572. <para>
  2573. Currently there are three option spaces defined: dhcp4 (to
  2574. be used in DHCPv4 daemon) and dhcp6 (for the DHCPv6 daemon); there
  2575. is also vendor-encapsulated-options-space, which is empty by default, but options
  2576. can be defined in it. Those options are called vendor-specific
  2577. information options. The following examples show how to define
  2578. an option "foo" with code 1 that consists of an IPv4 address, an
  2579. unsigned 16 bit integer and a string. The "foo" option is conveyed
  2580. in a vendor specific information option.
  2581. </para>
  2582. <para>
  2583. The first step is to define the format of the option:
  2584. <screen>
  2585. &gt; <userinput>config add Dhcp4/option-def</userinput>
  2586. &gt; <userinput>config set Dhcp4/option-def[0]/name "foo"</userinput>
  2587. &gt; <userinput>config set Dhcp4/option-def[0]/code 1</userinput>
  2588. &gt; <userinput>config set Dhcp4/option-def[0]/space "vendor-encapsulated-options-space"</userinput>
  2589. &gt; <userinput>config set Dhcp4/option-def[0]/type "record"</userinput>
  2590. &gt; <userinput>config set Dhcp4/option-def[0]/array false</userinput>
  2591. &gt; <userinput>config set Dhcp4/option-def[0]/record-types "ipv4-address, uint16, string"</userinput>
  2592. &gt; <userinput>config set Dhcp4/option-def[0]/encapsulates ""</userinput>
  2593. &gt; <userinput>config commit</userinput>
  2594. </screen>
  2595. (Note that the option space is set to "vendor-encapsulated-options-space".)
  2596. Once the option format is defined, the next step is to define actual values
  2597. for that option:
  2598. <screen>
  2599. &gt; <userinput>config add Dhcp4/option-data</userinput>
  2600. &gt; <userinput>config set Dhcp4/option-data[0]/name "foo"</userinput>
  2601. &gt; <userinput>config set Dhcp4/option-data[0]/space "vendor-encapsulated-options-space"</userinput>
  2602. &gt; <userinput>config set Dhcp4/option-data[0]/code 1</userinput>
  2603. &gt; <userinput>config set Dhcp4/option-data[0]/csv-format true</userinput>
  2604. &gt; <userinput>config set Dhcp4/option-data[0]/data "192.0.2.3, 123, Hello World"</userinput>
  2605. &gt; <userinput>config commit</userinput></screen>
  2606. We also set up a dummy value for vendor-opts, the option that conveys our sub-option "foo".
  2607. This is required else the option will not be included in messages sent to the client.
  2608. <screen>
  2609. &gt; <userinput>config add Dhcp4/option-data</userinput>
  2610. &gt; <userinput>config set Dhcp4/option-data[1]/name "vendor-encapsulated-options"</userinput>
  2611. &gt; <userinput>config set Dhcp4/option-data[1]/space "dhcp4"</userinput>
  2612. &gt; <userinput>config set Dhcp4/option-data[1]/code 43</userinput>
  2613. &gt; <userinput>config set Dhcp4/option-data[1]/csv-format false</userinput>
  2614. &gt; <userinput>config set Dhcp4/option-data[1]/data ""</userinput>
  2615. &gt; <userinput>config commit</userinput></screen>
  2616. </para>
  2617. <note>
  2618. <para>
  2619. With this version of Kea, the "vendor-encapsulated-options" option
  2620. must be specified in the configuration although it has no configurable
  2621. parameters. If it is not specified, the server will assume that it is
  2622. not configured and will not send it to a client. In the future there
  2623. will be no need to include this option in the configuration.
  2624. </para>
  2625. </note>
  2626. </section>
  2627. <section id="dhcp4-option-spaces">
  2628. <title>Nested DHCPv4 options (custom option spaces)</title>
  2629. <para>It is sometimes useful to define completely new option
  2630. space. This is the case when user creates new option in the
  2631. standard option space ("dhcp4 or "dhcp6") and wants this option
  2632. to convey sub-options. Thanks to being in the separate space,
  2633. sub-option codes will have a separate numbering scheme and may
  2634. overlap with codes of standard options.
  2635. </para>
  2636. <para>Note that creation of a new option space when defining
  2637. sub-options for a standard option is not required, because it is
  2638. created by default if the standard option is meant to convey any
  2639. sub-options (see <xref linkend="dhcp4-vendor-opts"/>).
  2640. </para>
  2641. <para>
  2642. Assume that we want to have a DHCPv4 option called "container" with
  2643. code 222 that conveys two sub-options with codes 1 and 2.
  2644. First we need to define the new sub-options:
  2645. <screen>
  2646. &gt; <userinput>config add Dhcp4/option-def</userinput>
  2647. &gt; <userinput>config set Dhcp4/option-def[0]/name "subopt1"</userinput>
  2648. &gt; <userinput>config set Dhcp4/option-def[0]/code 1</userinput>
  2649. &gt; <userinput>config set Dhcp4/option-def[0]/space "isc"</userinput>
  2650. &gt; <userinput>config set Dhcp4/option-def[0]/type "ipv4-address"</userinput>
  2651. &gt; <userinput>config set Dhcp4/option-def[0]/record-types ""</userinput>
  2652. &gt; <userinput>config set Dhcp4/option-def[0]/array false</userinput>
  2653. &gt; <userinput>config set Dhcp4/option-def[0]/encapsulate ""</userinput>
  2654. &gt; <userinput>config commit</userinput>
  2655. &gt; <userinput>config add Dhcp4/option-def</userinput>
  2656. &gt; <userinput>config set Dhcp4/option-def[1]/name "subopt2"</userinput>
  2657. &gt; <userinput>config set Dhcp4/option-def[1]/code 2</userinput>
  2658. &gt; <userinput>config set Dhcp4/option-def[1]/space "isc"</userinput>
  2659. &gt; <userinput>config set Dhcp4/option-def[1]/type "string"</userinput>
  2660. &gt; <userinput>config set Dhcp4/option-def[1]/record-types ""</userinput>
  2661. &gt; <userinput>config set Dhcp4/option-def[1]/array false</userinput>
  2662. &gt; <userinput>config set Dhcp4/option-def[1]/encapsulate ""</userinput>
  2663. &gt; <userinput>config commit</userinput>
  2664. </screen>
  2665. Note that we have defined the options to belong to a new option space
  2666. (in this case, "isc").
  2667. </para>
  2668. <para>
  2669. The next step is to define a regular DHCPv4 option with our desired
  2670. code and specify that it should include options from the new option space:
  2671. <screen>
  2672. &gt; <userinput>add Dhcp4/option-def</userinput>
  2673. &gt; <userinput>set Dhcp4/option-def[2]/name "container"</userinput>
  2674. &gt; <userinput>set Dhcp4/option-def[2]/code 222</userinput>
  2675. &gt; <userinput>set Dhcp4/option-def[2]/space "dhcp4"</userinput>
  2676. &gt; <userinput>set Dhcp4/option-def[2]/type "empty"</userinput>
  2677. &gt; <userinput>set Dhcp4/option-def[2]/array false</userinput>
  2678. &gt; <userinput>set Dhcp4/option-def[2]/record-types ""</userinput>
  2679. &gt; <userinput>set Dhcp4/option-def[2]/encapsulate "isc"</userinput>
  2680. &gt; <userinput>commit</userinput>
  2681. </screen>
  2682. The name of the option space in which the sub-options are defined
  2683. is set in the "encapsulate" field. The "type" field is set to "empty"
  2684. to indicate that this option does not carry any data other than
  2685. sub-options.
  2686. </para>
  2687. <para>
  2688. Finally, we can set values for the new options:
  2689. <screen>
  2690. &gt; <userinput>config add Dhcp4/option-data</userinput>
  2691. &gt; <userinput>config set Dhcp4/option-data[0]/name "subopt1"</userinput>
  2692. &gt; <userinput>config set Dhcp4/option-data[0]/space "isc"</userinput>
  2693. &gt; <userinput>config set Dhcp4/option-data[0]/code 1</userinput>
  2694. &gt; <userinput>config set Dhcp4/option-data[0]/csv-format true</userinput>
  2695. &gt; <userinput>config set Dhcp4/option-data[0]/data "192.0.2.3"</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[1]/name "subopt2"</userinput>
  2700. &gt; <userinput>config set Dhcp4/option-data[1]/space "isc"</userinput>
  2701. &gt; <userinput>config set Dhcp4/option-data[1]/code 2</userinput>
  2702. &gt; <userinput>config set Dhcp4/option-data[1]/csv-format true</userinput>
  2703. &gt; <userinput>config set Dhcp4/option-data[1]/data "Hello world"</userinput>
  2704. &gt; <userinput>config commit</userinput>
  2705. <userinput></userinput>
  2706. &gt; <userinput>config add Dhcp4/option-data</userinput>
  2707. &gt; <userinput>config set Dhcp4/option-data[2]/name "container"</userinput>
  2708. &gt; <userinput>config set Dhcp4/option-data[2]/space "dhcp4"</userinput>
  2709. &gt; <userinput>config set Dhcp4/option-data[2]/code 222</userinput>
  2710. &gt; <userinput>config set Dhcp4/option-data[2]/csv-format true</userinput>
  2711. &gt; <userinput>config set Dhcp4/option-data[2]/data ""</userinput>
  2712. &gt; <userinput>config commit</userinput>
  2713. </screen>
  2714. Even though the "container" option does not carry any data except
  2715. sub-options, the "data" field must be explicitly set to an empty value.
  2716. This is required because in the current version of BIND 10 DHCP, the
  2717. default configuration values are not propagated to the configuration parsers:
  2718. if the "data" is not set the parser will assume that this
  2719. parameter is not specified and an error will be reported.
  2720. </para>
  2721. <para>Note that it is possible to create an option which carries some data
  2722. in addition to the sub-options defined in the encapsulated option space. For example,
  2723. if the "container" option from the previous example was required to carry an uint16
  2724. value as well as the sub-options, the "type" value would have to be set to "uint16" in
  2725. the option definition. (Such an option would then have the following
  2726. data structure: DHCP header, uint16 value, sub-options.) The value specified
  2727. with the "data" parameter - which should be a valid integer enclosed in quotes,
  2728. e.g. "123" - would then be assigned to the uint16 field in the "container" option.
  2729. </para>
  2730. </section>
  2731. <section id="dhcp4-client-classifier">
  2732. <title>Client Classification in DHCPv4</title>
  2733. <note>
  2734. <para>
  2735. DHCPv4 server has been extended to support limited client classification.
  2736. Although the current capability is modest, it is expected to be expanded
  2737. in the future. It is envisaged that the majority of client classification
  2738. extensions will be using hooks extensions.
  2739. </para>
  2740. </note>
  2741. <para>In certain cases it is useful to differentiate between different
  2742. types of clients and treat them differently. The process of doing
  2743. classification is conducted in two steps. The first step is to assess
  2744. incoming packet and assign it to zero or more classes. This classification
  2745. is currently simple, but is expected to grow in capability soon. Currently
  2746. the server checks whether incoming packet has vendor class identifier
  2747. option (60). If it has, content of that option is prepended with
  2748. &quot;VENDOR_CLASS_&quot; then is interpreted as a class. For example,
  2749. modern cable modems will send this option with value &quot;docsis3.0&quot;
  2750. and as a result the packet will belong to class &quot;VENDOR_CLASS_docsis3.0&quot;.
  2751. </para>
  2752. <para>It is envisaged that the client classification will be used for changing
  2753. behavior of almost any part of the DHCP message processing, including assigning
  2754. leases from different pools, assigning different option (or different values of
  2755. the same options) etc. For now, there are only two mechanisms that are taking
  2756. advantage of client classification: specific processing for cable modems and
  2757. subnet selection.</para>
  2758. <para>
  2759. For clients that belong to the VENDOR_CLASS_docsis3.0 class, the siaddr
  2760. field is set to the value of next-server (if specified in a subnet). If
  2761. there is boot-file-name option specified, its value is also set in the
  2762. file field in the DHCPv4 packet. For eRouter1.0 class, the siaddr is
  2763. always set to 0.0.0.0. That capability is expected to be moved to
  2764. external hook library that will be dedicated to cable modems.
  2765. </para>
  2766. <para>
  2767. Kea can be instructed to limit access to given subnets based on class information.
  2768. This is particularly useful for cases where two types of devices share the
  2769. same link and are expected to be served from two different subnets. The
  2770. primary use case for such a scenario is cable networks. There are two
  2771. classes of devices: cable modem itself, which should be handled a lease
  2772. from subnet A and all other devices behind modems that should get a lease
  2773. from subnet B. That segregation is essential to prevent overly curious
  2774. users from playing with their cable modems. For details on how to set up
  2775. class restrictions on subnets, see <xref linkend="dhcp4-subnet-class"/>.
  2776. </para>
  2777. </section>
  2778. <section id="dhcp4-subnet-class">
  2779. <title>Limiting access to IPv4 subnet to certain classes</title>
  2780. <para>
  2781. In certain cases it beneficial to restrict access to certain subnets
  2782. only to clients that belong to a given subnet. For details on client
  2783. classes, see <xref linkend="dhcp4-client-classifier"/>. This is an
  2784. extension of a previous example from <xref linkend="dhcp4-address-config"/>.
  2785. Let's assume that the server is connected to a network segment that uses
  2786. the 192.0.2.0/24 prefix. The Administrator of that network has decided
  2787. that addresses from range 192.0.2.10 to 192.0.2.20 are going to be
  2788. managed by the Dhcp4 server. Only clients belonging to client class
  2789. VENDOR_CLASS_docsis3.0 are allowed to use this subnet. Such a
  2790. configuration can be achieved in the following way:
  2791. <screen>
  2792. &gt; <userinput>config add Dhcp4/subnet4</userinput>
  2793. &gt; <userinput>config set Dhcp4/subnet4[0]/subnet "192.0.2.0/24"</userinput>
  2794. &gt; <userinput>config set Dhcp4/subnet4[0]/pool [ "192.0.2.10 - 192.0.2.20" ]</userinput>
  2795. &gt; <userinput>config set Dhcp4/subnet4[0]/client-class "VENDOR_CLASS_docsis3.0"</userinput>
  2796. &gt; <userinput>config commit</userinput></screen>
  2797. </para>
  2798. <para>
  2799. Care should be taken with client classification as it is easy to prevent
  2800. clients that do not meet class criteria to be denied any service altogether.
  2801. </para>
  2802. </section>
  2803. <section id="dhcp4-ddns-config">
  2804. <title>Configuring DHCPv4 for DDNS</title>
  2805. <para>
  2806. As mentioned earlier, b10-dhcp4 can be configured to generate requests to the
  2807. DHCP-DDNS server to update DNS entries. These requests are known as
  2808. NameChangeRequests or NCRs. Each NCR contains the following information:
  2809. <orderedlist>
  2810. <listitem><para>
  2811. Whether it is a request to add (update) or remove DNS entries
  2812. </para></listitem>
  2813. <listitem><para>
  2814. Whether the change requests forward DNS updates (A records), reverse
  2815. DNS updates (PTR records), or both.
  2816. </para></listitem>
  2817. <listitem><para>
  2818. The FQDN, lease address, and DHCID
  2819. </para></listitem>
  2820. </orderedlist>
  2821. The parameters for controlling the generation of NCRs for submission to D2
  2822. are contained in the "dhcp-ddns" section of the b10-dhcp4 server
  2823. configuration. The default values for this section appears as follows:
  2824. <screen>
  2825. &gt; <userinput>config show Dhcp4/dhcp-ddns</userinput>
  2826. Dhcp4/dhcp-ddns/enable-updates true boolean
  2827. Dhcp4/dhcp-ddns/server-ip "127.0.0.1" string
  2828. Dhcp4/dhcp-ddns/server-port 53001 integer
  2829. Dhcp4/dhcp-ddns/sender-ip "" string
  2830. Dhcp4/dhcp-ddns/sender-port 0 integer
  2831. Dhcp4/dhcp-ddns/max-queue-size 1024 integer
  2832. Dhcp4/dhcp-ddns/ncr-protocol "UDP" string
  2833. Dhcp4/dhcp-ddns/ncr-format "JSON" string
  2834. Dhcp4/dhcp-ddns/override-no-update false boolean
  2835. Dhcp4/dhcp-ddns/override-client-update false boolean
  2836. Dhcp4/dhcp-ddns/replace-client-name false boolean
  2837. Dhcp4/dhcp-ddns/generated-prefix "myhost" string
  2838. Dhcp4/dhcp-ddns/qualifying-suffix "example.com" string
  2839. </screen>
  2840. </para>
  2841. <para>
  2842. The "enable-updates" parameter determines whether or not b10-dhcp4 will
  2843. generate NCRs. By default, this value is false hence DDNS updates are
  2844. disabled. To enable DDNS updates set this value to true:
  2845. </para>
  2846. <screen>
  2847. &gt; <userinput>config set Dhcp4/dhcp-ddns/enable-updates true</userinput>
  2848. &gt; <userinput>config commit</userinput>
  2849. </screen>
  2850. <section id="dhcpv4-d2-io-config">
  2851. <title>DHCP-DDNS Server Connectivity</title>
  2852. <para>
  2853. In order for NCRs to reach the D2 server, b10-dhcp4 must be able
  2854. to communicate with it. b10-dhcp4 uses the following configuration
  2855. parameters to control how it communications with D2:
  2856. <orderedlist>
  2857. <listitem><para>
  2858. server-ip - IP address on which D2 listens for requests. The default is
  2859. the local loopback interface at address 127.0.0.1. You may specify
  2860. either an IPv4 or IPv6 address.
  2861. </para></listitem>
  2862. <listitem><para>
  2863. server-port - port on which D2 listens for requests. The default value
  2864. is 53001.
  2865. </para></listitem>
  2866. <listitem><para>
  2867. sender-ip - IP address which b10-dhcp4 should use to send requests to D2.
  2868. The default value is blank which instructs b10-dhcp4 to select a suitable
  2869. address.
  2870. </para></listitem>
  2871. <listitem><para>
  2872. sender-port - port which b10-dhcp4 should use to send requests to D2. The
  2873. default value of 0 instructs b10-dhcp4 to select suitable port.
  2874. </para></listitem>
  2875. <listitem><para>
  2876. ncr-format - Socket protocol use when sending requests to D2. Currently
  2877. only UDP is supported. TCP may be available in an upcoming release.
  2878. </para></listitem>
  2879. <listitem><para>
  2880. ncr-protocol - Packet format to use when sending requests to D2.
  2881. Currently only JSON format is supported. Other formats may be available
  2882. in future releases.
  2883. </para></listitem>
  2884. <listitem><para>
  2885. max-queue-size - maximum number of requests allowed to queue waiting to
  2886. be sent to D2. This value guards against requests accumulating
  2887. uncontrollably if they are being generated faster than they can be
  2888. delivered. If the number of requests queued for transmission reaches
  2889. this value, DDNS updating will be turned off until the queue backlog has
  2890. been sufficiently reduced. The intent is allow the b10-dhcp4 server to
  2891. continue lease operations. The default value is 1024.
  2892. </para></listitem>
  2893. </orderedlist>
  2894. By default, D2 is assumed to running on the same machine as b10-dhcp4, and
  2895. all of the default values mentioned above should be sufficient.
  2896. If, however, D2 has been configured to listen on a different address or
  2897. port, these values must altered accordingly. For example, if D2 has been
  2898. configured to listen on 198.162.1.10 port 900, the following commands
  2899. would be required:
  2900. <screen>
  2901. &gt; <userinput>config set Dhcp4/dhcp-ddns/server-ip "198.162.1.10"</userinput>
  2902. &gt; <userinput>config set Dhcp4/dhcp-ddns/server-port 900</userinput>
  2903. &gt; <userinput>config commit</userinput>
  2904. </screen>
  2905. </para>
  2906. </section>
  2907. <section id="dhcpv4-d2-rules-config">
  2908. <title>When does the b10-dhcp4 server generate DDNS requests?</title>
  2909. b10-dhcp4 follows the behavior prescribed for DHCP servers in RFC 4702.
  2910. It is important to keep in mind that b10-dhcp4 provides the initial decision
  2911. making of when and what to update and forwards that information to D2 in
  2912. the form of NCRs. Carrying out the actual DNS updates and dealing with
  2913. such things as conflict resolution are the purview of D2 (<xref linkend="dhcp-ddns-server"/>).
  2914. <para>
  2915. This section describes when b10-dhcp4 will generate NCRs and the
  2916. configuration parameters that can be used to influence this decision.
  2917. It assumes that the "enable-updates" parameter is true.
  2918. </para>
  2919. <para>
  2920. In general, b10-dhcp4 will generate DDNS update requests when:
  2921. <orderedlist>
  2922. <listitem><para>
  2923. A new lease is granted in response to a DHCP REQUEST
  2924. </para></listitem>
  2925. <listitem><para>
  2926. An existing lease is renewed but the FQDN associated with it has
  2927. changed.
  2928. </para></listitem>
  2929. <listitem><para>
  2930. An existing lease is released in response to a DHCP RELEASE
  2931. </para></listitem>
  2932. </orderedlist>
  2933. In the second case, lease renewal, two DDNS requests will be issued: one
  2934. request to remove entries for the previous FQDN and a second request to
  2935. add entries for the new FQDN. In the last case, a lease release, a
  2936. single DDNS request to remove its entries will be made. The decision
  2937. making involved when granting a new lease (the first case) is more
  2938. involved and is discussed next.
  2939. </para>
  2940. <para>
  2941. When a new lease is granted, b10-dhcp4 will generate a DDNS
  2942. update request if the DHCP REQUEST contains either the FQDN option
  2943. (code 81) or the Host Name option (code 12). If both are present,
  2944. the server will use the FQDN option. By default b10-dhcp4
  2945. will respect the FQDN N and S flags specified by the client as shown
  2946. in the following table:
  2947. </para>
  2948. <table id="fqdn-flag-table">
  2949. <title>Default FQDN Flag Behavior</title>
  2950. <tgroup cols='4' align='left'>
  2951. <colspec colname='cflags'/>
  2952. <colspec colname='meaning'/>
  2953. <colspec colname='response'/>
  2954. <colspec colname='sflags'/>
  2955. <thead>
  2956. <row>
  2957. <entry>Client Flags:N-S</entry>
  2958. <entry>Client Intent</entry>
  2959. <entry>Server Response</entry>
  2960. <entry>Server Flags:N-S-O</entry>
  2961. </row>
  2962. </thead>
  2963. <tbody>
  2964. <row>
  2965. <entry>0-0</entry>
  2966. <entry>
  2967. Client wants to do forward updates, server should do reverse updates
  2968. </entry>
  2969. <entry>Server generates reverse-only request</entry>
  2970. <entry>1-0-0</entry>
  2971. </row>
  2972. <row>
  2973. <entry>0-1</entry>
  2974. <entry>Server should do both forward and reverse updates</entry>
  2975. <entry>Server generates request to update both directions</entry>
  2976. <entry>0-1-0</entry>
  2977. </row>
  2978. <row>
  2979. <entry>1-0</entry>
  2980. <entry>Client wants no updates done</entry>
  2981. <entry>Server does not generate a request</entry>
  2982. <entry>1-0-0</entry>
  2983. </row>
  2984. </tbody>
  2985. </tgroup>
  2986. </table>
  2987. <para>
  2988. The first row in the table above represents "client delegation". Here
  2989. the DHCP client states that it intends to do the forward DNS updates and
  2990. the server should do the reverse updates. By default, b10-dhcp4 will honor
  2991. the client's wishes and generate a DDNS request to D2 to update only
  2992. reverse DNS data. The parameter, "override-client-update", can be used
  2993. to instruct the server to override client delegation requests. When
  2994. this parameter is true, b10-dhcp4 will disregard requests for client
  2995. delegation and generate a DDNS request to update both forward and
  2996. reverse DNS data. In this case, the N-S-O flags in the server's
  2997. response to the client will be 0-1-1 respectively.
  2998. </para>
  2999. <para>
  3000. (Note that the flag combination N=1, S=1 is prohibited according to
  3001. RFC 4702. If such a combination is received from the client, the packet
  3002. will be dropped by the b10-dhcp4.)
  3003. </para>
  3004. <para>
  3005. To override client delegation, issue the following commands:
  3006. </para>
  3007. <screen>
  3008. &gt; <userinput>config set Dhcp4/dhcp-ddns/override-client-update true</userinput>
  3009. &gt; <userinput>config commit</userinput>
  3010. </screen>
  3011. <para>
  3012. The third row in the table above describes the case in which the client
  3013. requests that no DNS updates be done. The parameter, "override-no-update",
  3014. can be used to instruct the server to disregard the client's wishes. When
  3015. this parameter is true, b10-dhcp4 will generate DDNS update request to D2
  3016. even if the client requests no updates be done. The N-S-O flags in the
  3017. server's response to the client will be 0-1-1.
  3018. </para>
  3019. <para>
  3020. To override client delegation, issue the following commands:
  3021. </para>
  3022. <screen>
  3023. &gt; <userinput>config set Dhcp4/dhcp-ddns/override-no-update true</userinput>
  3024. &gt; <userinput>config commit</userinput>
  3025. </screen>
  3026. <para>
  3027. b10-dhcp4 will always generate DDNS update requests if the client request
  3028. only contains the Host Name option. In addition it will include an FQDN
  3029. option in the response to the client with the FQDN N-S-O flags set to
  3030. 0-1-0 respectively. The domain name portion of the FQDN option will be
  3031. the name submitted to D2 in the DDNS update request.
  3032. </para>
  3033. </section>
  3034. <section id="dhcpv4-fqdn-name-generation">
  3035. <title>b10-dhcp4 name generation for DDNS update requests</title>
  3036. Each NameChangeRequest must of course include the fully qualified domain
  3037. name whose DNS entries are to be affected. b10-dhcp4 can be configured to
  3038. supply a portion or all of that name based upon what it receives from
  3039. the client in the DHCP REQUEST.
  3040. <para>
  3041. The rules for determining the FQDN option are as follows:
  3042. <orderedlist>
  3043. <listitem><para>
  3044. If configured to do, so ignore the REQUEST contents and generate a
  3045. FQDN using a configurable prefix and suffix.
  3046. </para></listitem>
  3047. <listitem><para>
  3048. If the REQUEST contains the client FQDN option, the candidate
  3049. name is taken from there, otherwise it is taken from the Host Name option.
  3050. The candiate name may then be modified:
  3051. <orderedlist>
  3052. <listitem><para>
  3053. If the candidate name is a fully qualified domain name, use it.
  3054. </para></listitem>
  3055. <listitem><para>
  3056. If the candidate name is a partial (i.e. unqualified) name then
  3057. add a configurable suffix to the name and use the result as the FQDN.
  3058. </para></listitem>
  3059. <listitem><para>
  3060. If the candidate name is a empty, generate a FQDN using a
  3061. configurable prefix and suffix.
  3062. </para></listitem>
  3063. </orderedlist>
  3064. </para></listitem>
  3065. </orderedlist>
  3066. To instruct b10-dhcp4 to always generate the FQDN for a client, set the
  3067. parameter "replace-client-name" to true as follows:
  3068. </para>
  3069. <screen>
  3070. &gt; <userinput>config set Dhcp4/dhcp-ddns/replace-client-name true</userinput>
  3071. &gt; <userinput>config commit</userinput>
  3072. </screen>
  3073. <para>
  3074. The prefix used in the generation of a FQDN is specified by the
  3075. "generated-prefix" parameter. The default value is "myhost". To alter
  3076. its value simply set it to the desired string:
  3077. </para>
  3078. <screen>
  3079. &gt; <userinput>config set Dhcp4/dhcp-ddns/generated-prefix "another.host"</userinput>
  3080. &gt; <userinput>config commit</userinput>
  3081. </screen>
  3082. <para>
  3083. The suffix used when generating a FQDN or when qualifying a partial
  3084. name is specified by the "qualifying-suffix" parameter. The default
  3085. value is "example.com". To alter its value simply set it to the desired
  3086. string:
  3087. </para>
  3088. <screen>
  3089. &gt; <userinput>config set Dhcp4/dhcp-ddns/generated-prefix "our.net"</userinput>
  3090. &gt; <userinput>config commit</userinput>
  3091. </screen>
  3092. </section>
  3093. <para>
  3094. When generating a name, b10-dhcp4 will construct name of the format:
  3095. </para>
  3096. <para>
  3097. [generated-prefix]-[address-text].[qualifying-suffix].
  3098. </para>
  3099. <para>
  3100. where address-text is simply the lease IP address converted to a
  3101. hyphenated string. For example, if lease address is 172.16.1.10 and
  3102. assuming default values for generated-prefix and qualifying-suffix, the
  3103. generated FQDN would be:
  3104. </para>
  3105. <para>
  3106. myhost-172-16-1-10.example.com.
  3107. </para>
  3108. </section>
  3109. </section> <!-- end of configuring b10-dhcp4 server section with many subsections -->
  3110. <section id="dhcp4-serverid">
  3111. <title>Server Identifier in DHCPv4</title>
  3112. <para>
  3113. The DHCPv4 protocol uses a "server identifier" for clients to be able
  3114. to discriminate between several servers present on the same link: this
  3115. value is an IPv4 address of the server. The server chooses the IPv4 address
  3116. of the interface on which the message from the client (or relay) has been
  3117. received. A single server instance will use multiple server identifiers
  3118. if it is receiving queries on multiple interfaces.
  3119. </para>
  3120. <para>
  3121. Currently there is no mechanism to override the default server identifiers
  3122. by an administrator. In the future, the configuration mechanism will be used
  3123. to specify the custom server identifier.
  3124. </para>
  3125. </section>
  3126. <section id="dhcp4-next-server">
  3127. <title>Next server (siaddr)</title>
  3128. <para>In some cases, clients want to obtain configuration from the TFTP server.
  3129. Although there is a dedicated option for it, some devices may use siaddr field
  3130. in the DHCPv4 packet for that purpose. That specific field can be configured
  3131. using next-server directive. It is possible to define it in global scope or
  3132. for a given subnet only. If both are defined, subnet value takes precedence.
  3133. The value in subnet can be set to 0.0.0.0, which means that next-server should
  3134. not be sent. It may also be set to empty string, which means the same as if
  3135. it was not defined at all - use global value.
  3136. </para>
  3137. <screen>
  3138. &gt; <userinput>config add Dhcp4/next-server</userinput>
  3139. &gt; <userinput>config set Dhcp4/next-server "192.0.2.123"</userinput>
  3140. &gt; <userinput>config commit</userinput>
  3141. <userinput></userinput>
  3142. &gt; <userinput>config add Dhcp4/subnet[0]/next-server</userinput>
  3143. &gt; <userinput>config set Dhcp4/subnet[0]/next-server "192.0.2.234"</userinput>
  3144. &gt; <userinput>config commit</userinput>
  3145. </screen>
  3146. </section>
  3147. <section id="dhcp4-echo-client-id">
  3148. <title>Echoing client-id (RFC6842)</title>
  3149. <para>Original DHCPv4 spec (RFC2131) states that the DHCPv4
  3150. server must not send back client-id options when responding to
  3151. clients. However, in some cases that confused clients that did
  3152. not have MAC address or client-id. See RFC6842 for details. That
  3153. behavior has changed with the publication of RFC6842 which
  3154. updated RFC2131. That update now states that the server must
  3155. send client-id if client sent it. That is the default behaviour
  3156. that Kea offers. However, in some cases older devices that do
  3157. not support RFC6842 may refuse to accept responses that include
  3158. client-id option. To enable backward compatibility, an optional
  3159. configuration parameter has been introduced. To configure it,
  3160. use the following commands:</para>
  3161. <screen>
  3162. &gt; <userinput>config add Dhcp4/echo-client-id</userinput>
  3163. &gt; <userinput>config set Dhcp4/echo-client-id False</userinput>
  3164. &gt; <userinput>config commit</userinput>
  3165. </screen>
  3166. </section>
  3167. <section id="dhcp4-subnet-selection">
  3168. <title>How DHCPv4 server selects subnet for a client</title>
  3169. <para>
  3170. The DHCPv4 server differentiates between the directly connected clients,
  3171. clients trying to renew leases and clients sending their messages through
  3172. relays. For the directly connected clients the server will check the
  3173. configuration of the interface on which the message has been received, and
  3174. if the server configuration doesn't match any configured subnet the
  3175. message is discarded.</para>
  3176. <para>Assuming that the server's interface is configured with the 192.0.2.3
  3177. IPv4 address, the server will only process messages received through
  3178. this interface from the directly connected client, if there is a subnet
  3179. configured, to which this IPv4 address belongs, e.g. 192.0.2.0/24.
  3180. The server will use this subnet to assign IPv4 address for the client.
  3181. </para>
  3182. <para>
  3183. The rule above does not apply when the client unicasts its message, i.e.
  3184. is trying to renew its lease. Such message is accepted through any
  3185. interface. The renewing client sets ciaddr to the currently used IPv4
  3186. address. The server uses this address to select the subnet for the client
  3187. (in particular, to extend the lease using this address).
  3188. </para>
  3189. <para>
  3190. If the message is relayed it is accepted through any interface. The giaddr
  3191. set by the relay agent is used to select the subnet for the client.
  3192. </para>
  3193. <para>
  3194. It is also possible to specify a relay IPv4 address for a given subnet. It
  3195. can be used to match incoming packets into a subnet in uncommon configurations,
  3196. e.g. shared subnets. See <xref linkend="dhcp4-relay-override"/> for details.
  3197. </para>
  3198. <note>
  3199. <para>The subnet selection mechanism described in this section is based
  3200. on the assumption that client classification is not used. The classification
  3201. mechanism alters the way in which subnet is selected for the client,
  3202. depending on the classes that the client belongs to.</para>
  3203. </note>
  3204. </section>
  3205. <section id="dhcp4-relay-override">
  3206. <title>Using specific relay agent for a subnet</title>
  3207. <para>
  3208. The relay has to have an interface connected to the link on which
  3209. the clients are being configured. Typically the relay has an IPv4
  3210. address configured on that interface that belongs to the subnet that
  3211. the server will assign addresses from. In such typical case, the
  3212. server is able to use IPv4 address inserted by the relay (in GIADDR
  3213. field of the DHCPv4 packet) to select appropriate subnet.
  3214. </para>
  3215. <para>
  3216. However, that is not always the case. In certain uncommon, but
  3217. valid deployments, the relay address may not match the subnet. This
  3218. usually means that there is more than one subnet allocated for a given
  3219. link. Two most common examples where this is the case are long lasting
  3220. network renumbering (where both old and new address space is still being
  3221. used) and a cable network. In a cable network both cable modems and the
  3222. devices behind them are physically connected to the same link, yet
  3223. they use distinct addressing. In such case, the DHCPv4 server needs
  3224. additional information (IPv4 address of the relay) to properly select
  3225. an appropriate subnet.
  3226. </para>
  3227. <para>
  3228. The following example assumes that there is a subnet 192.0.2.0/24
  3229. that is accessible via relay that uses 10.0.0.1 as its IPv4 address.
  3230. The server will be able to select this subnet for any incoming packets
  3231. that came from a relay that has an address in 192.0.2.0/24 subnet.
  3232. It will also select that subnet for a relay with address 10.0.0.1.
  3233. <screen>
  3234. &gt; <userinput>config add Dhcp4/subnet4</userinput>
  3235. &gt; <userinput>config set Dhcp4/subnet4[0]/subnet "192.0.2.0/24"</userinput>
  3236. &gt; <userinput>config set Dhcp4/subnet4[0]/pool [ "192.0.2.10 - 192.0.2.20" ]</userinput>
  3237. &gt; <userinput>config set Dhcp4/subnet4[0]/relay/ip-address "10.0.0.1"</userinput>
  3238. &gt; <userinput>config commit</userinput></screen>
  3239. </para>
  3240. </section>
  3241. <section id="dhcp4-srv-example-client-class-relay">
  3242. <title>Segregating IPv4 clients in a cable network</title>
  3243. <para>
  3244. In certain cases, it is useful to mix relay address information,
  3245. introduced in <xref linkend="dhcp4-relay-override"/> with client
  3246. classification, explained in <xref linkend="dhcp4-subnet-class"/>.
  3247. One specific example is cable network, where typically modems
  3248. get addresses from a different subnet than all devices connected
  3249. behind them.
  3250. </para>
  3251. <para>
  3252. Let's assume that there is one CMTS (Cable Modem Termination System)
  3253. with one CM MAC (a physical link that modems are connected to).
  3254. We want the modems to get addresses from the 10.1.1.0/24 subnet, while
  3255. everything connected behind modems should get addresses from another
  3256. subnet (192.0.2.0/24). The CMTS that acts as a relay an uses address
  3257. 10.1.1.1. The following configuration can serve that configuration:
  3258. <screen>
  3259. &gt; <userinput>config add Dhcp4/subnet4</userinput>
  3260. &gt; <userinput>config set Dhcp4/subnet4[0]/subnet "10.1.1.0/24"</userinput>
  3261. &gt; <userinput>config set Dhcp4/subnet4[0]/pool [ "10.1.1.2 - 10.1.1.20" ]</userinput>
  3262. &gt; <userinput>config set Dhcp4/subnet4[0]/client-class "docsis3.0"</userinput>
  3263. &gt; <userinput>config set Dhcp4/subnet4[0]/relay/ip-address "10.1.1.1"</userinput>
  3264. &gt; <userinput>config add Dhcp4/subnet4</userinput>
  3265. &gt; <userinput>config set Dhcp4/subnet4[1]/subnet "192.0.2.0/24"</userinput>
  3266. &gt; <userinput>config set Dhcp4/subnet4[1]/pool [ "192.0.2.10 - 192.0.2.20" ]</userinput>
  3267. &gt; <userinput>config set Dhcp4/subnet4[1]/relay/ip-address "10.1.1.1"</userinput>
  3268. &gt; <userinput>config commit</userinput></screen>
  3269. </para>
  3270. </section>
  3271. <section id="dhcp4-std">
  3272. <title>Supported Standards</title>
  3273. <para>The following standards and draft standards are currently
  3274. supported:</para>
  3275. <itemizedlist>
  3276. <listitem>
  3277. <simpara><ulink url="http://tools.ietf.org/html/rfc2131">RFC 2131</ulink>: Supported messages are DISCOVER, OFFER,
  3278. REQUEST, RELEASE, ACK, and NAK.</simpara>
  3279. </listitem>
  3280. <listitem>
  3281. <simpara><ulink url="http://tools.ietf.org/html/rfc2132">RFC 2132</ulink>:
  3282. Supported options are: PAD (0),
  3283. END(255), Message Type(53), DHCP Server Identifier (54),
  3284. Domain Name (15), DNS Servers (6), IP Address Lease Time
  3285. (51), Subnet mask (1), and Routers (3).</simpara>
  3286. </listitem>
  3287. <listitem>
  3288. <simpara><ulink url="http://tools.ietf.org/html/rfc3046">RFC 3046</ulink>:
  3289. Relay Agent Information option is supported.</simpara>
  3290. </listitem>
  3291. <listitem>
  3292. <simpara><ulink url="http://tools.ietf.org/html/rfc3925">RFC 3925</ulink>:
  3293. Vendor-Identifying Vendor Class and Vendor-Identifying Vendor-Specific
  3294. Information option are supported.</simpara>
  3295. </listitem>
  3296. <listitem>
  3297. <simpara><ulink url="http://tools.ietf.org/html/rfc6842">RFC 6842</ulink>:
  3298. Server by default sends back client-id option. That capability may be
  3299. disabled. See <xref linkend="dhcp4-echo-client-id"/> for details.
  3300. </simpara>
  3301. </listitem>
  3302. </itemizedlist>
  3303. </section>
  3304. <section id="dhcp4-limit">
  3305. <title>DHCPv4 Server Limitations</title>
  3306. <para>These are the current limitations of the DHCPv4 server
  3307. software. Most of them are reflections of the current stage of
  3308. development and should be treated as <quote>not implemented
  3309. yet</quote>, rather than actual limitations.</para>
  3310. <itemizedlist>
  3311. <listitem> <!-- see tickets #3234, #3281 -->
  3312. <simpara>
  3313. Removal of a subnet during server reconfiguration may cause renumbering
  3314. of auto-generated subnet identifiers, as described in section
  3315. <xref linkend="ipv4-subnet-id"/>.
  3316. </simpara>
  3317. </listitem>
  3318. <listitem>
  3319. <simpara>
  3320. BOOTP (<ulink url="http://tools.ietf.org/html/rfc951">RFC 951</ulink>)
  3321. is not supported.
  3322. </simpara>
  3323. </listitem>
  3324. <listitem>
  3325. <simpara>Raw sockets operation is working on Linux
  3326. only. See <xref linkend="iface-detect"/> for details.</simpara>
  3327. </listitem>
  3328. <listitem>
  3329. <simpara>The DHCPv4 server does not verify that
  3330. assigned address is unused. According to <ulink url="http://tools.ietf.org/html/rfc2131">RFC 2131</ulink>, the
  3331. allocating server should verify that address is not used by
  3332. sending ICMP echo request.</simpara>
  3333. </listitem>
  3334. <listitem>
  3335. <simpara>Address duplication report (DECLINE) is not supported yet.</simpara>
  3336. </listitem>
  3337. <listitem>
  3338. <simpara>
  3339. The server doesn't act upon expired leases. In particular,
  3340. when a lease expires, the server doesn't request the removal
  3341. of the DNS records associated with it.
  3342. </simpara>
  3343. </listitem>
  3344. </itemizedlist>
  3345. </section>
  3346. <!--
  3347. <section id="dhcp4-srv-examples">
  3348. <title>Kea DHCPv4 server examples</title>
  3349. <para>
  3350. This section provides easy to use example. Each example can be read
  3351. separately. It is not intended to be read sequentially as there will
  3352. be many repetitions between examples. They are expected to serve as
  3353. easy to use copy-paste solutions to many common deployments.
  3354. </para>
  3355. @todo: add simple configuration for direct clients
  3356. @todo: add configuration for relayed clients
  3357. @todo: add client classification example
  3358. </section> -->
  3359. </chapter>
  3360. <chapter id="dhcp6">
  3361. <title>The DHCPv6 Server</title>
  3362. <section id="dhcp6-start-stop">
  3363. <title>Starting and Stopping the DHCPv6 Server</title>
  3364. <para>
  3365. <command>b10-dhcp6</command> is the Kea DHCPv6 server and is configured
  3366. through the <command>bindctl</command> program.
  3367. </para>
  3368. <para>
  3369. After starting <command>bind10</command> and starting <command>bindctl</command>, the first step
  3370. in configuring the server is to add <command>b10-dhcp6</command> to the list of running services.
  3371. <screen>
  3372. &gt; <userinput>config add Init/components b10-dhcp6</userinput>
  3373. &gt; <userinput>config set Init/components/b10-dhcp6/kind dispensable</userinput>
  3374. &gt; <userinput>config commit</userinput>
  3375. </screen>
  3376. </para>
  3377. <para>
  3378. To remove <command>b10-dhcp6</command> from the set of running services,
  3379. the <command>b10-dhcp6</command> is removed from list of Init components:
  3380. <screen>
  3381. &gt; <userinput>config remove Init/components b10-dhcp6</userinput>
  3382. &gt; <userinput>config commit</userinput>
  3383. </screen>
  3384. </para>
  3385. <para>
  3386. Note that the server was only removed from the list, so BIND10 will not
  3387. restart it, but the server itself is still running. Hence it is usually
  3388. desired to stop it:
  3389. <screen>
  3390. &gt; <userinput>Dhcp6 shutdown</userinput>
  3391. </screen>
  3392. </para>
  3393. <para>
  3394. During start-up the server will detect available network interfaces
  3395. and will attempt to open UDP sockets on all interfaces that
  3396. are up, running, are not loopback, are multicast-capable, and
  3397. have IPv6 address assigned. It will then listen to incoming traffic.
  3398. </para>
  3399. </section>
  3400. <section id="dhcp6-configuration">
  3401. <title>DHCPv6 Server Configuration</title>
  3402. <para>
  3403. Once the server has been started, it can be configured. To view the
  3404. current configuration, use the following command in <command>bindctl</command>:
  3405. <screen>&gt; <userinput>config show Dhcp6</userinput></screen>
  3406. When starting the Dhcp6 daemon for the first time, the default configuration
  3407. will be available. It will look similar to this:
  3408. <screen>
  3409. &gt; <userinput>config show Dhcp6</userinput>
  3410. Dhcp6/hooks-libraries [] list (default)
  3411. Dhcp6/interfaces/ list (default)
  3412. Dhcp6/renew-timer 1000 integer (default)
  3413. Dhcp6/rebind-timer 2000 integer (default)
  3414. Dhcp6/preferred-lifetime 3000 integer (default)
  3415. Dhcp6/valid-lifetime 4000 integer (default)
  3416. Dhcp6/option-def [] list (default)
  3417. Dhcp6/option-data [] list (default)
  3418. Dhcp6/lease-database/type "" string (default)
  3419. Dhcp6/lease-database/name "" string (default)
  3420. Dhcp6/lease-database/user "" string (default)
  3421. Dhcp6/lease-database/host "" string (default)
  3422. Dhcp6/lease-database/password "" string (default)
  3423. Dhcp6/subnet6/ list
  3424. Dhcp6/dhcp-ddns/enable-updates true boolean
  3425. Dhcp6/dhcp-ddns/server-ip "127.0.0.1" string
  3426. Dhcp6/dhcp-ddns/server-port 53001 integer
  3427. Dhcp6/dhcp-ddns/sender-ip "" string
  3428. Dhcp6/dhcp-ddns/sender-port 0 integer
  3429. Dhcp6/dhcp-ddns/max-queue-size 1024 integer
  3430. Dhcp6/dhcp-ddns/ncr-protocol "UDP" string
  3431. Dhcp6/dhcp-ddns/ncr-format "JSON" string
  3432. Dhcp6/dhcp-ddns/always-include-fqdn false boolean
  3433. Dhcp6/dhcp-ddns/override-no-update false boolean
  3434. Dhcp6/dhcp-ddns/override-client-update false boolean
  3435. Dhcp6/dhcp-ddns/replace-client-name false boolean
  3436. Dhcp6/dhcp-ddns/generated-prefix "myhost" string
  3437. Dhcp6/dhcp-ddns/qualifying-suffix "example.com" string
  3438. </screen>
  3439. </para>
  3440. <para>
  3441. To change one of the parameters, simply follow
  3442. the usual <command>bindctl</command> procedure. For example, to make the
  3443. leases longer, change their valid-lifetime parameter:
  3444. <screen>
  3445. &gt; <userinput>config set Dhcp6/valid-lifetime 7200</userinput>
  3446. &gt; <userinput>config commit</userinput></screen>
  3447. Most Dhcp6 parameters are of global scope
  3448. and apply to all defined subnets, unless they are overridden on a
  3449. per-subnet basis.
  3450. </para>
  3451. <note>
  3452. <para>
  3453. With this version of Kea, there are a number of known limitations
  3454. and problems in the DHCPv6 server. See <xref linkend="dhcp6-limit"/>.
  3455. </para>
  3456. </note>
  3457. <section>
  3458. <title>Default storage for leases</title>
  3459. <para>
  3460. The server is able to store lease data in different repositories. Larger deployments
  3461. may elect to store leases in a database.
  3462. <xref linkend="database-configuration6"/> describes one way to do it.
  3463. By default, the server will use a CSV file rather than a database to store
  3464. lease information. One of the advantages of using a file is that it eliminates
  3465. dependency on third party database software.
  3466. </para>
  3467. <para>
  3468. The configuration of the file backend (Memfile)
  3469. is controlled through the Dhcp6/lease-database parameters. When default
  3470. parameters are left, the Memfile backend will write leases to a disk in the
  3471. [bind10-install-dir]/var/bind10/kea-leases6.csv.
  3472. </para>
  3473. <para>
  3474. It is possible to alter the default location of the lease file. The following
  3475. configuration:
  3476. <screen>
  3477. &gt; <userinput>config set Dhcp4/lease-database/type "memfile"</userinput>
  3478. &gt; <userinput>config set Dhcp4/lease-database/persist true</userinput>
  3479. &gt; <userinput>config set Dhcp4/lease-database/leasefile "/tmp/kea-leases6.csv"</userinput>
  3480. &gt; <userinput>config commit</userinput>
  3481. </screen>
  3482. will change the default location of the lease file to /tmp/kea-leases6.csv.
  3483. </para>
  3484. <para>
  3485. The "persist" parameter controls whether the leases are written to disk.
  3486. It is strongly recommended that this parameter is set to "true" at all times
  3487. during the normal operation of the server.
  3488. </para>
  3489. </section>
  3490. <section id="database-configuration6">
  3491. <title>Database Configuration</title>
  3492. <para>
  3493. All leases issued by the server are stored in the lease database. Currently
  3494. there are 3 database backends available: MySQL, PostgreSQL and memfile.
  3495. <footnote>
  3496. <para>
  3497. The server comes with an in-memory database ("memfile") configured as the default
  3498. database. This is used for internal testing and is not supported. In addition,
  3499. it does not store lease information on disk: lease information will be lost if the
  3500. server is restarted.
  3501. </para>
  3502. </footnote>, and so the server must be configured to
  3503. access the correct database with the appropriate credentials.
  3504. </para>
  3505. <note>
  3506. <para>
  3507. Database access information must be configured for the DHCPv6 server, even if
  3508. it has already been configured for the DHCPv4 server. The servers store their
  3509. information independently, so each server can use a separate
  3510. database or both servers can use the same database.
  3511. </para>
  3512. </note>
  3513. <para>
  3514. Database configuration is controlled through the Dhcp6/lease-database parameters.
  3515. The type of the database must be set to "mysql", "postgresql" or "memfile":
  3516. <screen>
  3517. &gt; <userinput>config set Dhcp6/lease-database/type "mysql"</userinput>
  3518. </screen>
  3519. Next, the name of the database is to hold the leases must be set: this is the
  3520. name used when the lease database was created (see <xref linkend="dhcp-mysql-database-create"/>
  3521. or <xref linkend="dhcp-pgsql-database-create"/>).
  3522. <screen>
  3523. &gt; <userinput>config set Dhcp6/lease-database/name "<replaceable>database-name</replaceable>"</userinput>
  3524. </screen>
  3525. If the database is located on a different system to the DHCPv6 server, the
  3526. database host name must also be specified (although note that this configuration
  3527. may have a severe impact on server performance):
  3528. <screen>
  3529. &gt; <userinput>config set Dhcp6/lease-database/host "<replaceable>remote-host-name</replaceable>"</userinput>
  3530. </screen>
  3531. The usual state of affairs will be to have the database on the same machine as the
  3532. DHCPv6 server. In this case, set the value to the empty string (this is the default):
  3533. <screen>
  3534. &gt; <userinput>config set Dhcp6/lease-database/host ""</userinput>
  3535. </screen>
  3536. </para>
  3537. <para>
  3538. Finally, the credentials of the account under which the server will access the database
  3539. should be set:
  3540. <screen>
  3541. &gt; <userinput>config set Dhcp6/lease-database/user "<replaceable>user-name</replaceable>"</userinput>
  3542. &gt; <userinput>config set Dhcp6/lease-database/password "<replaceable>password</replaceable>"</userinput>
  3543. </screen>
  3544. If there is no password to the account, set the password to the empty string "". (This is also the default.)
  3545. </para>
  3546. <note>
  3547. <para>The password is echoed when entered and is stored in clear text in the configuration
  3548. database. Improved password security will be added in a future version of Kea.</para>
  3549. </note>
  3550. </section>
  3551. <section id="dhcp6-interface-selection">
  3552. <title>Interface selection</title>
  3553. <para>
  3554. When DHCPv6 server starts up, by default it will listen to the DHCP
  3555. traffic and respond to it on all interfaces detected during startup.
  3556. However, in many cases it is desired to configure the server to listen and
  3557. respond on selected interfaces only. The sample commands in this section
  3558. show how to make interface selection using bindctl.
  3559. </para>
  3560. <para>
  3561. The default configuration can be presented with the following command:
  3562. <screen>
  3563. &gt; <userinput>config show Dhcp6/interfaces</userinput>
  3564. <userinput>Dhcp6/interfaces[0] "*" string</userinput></screen>
  3565. An asterisk sign plays a role of the wildcard and means "listen on all interfaces".
  3566. </para>
  3567. <para>
  3568. In order to override the default configuration, the existing entry can be replaced
  3569. with the actual interface name:
  3570. <screen>
  3571. &gt; <userinput>config set Dhcp6/interfaces[0] eth1</userinput>
  3572. &gt; <userinput>config commit</userinput></screen>
  3573. Other interface names can be added on one-by-one basis:
  3574. <screen>
  3575. &gt; <userinput>config add Dhcp6/interfaces eth2</userinput>
  3576. &gt; <userinput>config commit</userinput></screen>
  3577. Configuration will now contain two interfaces which can be presented as follows:
  3578. <screen>
  3579. &gt; <userinput>config show Dhcp6/interfaces</userinput>
  3580. <userinput>Dhcp6/interfaces[0] "eth1" string</userinput>
  3581. <userinput>Dhcp6/interfaces[1] "eth2" string</userinput></screen>
  3582. When configuration gets committed, the server will start to listen on
  3583. eth1 and eth2 interfaces only.
  3584. </para>
  3585. <para>
  3586. It is possible to use wildcard interface name (asterisk) concurrently with explicit
  3587. interface names:
  3588. <screen>
  3589. &gt; <userinput>config add Dhcp6/interfaces *</userinput>
  3590. &gt; <userinput>config commit</userinput></screen>
  3591. This will result in the following configuration:
  3592. <screen>
  3593. &gt; <userinput>config show Dhcp6/interfaces</userinput>
  3594. <userinput>Dhcp6/interfaces[0] "eth1" string</userinput>
  3595. <userinput>Dhcp6/interfaces[1] "eth2" string</userinput>
  3596. <userinput>Dhcp6/interfaces[2] "*" string</userinput></screen>
  3597. The presence of the wildcard name implies that server will listen on all interfaces.
  3598. In order to fall back to the previous configuration when server listens on eth1 and eth2:
  3599. <screen>
  3600. &gt; <userinput>config remove Dhcp6/interfaces[2]</userinput>
  3601. &gt; <userinput>config commit</userinput></screen>
  3602. </para>
  3603. </section>
  3604. <section id="ipv6-subnet-id">
  3605. <title>IPv6 Subnet Identifier</title>
  3606. <para>
  3607. Subnet identifier is a unique number associated with a particular subnet.
  3608. In principle, it is used to associate clients' leases with respective subnets.
  3609. When subnet identifier is not specified for a subnet being configured, it will
  3610. be automatically assigned by the configuration mechanism. The identifiers
  3611. are assigned from 1 and are monotonically increased for each subsequent
  3612. subnet: 1, 2, 3 ....
  3613. </para>
  3614. <para>
  3615. If there are multiple subnets configured with auto-generated identifiers and
  3616. one of them is removed, the subnet identifiers may be renumbered. For example:
  3617. if there are 4 subnets and 3rd is removed the last subnet will be assigned
  3618. identifier that the 3rd subnet had before removal. As a result, the leases
  3619. stored in the lease database for subnet 3 are now associated with the
  3620. subnet 4, which may have unexpected consequences. In the future it is planned
  3621. to implement the mechanism to preserve auto-generated subnet ids upon removal
  3622. of one of the subnets. Currently, the only remedy for this issue is to
  3623. manually specify the unique subnet identifier for each subnet.
  3624. </para>
  3625. <para>
  3626. The following configuration:
  3627. <screen>
  3628. &gt; <userinput>config add Dhcp6/subnet6</userinput>
  3629. &gt; <userinput>config set Dhcp6/subnet6[0]/subnet "2001:db8:1::/64"</userinput>
  3630. &gt; <userinput>config set Dhcp6/subnet6[0]/id 1024</userinput>
  3631. &gt; <userinput>config commit</userinput>
  3632. </screen>
  3633. will assign the arbitrary subnet identifier to the newly configured subnet.
  3634. This identifier will not change for this subnet until "id" parameter is
  3635. removed or set to 0. The value of 0 forces auto-generation of subnet
  3636. identifier.
  3637. </para>
  3638. </section>
  3639. <section id="dhcp6-unicast">
  3640. <title>Unicast traffic support</title>
  3641. <para>
  3642. When DHCPv6 server starts up, by default it listens to the DHCP traffic
  3643. sent to multicast address ff02::1:2 on each interface that it is
  3644. configured to listen on (see <xref linkend="dhcp6-interface-selection"/>).
  3645. In some cases it is useful to configure a server to handle incoming
  3646. traffic sent to the global unicast addresses as well. The most common
  3647. reason for that is to have relays send their traffic to the server
  3648. directly. To configure server to listen on specific unicast address, a
  3649. notation to specify interfaces has been extended. Interface name can be
  3650. optionally followed by a slash, followed by global unicast address that
  3651. server should listen on. That will be done in addition to normal
  3652. link-local binding + listening on ff02::1:2 address. The sample commands
  3653. listed below show how to listen on 2001:db8::1 (a global address)
  3654. configured on the eth1 interface.
  3655. </para>
  3656. <para>
  3657. <screen>
  3658. &gt; <userinput>config set Dhcp6/interfaces[0] eth1/2001:db8::1</userinput>
  3659. &gt; <userinput>config commit</userinput></screen>
  3660. When configuration gets committed, the server will start to listen on
  3661. eth1 on link-local address, multicast group (ff02::1:2) and 2001:db8::1.
  3662. </para>
  3663. <para>
  3664. It is possible to mix interface names, wildcards and interface name/addresses
  3665. on the Dhcp6/interface list. It is not possible to specify more than one
  3666. unicast address on a given interface.
  3667. </para>
  3668. <para>
  3669. Care should be taken to specify proper unicast addresses. The server will
  3670. attempt to bind to those addresses specified, without any additional checks.
  3671. That approach is selected on purpose, so in the software can be used to
  3672. communicate over uncommon addresses if the administrator desires so.
  3673. </para>
  3674. </section>
  3675. <section id="dhcp6-address-config">
  3676. <title>Subnet and Address Pool</title>
  3677. <para>
  3678. The essential role of a DHCPv6 server is address assignment. For this,
  3679. the server has to be configured with at least one subnet and one pool of dynamic
  3680. addresses to be managed. For example, assume that the server
  3681. is connected to a network segment that uses the 2001:db8:1::/64
  3682. prefix. The Administrator of that network has decided that addresses from range
  3683. 2001:db8:1::1 to 2001:db8:1::ffff are going to be managed by the Dhcp6
  3684. server. Such a configuration can be achieved in the following way:
  3685. <screen>
  3686. &gt; <userinput>config add Dhcp6/subnet6</userinput>
  3687. &gt; <userinput>config set Dhcp6/subnet6[0]/subnet "2001:db8:1::/64"</userinput>
  3688. &gt; <userinput>config set Dhcp6/subnet6[0]/pool [ "2001:db8:1::0 - 2001:db8:1::ffff" ]</userinput>
  3689. &gt; <userinput>config commit</userinput></screen>
  3690. Note that subnet is defined as a simple string, but the pool parameter
  3691. is actually a list of pools: for this reason, the pool definition is
  3692. enclosed in square brackets, even though only one range of addresses
  3693. is specified.</para>
  3694. <para>It is possible to define more than one pool in a
  3695. subnet: continuing the previous example, further assume that
  3696. 2001:db8:1:0:5::/80 should be also be managed by the server. It could be written as
  3697. 2001:db8:1:0:5:: to 2001:db8:1::5:ffff:ffff:ffff, but typing so many 'f's
  3698. is cumbersome. It can be expressed more simply as 2001:db8:1:0:5::/80. Both
  3699. formats are supported by Dhcp6 and can be mixed in the pool list.
  3700. For example, one could define the following pools:
  3701. <screen>
  3702. &gt; <userinput>config set Dhcp6/subnet6[0]/pool [ "2001:db8:1::1 - 2001:db8:1::ffff", "2001:db8:1:0:5::/80" ]</userinput>
  3703. &gt; <userinput>config commit</userinput></screen>
  3704. The number of pools is not limited, but for performance reasons it is recommended to
  3705. use as few as possible.
  3706. </para>
  3707. <para>
  3708. The server may be configured to serve more than one subnet. To add a second subnet,
  3709. use a command similar to the following:
  3710. <screen>
  3711. &gt; <userinput>config add Dhcp6/subnet6</userinput>
  3712. &gt; <userinput>config set Dhcp6/subnet6[1]/subnet "2001:db8:beef::/48"</userinput>
  3713. &gt; <userinput>config set Dhcp6/subnet6[1]/pool [ "2001:db8:beef::/48" ]</userinput>
  3714. &gt; <userinput>config commit</userinput></screen>
  3715. Arrays are counted from 0. subnet[0] refers to the subnet defined in the
  3716. previous example. The <command>config add Dhcp6/subnet6</command> command adds
  3717. another (second) subnet. It can be referred to as
  3718. <command>Dhcp6/subnet6[1]</command>. In this example, we allow server to
  3719. dynamically assign all addresses available in the whole subnet. Although
  3720. very wasteful, it is certainly a valid configuration to dedicate the
  3721. whole /48 subnet for that purpose.
  3722. </para>
  3723. <para>
  3724. When configuring a DHCPv6 server using prefix/length notation, please pay
  3725. attention to the boundary values. When specifying that the server should use
  3726. a given pool, it will be able to allocate also first (typically network
  3727. address) address from that pool. For example for pool 2001:db8::/64 the
  3728. 2001:db8:: address may be assigned as well. If you want to avoid this,
  3729. please use the "min-max" notation.
  3730. </para>
  3731. </section>
  3732. <section>
  3733. <!-- @todo: add real meat to the prefix delegation config this is just place holder stuff -->
  3734. <title>Subnet and Prefix Delegation Pools</title>
  3735. <para>
  3736. Subnets may also be configured to delegate address prefixes....
  3737. A subnet may have one or more prefix delegation pools. Each pool has
  3738. a prefixed address, which is specified as a prefix and a prefix length,
  3739. as well as a delegated prefix length. A sample configuration is shown
  3740. below:
  3741. <screen>
  3742. &gt; <userinput>config add Dhcp6/subnet6</userinput>
  3743. &gt; <userinput>config set Dhcp6/subnet6[0]/subnet "2001:db8:1::/64"</userinput>
  3744. &gt; <userinput>config show Dhcp6/subnet6[0]</userinput>
  3745. &gt; <userinput>config add Dhcp6/subnet6[0]/pd-pools</userinput>
  3746. &gt; <userinput>config set Dhcp6/subnet6[0]/pd-pools[0]/prefix "2001:db8:1::"</userinput>
  3747. &gt; <userinput>config set Dhcp6/subnet6[0]/pd-pools[0]/prefix-len 64</userinput>
  3748. &gt; <userinput>config set Dhcp6/subnet6[0]/pd-pools[0]/delegated-len 96</userinput>
  3749. &gt; <userinput>config commit</userinput></screen>
  3750. </para>
  3751. </section>
  3752. <section id="dhcp6-std-options">
  3753. <title>Standard DHCPv6 options</title>
  3754. <para>
  3755. One of the major features of DHCPv6 server is to provide configuration
  3756. options to clients. Although there are several options that require
  3757. special behavior, most options are sent by the server only if the client
  3758. explicitly requested them. The following example shows how to
  3759. configure DNS servers, which is one of the most frequently used
  3760. options. Numbers in the first column are added for easier reference and
  3761. will not appear on screen. Options specified in this way are considered
  3762. global and apply to all configured subnets.
  3763. <screen>
  3764. 1. &gt; <userinput>config add Dhcp6/option-data</userinput>
  3765. 2. &gt; <userinput>config set Dhcp6/option-data[0]/name "dns-servers"</userinput>
  3766. 3. &gt; <userinput>config set Dhcp6/option-data[0]/code 23</userinput>
  3767. 4. &gt; <userinput>config set Dhcp6/option-data[0]/space "dhcp6"</userinput>
  3768. 5. &gt; <userinput>config set Dhcp6/option-data[0]/csv-format true</userinput>
  3769. 6. &gt; <userinput>config set Dhcp6/option-data[0]/data "2001:db8::cafe, 2001:db8::babe"</userinput>
  3770. 7. &gt; <userinput>config commit</userinput>
  3771. </screen>
  3772. </para>
  3773. <para>
  3774. The first line creates new entry in option-data table. It
  3775. contains information on all global options that the server is
  3776. supposed to configure in all subnets. The second line specifies
  3777. option name. For a complete list of currently supported names,
  3778. see <xref linkend="dhcp6-std-options-list"/>.
  3779. The third line specifies option code, which must match one of the
  3780. values from that
  3781. list. Line 4 specifies option space, which must always
  3782. be set to "dhcp6" as these are standard DHCPv6 options. For
  3783. other name spaces, including custom option spaces, see <xref
  3784. linkend="dhcp6-option-spaces"/>. The fifth line specifies the format in
  3785. which the data will be entered: use of CSV (comma
  3786. separated values) is recommended. The sixth line gives the actual value to
  3787. be sent to clients. Data is specified as a normal text, with
  3788. values separated by commas if more than one value is
  3789. allowed.
  3790. </para>
  3791. <para>
  3792. Options can also be configured as hexadecimal values. If csv-format is
  3793. set to false, the option data must be specified as a string of hexadecimal
  3794. numbers. The
  3795. following commands configure the DNS-SERVERS option for all
  3796. subnets with the following addresses: 2001:db8:1::cafe and
  3797. 2001:db8:1::babe.
  3798. <screen>
  3799. &gt; <userinput>config add Dhcp6/option-data</userinput>
  3800. &gt; <userinput>config set Dhcp6/option-data[0]/name "dns-servers"</userinput>
  3801. &gt; <userinput>config set Dhcp6/option-data[0]/code 23</userinput>
  3802. &gt; <userinput>config set Dhcp6/option-data[0]/space "dhcp6"</userinput>
  3803. &gt; <userinput>config set Dhcp6/option-data[0]/csv-format false</userinput>
  3804. &gt; <userinput>config set Dhcp6/option-data[0]/data "2001 0DB8 0001 0000 0000 0000</userinput>
  3805. <userinput>0000 CAFE 2001 0DB8 0001 0000 0000 0000 0000 BABE"</userinput>
  3806. &gt; <userinput>config commit</userinput>
  3807. </screen>
  3808. (The value for the setting of the "data" element is split across two
  3809. lines in this document for clarity: when entering the command, the
  3810. whole string should be entered on the same line.)
  3811. </para>
  3812. <para>
  3813. It is possible to override options on a per-subnet basis. If
  3814. clients connected to most of your subnets are expected to get the
  3815. same values of a given option, you should use global options: you
  3816. can then override specific values for a small number of subnets.
  3817. On the other hand, if you use different values in each subnet,
  3818. it does not make sense to specify global option values
  3819. (Dhcp6/option-data), rather you should set only subnet-specific values
  3820. (Dhcp6/subnet[X]/option-data[Y]).
  3821. </para>
  3822. <para>
  3823. The following commands override the global
  3824. DNS servers option for a particular subnet, setting a single DNS
  3825. server with address 2001:db8:1::3.
  3826. <screen>
  3827. &gt; <userinput>config add Dhcp6/subnet6[0]/option-data</userinput>
  3828. &gt; <userinput>config set Dhcp6/subnet6[0]/option-data[0]/name "dns-servers"</userinput>
  3829. &gt; <userinput>config set Dhcp6/subnet6[0]/option-data[0]/code 23</userinput>
  3830. &gt; <userinput>config set Dhcp6/subnet6[0]/option-data[0]/space "dhcp6"</userinput>
  3831. &gt; <userinput>config set Dhcp6/subnet6[0]/option-data[0]/csv-format true</userinput>
  3832. &gt; <userinput>config set Dhcp6/subnet6[0]/option-data[0]/data "2001:db8:1::3"</userinput>
  3833. &gt; <userinput>config commit</userinput></screen>
  3834. </para>
  3835. <note>
  3836. <para>
  3837. In future versions of BIND 10 DHCP, it will not be necessary to specify
  3838. option code, space and csv-format fields, as those fields will be set
  3839. automatically.
  3840. </para>
  3841. </note>
  3842. <para>
  3843. The currently supported standard DHCPv6 options are
  3844. listed in <xref linkend="dhcp6-std-options-list"/>.
  3845. The "Name" and "Code"
  3846. are the values that should be used as a name in the option-data
  3847. structures. "Type" designates the format of the data: the meanings of
  3848. the various types is given in <xref linkend="dhcp-types"/>.
  3849. </para>
  3850. <para>
  3851. Some options are designated as arrays, which means that more than one
  3852. value is allowed in such an option. For example the option dns-servers
  3853. allows the specification of more than one IPv6 address, so allowing
  3854. clients to obtain the the addresses of multiple DNS servers.
  3855. </para>
  3856. <!-- @todo: describe record types -->
  3857. <para>
  3858. The <xref linkend="dhcp6-custom-options"/> describes the configuration
  3859. syntax to create custom option definitions (formats). It is generally not
  3860. allowed to create custom definitions for standard options, even if the
  3861. definition being created matches the actual option format defined in the
  3862. RFCs. There is an exception from this rule for standard options for which
  3863. Kea does not provide a definition yet. In order to use such options,
  3864. a server administrator must create a definition as described in
  3865. <xref linkend="dhcp6-custom-options"/> in the 'dhcp6' option space. This
  3866. definition should match the option format described in the relevant
  3867. RFC but configuration mechanism would allow any option format as it has
  3868. no means to validate it at the moment.
  3869. </para>
  3870. <para>
  3871. <table frame="all" id="dhcp6-std-options-list">
  3872. <title>List of standard DHCPv6 options</title>
  3873. <tgroup cols='4'>
  3874. <colspec colname='name'/>
  3875. <colspec colname='code'/>
  3876. <colspec colname='type'/>
  3877. <colspec colname='array'/>
  3878. <thead>
  3879. <row><entry>Name</entry><entry>Code</entry><entry>Type</entry><entry>Array?</entry></row>
  3880. </thead>
  3881. <tbody>
  3882. <!-- Our engine uses those options on its own, admin must not configure them on his own
  3883. <row><entry>clientid</entry><entry>1</entry><entry>binary</entry><entry>false</entry></row>
  3884. <row><entry>serverid</entry><entry>2</entry><entry>binary</entry><entry>false</entry></row>
  3885. <row><entry>ia-na</entry><entry>3</entry><entry>record</entry><entry>false</entry></row>
  3886. <row><entry>ia-ta</entry><entry>4</entry><entry>uint32</entry><entry>false</entry></row>
  3887. <row><entry>iaaddr</entry><entry>5</entry><entry>record</entry><entry>false</entry></row>
  3888. <row><entry>oro</entry><entry>6</entry><entry>uint16</entry><entry>true</entry></row> -->
  3889. <row><entry>preference</entry><entry>7</entry><entry>uint8</entry><entry>false</entry></row>
  3890. <!-- Our engine uses those options on its own, admin must not configure them on his own
  3891. <row><entry>elapsed-time</entry><entry>8</entry><entry>uint16</entry><entry>false</entry></row>
  3892. <row><entry>relay-msg</entry><entry>9</entry><entry>binary</entry><entry>false</entry></row>
  3893. <row><entry>auth</entry><entry>11</entry><entry>binary</entry><entry>false</entry></row>
  3894. <row><entry>unicast</entry><entry>12</entry><entry>ipv6-address</entry><entry>false</entry></row>
  3895. <row><entry>status-code</entry><entry>13</entry><entry>record</entry><entry>false</entry></row>
  3896. <row><entry>rapid-commit</entry><entry>14</entry><entry>empty</entry><entry>false</entry></row>
  3897. <row><entry>user-class</entry><entry>15</entry><entry>binary</entry><entry>false</entry></row>
  3898. <row><entry>vendor-class</entry><entry>16</entry><entry>record</entry><entry>false</entry></row>
  3899. <row><entry>vendor-opts</entry><entry>17</entry><entry>uint32</entry><entry>false</entry></row>
  3900. <row><entry>interface-id</entry><entry>18</entry><entry>binary</entry><entry>false</entry></row>
  3901. <row><entry>reconf-msg</entry><entry>19</entry><entry>uint8</entry><entry>false</entry></row>
  3902. <row><entry>reconf-accept</entry><entry>20</entry><entry>empty</entry><entry>false</entry></row> -->
  3903. <row><entry>sip-server-dns</entry><entry>21</entry><entry>fqdn</entry><entry>true</entry></row>
  3904. <row><entry>sip-server-addr</entry><entry>22</entry><entry>ipv6-address</entry><entry>true</entry></row>
  3905. <row><entry>dns-servers</entry><entry>23</entry><entry>ipv6-address</entry><entry>true</entry></row>
  3906. <row><entry>domain-search</entry><entry>24</entry><entry>fqdn</entry><entry>true</entry></row>
  3907. <!-- <row><entry>ia-pd</entry><entry>25</entry><entry>record</entry><entry>false</entry></row> -->
  3908. <!-- <row><entry>iaprefix</entry><entry>26</entry><entry>record</entry><entry>false</entry></row> -->
  3909. <row><entry>nis-servers</entry><entry>27</entry><entry>ipv6-address</entry><entry>true</entry></row>
  3910. <row><entry>nisp-servers</entry><entry>28</entry><entry>ipv6-address</entry><entry>true</entry></row>
  3911. <row><entry>nis-domain-name</entry><entry>29</entry><entry>fqdn</entry><entry>true</entry></row>
  3912. <row><entry>nisp-domain-name</entry><entry>30</entry><entry>fqdn</entry><entry>true</entry></row>
  3913. <row><entry>sntp-servers</entry><entry>31</entry><entry>ipv6-address</entry><entry>true</entry></row>
  3914. <row><entry>information-refresh-time</entry><entry>32</entry><entry>uint32</entry><entry>false</entry></row>
  3915. <row><entry>bcmcs-server-dns</entry><entry>33</entry><entry>fqdn</entry><entry>true</entry></row>
  3916. <row><entry>bcmcs-server-addr</entry><entry>34</entry><entry>ipv6-address</entry><entry>true</entry></row>
  3917. <row><entry>geoconf-civic</entry><entry>36</entry><entry>record</entry><entry>false</entry></row>
  3918. <row><entry>remote-id</entry><entry>37</entry><entry>record</entry><entry>false</entry></row>
  3919. <row><entry>subscriber-id</entry><entry>38</entry><entry>binary</entry><entry>false</entry></row>
  3920. <row><entry>client-fqdn</entry><entry>39</entry><entry>record</entry><entry>false</entry></row>
  3921. <row><entry>pana-agent</entry><entry>40</entry><entry>ipv6-address</entry><entry>true</entry></row>
  3922. <row><entry>new-posix-timezone</entry><entry>41</entry><entry>string</entry><entry>false</entry></row>
  3923. <row><entry>new-tzdb-timezone</entry><entry>42</entry><entry>string</entry><entry>false</entry></row>
  3924. <row><entry>ero</entry><entry>43</entry><entry>uint16</entry><entry>true</entry></row>
  3925. <row><entry>lq-query</entry><entry>44</entry><entry>record</entry><entry>false</entry></row>
  3926. <row><entry>client-data</entry><entry>45</entry><entry>empty</entry><entry>false</entry></row>
  3927. <row><entry>clt-time</entry><entry>46</entry><entry>uint32</entry><entry>false</entry></row>
  3928. <row><entry>lq-relay-data</entry><entry>47</entry><entry>record</entry><entry>false</entry></row>
  3929. <row><entry>lq-client-link</entry><entry>48</entry><entry>ipv6-address</entry><entry>true</entry></row>
  3930. </tbody>
  3931. </tgroup>
  3932. </table>
  3933. </para>
  3934. </section>
  3935. <section id="dhcp6-custom-options">
  3936. <title>Custom DHCPv6 options</title>
  3937. <para>It is also possible to define options other than the standard ones.
  3938. Assume that we want to define a new DHCPv6 option called "foo" which will have
  3939. code 100 and will convey a single unsigned 32 bit integer value. We can define
  3940. such an option by using the following commands:
  3941. <screen>
  3942. &gt; <userinput>config add Dhcp6/option-def</userinput>
  3943. &gt; <userinput>config set Dhcp6/option-def[0]/name "foo"</userinput>
  3944. &gt; <userinput>config set Dhcp6/option-def[0]/code 100</userinput>
  3945. &gt; <userinput>config set Dhcp6/option-def[0]/type "uint32"</userinput>
  3946. &gt; <userinput>config set Dhcp6/option-def[0]/array false</userinput>
  3947. &gt; <userinput>config set Dhcp6/option-def[0]/record-types ""</userinput>
  3948. &gt; <userinput>config set Dhcp6/option-def[0]/space "dhcp6"</userinput>
  3949. &gt; <userinput>config set Dhcp6/option-def[0]/encapsulate ""</userinput>
  3950. &gt; <userinput>config commit</userinput></screen>
  3951. The "false" value of the "array" parameter determines that the option
  3952. does NOT comprise an array of "uint32" values but rather a single value.
  3953. Two other parameters have been left blank: "record-types" and "encapsulate".
  3954. The former specifies the comma separated list of option data fields if the
  3955. option comprises a record of data fields. The "record-fields" value should
  3956. be non-empty if the "type" is set to "record". Otherwise it must be left
  3957. blank. The latter parameter specifies the name of the option space being
  3958. encapsulated by the particular option. If the particular option does not
  3959. encapsulate any option space it should be left blank.
  3960. Note that the above set of comments define the format of the new option and do not
  3961. set its values.
  3962. </para>
  3963. <para>Once the new option format is defined, its value is set
  3964. in the same way as for a standard option. For example the following
  3965. commands set a global value that applies to all subnets.
  3966. <screen>
  3967. &gt; <userinput>config add Dhcp6/option-data</userinput>
  3968. &gt; <userinput>config set Dhcp6/option-data[0]/name "foo"</userinput>
  3969. &gt; <userinput>config set Dhcp6/option-data[0]/code 100</userinput>
  3970. &gt; <userinput>config set Dhcp6/option-data[0]/space "dhcp6"</userinput>
  3971. &gt; <userinput>config set Dhcp6/option-data[0]/csv-format true</userinput>
  3972. &gt; <userinput>config set Dhcp6/option-data[0]/data "12345"</userinput>
  3973. &gt; <userinput>config commit</userinput></screen>
  3974. </para>
  3975. <para>New options can take more complex forms than simple use of
  3976. primitives (uint8, string, ipv6-address etc): it is possible to
  3977. define an option comprising a number of existing primitives.
  3978. </para>
  3979. <para>
  3980. Assume we want to define a new option that will consist of an IPv6
  3981. address, followed by an unsigned 16 bit integer, followed by a
  3982. boolean value, followed by a text string. Such an option could
  3983. be defined in the following way:
  3984. <screen>
  3985. &gt; <userinput>config add Dhcp6/option-def</userinput>
  3986. &gt; <userinput>config set Dhcp6/option-def[0]/name "bar"</userinput>
  3987. &gt; <userinput>config set Dhcp6/option-def[0]/code 101</userinput>
  3988. &gt; <userinput>config set Dhcp6/option-def[0]/space "dhcp6"</userinput>
  3989. &gt; <userinput>config set Dhcp6/option-def[0]/type "record"</userinput>
  3990. &gt; <userinput>config set Dhcp6/option-def[0]/array false</userinput>
  3991. &gt; <userinput>config set Dhcp6/option-def[0]/record-types "ipv6-address, uint16, boolean, string"</userinput>
  3992. &gt; <userinput>config set Dhcp6/option-def[0]/encapsulate ""</userinput>
  3993. </screen>
  3994. The "type" is set to "record" to indicate that the option contains
  3995. multiple values of different types. These types are given as a comma-separated
  3996. list in the "record-types" field and should be those listed in <xref linkend="dhcp-types"/>.
  3997. </para>
  3998. <para>
  3999. The values of the option are set as follows:
  4000. <screen>
  4001. &gt; <userinput>config add Dhcp6/option-data</userinput>
  4002. &gt; <userinput>config set Dhcp6/option-data[0]/name "bar"</userinput>
  4003. &gt; <userinput>config set Dhcp6/option-data[0]/space "dhcp6"</userinput>
  4004. &gt; <userinput>config set Dhcp6/option-data[0]/code 101</userinput>
  4005. &gt; <userinput>config set Dhcp6/option-data[0]/csv-format true</userinput>
  4006. &gt; <userinput>config set Dhcp6/option-data[0]/data "2001:db8:1::10, 123, false, Hello World"</userinput>
  4007. &gt; <userinput>config commit</userinput></screen>
  4008. "csv-format" is set "true" to indicate that the "data" field comprises a command-separated
  4009. list of values. The values in the "data" must correspond to the types set in
  4010. the "record-types" field of the option definition.
  4011. </para>
  4012. <note>
  4013. <para>
  4014. It is recommended that boolean values are specified using "true" and "false"
  4015. strings. This helps to prevent errors when typing multiple comma separated
  4016. values, as it make it easier to identify the type of the value being typed,
  4017. and compare it with the order of data fields. Nevertheless, it is possible
  4018. to use integer values: "1" and "0", instead of "true" and "false"
  4019. accordingly. If other integer value is specified, the configuration is
  4020. rejected.
  4021. </para>
  4022. </note>
  4023. </section>
  4024. <section id="dhcp6-vendor-opts">
  4025. <title>DHCPv6 vendor specific options</title>
  4026. <para>
  4027. Currently there are three option spaces defined: dhcp4 (to be used
  4028. in DHCPv4 daemon) and dhcp6 (for the DHCPv6 daemon); there is also
  4029. vendor-opts-space, which is empty by default, but options can be
  4030. defined in it. Those options are called vendor-specific information
  4031. options. The following examples show how to define an option "foo"
  4032. with code 1 that consists of an IPv6 address, an unsigned 16 bit integer
  4033. and a string. The "foo" option is conveyed in a vendor specific
  4034. information option. This option comprises a single uint32 value
  4035. that is set to "12345". The sub-option "foo" follows the data
  4036. field holding this value.
  4037. <screen>
  4038. &gt; <userinput>config add Dhcp6/option-def</userinput>
  4039. &gt; <userinput>config set Dhcp6/option-def[0]/name "foo"</userinput>
  4040. &gt; <userinput>config set Dhcp6/option-def[0]/code 1</userinput>
  4041. &gt; <userinput>config set Dhcp6/option-def[0]/space "vendor-opts-space"</userinput>
  4042. &gt; <userinput>config set Dhcp6/option-def[0]/type "record"</userinput>
  4043. &gt; <userinput>config set Dhcp6/option-def[0]/array false</userinput>
  4044. &gt; <userinput>config set Dhcp6/option-def[0]/record-types "ipv6-address, uint16, string"</userinput>
  4045. &gt; <userinput>config set Dhcp6/option-def[0]/encapsulates ""</userinput>
  4046. &gt; <userinput>config commit</userinput>
  4047. </screen>
  4048. (Note that the option space is set to "vendor-opts-space".)
  4049. Once the option format is defined, the next step is to define actual values
  4050. for that option:
  4051. <screen>
  4052. &gt; <userinput>config add Dhcp6/option-data</userinput>
  4053. &gt; <userinput>config set Dhcp6/option-data[0]/name "foo"</userinput>
  4054. &gt; <userinput>config set Dhcp6/option-data[0]/space "vendor-opts-space"</userinput>
  4055. &gt; <userinput>config set Dhcp6/option-data[0]/code 1</userinput>
  4056. &gt; <userinput>config set Dhcp6/option-data[0]/csv-format true</userinput>
  4057. &gt; <userinput>config set Dhcp6/option-data[0]/data "2001:db8:1::10, 123, Hello World"</userinput>
  4058. &gt; <userinput>config commit</userinput></screen>
  4059. We should also define values for the vendor-opts, that will convey our option foo.
  4060. <screen>
  4061. &gt; <userinput>config add Dhcp6/option-data</userinput>
  4062. &gt; <userinput>config set Dhcp6/option-data[1]/name "vendor-opts"</userinput>
  4063. &gt; <userinput>config set Dhcp6/option-data[1]/space "dhcp6"</userinput>
  4064. &gt; <userinput>config set Dhcp6/option-data[1]/code 17</userinput>
  4065. &gt; <userinput>config set Dhcp6/option-data[1]/csv-format true</userinput>
  4066. &gt; <userinput>config set Dhcp6/option-data[1]/data "12345"</userinput>
  4067. &gt; <userinput>config commit</userinput></screen>
  4068. </para>
  4069. </section>
  4070. <section id="dhcp6-option-spaces">
  4071. <title>Nested DHCPv6 options (custom option spaces)</title>
  4072. <para>It is sometimes useful to define completely new option
  4073. spaces. This is useful if the user wants his new option to
  4074. convey sub-options that use separate numbering scheme, for
  4075. example sub-options with codes 1 and 2. Those option codes
  4076. conflict with standard DHCPv6 options, so a separate option
  4077. space must be defined.
  4078. </para>
  4079. <para>Note that it is not required to create new option space when
  4080. defining sub-options for a standard option because it is by
  4081. default created if the standard option is meant to convey
  4082. any sub-options (see <xref linkend="dhcp6-vendor-opts"/>).
  4083. </para>
  4084. <para>
  4085. Assume that we want to have a DHCPv6 option called "container"
  4086. with code 102 that conveys two sub-options with codes 1 and 2.
  4087. First we need to define the new sub-options:
  4088. <screen>
  4089. &gt; <userinput>config add Dhcp6/option-def</userinput>
  4090. &gt; <userinput>config set Dhcp6/option-def[0]/name "subopt1"</userinput>
  4091. &gt; <userinput>config set Dhcp6/option-def[0]/code 1</userinput>
  4092. &gt; <userinput>config set Dhcp6/option-def[0]/space "isc"</userinput>
  4093. &gt; <userinput>config set Dhcp6/option-def[0]/type "ipv6-address"</userinput>
  4094. &gt; <userinput>config set Dhcp6/option-def[0]/record-types ""</userinput>
  4095. &gt; <userinput>config set Dhcp6/option-def[0]/array false</userinput>
  4096. &gt; <userinput>config set Dhcp6/option-def[0]/encapsulate ""</userinput>
  4097. &gt; <userinput>config commit</userinput>
  4098. &gt; <userinput></userinput>
  4099. &gt; <userinput>config add Dhcp6/option-def</userinput>
  4100. &gt; <userinput>config set Dhcp6/option-def[1]/name "subopt2"</userinput>
  4101. &gt; <userinput>config set Dhcp6/option-def[1]/code 2</userinput>
  4102. &gt; <userinput>config set Dhcp6/option-def[1]/space "isc"</userinput>
  4103. &gt; <userinput>config set Dhcp6/option-def[1]/type "string"</userinput>
  4104. &gt; <userinput>config set Dhcp6/option-def[1]/record-types ""</userinput>
  4105. &gt; <userinput>config set Dhcp6/option-def[1]/array false</userinput>
  4106. &gt; <userinput>config set Dhcp6/option-def[1]/encapsulate ""</userinput>
  4107. &gt; <userinput>config commit</userinput>
  4108. </screen>
  4109. Note that we have defined the options to belong to a new option space
  4110. (in this case, "isc").
  4111. </para>
  4112. <para>
  4113. The next step is to define a regular DHCPv6 option and specify that it
  4114. should include options from the isc option space:
  4115. <screen>
  4116. &gt; <userinput>config add Dhcp6/option-def</userinput>
  4117. &gt; <userinput>config set Dhcp6/option-def[2]/name "container"</userinput>
  4118. &gt; <userinput>config set Dhcp6/option-def[2]/code 102</userinput>
  4119. &gt; <userinput>config set Dhcp6/option-def[2]/space "dhcp6"</userinput>
  4120. &gt; <userinput>config set Dhcp6/option-def[2]/type "empty"</userinput>
  4121. &gt; <userinput>config set Dhcp6/option-def[2]/array false</userinput>
  4122. &gt; <userinput>config set Dhcp6/option-def[2]/record-types ""</userinput>
  4123. &gt; <userinput>config set Dhcp6/option-def[2]/encapsulate "isc"</userinput>
  4124. &gt; <userinput>config commit</userinput>
  4125. </screen>
  4126. The name of the option space in which the sub-options are defined
  4127. is set in the "encapsulate" field. The "type" field is set to "empty"
  4128. which imposes that this option does not carry any data other than
  4129. sub-options.
  4130. </para>
  4131. <para>
  4132. Finally, we can set values for the new options:
  4133. <screen>
  4134. &gt; <userinput>config add Dhcp6/option-data</userinput>
  4135. &gt; <userinput>config set Dhcp6/option-data[0]/name "subopt1"</userinput>
  4136. &gt; <userinput>config set Dhcp6/option-data[0]/space "isc"</userinput>
  4137. &gt; <userinput>config set Dhcp6/option-data[0]/code 1</userinput>
  4138. &gt; <userinput>config set Dhcp6/option-data[0]/csv-format true</userinput>
  4139. &gt; <userinput>config set Dhcp6/option-data[0]/data "2001:db8::abcd"</userinput>
  4140. &gt; <userinput>config commit</userinput>
  4141. &gt; <userinput></userinput>
  4142. &gt; <userinput>config add Dhcp6/option-data</userinput>
  4143. &gt; <userinput>config set Dhcp6/option-data[1]/name "subopt2"</userinput>
  4144. &gt; <userinput>config set Dhcp6/option-data[1]/space "isc"</userinput>
  4145. &gt; <userinput>config set Dhcp6/option-data[1]/code 2</userinput>
  4146. &gt; <userinput>config set Dhcp6/option-data[1]/csv-format true</userinput>
  4147. &gt; <userinput>config set Dhcp6/option-data[1]/data "Hello world"</userinput>
  4148. &gt; <userinput>config commit</userinput>
  4149. &gt; <userinput></userinput>
  4150. &gt; <userinput>config add Dhcp6/option-data</userinput>
  4151. &gt; <userinput>config set Dhcp6/option-data[2]/name "container"</userinput>
  4152. &gt; <userinput>config set Dhcp6/option-data[2]/space "dhcp6"</userinput>
  4153. &gt; <userinput>config set Dhcp6/option-data[2]/code 102</userinput>
  4154. &gt; <userinput>config set Dhcp6/option-data[2]/csv-format true</userinput>
  4155. &gt; <userinput>config set Dhcp6/option-data[2]/data ""</userinput>
  4156. &gt; <userinput>config commit</userinput>
  4157. </screen>
  4158. Even though the "container" option does not carry any data except
  4159. sub-options, the "data" field must be explicitly set to an empty value.
  4160. This is required because in the current version of BIND 10 DHCP, the
  4161. default configuration values are not propagated to the configuration parsers:
  4162. if the "data" is not set the parser will assume that this
  4163. parameter is not specified and an error will be reported.
  4164. </para>
  4165. <para>Note that it is possible to create an option which carries some data
  4166. in addition to the sub-options defined in the encapsulated option space. For example,
  4167. if the "container" option from the previous example was required to carry an uint16
  4168. value as well as the sub-options, the "type" value would have to be set to "uint16" in
  4169. the option definition. (Such an option would then have the following
  4170. data structure: DHCP header, uint16 value, sub-options.) The value specified
  4171. with the "data" parameter - which should be a valid integer enclosed in quotes,
  4172. e.g. "123" - would then be assigned to the uint16 field in the "container" option.
  4173. </para>
  4174. </section>
  4175. <section id="dhcp6-config-subnets">
  4176. <title>IPv6 Subnet Selection</title>
  4177. <para>
  4178. The DHCPv6 server may receive requests from local (connected to the
  4179. same subnet as the server) and remote (connecting via relays) clients.
  4180. As server may have many subnet configurations defined, it must select
  4181. appropriate subnet for a given request.
  4182. </para>
  4183. <para>
  4184. The server can not assume which of configured subnets are local. It is
  4185. possible in IPv4, where there is reasonable expectation that the
  4186. server will have a (global) IPv4 address configured on the interface,
  4187. and can use that information to detect whether a subnet is local or
  4188. not. That assumption is not true in IPv6, as the DHCPv6 must be able
  4189. to operate with having link-local addresses only. Therefore an optional
  4190. &quot;interface&quot; parameter is available within a subnet definition
  4191. to designate that a given subnet is local, i.e. reachable directly over
  4192. specified interface. For example the server that is intended to serve
  4193. a local subnet over eth0 may be configured as follows:
  4194. <screen>
  4195. &gt; <userinput>config add Dhcp6/subnet6</userinput>
  4196. &gt; <userinput>config set Dhcp6/subnet6[1]/subnet "2001:db8:beef::/48"</userinput>
  4197. &gt; <userinput>config set Dhcp6/subnet6[1]/pool [ "2001:db8:beef::/48" ]</userinput>
  4198. &gt; <userinput>config set Dhcp6/subnet6[1]/interface "eth0"</userinput>
  4199. &gt; <userinput>config commit</userinput>
  4200. </screen>
  4201. </para>
  4202. </section>
  4203. <section id="dhcp6-relays">
  4204. <title>DHCPv6 Relays</title>
  4205. <para>
  4206. A DHCPv6 server with multiple subnets defined must select the
  4207. appropriate subnet when it receives a request from client. For clients
  4208. connected via relays, two mechanisms are used:
  4209. </para>
  4210. <para>
  4211. The first uses the linkaddr field in the RELAY_FORW message. The name
  4212. of this field is somewhat misleading in that it does not contain a link-layer
  4213. address: instead, it holds an address (typically a global address) that is
  4214. used to identify a link. The DHCPv6 server checks if the address belongs
  4215. to a defined subnet and, if it does, that subnet is selected for the client's
  4216. request.
  4217. </para>
  4218. <para>
  4219. The second mechanism is based on interface-id options. While forwarding a client's
  4220. message, relays may insert an interface-id option into the message that
  4221. identifies the interface on the relay that received the message. (Some
  4222. relays allow configuration of that parameter, but it is sometimes
  4223. hardcoded and may range from the very simple (e.g. "vlan100") to the very cryptic:
  4224. one example seen on real hardware was "ISAM144|299|ipv6|nt:vp:1:110"). The
  4225. server can use this information to select the appropriate subnet.
  4226. The information is also returned to the relay which then knows the
  4227. interface to use to transmit the response to the client. In order for
  4228. this to work successfully, the relay interface IDs must be unique within
  4229. the network and the server configuration must match those values.
  4230. </para>
  4231. <para>
  4232. When configuring the DHCPv6 server, it should be noted that two
  4233. similarly-named parameters can be configured for a subnet:
  4234. <itemizedlist>
  4235. <listitem><simpara>
  4236. "interface" defines which local network interface can be used
  4237. to access a given subnet.
  4238. </simpara></listitem>
  4239. <listitem><simpara>
  4240. "interface-id" specifies the content of the interface-id option
  4241. used by relays to identify the interface on the relay to which
  4242. the response packet is sent.
  4243. </simpara></listitem>
  4244. </itemizedlist>
  4245. The two are mutually exclusive: a subnet cannot be both reachable locally
  4246. (direct traffic) and via relays (remote traffic). Specifying both is a
  4247. configuration error and the DHCPv6 server will refuse such a configuration.
  4248. </para>
  4249. <para>
  4250. To specify interface-id with value "vlan123", the following commands can
  4251. be used:
  4252. <screen>
  4253. &gt; <userinput>config add Dhcp6/subnet6</userinput>
  4254. &gt; <userinput>config set Dhcp6/subnet6[0]/subnet "2001:db8:beef::/48"</userinput>
  4255. &gt; <userinput>config set Dhcp6/subnet6[0]/pool [ "2001:db8:beef::/48" ]</userinput>
  4256. &gt; <userinput>config set Dhcp6/subnet6[0]/interface-id "vland123"</userinput>
  4257. &gt; <userinput>config commit</userinput>
  4258. </screen>
  4259. </para>
  4260. </section>
  4261. <section id="dhcp6-client-classifier">
  4262. <title>Client Classification in DHCPv6</title>
  4263. <note>
  4264. <para>
  4265. DHCPv6 server has been extended to support limited client classification.
  4266. Although the current capability is modest, it is expected to be expanded
  4267. in the future. It is envisaged that the majority of client classification
  4268. extensions will be using hooks extensions.
  4269. </para>
  4270. </note>
  4271. <para>In certain cases it is useful to differentiate between different types
  4272. of clients and treat them differently. The process of doing classification
  4273. is conducted in two steps. The first step is to assess incoming packet and
  4274. assign it to zero or more classes. This classification is currently simple,
  4275. but is expected to grow in capability soon. Currently the server checks whether
  4276. incoming packet has vendor class option (16). If it has, content
  4277. of that option is prepended with &quot;VENDOR_CLASS_&quot; interpreted as a
  4278. class. For example, modern cable modems will send this option with value
  4279. &quot;docsis3.0&quot; and as a result the packet will belong to class
  4280. &quot;VENDOR_CLASS_docsis3.0&quot;.
  4281. </para>
  4282. <para>It is envisaged that the client classification will be used for changing
  4283. behavior of almost any part of the DHCP engine processing, including assigning
  4284. leases from different pools, assigning different option (or different values of
  4285. the same options) etc. For now, there is only one mechanism that is taking
  4286. advantage of client classification: subnet selection.</para>
  4287. <para>
  4288. Kea can be instructed to limit access to given subnets based on class information.
  4289. This is particularly useful for cases where two types of devices share the
  4290. same link and are expected to be served from two different subnets. The
  4291. primary use case for such a scenario are cable networks. There are two
  4292. classes of devices: cable modem itself, which should be handled a lease
  4293. from subnet A and all other devices behind modems that should get a lease
  4294. from subnet B. That segregation is essential to prevent overly curious
  4295. users from playing with their cable modems. For details on how to set up
  4296. class restrictions on subnets, see <xref linkend="dhcp6-subnet-class"/>.
  4297. </para>
  4298. </section>
  4299. <section id="dhcp6-subnet-class">
  4300. <title>Limiting access to IPv6 subnet to certain classes</title>
  4301. <para>
  4302. In certain cases it beneficial to restrict access to certains subnets
  4303. only to clients that belong to a given subnet. For details on client
  4304. classes, see <xref linkend="dhcp6-client-classifier"/>. This is an
  4305. extension of a previous example from <xref linkend="dhcp6-address-config"/>.
  4306. Let's assume that the server is connected to a network segment that uses
  4307. the 2001:db8:1::/64 prefix. The Administrator of that network has
  4308. decided that addresses from range 2001:db8:1::1 to 2001:db8:1::ffff are
  4309. going to be managed by the Dhcp6 server. Only clients belonging to the
  4310. eRouter1.0 client class are allowed to use that pool. Such a
  4311. configuration can be achieved in the following way:
  4312. <screen>
  4313. &gt; <userinput>config add Dhcp6/subnet6</userinput>
  4314. &gt; <userinput>config set Dhcp6/subnet6[0]/subnet "2001:db8:1::/64"</userinput>
  4315. &gt; <userinput>config set Dhcp6/subnet6[0]/pool [ "2001:db8:1::0 - 2001:db8:1::ffff" ]</userinput>
  4316. &gt; <userinput>config set Dhcp6/subnet6[0]/client-class "eRouter1.0"</userinput>
  4317. &gt; <userinput>config commit</userinput></screen>
  4318. </para>
  4319. <para>
  4320. Care should be taken with client classification as it is easy to prevent
  4321. clients that do not meet class criteria to be denied any service altogether.
  4322. </para>
  4323. </section>
  4324. <section id="dhcp6-ddns-config">
  4325. <title>Configuring DHCPv6 for DDNS</title>
  4326. <para>
  4327. As mentioned earlier, b10-dhcp6 can be configured to generate requests to
  4328. the DHCP-DDNS server (referred to here as the "D2" server) to update
  4329. DNS entries. These requests are known as NameChangeRequests or NCRs.
  4330. Each NCR contains the following information:
  4331. <orderedlist>
  4332. <listitem><para>
  4333. Whether it is a request to add (update) or remove DNS entries
  4334. </para></listitem>
  4335. <listitem><para>
  4336. Whether the change requests forward DNS updates (AAAA records), reverse
  4337. DNS updates (PTR records), or both.
  4338. </para></listitem>
  4339. <listitem><para>
  4340. The FQDN, lease address, and DHCID
  4341. </para></listitem>
  4342. </orderedlist>
  4343. The parameters controlling the generation of NCRs for submission to D2
  4344. are contained in the "dhcp-ddns" section of b10-dhcp6
  4345. configuration. The default values for this section appears as follows:
  4346. <screen>
  4347. &gt; <userinput>config show Dhcp6/dhcp-ddns</userinput>
  4348. Dhcp6/dhcp-ddns/enable-updates true boolean
  4349. Dhcp6/dhcp-ddns/server-ip "127.0.0.1" string
  4350. Dhcp6/dhcp-ddns/server-port 53001 integer
  4351. Dhcp6/dhcp-ddns/sender-ip "" string
  4352. Dhcp6/dhcp-ddns/sender-port 0 integer
  4353. Dhcp6/dhcp-ddns/max-queue-size 1024 integer
  4354. Dhcp6/dhcp-ddns/ncr-protocol "UDP" string
  4355. Dhcp6/dhcp-ddns/ncr-format "JSON" string
  4356. Dhcp6/dhcp-ddns/override-no-update false boolean
  4357. Dhcp6/dhcp-ddns/override-client-update false boolean
  4358. Dhcp6/dhcp-ddns/replace-client-name false boolean
  4359. Dhcp6/dhcp-ddns/generated-prefix "myhost" string
  4360. Dhcp6/dhcp-ddns/qualifying-suffix "example.com" string
  4361. </screen>
  4362. </para>
  4363. <para>
  4364. The "enable-updates" parameter determines whether or not b10-dhcp6 will
  4365. generate NCRs. By default, this value is false hence DDNS updates are
  4366. disabled. To enable DDNS updates set this value to true as follows:
  4367. </para>
  4368. <screen>
  4369. &gt; <userinput>config set Dhcp6/dhcp-ddns/enable-updates true</userinput>
  4370. &gt; <userinput>config commit</userinput>
  4371. </screen>
  4372. <section id="dhcpv6-d2-io-config">
  4373. <title>DHCP-DDNS Server Connectivity</title>
  4374. <para>
  4375. In order for NCRs to reach the D2 server, b10-dhcp6 must be able
  4376. to communicate with it. b10-dhcp6 uses the following configuration
  4377. parameters to control how it communications with D2:
  4378. <orderedlist>
  4379. <listitem><para>
  4380. server-ip - IP address on which D2 listens for requests. The default is
  4381. the local loopback interface at address 127.0.0.1. You may specify
  4382. either an IPv4 or IPv6 address.
  4383. </para></listitem>
  4384. <listitem><para>
  4385. server-port - port on which D2 listens for requests. The default value
  4386. is 53001.
  4387. </para></listitem>
  4388. <listitem><para>
  4389. sender-ip - IP address which b10-dhcp6 should use to send requests to D2.
  4390. The default value is blank which instructs b10-dhcp6 to select a suitable
  4391. address.
  4392. </para></listitem>
  4393. <listitem><para>
  4394. sender-port - port which b10-dhcp6 should use to send requests to D2. The
  4395. default value of 0 instructs b10-dhcp6 to select suitable port.
  4396. </para></listitem>
  4397. <listitem><para>
  4398. ncr-format - Socket protocol use when sending requests to D2. Currently
  4399. only UDP is supported. TCP may be available in an upcoming release.
  4400. </para></listitem>
  4401. <listitem><para>
  4402. ncr-protocol - Packet format to use when sending requests to D2.
  4403. Currently only JSON format is supported. Other formats may be available
  4404. in future releases.
  4405. </para></listitem>
  4406. <listitem><para>
  4407. max-queue-size - maximum number of requests allowed to queue waiting to
  4408. be sent to D2. This value guards against requests accumulating
  4409. uncontrollably if they are being generated faster than they can be
  4410. delivered. If the number of requests queued for transmission reaches
  4411. this value, DDNS updating will be turned off until the queue backlog has
  4412. been sufficiently reduced. The intent is allow b10-dhcp6 to
  4413. continue lease operations. The default value is 1024.
  4414. </para></listitem>
  4415. </orderedlist>
  4416. By default, D2 is assumed to running on the same machine as b10-dhcp6, and
  4417. all of the default values mentioned above should be sufficient.
  4418. If, however, D2 has been configured to listen on a different address or
  4419. port, these values must altered accordingly. For example, if D2 has been
  4420. configured to listen on 3001::5 port 900, the following commands
  4421. would be required:
  4422. <screen>
  4423. &gt; <userinput>config set Dhcp6/dhcp-ddns/server-ip "3001::5"</userinput>
  4424. &gt; <userinput>config set Dhcp6/dhcp-ddns/server-port 900</userinput>
  4425. &gt; <userinput>config commit</userinput>
  4426. </screen>
  4427. </para>
  4428. </section>
  4429. <section id="dhcpv6-d2-rules-config">
  4430. <title>When does b10-dhcp6 generate DDNS request</title>
  4431. b10-dhcp6 follows the behavior prescribed for DHCP servers in RFC 4704.
  4432. It is important to keep in mind that b10-dhcp6 provides the initial decision
  4433. making of when and what to update and forwards that information to D2 in
  4434. the form of NCRs. Carrying out the actual DNS updates and dealing with
  4435. such things as conflict resolution are the purview of D2 (<xref linkend="dhcp-ddns-server"/>).
  4436. <para>
  4437. This section describes when b10-dhcp6 will generate NCRs and the
  4438. configuration parameters that can be used to influence this decision.
  4439. It assumes that the "enable-updates" parameter is true.
  4440. </para>
  4441. <note>
  4442. <para>
  4443. Currently the interface between b10-dhcp6 and D2 only supports requests
  4444. which update DNS entries for a single IP address. If a lease grants
  4445. more than one address, b10-dhcp6 will create the DDNS update request for
  4446. only the first of these addresses. Support for multiple address
  4447. mappings may be provided in a future release.
  4448. </para>
  4449. </note>
  4450. <para>
  4451. In general, b10-dhcp6 will generate DDNS update requests when:
  4452. <orderedlist>
  4453. <listitem><para>
  4454. A new lease is granted in response to a DHCP REQUEST
  4455. </para></listitem>
  4456. <listitem><para>
  4457. An existing lease is renewed but the FQDN associated with it has
  4458. changed.
  4459. </para></listitem>
  4460. <listitem><para>
  4461. An existing lease is released in response to a DHCP RELEASE
  4462. </para></listitem>
  4463. </orderedlist>
  4464. In the second case, lease renewal, two DDNS requests will be issued: one
  4465. request to remove entries for the previous FQDN and a second request to
  4466. add entries for the new FQDN. In the last case, a lease release, a
  4467. single DDNS request to remove its entries will be made. The decision
  4468. making involved when granting a new lease is more involved and is
  4469. discussed next.
  4470. </para>
  4471. <para>
  4472. b10-dhcp6 will generate a DDNS update request only if the DHCP REQUEST
  4473. contains the FQDN option (code 39). By default b10-dhcp6 will
  4474. respect the FQDN N and S flags specified by the client as shown in the
  4475. following table:
  4476. </para>
  4477. <table id="dhcp6-fqdn-flag-table">
  4478. <title>Default FQDN Flag Behavior</title>
  4479. <tgroup cols='4' align='left'>
  4480. <colspec colname='cflags'/>
  4481. <colspec colname='meaning'/>
  4482. <colspec colname='response'/>
  4483. <colspec colname='sflags'/>
  4484. <thead>
  4485. <row>
  4486. <entry>Client Flags:N-S</entry>
  4487. <entry>Client Intent</entry>
  4488. <entry>Server Response</entry>
  4489. <entry>Server Flags:N-S-O</entry>
  4490. </row>
  4491. </thead>
  4492. <tbody>
  4493. <row>
  4494. <entry>0-0</entry>
  4495. <entry>
  4496. Client wants to do forward updates, server should do reverse updates
  4497. </entry>
  4498. <entry>Server generates reverse-only request</entry>
  4499. <entry>1-0-0</entry>
  4500. </row>
  4501. <row>
  4502. <entry>0-1</entry>
  4503. <entry>Server should do both forward and reverse updates</entry>
  4504. <entry>Server generates request to update both directions</entry>
  4505. <entry>0-1-0</entry>
  4506. </row>
  4507. <row>
  4508. <entry>1-0</entry>
  4509. <entry>Client wants no updates done</entry>
  4510. <entry>Server does not generate a request</entry>
  4511. <entry>1-0-0</entry>
  4512. </row>
  4513. </tbody>
  4514. </tgroup>
  4515. </table>
  4516. <para>
  4517. The first row in the table above represents "client delegation". Here
  4518. the DHCP client states that it intends to do the forward DNS updates and
  4519. the server should do the reverse updates. By default, b10-dhcp6 will honor
  4520. the client's wishes and generate a DDNS request to D2 to update only
  4521. reverse DNS data. The parameter, "override-client-update", can be used
  4522. to instruct the server to override client delegation requests. When
  4523. this parameter is true, b10-dhcp6 will disregard requests for client
  4524. delegation and generate a DDNS request to update both forward and
  4525. reverse DNS data. In this case, the N-S-O flags in the server's
  4526. response to the client will be 0-1-1 respectively.
  4527. </para>
  4528. <para>
  4529. (Note that the flag combination N=1, S=1 is prohibited according to
  4530. RFC 4702. If such a combination is received from the client, the packet
  4531. will be dropped by b10-dhcp6.)
  4532. </para>
  4533. <para>
  4534. To override client delegation, issue the following commands:
  4535. </para>
  4536. <screen>
  4537. &gt; <userinput>config set Dhcp6/dhcp-ddns/override-client-update true</userinput>
  4538. &gt; <userinput>config commit</userinput>
  4539. </screen>
  4540. <para>
  4541. The third row in the table above describes the case in which the client
  4542. requests that no DNS updates be done. The parameter, "override-no-update",
  4543. can be used to instruct the server to disregard the client's wishes. When
  4544. this parameter is true, b10-dhcp6 will generate DDNS update request to D2
  4545. even if the client requests no updates be done. The N-S-O flags in the
  4546. server's response to the client will be 0-1-1.
  4547. </para>
  4548. <para>
  4549. To override client delegation, issue the following commands:
  4550. </para>
  4551. <screen>
  4552. &gt; <userinput>config set Dhcp6/dhcp-ddns/override-no-update true</userinput>
  4553. &gt; <userinput>config commit</userinput>
  4554. </screen>
  4555. </section>
  4556. <section id="dhcpv6-fqdn-name-generation">
  4557. <title>b10-dhcp6 name generation for DDNS update requests</title>
  4558. Each NameChangeRequest must of course include the fully qualified domain
  4559. name whose DNS entries are to be affected. b10-dhcp6 can be configured to
  4560. supply a portion or all of that name based upon what it receives from
  4561. the client in the DHCP REQUEST.
  4562. <para>
  4563. The rules for determining the FQDN option are as follows:
  4564. <orderedlist>
  4565. <listitem><para>
  4566. If configured to do so ignore the REQUEST contents and generate a
  4567. FQDN using a configurable prefix and suffix.
  4568. </para></listitem>
  4569. <listitem><para>
  4570. Otherwise, using is the domain name value from the client FQDN option as
  4571. the candidate name:
  4572. <orderedlist>
  4573. <listitem><para>
  4574. If the candidate name is a fully qualified domain name then use it.
  4575. </para></listitem>
  4576. <listitem><para>
  4577. If the candidate name is a partial (i.e. unqualified) name then
  4578. add a configurable suffix to the name and use the result as the FQDN.
  4579. </para></listitem>
  4580. <listitem><para>
  4581. If the candidate name is a empty then generate a FQDN using a
  4582. configurable prefix and suffix.
  4583. </para></listitem>
  4584. </orderedlist>
  4585. </para></listitem>
  4586. </orderedlist>
  4587. To instruct b10-dhcp6 to always generate a FQDN, set the parameter
  4588. "replace-client-name" to true:
  4589. </para>
  4590. <screen>
  4591. &gt; <userinput>config set Dhcp6/dhcp-ddns/replace-client-name true</userinput>
  4592. &gt; <userinput>config commit</userinput>
  4593. </screen>
  4594. <para>
  4595. The prefix used when generating a FQDN is specified by the
  4596. "generated-prefix" parameter. The default value is "myhost". To alter
  4597. its value, simply set it to the desired string:
  4598. </para>
  4599. <screen>
  4600. &gt; <userinput>config set Dhcp6/dhcp-ddns/generated-prefix "another.host"</userinput>
  4601. &gt; <userinput>config commit</userinput>
  4602. </screen>
  4603. <para>
  4604. The suffix used when generating a FQDN or when qualifying a partial
  4605. name is specified by the "qualifying-suffix" parameter. The default
  4606. value is "example.com". To alter its value simply set it to the desired
  4607. string:
  4608. </para>
  4609. <screen>
  4610. &gt; <userinput>config set Dhcp6/dhcp-ddns/generated-prefix "our.net"</userinput>
  4611. &gt; <userinput>config commit</userinput>
  4612. </screen>
  4613. </section>
  4614. <para>
  4615. When qualifying a partial name, b10-dhcp6 will construct a name with the
  4616. format:
  4617. </para>
  4618. <para>
  4619. [candidate-name].[qualifying-suffix].
  4620. </para>
  4621. <para>
  4622. where candidate-name is the partial name supplied in the REQUEST.
  4623. For example, if FQDN domain name value was "some-computer" and assuming
  4624. the default value for qualifying-suffix, the generated FQDN would be:
  4625. </para>
  4626. <para>
  4627. some-computer.example.com.
  4628. </para>
  4629. <para>
  4630. When generating a the entire name, b10-dhcp6 will construct name of the
  4631. format:
  4632. </para>
  4633. <para>
  4634. [generated-prefix]-[address-text].[qualifying-suffix].
  4635. </para>
  4636. <para>
  4637. where address-text is simply the lease IP address converted to a
  4638. hyphenated string. For example, if lease address is 3001:1::70E and
  4639. assuming default values for generated-prefix and qualifying-suffix, the
  4640. generated FQDN would be:
  4641. </para>
  4642. <para>
  4643. myhost-3001-1--70E.example.com.
  4644. </para>
  4645. </section>
  4646. </section>
  4647. <section id="dhcp6-serverid">
  4648. <title>Server Identifier in DHCPv6</title>
  4649. <para>The DHCPv6 protocol uses a "server identifier" (also known
  4650. as a DUID) for clients to be able to discriminate between several
  4651. servers present on the same link. There are several types of
  4652. DUIDs defined, but <ulink url="http://tools.ietf.org/html/rfc3315">RFC 3315</ulink> instructs servers to use DUID-LLT if
  4653. possible. This format consists of a link-layer (MAC) address and a
  4654. timestamp. When started for the first time, the DHCPv6 server will
  4655. automatically generate such a DUID and store the chosen value to
  4656. a file. That file is read by the server
  4657. and the contained value used whenever the server is subsequently started.
  4658. </para>
  4659. <para>
  4660. It is unlikely that this parameter should ever need to be changed.
  4661. However, if such a need arises, stop the server, edit the file and restart
  4662. the server. (The file is named b10-dhcp6-serverid and by default is
  4663. stored in the "var" subdirectory of the directory in which BIND 10 is installed.
  4664. This can be changed when BIND 10 is built by using "--localstatedir"
  4665. on the "configure" command line.) The file is a text file that contains
  4666. double digit hexadecimal values
  4667. separated by colons. This format is similar to typical MAC address
  4668. format. Spaces are ignored. No extra characters are allowed in this
  4669. file.
  4670. </para>
  4671. </section>
  4672. <section id="dhcp6-relay-override">
  4673. <title>Using specific relay agent for a subnet</title>
  4674. <para>
  4675. The relay has to have an interface connected to the link on which
  4676. the clients are being configured. Typically the relay has a global IPv6
  4677. address configured on that interface that belongs to the subnet that
  4678. the server will assign addresses from. In such typical case, the
  4679. server is able to use IPv6 address inserted by the relay (in link-addr
  4680. field in RELAY-FORW message) to select appropriate subnet.
  4681. </para>
  4682. <para>
  4683. However, that is not always the case. The relay
  4684. address may not match the subnet in certain deployments. This
  4685. usually means that there is more than one subnet allocated for a given
  4686. link. Two most common examples where this is the case are long lasting
  4687. network renumbering (where both old and new address space is still being
  4688. used) and a cable network. In a cable network both cable modems and the
  4689. devices behind them are physically connected to the same link, yet
  4690. they use distinct addressing. In such case, the DHCPv6 server needs
  4691. additional information (like the value of interface-id option or IPv6
  4692. address inserted in the link-addr field in RELAY-FORW message) to
  4693. properly select an appropriate subnet.
  4694. </para>
  4695. <para>
  4696. The following example assumes that there is a subnet 2001:db8:1::/64
  4697. that is accessible via relay that uses 3000::1 as its IPv6 address.
  4698. The server will be able to select this subnet for any incoming packets
  4699. that came from a relay that has an address in 2001:db8:1::/64 subnet.
  4700. It will also select that subnet for a relay with address 3000::1.
  4701. <screen>
  4702. &gt; <userinput>config add Dhcp6/subnet6</userinput>
  4703. &gt; <userinput>config set Dhcp6/subnet6[0]/subnet "2001:db8:1::/64"</userinput>
  4704. &gt; <userinput>config set Dhcp6/subnet6[0]/pool [ "2001:db8:1::2 - 2001:db8:1::ffff" ]</userinput>
  4705. &gt; <userinput>config set Dhcp6/subnet6[0]/relay/ip-address "3000::1"</userinput>
  4706. &gt; <userinput>config commit</userinput></screen>
  4707. </para>
  4708. </section>
  4709. <section id="dhcp6-client-class-relay">
  4710. <title>Segregating IPv6 clients in a cable network</title>
  4711. <para>
  4712. In certain cases, it is useful to mix relay address information,
  4713. introduced in <xref linkend="dhcp6-relay-override"/> with client
  4714. classification, explained in <xref linkend="dhcp6-subnet-class"/>.
  4715. One specific example is cable network, where typically modems
  4716. get addresses from a different subnet than all devices connected
  4717. behind them.
  4718. </para>
  4719. <para>
  4720. Let's assume that there is one CMTS (Cable Modem Termination System)
  4721. with one CM MAC (a physical link that modems are connected to).
  4722. We want the modems to get addresses from the 3000::/64 subnet,
  4723. while everything connected behind modems should get addresses from
  4724. another subnet (2001:db8:1::/64). The CMTS that acts as a relay
  4725. an uses address 3000::1. The following configuration can serve
  4726. that configuration:
  4727. <screen>
  4728. &gt; <userinput>config add Dhcp6/subnet6</userinput>
  4729. &gt; <userinput>config set Dhcp6/subnet6[0]/subnet "3000::/64"</userinput>
  4730. &gt; <userinput>config set Dhcp6/subnet6[0]/pool [ "3000::2 - 3000::ffff" ]</userinput>
  4731. &gt; <userinput>config set Dhcp6/subnet6[0]/client-class "docsis3.0"</userinput>
  4732. &gt; <userinput>config set Dhcp6/subnet6[0]/relay/ip-address "3000::1"</userinput>
  4733. &gt; <userinput>config add Dhcp6/subnet6</userinput>
  4734. &gt; <userinput>config set Dhcp6/subnet6[1]/subnet "2001:db8:1::/64"</userinput>
  4735. &gt; <userinput>config set Dhcp6/subnet6[1]/pool [ "2001:db8:1::1 - 2001:db8:1::ffff" ]</userinput>
  4736. &gt; <userinput>config set Dhcp6/subnet6[1]/relay/ip-address "3000::1"</userinput>
  4737. &gt; <userinput>config commit</userinput></screen>
  4738. </para>
  4739. </section>
  4740. <section id="dhcp6-std">
  4741. <title>Supported Standards</title>
  4742. <para>The following standards and draft standards are currently
  4743. supported:</para>
  4744. <itemizedlist>
  4745. <listitem>
  4746. <simpara><ulink url="http://tools.ietf.org/html/rfc3315">RFC 3315</ulink>: Supported messages are SOLICIT,
  4747. ADVERTISE, REQUEST, RELEASE, RENEW, REBIND and REPLY.</simpara>
  4748. </listitem>
  4749. <listitem>
  4750. <simpara><ulink url="http://tools.ietf.org/html/rfc3633">RFC 3633</ulink>: Supported options are IA_PD and
  4751. IA_PREFIX. Also supported is the status code NoPrefixAvail.</simpara>
  4752. </listitem>
  4753. <listitem>
  4754. <simpara><ulink url="http://tools.ietf.org/html/rfc3646">RFC 3646</ulink>: Supported option is DNS_SERVERS.</simpara>
  4755. </listitem>
  4756. <listitem>
  4757. <simpara><ulink url="http://tools.ietf.org/html/rfc4704">RFC 4704</ulink>: Supported option is CLIENT_FQDN.</simpara>
  4758. </listitem>
  4759. </itemizedlist>
  4760. </section>
  4761. <section id="dhcp6-limit">
  4762. <title>DHCPv6 Server Limitations</title>
  4763. <para> These are the current limitations and known problems
  4764. with the DHCPv6 server
  4765. software. Most of them are reflections of the early stage of
  4766. development and should be treated as <quote>not implemented
  4767. yet</quote>, rather than actual limitations.</para>
  4768. <itemizedlist>
  4769. <listitem> <!-- see tickets #3234, #3281 -->
  4770. <para>
  4771. On-line configuration has some limitations. Adding new subnets or
  4772. modifying existing ones work, as is removing the last subnet from
  4773. the list. However, removing non-last (e.g. removing subnet 1,2 or 3 if
  4774. there are 4 subnets configured) will cause issues. The problem is
  4775. caused by simplistic subnet-id assignment. The subnets are always
  4776. numbered, starting from 1. That subnet-id is then used in leases
  4777. that are stored in the lease database. Removing non-last subnet will
  4778. cause the configuration information to mismatch data in the lease
  4779. database. It is possible to manually update subnet-id fields in
  4780. MySQL or PostgreSQL database, but it is awkward and error prone
  4781. process. A better reconfiguration support is planned.
  4782. </para>
  4783. </listitem>
  4784. <listitem>
  4785. <para>
  4786. On startup, the DHCPv6 server does not get the full configuration from
  4787. BIND 10. To remedy this, after starting BIND 10, modify any parameter
  4788. and commit the changes, e.g.
  4789. <screen>
  4790. &gt; <userinput>config show Dhcp6/renew-timer</userinput>
  4791. Dhcp6/renew-timer 1000 integer (default)
  4792. &gt; <userinput>config set Dhcp6/renew-timer 1001</userinput>
  4793. &gt; <userinput>config commit</userinput></screen>
  4794. </para>
  4795. </listitem>
  4796. <listitem>
  4797. <simpara>Temporary addresses are not supported.</simpara>
  4798. </listitem>
  4799. <listitem>
  4800. <simpara>
  4801. The server will allocate, renew or rebind a maximum of one lease
  4802. for a particular IA option (IA_NA or IA_PD) sent by a client.
  4803. <ulink url="http://tools.ietf.org/html/rfc3315">RFC 3315</ulink> and
  4804. <ulink url="http://tools.ietf.org/html/rfc3633">RFC 3633</ulink> allow
  4805. for multiple addresses or prefixes to be allocated for a single IA.
  4806. </simpara>
  4807. </listitem>
  4808. <listitem>
  4809. <simpara>Temporary addresses are not supported.</simpara>
  4810. </listitem>
  4811. <listitem>
  4812. <simpara>
  4813. Confirmation (CONFIRM), duplication report (DECLINE),
  4814. stateless configuration (INFORMATION-REQUEST) and client
  4815. reconfiguration (RECONFIGURE) are not yet supported.
  4816. </simpara>
  4817. </listitem>
  4818. <listitem>
  4819. <simpara>
  4820. The server doesn't act upon expired leases. In particular,
  4821. when a lease expires, the server doesn't request removal of
  4822. the DNS records associated with it.
  4823. </simpara>
  4824. </listitem>
  4825. </itemizedlist>
  4826. </section>
  4827. <!--
  4828. <section id="dhcp6-srv-examples">
  4829. <title>Kea DHCPv6 server examples</title>
  4830. <para>
  4831. This section provides easy to use example. Each example can be read
  4832. separately. It is not intended to be read sequentially as there will
  4833. be many repetitions between examples. They are expected to serve as
  4834. easy to use copy-paste solutions to many common deployments.
  4835. </para>
  4836. @todo: add simple configuration for direct clients
  4837. @todo: add configuration for relayed clients
  4838. @todo: add client classification example
  4839. </section> -->
  4840. </chapter>
  4841. <chapter id="dhcp-ddns-server">
  4842. <title>The DHCP-DDNS Server</title>
  4843. <para>
  4844. The DHCP-DDNS Server (b10-dhcp-ddns, known informally as D2) conducts the client side of
  4845. the DDNS protocol (defined in RFC 2136) on behalf of the DHCPv4 and DHCPv6
  4846. servers (b10-dhcp4 and b10-dhcp6 respectively). The DHCP servers construct
  4847. DDNS update requests, known as NameChangeRequests (NCRs), based upon DHCP
  4848. lease change events and then post these to D2. D2 attempts to match
  4849. each such request to the appropriate DNS server(s) and carry out the
  4850. necessary conversation with those servers to update the DNS data.
  4851. </para>
  4852. <para>
  4853. In order to match a request to appropriate DNS servers, D2 must have a
  4854. catalog of servers from which to select. In fact, D2 has two such catalogs,
  4855. one for forward DNS and one for reverse DNS; these catalogs are referred
  4856. to as DDNS Domain Lists. Each list consists of one or more named DDNS
  4857. Domains. Further, each DDNS Domain has a list of of one or more DNS
  4858. servers that publish the DNS data for that domain.
  4859. </para>
  4860. <para>
  4861. When conducting forward domain matching, D2 will compare the FQDN in
  4862. the request against the name of each forward DDNS Domain. The domain
  4863. whose name matches the longest portion of the FQDN is considered the
  4864. best match. For example, if the FQDN is "myhost.sample.example.com.",
  4865. and there are two forward domains in the catalog: "sample.example.com."
  4866. and "example.com.", the former is regarded as the best match. In some
  4867. cases, it may not be possible to find a suitable match. Given the same two
  4868. forward domains there would be no match for the FQDN, "bogus.net", so the
  4869. request would be rejected. Finally, if there are no forward DDNS Domains
  4870. defined, D2 will simply disregard the forward update portion of requests.
  4871. </para>
  4872. <para>
  4873. When conducting reverse domain matching, D2 constructs a reverse
  4874. FQDN from the lease address in the request and compare that against
  4875. the name of each reverse DDNS Domain. Again, the domain whose name matches
  4876. the longest portion of the FQDN is considered the best match. For instance,
  4877. if the lease address is "172.16.1.40" and there are two reverse domains in
  4878. the catalog: "1.16.172.in-addr.arpa." and "16.172.in-addr.arpa", the
  4879. former is the best match. As with forward matching, it is possible to not
  4880. find a suitable match. Given the same two domains, there would be no
  4881. match for the lease address, "192.168.1.50", and the request would be
  4882. rejected. Finally, if there are no reverse DDNS Domains defined, D2 will
  4883. simply disregard the reverse update portion of requests.
  4884. </para>
  4885. <section id="dhcp-ddns-server-start-stop">
  4886. <title>Starting and Stopping the DHCP-DDNS Server</title>
  4887. <para>
  4888. <command>b10-dhcp-ddns</command> is the BIND 10 DHCP-DDNS server and,
  4889. like other parts of BIND 10, is configured through the
  4890. <command>bindctl</command> program.
  4891. </para>
  4892. <para>
  4893. After starting BIND 10 and entering bindctl, the first step in
  4894. configuring the server is to add it to the list of running BIND 10
  4895. services.
  4896. <screen>
  4897. &gt; <userinput>config add Init/components b10-dhcp-ddns</userinput>
  4898. &gt; <userinput>config set Init/components/b10-dhcp-ddns/kind dispensable</userinput>
  4899. &gt; <userinput>config commit</userinput>
  4900. </screen>
  4901. </para>
  4902. <para>
  4903. To remove <command>b10-dhcp-ddns</command> from the set of running services,
  4904. the <command>b10-dhcp-ddns</command> is removed from list of Init components:
  4905. <screen>
  4906. &gt; <userinput>config remove Init/components b10-dhcp-ddns</userinput>
  4907. &gt; <userinput>config commit</userinput>
  4908. </screen>
  4909. </para>
  4910. <para>
  4911. Note that the server was only removed from the list, so it will not be
  4912. automatically restarted, but the server itself is still running. Hence it
  4913. is usually desired to stop it:
  4914. </para>
  4915. <screen>
  4916. &gt; <userinput>DhcpDdns shutdown</userinput>
  4917. </screen>
  4918. <para>
  4919. Upon start up the module will load its configuration and begin listening
  4920. for NCRs based on that configuration.
  4921. </para>
  4922. </section> <!-- end start-stop -->
  4923. <section id="d2-configuration">
  4924. <title>Configuring the DHCP-DDNS Server</title>
  4925. <para>
  4926. Once the server is started, it can be configured. To view the
  4927. current configuration, use the following command in <command>bindctl</command>:
  4928. <screen>
  4929. &gt; <userinput>config show DhcpDdns</userinput></screen>
  4930. When starting b10-dhcp-ddns module for the first time, the default
  4931. configuration will be available. It will look similar to this:
  4932. <screen>
  4933. &gt; <userinput>config show DhcpDdns</userinput>
  4934. DhcpDdns/ip_address "127.0.0.1" string (default)
  4935. DhcpDdns/port 53001 integer (default)
  4936. DhcpDdns/dns_server_timeout 100 integer (default)
  4937. DhcpDdns/ncr_protocol "UDP" string (default)
  4938. DhcpDdns/ncr_format "JSON" string (default)
  4939. DhcpDdns/tsig_keys [] list (default)
  4940. DhcpDdns/forward_ddns/ddns_domains [] list (default)
  4941. DhcpDdns/reverse_ddns/ddns_domains [] list (default)
  4942. </screen>
  4943. <para>
  4944. (While displayed, the parameter "interface" is not implemented, and
  4945. will be removed in the near future.)
  4946. </para>
  4947. </para>
  4948. <para>
  4949. The configuration can be divided as follows, each of which is described
  4950. in its own section:
  4951. </para>
  4952. <itemizedlist>
  4953. <listitem>
  4954. <simpara>
  4955. <command>Global Server Parameters</command> &mdash;
  4956. values which control connectivity and global server behavior
  4957. </simpara>
  4958. </listitem>
  4959. <listitem>
  4960. <simpara>
  4961. <command>TSIG Key Info</command> &mdash;
  4962. defines the TSIG keys used for secure traffic with DNS servers
  4963. </simpara>
  4964. </listitem>
  4965. <listitem>
  4966. <simpara>
  4967. <command>Forward DDNS</command> &mdash;
  4968. defines the catalog of Forward DDNS Domains
  4969. </simpara>
  4970. </listitem>
  4971. <listitem>
  4972. <simpara>
  4973. <command>Reverse DDNS</command> &mdash;
  4974. defines the catalog of Forward DDNS Domains
  4975. </simpara>
  4976. </listitem>
  4977. </itemizedlist>
  4978. <section id="d2-server-parameter-config">
  4979. <title>Global Server Parameters</title>
  4980. <orderedlist>
  4981. <listitem><para>
  4982. ip_address - IP address on which D2 listens for requests. The default is
  4983. the local loopback interface at address 127.0.0.1. You may specify
  4984. either an IPv4 or IPv6 address.
  4985. </para></listitem>
  4986. <listitem><para>
  4987. port - Port on which D2 listens for requests. The default value
  4988. is 53001.
  4989. </para></listitem>
  4990. <listitem><para>
  4991. ncr_format - Socket protocol to use when sending requests to D2.
  4992. Currently only UDP is supported. TCP may be available in an upcoming
  4993. release.
  4994. </para></listitem>
  4995. <listitem><para>
  4996. ncr_protocol - Packet format to use when sending requests to D2.
  4997. Currently only JSON format is supported. Other formats may be available
  4998. in future releases.
  4999. </para></listitem>
  5000. <listitem><para>
  5001. dns_server_timeout - The maximum amount of time in milliseconds, that
  5002. D2 will wait for a response from a DNS server to a single DNS update
  5003. message.
  5004. </para></listitem>
  5005. </orderedlist>
  5006. <para>
  5007. D2 must listen for change requests on a known address and port. By
  5008. default it listens at 127.0.0.1 on port 53001. The following example
  5009. illustrates how to change D2's global parameters so it will listen
  5010. at 192.168.1.10 port 900:
  5011. <screen>
  5012. &gt; <userinput>config set DhcpDdns/ip_address "192.168.1.10"</userinput>
  5013. &gt; <userinput>config set DhcpDdns/port 900</userinput>
  5014. &gt; <userinput>config commit</userinput>
  5015. </screen>
  5016. </para>
  5017. <warning>
  5018. <simpara>
  5019. When the DHCP-DDNS server is configured to listen at an address
  5020. other than the loopback address (127.0.0.1 or ::1), it is possible
  5021. for a malicious attacker to send bogus NameChangeRequests to it
  5022. and change entries in the DNS. For this reason, addresses other
  5023. than the IPv4 or IPv6 loopback addresses should only be used
  5024. for testing purposes. A future version of Kea will implement
  5025. authentication to guard against such attacks.
  5026. </simpara>
  5027. </warning>
  5028. <note>
  5029. <simpara>
  5030. If the ip_address and port are changed, it will be necessary to change the
  5031. corresponding values in the DHCP servers' "dhcp-ddns" configuration section.
  5032. </simpara>
  5033. </note>
  5034. </section> <!-- "d2-server-parameter-config" -->
  5035. <section id="d2-tsig-key-list-config">
  5036. <title>TSIG Key List</title>
  5037. <para>
  5038. A DDNS protocol exchange can be conducted with or without TSIG
  5039. (defined in <ulink url="http://tools.ietf/org/html/rfc2845">RFC
  5040. 2845</ulink>). This configuration section allows the administrator
  5041. to define the set of TSIG keys that may be used in such
  5042. exchanges.</para>
  5043. <para>To use TSIG when updating entries in a DNS Domain,
  5044. a key must be defined in the TSIG Key List and referenced by
  5045. name in that domain's configuration entry. When D2 matches a
  5046. change request to a domain, it checks whether the domain has
  5047. a TSIG key associated with it. If so, D2 will use that key to
  5048. sign DNS update messages sent to and verify repsonses received
  5049. from the domain's DNS server(s). For each TSIG key required by
  5050. the DNS servers that D2 will be working with there must be a
  5051. corresponding TSIG key in the TSIG Key list.</para>
  5052. <para>
  5053. As one might gather from the name, the tsig_key section of the
  5054. D2 configuration lists the TSIG keys. Each entry describes a
  5055. TSIG key used by one or more DNS servers to authenticate requests
  5056. and sign responses. Every entry in the list has three parameters:
  5057. <itemizedlist>
  5058. <listitem>
  5059. <simpara>
  5060. <command>name</command> &mdash;
  5061. a unique text label used to identify this key within the
  5062. list. This value is used to specify which key (if any) should be
  5063. used when updating a specific domain. So long as it is unique its
  5064. content is arbitrary, although for clarity and ease of maintenance
  5065. it is recommended that it match the name used on the DNS server(s).
  5066. It cannot be blank.
  5067. </simpara>
  5068. </listitem>
  5069. <listitem>
  5070. <simpara>
  5071. <command>algorithm</command> &mdash;
  5072. specifies which hashing algorithm should be used with this
  5073. key. This value must specify the same algorithm used for the
  5074. key on the DNS server(s). The supported algorithms are listed below:
  5075. <itemizedlist>
  5076. <listitem>
  5077. <command>HMAC-MD5</command>
  5078. </listitem>
  5079. <listitem>
  5080. <command>HMAC-SHA1</command>
  5081. </listitem>
  5082. <listitem>
  5083. <command>HMAC-SHA224</command>
  5084. </listitem>
  5085. <listitem>
  5086. <command>HMAC-SHA256</command>
  5087. </listitem>
  5088. <listitem>
  5089. <command>HMAC-SHA384</command>
  5090. </listitem>
  5091. <listitem>
  5092. <command>HMAC-SHA512</command>
  5093. </listitem>
  5094. </itemizedlist>
  5095. This value is not case sensitive.
  5096. </simpara>
  5097. </listitem>
  5098. <listitem>
  5099. <simpara>
  5100. <command>secret</command> &mdash;
  5101. is used to specify the shared secret key code for this key. This value is
  5102. case sensitive and must exactly match the value specified on the DNS server(s).
  5103. It is a base64-encoded text value.
  5104. </simpara>
  5105. </listitem>
  5106. </itemizedlist>
  5107. </para>
  5108. <para>
  5109. As an example, suppose that a domain D2 will be updating is
  5110. maintained by a BIND9 DNS server which requires dynamic updates
  5111. to be secured with TSIG. Suppose further that the entry for
  5112. the TSIG key in BIND9's named.conf file looks like this:
  5113. <screen>
  5114. :
  5115. key "key.four.example.com." {
  5116. algorithm hmac-sha224;
  5117. secret "bZEG7Ow8OgAUPfLWV3aAUQ==";
  5118. };
  5119. :
  5120. </screen>
  5121. By default, the TSIG Key list is empty:
  5122. <screen>
  5123. <userinput>> config show DhcpDdns/tsig_keys</userinput>
  5124. DhcpDdns/tsig_keys [] list (default)
  5125. </screen>
  5126. We must first create a new key in the list:
  5127. <screen>
  5128. <userinput>> config add DhcpDdns/tsig_keys</userinput>
  5129. </screen>
  5130. Displaying the new element, reveals:
  5131. <screen>
  5132. <userinput>> config show DhcpDdns/tsig_keys[0]</userinput>
  5133. DhcpDdns/tsig_keys[0]/name "" string (default)
  5134. DhcpDdns/tsig_keys[0]/algorithm "HMAC-MD5" string (modified)
  5135. DhcpDdns/tsig_keys[0]/secret "" string (default)
  5136. </screen>
  5137. Now set all three values to match BIND9's key:
  5138. <screen>
  5139. <userinput>> config set DhcpDdns/tsig_keys[0]/name "key.four.example.com"</userinput>
  5140. <userinput>> config set DhcpDdns/tsig_keys[0]/algorithm "HMAC-SHA224"</userinput>
  5141. <userinput>> config set DhcpDdns/tsig_keys[0]/secret "bZEG7Ow8OgAUPfLWV3aAUQ=="</userinput>
  5142. <userinput>> config commit</userinput>
  5143. </screen>
  5144. </para>
  5145. These steps would be repeated for each TSIG key needed. Note that the same TSIG key
  5146. can be used with more than one domain.
  5147. </section> <!-- "d2-tsig-key-list-config" -->
  5148. <section id="d2-forward-ddns-config">
  5149. <title>Forward DDNS</title>
  5150. <para>
  5151. The Forward DDNS section is used to configure D2's forward update
  5152. behavior. Currently it contains a single parameter, the catalog of
  5153. forward DDNS Domains:
  5154. <screen>
  5155. <userinput>> config show DhcpDdns/forward_ddns/</userinput>
  5156. DhcpDdns/forward_ddns/ddns_domains [] list (default)
  5157. </screen>
  5158. By default, this list is empty, which will cause the server to ignore
  5159. the forward update portions of requests.
  5160. </para>
  5161. <section id="add-forward-ddns-domain">
  5162. <title>Adding Forward DDNS Domains</title>
  5163. <para>
  5164. A forward DDNS Domain maps a forward DNS zone to a set of DNS servers
  5165. which maintain the forward DNS data for that zone. You will need one
  5166. forward DDNS Domain for each zone you wish to service. It may very
  5167. well be that some or all of your zones are maintained by the same
  5168. servers. You will still need one DDNS Domain per zone. Remember that
  5169. matching a request to the appropriate server(s) is done by zone and
  5170. a DDNS Domain only defines a single zone.
  5171. </para>
  5172. <para>
  5173. The section describes how to add Forward DDNS Domains. Repeat these
  5174. steps for each Forward DDNS Domain desired. Each Forward DDNS Domain
  5175. has the following parameters:
  5176. <itemizedlist>
  5177. <listitem>
  5178. <simpara>
  5179. <command>name</command> &mdash;
  5180. The fully qualified domain name (or zone) that this DDNS Domain
  5181. can update. This is value used to compare against the request
  5182. FQDN during forward matching. It must be unique within the
  5183. catalog.
  5184. </simpara>
  5185. </listitem>
  5186. <listitem>
  5187. <simpara>
  5188. <command>key_name</command> &mdash;
  5189. If TSIG is used with this domain's servers, this
  5190. value should be the name of the key from within the TSIG Key List
  5191. to use. If the value is blank (the default), TSIG will not be
  5192. used in DDNS conversations with this domain's servers. Currently
  5193. TSIG has not been implemented, so this value is ignored.
  5194. </simpara>
  5195. </listitem>
  5196. <listitem>
  5197. <simpara>
  5198. <command>dns_servers</command> &mdash;
  5199. A list of one or more DNS servers which can conduct the server
  5200. side of the DDNS protocol for this domain. The servers
  5201. are used in a first to last preference. In other words, when D2
  5202. begins to process a request for this domain it will pick the
  5203. first server in this list and attempt to communicate with it.
  5204. If that attempt fails, it will move to next one in the list and
  5205. so on until the it achieves success or the list is exhausted.
  5206. </simpara>
  5207. </listitem>
  5208. </itemizedlist>
  5209. To create a new forward DDNS Domain, one must first add a new domain
  5210. element:
  5211. <screen>
  5212. <userinput>> config add DhcpDdns/forward_ddns/ddns_domains</userinput>
  5213. </screen>
  5214. Displaying the DDNS Domain reveals this:
  5215. <screen>
  5216. <userinput>> config show DhcpDdns/forward_ddns/ddns_domains[0]</userinput>
  5217. DhcpDdns/forward_ddns/ddns_domains[0]/name "" string (default)
  5218. DhcpDdns/forward_ddns/ddns_domains[0]/key_name "" string (default)
  5219. DhcpDdns/forward_ddns/ddns_domains[0]/dns_servers [] list (default)
  5220. </screen>
  5221. To set the domain's name to "other.example.com":
  5222. <screen>
  5223. <userinput>> config set DhcpDdns/forward_ddns/ddns_domains[1]/name "other.example.com"</userinput>
  5224. <userinput>> config commit</userinput>
  5225. </screen>
  5226. It is permissible to add a domain without any servers. If that domain
  5227. should be matched to a request, however, the request will fail. In
  5228. order to make the domain useful though, we must add at least one DNS
  5229. server to it.
  5230. </para>
  5231. <section id="add-forward-dns-servers">
  5232. <title>Adding Forward DNS Servers</title>
  5233. <para>
  5234. The section describes how to add DNS servers to a Forward DDNS Domain.
  5235. Repeat them for as many servers as desired for a each domain.
  5236. </para>
  5237. <para>
  5238. Forward DNS Server entries represent actual DNS servers which
  5239. support the server side of the DDNS protocol. Each Forward DNS Server
  5240. has the following parameters:
  5241. <itemizedlist>
  5242. <listitem>
  5243. <simpara>
  5244. <command>hostname</command> &mdash;
  5245. The resolvable host name of the DNS server. This value is not
  5246. yet implemented.
  5247. </simpara>
  5248. </listitem>
  5249. <listitem>
  5250. <simpara>
  5251. <command>ip_address</command> &mdash;
  5252. The IP address at which the server listens for DDNS requests.
  5253. This may be either an IPv4 or an IPv6 address.
  5254. </simpara>
  5255. </listitem>
  5256. <listitem>
  5257. <simpara>
  5258. <command>port</command> &mdash;
  5259. The port on which the server listens for DDNS requests. It
  5260. defaults to the standard DNS service port of 53.
  5261. </simpara>
  5262. </listitem>
  5263. </itemizedlist>
  5264. To create a new forward DNS Server, one must first add a new server
  5265. element to the domain:
  5266. <screen>
  5267. <userinput>> config add DhcpDdns/forward_ddns/ddns_domains[0]/dns_servers</userinput>
  5268. </screen>
  5269. Displaying the DNS Server element should appear as follows:
  5270. <screen>
  5271. <userinput>> config show DhcpDdns/forward_ddns/ddns_domains[0]/dns_servers[0]</userinput>
  5272. DhcpDdns/forward_ddns/ddns_domains[0]/dns_servers[0]/hostname "" string (default)
  5273. DhcpDdns/forward_ddns/ddns_domains[0]/dns_servers[0]/ip_address "" string (default)
  5274. DhcpDdns/forward_ddns/ddns_domains[0]/dns_servers[0]/port 53 integer(default)
  5275. </screen>
  5276. As stated earlier, "hostname" is not yet supported so, the parameter
  5277. "ip_address" must be set to the address of the DNS server. If for
  5278. example the service is running at "172.88.99.10", then set it as
  5279. follows:
  5280. <screen>
  5281. <userinput>> config set DhcpDdns/forward_ddns/ddns_domains[0]/dns_servers[0]/ip_address "172.88.99.10"</userinput>
  5282. <userinput>> config commit</userinput>
  5283. </screen>
  5284. </para>
  5285. </section> <!-- "add-forward-dns-servers" -->
  5286. </section> <!-- "add-forward-ddns-domains" -->
  5287. </section> <!-- "d2-forward-ddns-config" -->
  5288. <section id="d2-reverse-ddns-config">
  5289. <title>Reverse DDNS</title>
  5290. <para>
  5291. The Reverse DDNS section is used to configure D2's reverse update
  5292. behavior, and the concepts are the same as for the forward DDNS
  5293. section. Currently it contains a single parameter, the catalog of
  5294. reverse DDNS Domains:
  5295. <screen>
  5296. <userinput>> config show DhcpDdns/reverse_ddns/</userinput>
  5297. DhcpDdns/reverse_ddns/ddns_domains [] list (default)
  5298. </screen>
  5299. By default, this list is empty, which will cause the server to ignore
  5300. the reverse update portions of requests.
  5301. </para>
  5302. <section id="add-reverse-ddns-domain">
  5303. <title>Adding Reverse DDNS Domains</title>
  5304. <para>
  5305. A reverse DDNS Domain maps a reverse DNS zone to a set of DNS servers
  5306. which maintain the reverse DNS data for that zone. You will need one
  5307. reverse DDNS Domain for each zone you wish to service. It may very
  5308. well be that some or all of your zones are maintained by the same
  5309. servers; even then, you will still need one DDNS Domain entry for each
  5310. zone. Remember that
  5311. matching a request to the appropriate server(s) is done by zone and
  5312. a DDNS Domain only defines a single zone.
  5313. </para>
  5314. <para>
  5315. The section describes how to add Reverse DDNS Domains. Repeat these
  5316. steps for each Reverse DDNS Domain desired. Each Reverse DDNS Domain
  5317. has the following parameters:
  5318. <itemizedlist>
  5319. <listitem>
  5320. <simpara>
  5321. <command>name</command> &mdash;
  5322. The fully qualified reverse zone that this DDNS Domain
  5323. can update. This is the value used during reverse matching
  5324. which will compare it with a reversed version of the request's
  5325. lease address. The zone name should follow the appropriate
  5326. standards: for example, to to support the IPv4 subnet 172.16.1,
  5327. the name should be. "1.16.172.in-addr.arpa.". Similarly,
  5328. to support an IPv6 subent of 2001:db8:1, the name should be
  5329. "1.0.0.0.8.B.D.0.1.0.0.2.ip6.arpa."
  5330. Whatever the name, it must be unique within the catalog.
  5331. </simpara>
  5332. </listitem>
  5333. <listitem>
  5334. <simpara>
  5335. <command>key_name</command> &mdash;
  5336. If TSIG should be used with this domain's servers, then this
  5337. value should be the name of that key from the TSIG Key List.
  5338. If the value is blank (the default), TSIG will not be
  5339. used in DDNS conversations with this domain's servers. Currently
  5340. this value is not used as TSIG has not been implemented.
  5341. </simpara>
  5342. </listitem>
  5343. <listitem>
  5344. <simpara>
  5345. <command>dns_servers</command> &mdash;
  5346. a list of one or more DNS servers which can conduct the server
  5347. side of the DDNS protocol for this domain. Currently the servers
  5348. are used in a first to last preference. In other words, when D2
  5349. begins to process a request for this domain it will pick the
  5350. first server in this list and attempt to communicate with it.
  5351. If that attempt fails, it will move to next one in the list and
  5352. so on until the it achieves success or the list is exhausted.
  5353. </simpara>
  5354. </listitem>
  5355. </itemizedlist>
  5356. To create a new reverse DDNS Domain, one must first add a new domain
  5357. element:
  5358. <screen>
  5359. <userinput>> config add DhcpDdns/reverse_ddns/ddns_domains</userinput>
  5360. </screen>
  5361. Displaying the DDNS Domain reveals this:
  5362. <screen>
  5363. <userinput>> config show DhcpDdns/reverse_ddns/ddns_domains[0]</userinput>
  5364. DhcpDdns/reverse_ddns/ddns_domains[0]/name "" string (default)
  5365. DhcpDdns/reverse_ddns/ddns_domains[0]/key_name "" string (default)
  5366. DhcpDdns/reverse_ddns/ddns_domains[0]/dns_servers [] list (default)
  5367. </screen>
  5368. For domain supporting the subnet 2001:db8:1::, we would set the
  5369. domain's name as follows:
  5370. <screen>
  5371. <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>
  5372. <userinput>> config commit</userinput>
  5373. </screen>
  5374. It is permissible to add a domain without any servers. If that domain
  5375. should be matched to a request, however, the request will fail. In
  5376. order to make the domain useful though, we must add at least one DNS
  5377. server to it.
  5378. </para>
  5379. <section id="add-reverse-dns-servers">
  5380. <title>Adding Reverse DNS Servers</title>
  5381. <para>
  5382. The section describes how to add DNS servers to a Reverse DDNS Domain.
  5383. Repeat them for as many servers as desired for a each domain.
  5384. </para>
  5385. <para>
  5386. Reverse DNS Server entries represents a actual DNS servers which
  5387. support the server side of the DDNS protocol. Each Reverse DNS Server
  5388. has the following parameters:
  5389. <itemizedlist>
  5390. <listitem>
  5391. <simpara>
  5392. <command>hostname</command> &mdash;
  5393. The resolvable host name of the DNS server. This value is
  5394. currently ignored.
  5395. </simpara>
  5396. </listitem>
  5397. <listitem>
  5398. <simpara>
  5399. <command>ip_address</command> &mdash;
  5400. The IP address at which the server listens for DDNS requests.
  5401. </simpara>
  5402. </listitem>
  5403. <listitem>
  5404. <simpara>
  5405. <command>port</command> &mdash;
  5406. The port on which the server listens for DDNS requests. It
  5407. defaults to the standard DNS service port of 53.
  5408. </simpara>
  5409. </listitem>
  5410. </itemizedlist>
  5411. To create a new reverse DNS Server, one must first add a new server
  5412. element to the domain:
  5413. <screen>
  5414. <userinput>> config add DhcpDdns/reverse_ddns/ddns_domains[0]/dns_servers</userinput>
  5415. </screen>
  5416. Displaying the DNS Server element should appear as follows:
  5417. <screen>
  5418. <userinput>> config show DhcpDdns/reverse_ddns/ddns_domains[0]/dns_servers[0]</userinput>
  5419. DhcpDdns/reverse_ddns/ddns_domains[0]/dns_servers[0]/hostname "" string (default)
  5420. DhcpDdns/reverse_ddns/ddns_domains[0]/dns_servers[0]/ip_address "" string (default)
  5421. DhcpDdns/reverse_ddns/ddns_domains[0]/dns_servers[0]/port 53 integer(default)
  5422. </screen>
  5423. As stated earlier, "hostname" is not yet supported so, the parameter
  5424. "ip_address" must be set to the address of the DNS server. If for
  5425. example the service is running at "172.88.99.10", then set it as
  5426. follows:
  5427. <screen>
  5428. <userinput>> config set DhcpDdns/reverse_ddns/ddns_domains[0]/dns_servers[0]/ip_address "172.88.99.10"</userinput>
  5429. <userinput>> config commit</userinput>
  5430. </screen>
  5431. </para>
  5432. </section> <!-- "add-reverse-dns-servers" -->
  5433. </section> <!-- "add-reverse-ddns-domains" -->
  5434. </section> <!-- "d2-reverse-ddns-config" -->
  5435. <section id="d2-exmaple-config">
  5436. <title>Example DHCP-DDNS Server Configuration</title>
  5437. <para>
  5438. This section provides an example DHCP-DDNS server configuration based
  5439. on a small example network. Let's suppose our example network has
  5440. three domains, each with their own subnet.
  5441. <table>
  5442. <title>Our example network</title>
  5443. <tgroup cols='4' align='left'>
  5444. <colspec colname='domain'/>
  5445. <colspec colname='subnet'/>
  5446. <colspec colname='fservers'/>
  5447. <colspec colname='rservers'/>
  5448. <thead>
  5449. <row>
  5450. <entry>Domain</entry>
  5451. <entry>Subnet</entry>
  5452. <entry>Forward DNS Servers</entry>
  5453. <entry>Reverse DNS Servers</entry>
  5454. </row>
  5455. </thead>
  5456. <tbody>
  5457. <row>
  5458. <entry>four.example.com</entry>
  5459. <entry>192.0.2.0/24</entry>
  5460. <entry>172.16.1.5, 172.16.2.5</entry>
  5461. <entry>172.16.1.5, 172.16.2.5</entry>
  5462. </row>
  5463. <row>
  5464. <entry>six.example.com</entry>
  5465. <entry>2001:db8:1::/64</entry>
  5466. <entry>3001:1::50</entry>
  5467. <entry>3001:1::51</entry>
  5468. </row>
  5469. <row>
  5470. <entry>example.com</entry>
  5471. <entry>192.0.0.0/16</entry>
  5472. <entry>172.16.2.5</entry>
  5473. <entry>172.16.2.5</entry>
  5474. </row>
  5475. </tbody>
  5476. </tgroup>
  5477. </table>
  5478. </para>
  5479. <para>
  5480. We need to construct three forward DDNS Domains:
  5481. <table>
  5482. <title>Forward DDNS Domains Needed</title>
  5483. <tgroup cols='3' align='left'>
  5484. <colspec colname='num'/>
  5485. <colspec colname='name'/>
  5486. <colspec colname='servers'/>
  5487. <thead>
  5488. <row>
  5489. <entry>#</entry>
  5490. <entry>DDNS Domain Name</entry>
  5491. <entry>DNS Servers</entry>
  5492. </row>
  5493. </thead>
  5494. <tbody>
  5495. <row>
  5496. <entry>1.</entry>
  5497. <entry>four.example.com.</entry>
  5498. <entry>172.16.1.5, 172.16.2.5</entry>
  5499. </row>
  5500. <row>
  5501. <entry>2.</entry>
  5502. <entry>six.example.com.</entry>
  5503. <entry>3001:1::50</entry>
  5504. </row>
  5505. <row>
  5506. <entry>3.</entry>
  5507. <entry>example.com.</entry>
  5508. <entry>172.16.2.5</entry>
  5509. </row>
  5510. </tbody>
  5511. </tgroup>
  5512. </table>
  5513. As discussed earlier, FQDN to domain matching is based on the longest
  5514. match. The FQDN, "myhost.four.example.com.", will match the first
  5515. domain ("four.example.com") while "admin.example.com." will match the
  5516. third domain ("example.com"). The
  5517. FQDN, "other.example.net." will fail to match any domain and would
  5518. be rejected.
  5519. </para>
  5520. <para>
  5521. The following series of commands in bindctl will create the Forward
  5522. DDNS Domains.
  5523. <screen>
  5524. <userinput>
  5525. > config add DhcpDdns/forward_ddns/ddns_domains
  5526. > config set DhcpDdns/forward_ddns/ddns_domains[0]/name "four.example.com."
  5527. > config add DhcpDdns/forward_ddns/ddns_domains[0]/dns_servers
  5528. > config set DhcpDdns/forward_ddns/ddns_domains[0]/dns_servers[0]/ip_address "172.16.1.5"
  5529. > config add DhcpDdns/forward_ddns/ddns_domains[0]/dns_servers
  5530. > config set DhcpDdns/forward_ddns/ddns_domains[0]/dns_servers[1]/ip_address "172.16.2.5"
  5531. >
  5532. > config add DhcpDdns/forward_ddns/ddns_domains
  5533. > config set DhcpDdns/forward_ddns/ddns_domains[1]/name "six.example.com."
  5534. > config add DhcpDdns/forward_ddns/ddns_domains[1]/dns_servers
  5535. > config set DhcpDdns/forward_ddns/ddns_domains[1]/dns_servers[0]/ip_address "3001:1::50:"
  5536. >
  5537. > config add DhcpDdns/forward_ddns/ddns_domains
  5538. > config set DhcpDdns/forward_ddns/ddns_domains[2]/name "example.com."
  5539. > config add DhcpDdns/forward_ddns/ddns_domains[2]/dns_servers
  5540. > config set DhcpDdns/forward_ddns/ddns_domains[2]/dns_servers[0]/ip_address "172.16.2.5"
  5541. >
  5542. > config commit
  5543. </userinput>
  5544. </screen>
  5545. </para>
  5546. <para>
  5547. Similarly, we need to construct the three reverse DDNS Domains:
  5548. <table>
  5549. <title>Reverse DDNS Domains Needed</title>
  5550. <tgroup cols='3' align='left'>
  5551. <colspec colname='num'/>
  5552. <colspec colname='DDNS Domain name'/>
  5553. <colspec colname='DDNS Domain DNS Servers'/>
  5554. <thead>
  5555. <row>
  5556. <entry>#</entry>
  5557. <entry>DDNS Domain Name</entry>
  5558. <entry>DNS Servers</entry>
  5559. </row>
  5560. </thead>
  5561. <tbody>
  5562. <row>
  5563. <entry>1.</entry>
  5564. <entry>2.0.192.in-addr.arpa.</entry>
  5565. <entry>172.16.1.5, 172.16.2.5</entry>
  5566. </row>
  5567. <row>
  5568. <entry>2.</entry>
  5569. <entry>1.0.0.0.8.d.b.0.1.0.0.2.ip6.arpa.</entry>
  5570. <entry>3001:1::50</entry>
  5571. </row>
  5572. <row>
  5573. <entry>3.</entry>
  5574. <entry>0.182.in-addr.arpa.</entry>
  5575. <entry>172.16.2.5</entry>
  5576. </row>
  5577. </tbody>
  5578. </tgroup>
  5579. </table>
  5580. An address of "192.0.2.150" will match the first domain,
  5581. "2001:db8:1::10" will match the second domain, and "192.0.50.77"
  5582. the third domain.
  5583. </para>
  5584. <para>
  5585. The following series of commands in bindctl will create our Reverse
  5586. DDNS Domains.
  5587. <screen>
  5588. <userinput>
  5589. > config add DhcpDdns/reverse_ddns/ddns_domains
  5590. > config set DhcpDdns/reverse_ddns/ddns_domains[0]/name "2.0.192.in-addr.arpa."
  5591. > config add DhcpDdns/reverse_ddns/ddns_domains[0]/dns_servers
  5592. > config set DhcpDdns/reverse_ddns/ddns_domains[0]/dns_servers[0]/ip_address "172.16.1.5"
  5593. > config add DhcpDdns/reverse_ddns/ddns_domains[0]/dns_servers
  5594. > config set DhcpDdns/reverse_ddns/ddns_domains[0]/dns_servers[1]/ip_address "172.16.2.5"
  5595. >
  5596. > config add DhcpDdns/reverse_ddns/ddns_domains
  5597. > config set DhcpDdns/reverse_ddns/ddns_domains[1]/name "1.0.0.0.8.d.b.0.1.0.0.2.ip6.arpa."
  5598. > config add DhcpDdns/reverse_ddns/ddns_domains[1]/dns_servers
  5599. > config set DhcpDdns/reverse_ddns/ddns_domains[1]/dns_servers[0]/ip_address "3001:1::50:"
  5600. >
  5601. > config add DhcpDdns/reverse_ddns/ddns_domains
  5602. > config set DhcpDdns/reverse_ddns/ddns_domains[2]/name "0.192.in-addr.arpa."
  5603. > config add DhcpDdns/reverse_ddns/ddns_domains[2]/dns_servers
  5604. > config set DhcpDdns/reverse_ddns/ddns_domains[2]/dns_servers[0]/ip_address "172.16.2.5"
  5605. >
  5606. > config commit
  5607. </userinput>
  5608. </screen>
  5609. </para>
  5610. </section> <!-- end of "d2-example" -->
  5611. </section> <!-- end of section "d2-configuration" -->
  5612. <section>
  5613. <title>DHCP-DDNS Server Limitations</title>
  5614. <para>The following are the current limitations of the DHCP-DDNS Server.</para>
  5615. <itemizedlist>
  5616. <listitem>
  5617. <simpara>
  5618. Requests received from the DHCP servers are placed in a
  5619. queue until they are processed. Currently all queued requests
  5620. are lost when the server shuts down.
  5621. </simpara>
  5622. </listitem>
  5623. <listitem>
  5624. <simpara>
  5625. TSIG Authentication (<ulink
  5626. url="http://tools.ietf.org/html/rfc2845">RFC 2845</ulink>)
  5627. is not supported yet.
  5628. </simpara>
  5629. </listitem>
  5630. </itemizedlist>
  5631. </section>
  5632. </chapter> <!-- DHCP-DDNS Server -->
  5633. <chapter id="libdhcp">
  5634. <title>libdhcp++ library</title>
  5635. <para>
  5636. libdhcp++ is a common library written in C++ that handles
  5637. many DHCP-related tasks, including:
  5638. <itemizedlist>
  5639. <listitem>
  5640. <simpara>DHCPv4 and DHCPv6 packets parsing, manipulation and assembly</simpara>
  5641. </listitem>
  5642. <listitem>
  5643. <simpara>Option parsing, manipulation and assembly</simpara>
  5644. </listitem>
  5645. <listitem>
  5646. <simpara>Network interface detection</simpara>
  5647. </listitem>
  5648. <listitem>
  5649. <simpara>Socket operations such as creation, data transmission and reception and socket closing.</simpara>
  5650. </listitem>
  5651. </itemizedlist>
  5652. </para>
  5653. <para>
  5654. While this library is currently used by Kea, it is designed to
  5655. be a portable, universal library, useful for any kind of DHCP-related software.
  5656. </para>
  5657. <!-- TODO: point to doxygen docs -->
  5658. <section id="iface-detect">
  5659. <title>Interface detection and Socket handling</title>
  5660. <para>Both the DHCPv4 and DHCPv6 components share network
  5661. interface detection routines. Interface detection is
  5662. currently supported on Linux, all BSD family (FreeBSD, NetBSD,
  5663. OpenBSD), Mac OS X and Solaris 11 systems.</para>
  5664. <para>DHCPv4 requires special raw socket processing to send and receive
  5665. packets from hosts that do not have IPv4 address assigned yet. Support
  5666. for this operation is implemented on Linux only, so it is likely that
  5667. DHCPv4 component will not work in certain cases on systems other than
  5668. Linux.</para>
  5669. </section>
  5670. <!--
  5671. <section id="packet-handling">
  5672. <title>DHCPv4/DHCPv6 packet handling</title>
  5673. <para>TODO: Describe packet handling here, with pointers to wiki</para>
  5674. </section>
  5675. -->
  5676. </chapter>
  5677. <chapter id="statistics">
  5678. <title>Statistics</title>
  5679. <para>
  5680. The <command>b10-stats</command> process is started by
  5681. <command>b10-init</command>.
  5682. It periodically collects statistics data from various modules
  5683. and aggregates it.
  5684. <!-- TODO -->
  5685. </para>
  5686. <para>
  5687. This stats daemon provides commands to identify if it is
  5688. running, show specified or all statistics data, and show specified
  5689. or all statistics data schema.
  5690. For example, using <command>bindctl</command>:
  5691. <screen>
  5692. &gt; <userinput>Stats show</userinput>
  5693. {
  5694. "Auth": {
  5695. "opcode.iquery": 0,
  5696. "opcode.notify": 10,
  5697. "opcode.query": 869617,
  5698. ...
  5699. "queries.tcp": 1749,
  5700. "queries.udp": 867868
  5701. },
  5702. "Init": {
  5703. "boot_time": "2011-01-20T16:59:03Z"
  5704. },
  5705. "Stats": {
  5706. "boot_time": "2011-01-20T16:59:05Z",
  5707. "last_update_time": "2011-01-20T17:04:05Z",
  5708. "lname": "4d3869d9_a@jreed.example.net",
  5709. "report_time": "2011-01-20T17:04:06Z",
  5710. "timestamp": 1295543046.823504
  5711. }
  5712. }
  5713. </screen>
  5714. </para>
  5715. </chapter>
  5716. <chapter id="logging">
  5717. <title>Logging</title>
  5718. <section>
  5719. <title>Logging configuration</title>
  5720. <para>
  5721. The logging system in Kea is configured through the
  5722. Logging module. All modules will look at the
  5723. configuration in Logging to see what should be logged and
  5724. to where.
  5725. <!-- TODO: what is context of Logging module for readers of this guide? -->
  5726. </para>
  5727. <section>
  5728. <title>Loggers</title>
  5729. <para>
  5730. Within Kea, a message is logged through a component
  5731. called a "logger". Different parts of log messages
  5732. through different loggers, and each logger can be configured
  5733. independently of one another.
  5734. </para>
  5735. <para>
  5736. In the Logging module, you can specify the configuration
  5737. for zero or more loggers; any that are not specified will
  5738. take appropriate default values.
  5739. </para>
  5740. <para>
  5741. The three most important elements of a logger configuration
  5742. are the <option>name</option> (the component that is
  5743. generating the messages), the <option>severity</option>
  5744. (what to log), and the <option>output_options</option>
  5745. (where to log).
  5746. </para>
  5747. <section>
  5748. <title>name (string)</title>
  5749. <para>
  5750. Each logger in the system has a name, the name being that
  5751. of the component using it to log messages. For instance,
  5752. if you want to configure logging for the Dhcp4 module,
  5753. you add an entry for a logger named <quote>Dhcp4</quote>. This
  5754. configuration will then be used by the loggers in the
  5755. Dhcp4 module, and all the libraries used by it.
  5756. </para>
  5757. <!-- TODO: later we will have a way to know names of all modules
  5758. Right now you can only see what their names are if they are running
  5759. (a simple 'help' without anything else in bindctl for instance).
  5760. -->
  5761. <para>
  5762. If you want to specify logging for one specific library
  5763. within the module, you set the name to
  5764. <replaceable>module.library</replaceable>. For example, the
  5765. logger used by the nameserver address store component
  5766. has the full name of <quote>Dhcp4.dhcpsrv</quote>. If
  5767. there is no entry in Logging for a particular library,
  5768. it will use the configuration given for the module.
  5769. </para>
  5770. <para>
  5771. To illustrate this, suppose you want the dhcpsrv library
  5772. to log messages of severity DEBUG, and the rest of the
  5773. Dhcp4 code to log messages of severity INFO. To achieve
  5774. this you specify two loggers, one with the name
  5775. <quote>Dhcp4</quote> and severity INFO, and one with
  5776. the name <quote>Dhcp4.dhcpsrv</quote> with severity
  5777. DEBUG. As there are no entries for other libraries,
  5778. they will use the configuration for the module
  5779. (<quote>Dhcp4</quote>), so giving the desired behavior.
  5780. </para>
  5781. <para>
  5782. One special case is that of a module name of <quote>*</quote>
  5783. (asterisks), which is interpreted as <emphasis>any</emphasis>
  5784. module. You can set global logging options by using this,
  5785. including setting the logging configuration for a library
  5786. that is used by multiple modules (e.g. <quote>*.config</quote>
  5787. specifies the configuration library code in whatever
  5788. module is using it).
  5789. </para>
  5790. <para>
  5791. If there are multiple logger specifications in the
  5792. configuration that might match a particular logger, the
  5793. specification with the more specific logger name takes
  5794. precedence. For example, if there are entries for
  5795. both <quote>*</quote> and <quote>Dhcp4</quote>, the
  5796. Dhcp4 module &mdash; and all libraries it uses &mdash;
  5797. will log messages according to the configuration in the
  5798. second entry (<quote>Dhcp4</quote>). All other modules
  5799. will use the configuration of the first entry
  5800. (<quote>*</quote>).
  5801. </para>
  5802. <para>
  5803. One final note about the naming. When specifying the
  5804. module name within a logger, use the name of the module
  5805. as specified in <command>bindctl</command>, e.g.
  5806. <quote>Dhcp4</quote> for the Dhcp4 module,
  5807. <quote>Dhcp6</quote> for the Dhcp6 module, etc. When
  5808. the message is logged, the message will include the name
  5809. of the logger generating the message, but with the module
  5810. name replaced by the name of the process implementing
  5811. the module (so for example, a message generated by the
  5812. <quote>Dhcp4</quote> logger will appear in the output
  5813. with a logger name of <quote>b10-dhcp4</quote>).
  5814. </para>
  5815. </section>
  5816. <section>
  5817. <title>severity (string)</title>
  5818. <para>
  5819. This specifies the category of messages logged.
  5820. Each message is logged with an associated severity which
  5821. may be one of the following (in descending order of
  5822. severity):
  5823. </para>
  5824. <itemizedlist>
  5825. <listitem>
  5826. <simpara> FATAL </simpara>
  5827. </listitem>
  5828. <listitem>
  5829. <simpara> ERROR </simpara>
  5830. </listitem>
  5831. <listitem>
  5832. <simpara> WARN </simpara>
  5833. </listitem>
  5834. <listitem>
  5835. <simpara> INFO </simpara>
  5836. </listitem>
  5837. <listitem>
  5838. <simpara> DEBUG </simpara>
  5839. </listitem>
  5840. </itemizedlist>
  5841. <para>
  5842. When the severity of a logger is set to one of these
  5843. values, it will only log messages of that severity, and
  5844. the severities above it. The severity may also be set to
  5845. NONE, in which case all messages from that logger are
  5846. inhibited.
  5847. <!-- TODO: worded wrong? If I set to INFO, why would it show DEBUG which is literally below in that list? -->
  5848. </para>
  5849. </section>
  5850. <section>
  5851. <title>output_options (list)</title>
  5852. <para>
  5853. Each logger can have zero or more
  5854. <option>output_options</option>. These specify where log
  5855. messages are sent to. These are explained in detail below.
  5856. </para>
  5857. <para>
  5858. The other options for a logger are:
  5859. </para>
  5860. </section>
  5861. <section>
  5862. <title>debuglevel (integer)</title>
  5863. <para>
  5864. When a logger's severity is set to DEBUG, this value
  5865. specifies what debug messages should be printed. It ranges
  5866. from 0 (least verbose) to 99 (most verbose).
  5867. </para>
  5868. <!-- TODO: complete this sentence:
  5869. The general classification of debug message types is
  5870. TODO; there's a ticket to determine these levels, see #1074
  5871. -->
  5872. <para>
  5873. If severity for the logger is not DEBUG, this value is ignored.
  5874. </para>
  5875. </section>
  5876. <section>
  5877. <title>additive (true or false)</title>
  5878. <para>
  5879. If this is true, the <option>output_options</option> from
  5880. the parent will be used. For example, if there are two
  5881. loggers configured; <quote>Dhcp4</quote> and
  5882. <quote>Dhcp4.dhcpsrv</quote>, and <option>additive</option>
  5883. is true in the second, it will write the log messages
  5884. not only to the destinations specified for
  5885. <quote>Dhcp4.dhcpsrv</quote>, but also to the destinations
  5886. as specified in the <option>output_options</option> in
  5887. the logger named <quote>Dhcp4</quote>.
  5888. </para>
  5889. </section>
  5890. </section>
  5891. <section>
  5892. <title>Output Options</title>
  5893. <para>
  5894. The main settings for an output option are the
  5895. <option>destination</option> and a value called
  5896. <option>output</option>, the meaning of which depends on
  5897. the destination that is set.
  5898. </para>
  5899. <section>
  5900. <title>destination (string)</title>
  5901. <para>
  5902. The destination is the type of output. It can be one of:
  5903. </para>
  5904. <itemizedlist>
  5905. <listitem>
  5906. <simpara> console </simpara>
  5907. </listitem>
  5908. <listitem>
  5909. <simpara> file </simpara>
  5910. </listitem>
  5911. <listitem>
  5912. <simpara> syslog </simpara>
  5913. </listitem>
  5914. </itemizedlist>
  5915. </section>
  5916. <section>
  5917. <title>output (string)</title>
  5918. <para>
  5919. Depending on what is set as the output destination, this
  5920. value is interpreted as follows:
  5921. </para>
  5922. <variablelist>
  5923. <varlistentry>
  5924. <term><option>destination</option> is <quote>console</quote></term>
  5925. <listitem>
  5926. <para>
  5927. The value of output must be one of <quote>stdout</quote>
  5928. (messages printed to standard output) or
  5929. <quote>stderr</quote> (messages printed to standard
  5930. error).
  5931. </para>
  5932. <para>
  5933. Note: if output is set to <quote>stderr</quote> and a lot of
  5934. messages are produced in a short time (e.g. if the logging
  5935. level is set to DEBUG), you may occasionally see some messages
  5936. jumbled up together. This is due to a combination of the way
  5937. that messages are written to the screen and the unbuffered
  5938. nature of the standard error stream. If this occurs, it is
  5939. recommended that output be set to <quote>stdout</quote>.
  5940. </para>
  5941. </listitem>
  5942. </varlistentry>
  5943. <varlistentry>
  5944. <term><option>destination</option> is <quote>file</quote></term>
  5945. <listitem>
  5946. <para>
  5947. The value of output is interpreted as a file name;
  5948. log messages will be appended to this file.
  5949. </para>
  5950. </listitem>
  5951. </varlistentry>
  5952. <varlistentry>
  5953. <term><option>destination</option> is <quote>syslog</quote></term>
  5954. <listitem>
  5955. <para>
  5956. The value of output is interpreted as the
  5957. <command>syslog</command> facility (e.g.
  5958. <emphasis>local0</emphasis>) that should be used
  5959. for log messages.
  5960. </para>
  5961. </listitem>
  5962. </varlistentry>
  5963. </variablelist>
  5964. <para>
  5965. The other options for <option>output_options</option> are:
  5966. </para>
  5967. <section>
  5968. <title>flush (true of false)</title>
  5969. <para>
  5970. Flush buffers after each log message. Doing this will
  5971. reduce performance but will ensure that if the program
  5972. terminates abnormally, all messages up to the point of
  5973. termination are output.
  5974. </para>
  5975. </section>
  5976. <section>
  5977. <title>maxsize (integer)</title>
  5978. <para>
  5979. Only relevant when destination is file, this is maximum
  5980. file size of output files in bytes. When the maximum
  5981. size is reached, the file is renamed and a new file opened.
  5982. (For example, a ".1" is appended to the name &mdash;
  5983. if a ".1" file exists, it is renamed ".2",
  5984. etc.)
  5985. </para>
  5986. <para>
  5987. If this is 0, no maximum file size is used.
  5988. </para>
  5989. <note>
  5990. <simpara>
  5991. Due to a limitation of the underlying logging library
  5992. (log4cplus), rolling over the log files (from ".1" to
  5993. ".2", etc) may show odd results: There can be
  5994. multiple small files at the timing of roll over. This
  5995. can happen when multiple processes try to roll
  5996. over the files simultaneously.
  5997. Version 1.1.0 of log4cplus solved this problem, so if
  5998. this or higher version of log4cplus is used to build
  5999. Kea, it shouldn't happen. Even for older versions
  6000. it is normally expected to happen rarely unless the log
  6001. messages are produced very frequently by multiple
  6002. different processes.
  6003. </simpara>
  6004. </note>
  6005. </section>
  6006. <section>
  6007. <title>maxver (integer)</title>
  6008. <para>
  6009. Maximum number of old log files to keep around when
  6010. rolling the output file. Only relevant when
  6011. <option>destination</option> is <quote>file</quote>.
  6012. </para>
  6013. </section>
  6014. </section>
  6015. </section>
  6016. <section>
  6017. <title>Example session</title>
  6018. <para>
  6019. In this example we want to set the global logging to
  6020. write to the file <filename>/var/log/my_bind10.log</filename>,
  6021. at severity WARN. We want the authoritative server to
  6022. log at DEBUG with debuglevel 40, to a different file
  6023. (<filename>/tmp/debug_messages</filename>).
  6024. </para>
  6025. <para>
  6026. Start <command>bindctl</command>.
  6027. </para>
  6028. <para>
  6029. <screen>["login success "]
  6030. &gt; <userinput>config show Logging</userinput>
  6031. Logging/loggers [] list
  6032. </screen>
  6033. </para>
  6034. <para>
  6035. By default, no specific loggers are configured, in which
  6036. case the severity defaults to INFO and the output is
  6037. written to stderr.
  6038. </para>
  6039. <para>
  6040. Let's first add a default logger:
  6041. </para>
  6042. <!-- TODO: adding the empty loggers makes no sense -->
  6043. <para>
  6044. <screen>&gt; <userinput>config add Logging/loggers</userinput>
  6045. &gt; <userinput>config show Logging</userinput>
  6046. Logging/loggers/ list (modified)
  6047. </screen>
  6048. </para>
  6049. <para>
  6050. The loggers value line changed to indicate that it is no
  6051. longer an empty list:
  6052. </para>
  6053. <para>
  6054. <screen>&gt; <userinput>config show Logging/loggers</userinput>
  6055. Logging/loggers[0]/name "" string (default)
  6056. Logging/loggers[0]/severity "INFO" string (default)
  6057. Logging/loggers[0]/debuglevel 0 integer (default)
  6058. Logging/loggers[0]/additive false boolean (default)
  6059. Logging/loggers[0]/output_options [] list (default)
  6060. </screen>
  6061. </para>
  6062. <para>
  6063. The name is mandatory, so we must set it. We will also
  6064. change the severity as well. Let's start with the global
  6065. logger.
  6066. </para>
  6067. <para>
  6068. <screen>&gt; <userinput>config set Logging/loggers[0]/name *</userinput>
  6069. &gt; <userinput>config set Logging/loggers[0]/severity WARN</userinput>
  6070. &gt; <userinput>config show Logging/loggers</userinput>
  6071. Logging/loggers[0]/name "*" string (modified)
  6072. Logging/loggers[0]/severity "WARN" string (modified)
  6073. Logging/loggers[0]/debuglevel 0 integer (default)
  6074. Logging/loggers[0]/additive false boolean (default)
  6075. Logging/loggers[0]/output_options [] list (default)
  6076. </screen>
  6077. </para>
  6078. <para>
  6079. Of course, we need to specify where we want the log
  6080. messages to go, so we add an entry for an output option.
  6081. </para>
  6082. <para>
  6083. <screen>&gt; <userinput> config add Logging/loggers[0]/output_options</userinput>
  6084. &gt; <userinput> config show Logging/loggers[0]/output_options</userinput>
  6085. Logging/loggers[0]/output_options[0]/destination "console" string (default)
  6086. Logging/loggers[0]/output_options[0]/output "stdout" string (default)
  6087. Logging/loggers[0]/output_options[0]/flush false boolean (default)
  6088. Logging/loggers[0]/output_options[0]/maxsize 0 integer (default)
  6089. Logging/loggers[0]/output_options[0]/maxver 0 integer (default)
  6090. </screen>
  6091. </para>
  6092. <para>
  6093. These aren't the values we are looking for.
  6094. </para>
  6095. <para>
  6096. <screen>&gt; <userinput> config set Logging/loggers[0]/output_options[0]/destination file</userinput>
  6097. &gt; <userinput> config set Logging/loggers[0]/output_options[0]/output /var/log/kea.log</userinput>
  6098. &gt; <userinput> config set Logging/loggers[0]/output_options[0]/maxsize 204800</userinput>
  6099. &gt; <userinput> config set Logging/loggers[0]/output_options[0]/maxver 8</userinput>
  6100. </screen>
  6101. </para>
  6102. <para>
  6103. Which would make the entire configuration for this logger
  6104. look like:
  6105. </para>
  6106. <para>
  6107. <screen>&gt; <userinput> config show all Logging/loggers</userinput>
  6108. Logging/loggers[0]/name "*" string (modified)
  6109. Logging/loggers[0]/severity "WARN" string (modified)
  6110. Logging/loggers[0]/debuglevel 0 integer (default)
  6111. Logging/loggers[0]/additive false boolean (default)
  6112. Logging/loggers[0]/output_options[0]/destination "file" string (modified)
  6113. Logging/loggers[0]/output_options[0]/output "/var/log/kea.log" string (modified)
  6114. Logging/loggers[0]/output_options[0]/flush false boolean (default)
  6115. Logging/loggers[0]/output_options[0]/maxsize 204800 integer (modified)
  6116. Logging/loggers[0]/output_options[0]/maxver 8 integer (modified)
  6117. </screen>
  6118. </para>
  6119. <para>
  6120. That looks OK, so let's commit it before we add the
  6121. configuration for the authoritative server's logger.
  6122. </para>
  6123. <para>
  6124. <screen>&gt; <userinput> config commit</userinput></screen>
  6125. </para>
  6126. <para>
  6127. Now that we have set it, and checked each value along
  6128. the way, adding a second entry is quite similar.
  6129. </para>
  6130. <para>
  6131. <screen>&gt; <userinput> config add Logging/loggers</userinput>
  6132. &gt; <userinput> config set Logging/loggers[1]/name Dhcp4</userinput>
  6133. &gt; <userinput> config set Logging/loggers[1]/severity DEBUG</userinput>
  6134. &gt; <userinput> config set Logging/loggers[1]/debuglevel 40</userinput>
  6135. &gt; <userinput> config add Logging/loggers[1]/output_options</userinput>
  6136. &gt; <userinput> config set Logging/loggers[1]/output_options[0]/destination file</userinput>
  6137. &gt; <userinput> config set Logging/loggers[1]/output_options[0]/output /tmp/dhcp4_debug.log</userinput>
  6138. &gt; <userinput> config commit</userinput>
  6139. </screen>
  6140. </para>
  6141. <para>
  6142. And that's it. Once we have found whatever it was we
  6143. needed the debug messages for, we can simply remove the
  6144. second logger to let the DHCP server use the
  6145. same settings as the rest.
  6146. </para>
  6147. <para>
  6148. <screen>&gt; <userinput> config remove Logging/loggers[1]</userinput>
  6149. &gt; <userinput> config commit</userinput>
  6150. </screen>
  6151. </para>
  6152. <para>
  6153. And every module will now be using the values from the
  6154. logger named <quote>*</quote>.
  6155. </para>
  6156. </section>
  6157. </section>
  6158. <section>
  6159. <title>Logging Message Format</title>
  6160. <para>
  6161. Each message written to the configured logging
  6162. destinations comprises a number of components that identify
  6163. the origin of the message and, if the message indicates
  6164. a problem, information about the problem that may be
  6165. useful in fixing it.
  6166. </para>
  6167. <para>
  6168. Consider the message below logged to a file:
  6169. <screen>2014-04-11 12:58:01.005 INFO [b10-dhcp4.dhcpsrv/27456]
  6170. DHCPSRV_MEMFILE_DB opening memory file lease database: type=memfile universe=4</screen>
  6171. </para>
  6172. <para>
  6173. Note: the layout of messages written to the system logging
  6174. file (syslog) may be slightly different. This message has
  6175. been split across two lines here for display reasons; in the
  6176. logging file, it will appear on one line.)
  6177. </para>
  6178. <para>
  6179. The log message comprises a number of components:
  6180. <variablelist>
  6181. <varlistentry>
  6182. <term>2014-04-11 12:58:01.005</term>
  6183. <!-- TODO: timestamp repeated even if using syslog? -->
  6184. <listitem><para>
  6185. The date and time at which the message was generated.
  6186. </para></listitem>
  6187. </varlistentry>
  6188. <varlistentry>
  6189. <term>INFO</term>
  6190. <listitem><para>
  6191. The severity of the message.
  6192. </para></listitem>
  6193. </varlistentry>
  6194. <varlistentry>
  6195. <term>[b10-dhcp4.dhcpsrv/27456]</term>
  6196. <listitem><para>
  6197. The source of the message. This comprises two components:
  6198. the BIND 10 process generating the message (in this
  6199. case, <command>b10-dhcp4</command>) and the module
  6200. within the program from which the message originated
  6201. (which is the name of the common library used by DHCP server
  6202. implementations).
  6203. </para></listitem>
  6204. </varlistentry>
  6205. <varlistentry>
  6206. <term>DHCPSRV_MEMFILE_DB</term>
  6207. <listitem><para>
  6208. The message identification. Every message in Kea
  6209. has a unique identification, which can be used as an
  6210. index into the <ulink
  6211. url="bind10-messages.html"><citetitle>Kea Messages
  6212. Manual</citetitle></ulink> (<ulink
  6213. url="http://kea.isc.org/docs/bind10-messages.html"
  6214. />) from which more information can be obtained.
  6215. </para></listitem>
  6216. </varlistentry>
  6217. <varlistentry>
  6218. <term>opening memory file lease database: type=memfile universe=4</term>
  6219. <listitem><para>
  6220. A brief description.
  6221. Within this text, information relating to the condition
  6222. that caused the message to be logged will be included.
  6223. In this example, the information is logged that the in-memory
  6224. lease database backend will be used to store DHCP leases.
  6225. </para></listitem>
  6226. </varlistentry>
  6227. </variablelist>
  6228. </para>
  6229. </section>
  6230. </chapter>
  6231. <chapter id="acknowledgements">
  6232. <title>Acknowledgements</title>
  6233. <para>Kea was initially implemented as a collection of applications
  6234. within the BIND 10 framework. Hence, Kea development would not be
  6235. possible without the generous support of BIND 10 project sponsors.</para>
  6236. <para><ulink url="http://jprs.co.jp/">JPRS</ulink> and
  6237. <ulink url="http://cira.ca/">CIRA</ulink> are Patron Level
  6238. sponsors.</para>
  6239. <para><ulink url="https://www.afnic.fr/">AFNIC</ulink>,
  6240. <ulink url="https://www.cnnic.net.cn/">CNNIC</ulink>,
  6241. <ulink url="https://www.nic.cz/">CZ.NIC</ulink>,
  6242. <ulink url="http://www.denic.de/">DENIC eG</ulink>,
  6243. <ulink url="https://www.google.com/">Google</ulink>,
  6244. <ulink url="https://www.ripe.net/">RIPE NCC</ulink>,
  6245. <ulink url="https://registro.br/">Registro.br</ulink>,
  6246. <ulink url="https://nzrs.net.nz/">.nz Registry Services</ulink>, and
  6247. <ulink url="https://www.tcinet.ru/">Technical Center of Internet</ulink>
  6248. are current sponsors.</para>
  6249. <para><ulink url="https://www.afilias.info/">Afilias</ulink>,
  6250. <ulink url="https://www.iis.se/">IIS.SE</ulink>,
  6251. <ulink url="http://www.nominet.org.uk/">Nominet</ulink>, and
  6252. <ulink url="https://www.sidn.nl/">SIDN</ulink> were founding
  6253. sponsors of the project.</para>
  6254. <!-- DHCP sponsorship by Comcast -->
  6255. <para>Support for the development of the DHCPv4, DHCPv6 and
  6256. DHCP-DDNS components is provided by
  6257. <ulink url="http://www.comcast.com/">Comcast</ulink>.</para>
  6258. </chapter>
  6259. <!-- TODO: Add bibliography section (mostly RFCs, probably) -->
  6260. <!-- TODO: how to help: run unit tests, join lists, review trac tickets -->
  6261. <!-- <index> <title>Index</title> </index> -->
  6262. </book>
  6263. <!--
  6264. TODO:
  6265. Overview
  6266. Getting BIND 10 Installed
  6267. Basics
  6268. Dependencies
  6269. Optional
  6270. Advanced
  6271. How Does Everything Work Together?
  6272. Need Help?
  6273. -->