bind10-guide.xml 289 KB

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