bind10-guide.xml 298 KB

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