bind10-guide.xml 297 KB

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