openvpn.8 227 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343
  1. .\" OpenVPN -- An application to securely tunnel IP networks
  2. .\" over a single TCP/UDP port, with support for SSL/TLS-based
  3. .\" session authentication and key exchange,
  4. .\" packet encryption, packet authentication, and
  5. .\" packet compression.
  6. .\"
  7. .\" Copyright (C) 2002-2018 OpenVPN Inc <sales@openvpn.net>
  8. .\"
  9. .\" This program is free software; you can redistribute it and/or modify
  10. .\" it under the terms of the GNU General Public License version 2
  11. .\" as published by the Free Software Foundation.
  12. .\"
  13. .\" This program is distributed in the hope that it will be useful,
  14. .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. .\" GNU General Public License for more details.
  17. .\"
  18. .\" You should have received a copy of the GNU General Public License along
  19. .\" with this program; if not, write to the Free Software Foundation, Inc.,
  20. .\" 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  21. .\"
  22. .\" Manual page for openvpn
  23. .\"
  24. .\" SH section heading
  25. .\" SS subsection heading
  26. .\" LP paragraph
  27. .\" IP indented paragraph
  28. .\" TP hanging label
  29. .\"
  30. .\" .nf -- no formatting
  31. .\" .fi -- resume formatting
  32. .\" .ft 3 -- boldface
  33. .\" .ft -- normal face
  34. .\" .in +|-{n} -- indent
  35. .\"
  36. .\" Support macros - this is not present on all platforms
  37. .\" Continuation line for .TP header.
  38. .de TQ
  39. . br
  40. . ns
  41. . TP \\$1\" no doublequotes around argument!
  42. ..
  43. .\" End of TQ macro
  44. .TH openvpn 8 "28 February 2018"
  45. .\"*********************************************************
  46. .SH NAME
  47. openvpn \- secure IP tunnel daemon.
  48. .\"*********************************************************
  49. .SH SYNOPSIS
  50. .ft 3
  51. openvpn [ options ... ]
  52. .ft
  53. .\"*********************************************************
  54. .SH INTRODUCTION
  55. .LP
  56. OpenVPN is an open source VPN daemon by James Yonan.
  57. Because OpenVPN tries to
  58. be a universal VPN tool offering a great deal of flexibility,
  59. there are a lot of options on this manual page.
  60. If you're new to OpenVPN, you might want to skip ahead to the
  61. examples section where you will see how to construct simple
  62. VPNs on the command line without even needing a configuration file.
  63. Also note that there's more documentation and examples on
  64. the OpenVPN web site:
  65. .I http://openvpn.net/
  66. And if you would like to see a shorter version of this manual,
  67. see the openvpn usage message which can be obtained by
  68. running
  69. .B openvpn
  70. without any parameters.
  71. .\"*********************************************************
  72. .SH DESCRIPTION
  73. .LP
  74. OpenVPN is a robust and highly flexible VPN daemon.
  75. OpenVPN supports SSL/TLS security, ethernet bridging,
  76. TCP or UDP tunnel transport through proxies or NAT,
  77. support for dynamic IP addresses and DHCP,
  78. scalability to hundreds or thousands of users,
  79. and portability to most major OS platforms.
  80. OpenVPN is tightly bound to the OpenSSL library, and derives much
  81. of its crypto capabilities from it.
  82. OpenVPN supports
  83. conventional encryption
  84. using a pre\-shared secret key
  85. .B (Static Key mode)
  86. or
  87. public key security
  88. .B (SSL/TLS mode)
  89. using client & server certificates.
  90. OpenVPN also
  91. supports non\-encrypted TCP/UDP tunnels.
  92. OpenVPN is designed to work with the
  93. .B TUN/TAP
  94. virtual networking interface that exists on most platforms.
  95. Overall, OpenVPN aims to offer many of the key features of IPSec but
  96. with a relatively lightweight footprint.
  97. .\"*********************************************************
  98. .SH OPTIONS
  99. OpenVPN allows any option to be placed either on the command line
  100. or in a configuration file. Though all command line options are preceded
  101. by a double\-leading\-dash ("\-\-"), this prefix can be removed when
  102. an option is placed in a configuration file.
  103. .\"*********************************************************
  104. .TP
  105. .B \-\-help
  106. Show options.
  107. .\"*********************************************************
  108. .TP
  109. .B \-\-config file
  110. Load additional config options from
  111. .B file
  112. where each line corresponds to one command line option,
  113. but with the leading '\-\-' removed.
  114. If
  115. .B \-\-config file
  116. is the only option to the openvpn command,
  117. the
  118. .B \-\-config
  119. can be removed, and the command can be given as
  120. .B openvpn file
  121. Note that
  122. configuration files can be nested to a reasonable depth.
  123. Double quotation or single quotation characters ("", '')
  124. can be used to enclose single parameters containing whitespace,
  125. and "#" or ";" characters in the first column
  126. can be used to denote comments.
  127. Note that OpenVPN 2.0 and higher performs backslash\-based shell
  128. escaping for characters not in single quotations,
  129. so the following mappings should be observed:
  130. .nf
  131. .ft 3
  132. .in +4
  133. \\\\ Maps to a single backslash character (\\).
  134. \\" Pass a literal doublequote character ("), don't
  135. interpret it as enclosing a parameter.
  136. \\[SPACE] Pass a literal space or tab character, don't
  137. interpret it as a parameter delimiter.
  138. .in -4
  139. .ft
  140. .fi
  141. For example on Windows, use double backslashes to
  142. represent pathnames:
  143. .nf
  144. .ft 3
  145. .in +4
  146. secret "c:\\\\OpenVPN\\\\secret.key"
  147. .in -4
  148. .ft
  149. .fi
  150. For examples of configuration files,
  151. see
  152. .I http://openvpn.net/examples.html
  153. Here is an example configuration file:
  154. .nf
  155. .ft 3
  156. .in +4
  157. #
  158. # Sample OpenVPN configuration file for
  159. # using a pre\-shared static key.
  160. #
  161. # '#' or ';' may be used to delimit comments.
  162. # Use a dynamic tun device.
  163. dev tun
  164. # Our remote peer
  165. remote mypeer.mydomain
  166. # 10.1.0.1 is our local VPN endpoint
  167. # 10.1.0.2 is our remote VPN endpoint
  168. ifconfig 10.1.0.1 10.1.0.2
  169. # Our pre\-shared static key
  170. secret static.key
  171. .in -4
  172. .ft
  173. .fi
  174. .\"*********************************************************
  175. .SS Tunnel Options:
  176. .TP
  177. .B \-\-mode m
  178. Set OpenVPN major mode. By default, OpenVPN runs in
  179. point\-to\-point mode ("p2p"). OpenVPN 2.0 introduces
  180. a new mode ("server") which implements a multi\-client
  181. server capability.
  182. .\"*********************************************************
  183. .TP
  184. .B \-\-local host
  185. Local host name or IP address for bind.
  186. If specified, OpenVPN will bind to this address only.
  187. If unspecified, OpenVPN will bind to all interfaces.
  188. .\"*********************************************************
  189. .TP
  190. .B \-\-remote host [port] [proto]
  191. Remote host name or IP address. On the client, multiple
  192. .B \-\-remote
  193. options may be specified for redundancy, each referring
  194. to a different OpenVPN server. Specifying multiple
  195. .B \-\-remote
  196. options for this purpose is a special case of the more
  197. general connection\-profile feature. See the
  198. .B <connection>
  199. documentation below.
  200. The OpenVPN client will try to connect to a server at
  201. .B host:port
  202. in the order specified by the list of
  203. .B \-\-remote
  204. options.
  205. .B proto
  206. indicates the protocol to use when connecting with the
  207. remote, and may be "tcp" or "udp".
  208. For forcing IPv4 or IPv6 connection suffix tcp or udp
  209. with 4/6 like udp4/udp6/tcp4/tcp6.
  210. The client will move on to the next host in the list,
  211. in the event of connection failure.
  212. Note that at any given time, the OpenVPN client
  213. will at most be connected to
  214. one server.
  215. Note that since UDP is connectionless, connection failure
  216. is defined by the
  217. .B \-\-ping
  218. and
  219. .B \-\-ping\-restart
  220. options.
  221. Note the following corner case: If you use multiple
  222. .B \-\-remote
  223. options, AND you are dropping root privileges on
  224. the client with
  225. .B \-\-user
  226. and/or
  227. .B \-\-group,
  228. AND the client is running a non\-Windows OS, if the client needs
  229. to switch to a different server, and that server pushes
  230. back different TUN/TAP or route settings, the client may lack
  231. the necessary privileges to close and reopen the TUN/TAP interface.
  232. This could cause the client to exit with a fatal error.
  233. If
  234. .B \-\-remote
  235. is unspecified, OpenVPN will listen
  236. for packets from any IP address, but will not act on those packets unless
  237. they pass all authentication tests. This requirement for authentication
  238. is binding on all potential peers, even those from known and supposedly
  239. trusted IP addresses (it is very easy to forge a source IP address on
  240. a UDP packet).
  241. When used in TCP mode,
  242. .B \-\-remote
  243. will act as a filter, rejecting connections from any host which does
  244. not match
  245. .B host.
  246. If
  247. .B host
  248. is a DNS name which resolves to multiple IP addresses,
  249. OpenVPN will try them in the order that the system getaddrinfo()
  250. presents them, so priorization and DNS randomization is done
  251. by the system library. Unless an IP version is forced by the
  252. protocol specification (4/6 suffix), OpenVPN will try both IPv4
  253. and IPv6 addresses, in the order getaddrinfo() returns them.
  254. .\"*********************************************************
  255. .TP
  256. .B \-\-remote\-random\-hostname
  257. Prepend a random string (6 bytes, 12 hex characters) to hostname to prevent
  258. DNS caching. For example, "foo.bar.gov" would be modified to
  259. "<random\-chars>.foo.bar.gov".
  260. .\"*********************************************************
  261. .TP
  262. .B <connection>
  263. Define a client connection
  264. profile. Client connection profiles are groups of OpenVPN options that
  265. describe how to connect to a given OpenVPN server. Client connection
  266. profiles are specified within an OpenVPN configuration file, and
  267. each profile is bracketed by
  268. .B <connection>
  269. and
  270. .B </connection>.
  271. An OpenVPN client will try each connection profile sequentially
  272. until it achieves a successful connection.
  273. .B \-\-remote\-random
  274. can be used to initially "scramble" the connection
  275. list.
  276. Here is an example of connection profile usage:
  277. .nf
  278. .ft 3
  279. .in +4
  280. client
  281. dev tun
  282. <connection>
  283. remote 198.19.34.56 1194 udp
  284. </connection>
  285. <connection>
  286. remote 198.19.34.56 443 tcp
  287. </connection>
  288. <connection>
  289. remote 198.19.34.56 443 tcp
  290. http\-proxy 192.168.0.8 8080
  291. </connection>
  292. <connection>
  293. remote 198.19.36.99 443 tcp
  294. http\-proxy 192.168.0.8 8080
  295. </connection>
  296. persist\-key
  297. persist\-tun
  298. pkcs12 client.p12
  299. remote\-cert\-tls server
  300. verb 3
  301. .in -4
  302. .ft
  303. .fi
  304. First we try to connect to a server at 198.19.34.56:1194 using UDP.
  305. If that fails, we then try to connect to 198.19.34.56:443 using TCP.
  306. If that also fails, then try connecting through an HTTP proxy at
  307. 192.168.0.8:8080 to 198.19.34.56:443 using TCP. Finally, try to
  308. connect through the same proxy to a server at 198.19.36.99:443
  309. using TCP.
  310. The following OpenVPN options may be used inside of
  311. a
  312. .B <connection>
  313. block:
  314. .B bind,
  315. .B connect\-retry,
  316. .B connect\-retry\-max,
  317. .B connect\-timeout,
  318. .B explicit\-exit\-notify,
  319. .B float,
  320. .B fragment,
  321. .B http\-proxy,
  322. .B http\-proxy\-option,
  323. .B link\-mtu,
  324. .B local,
  325. .B lport,
  326. .B mssfix,
  327. .B mtu\-disc,
  328. .B nobind,
  329. .B port,
  330. .B proto,
  331. .B remote,
  332. .B rport,
  333. .B socks\-proxy,
  334. .B tun\-mtu and
  335. .B tun\-mtu\-extra.
  336. A defaulting mechanism exists for specifying options to apply to
  337. all
  338. .B <connection>
  339. profiles. If any of the above options (with the exception of
  340. .B remote
  341. ) appear outside of a
  342. .B <connection>
  343. block, but in a configuration file which has one or more
  344. .B <connection>
  345. blocks, the option setting will be used as a default for
  346. .B <connection>
  347. blocks which follow it in the configuration file.
  348. For example, suppose the
  349. .B nobind
  350. option were placed in the sample configuration file above, near
  351. the top of the file, before the first
  352. .B <connection>
  353. block. The effect would be as if
  354. .B nobind
  355. were declared in all
  356. .B <connection>
  357. blocks below it.
  358. .\"*********************************************************
  359. .TP
  360. .B \-\-proto\-force p
  361. When iterating through connection profiles,
  362. only consider profiles using protocol
  363. .B p
  364. ('tcp'|'udp').
  365. .\"*********************************************************
  366. .TP
  367. .B \-\-remote\-random
  368. When multiple
  369. .B \-\-remote
  370. address/ports are specified, or if connection profiles are being
  371. used, initially randomize the order of the list
  372. as a kind of basic load\-balancing measure.
  373. .\"*********************************************************
  374. .TP
  375. .B \-\-proto p
  376. Use protocol
  377. .B p
  378. for communicating with remote host.
  379. .B p
  380. can be
  381. .B udp,
  382. .B tcp\-client,
  383. or
  384. .B tcp\-server.
  385. The default protocol is
  386. .B udp
  387. when
  388. .B \-\-proto
  389. is not specified.
  390. For UDP operation,
  391. .B \-\-proto udp
  392. should be specified on both peers.
  393. For TCP operation, one peer must use
  394. .B \-\-proto tcp\-server
  395. and the other must use
  396. .B \-\-proto tcp\-client.
  397. A peer started with
  398. .B tcp\-server
  399. will wait indefinitely for an incoming connection. A peer
  400. started with
  401. .B tcp\-client
  402. will attempt to connect, and if that fails, will sleep for 5
  403. seconds (adjustable via the
  404. .B \-\-connect\-retry
  405. option) and try again infinite or up to N retries (adjustable via the
  406. .B \-\-connect\-retry\-max
  407. option). Both TCP client and server will simulate
  408. a SIGUSR1 restart signal if either side resets the connection.
  409. OpenVPN is designed to operate optimally over UDP, but TCP capability is provided
  410. for situations where UDP cannot be used.
  411. In comparison with UDP, TCP will usually be
  412. somewhat less efficient and less robust when used over unreliable or congested
  413. networks.
  414. This article outlines some of problems with tunneling IP over TCP:
  415. .I http://sites.inka.de/sites/bigred/devel/tcp\-tcp.html
  416. There are certain cases, however, where using TCP may be advantageous from
  417. a security and robustness perspective, such as tunneling non\-IP or
  418. application\-level UDP protocols, or tunneling protocols which don't
  419. possess a built\-in reliability layer.
  420. .\"*********************************************************
  421. .TP
  422. .B \-\-connect\-retry n [max]
  423. Wait
  424. .B n
  425. seconds between connection attempts (default=5). Repeated reconnection
  426. attempts are slowed down after 5 retries per remote by doubling the wait
  427. time after each unsuccessful attempt. The optional argument
  428. .B max
  429. specifies the maximum value of wait time in seconds at which it gets
  430. capped (default=300).
  431. .\"*********************************************************
  432. .TP
  433. .B \-\-connect\-retry\-max n
  434. .B n
  435. specifies the number of times each
  436. .B \-\-remote
  437. or
  438. .B <connection>
  439. entry is tried. Specifying
  440. .B n
  441. as one would try each entry exactly once. A successful connection
  442. resets the counter. (default=unlimited).
  443. .\"*********************************************************
  444. .TP
  445. .B \-\-show\-proxy\-settings
  446. Show sensed HTTP or SOCKS proxy settings. Currently, only Windows clients
  447. support this option.
  448. .\"*********************************************************
  449. .TP
  450. .B \-\-http\-proxy server port [authfile|'auto'|'auto\-nct'] [auth\-method]
  451. Connect to remote host through an HTTP proxy at address
  452. .B server
  453. and port
  454. .B port.
  455. If HTTP Proxy\-Authenticate is required,
  456. .B authfile
  457. is a file containing a username and password on 2 lines, or
  458. "stdin" to prompt from console. Its content can also be specified
  459. in the config file with the
  460. .B \-\-http\-proxy\-user\-pass
  461. option. (See section on inline files)
  462. .B auth\-method
  463. should be one of "none", "basic", or "ntlm".
  464. HTTP Digest authentication is supported as well, but only via
  465. the
  466. .B auto
  467. or
  468. .B auto\-nct
  469. flags (below).
  470. The
  471. .B auto
  472. flag causes OpenVPN to automatically determine the
  473. .B auth\-method
  474. and query stdin or the management interface for
  475. username/password credentials, if required. This flag
  476. exists on OpenVPN 2.1 or higher.
  477. The
  478. .B auto\-nct
  479. flag (no clear\-text auth) instructs OpenVPN to automatically
  480. determine the authentication method, but to reject weak
  481. authentication protocols such as HTTP Basic Authentication.
  482. .\"*********************************************************
  483. .TP
  484. .B \-\-http\-proxy\-option type [parm]
  485. Set extended HTTP proxy options.
  486. Repeat to set multiple options.
  487. .B VERSION version \-\-
  488. Set HTTP version number to
  489. .B version
  490. (default=1.0).
  491. .B AGENT user\-agent \-\-
  492. Set HTTP "User\-Agent" string to
  493. .B user\-agent.
  494. .B CUSTOM\-HEADER name content \-\-
  495. Adds the custom Header with
  496. .B name
  497. as name and
  498. .B content
  499. as the content of the custom HTTP header.
  500. .\"*********************************************************
  501. .TP
  502. .B \-\-socks\-proxy server [port] [authfile]
  503. Connect to remote host through a Socks5 proxy at address
  504. .B server
  505. and port
  506. .B port
  507. (default=1080).
  508. .B authfile
  509. (optional) is a file containing a username and password on 2 lines, or
  510. "stdin" to prompt from console.
  511. .\"*********************************************************
  512. .TP
  513. .B \-\-resolv\-retry n
  514. If hostname resolve fails for
  515. .B \-\-remote,
  516. retry resolve for
  517. .B n
  518. seconds before failing.
  519. Set
  520. .B n
  521. to "infinite" to retry indefinitely.
  522. By default,
  523. .B \-\-resolv\-retry infinite
  524. is enabled. You can disable by setting n=0.
  525. .\"*********************************************************
  526. .TP
  527. .B \-\-float
  528. Allow remote peer to change its IP address and/or port number, such as due to
  529. DHCP (this is the default if
  530. .B \-\-remote
  531. is not used).
  532. .B \-\-float
  533. when specified with
  534. .B \-\-remote
  535. allows an OpenVPN session to initially connect to a peer
  536. at a known address, however if packets arrive from a new
  537. address and pass all authentication tests, the new address
  538. will take control of the session. This is useful when
  539. you are connecting to a peer which holds a dynamic address
  540. such as a dial\-in user or DHCP client.
  541. Essentially,
  542. .B \-\-float
  543. tells OpenVPN to accept authenticated packets
  544. from any address, not only the address which was specified in the
  545. .B \-\-remote
  546. option.
  547. .\"*********************************************************
  548. .TP
  549. .B \-\-ipchange cmd
  550. Run command
  551. .B cmd
  552. when our remote ip\-address is initially authenticated or
  553. changes.
  554. .B cmd
  555. consists of a path to script (or executable program), optionally
  556. followed by arguments. The path and arguments may be single\- or double\-quoted
  557. and/or escaped using a backslash, and should be separated by one or more spaces.
  558. When
  559. .B cmd
  560. is executed two arguments are appended after any arguments specified in
  561. .B cmd
  562. , as follows:
  563. .B cmd ip_address port_number
  564. Don't use
  565. .B \-\-ipchange
  566. in
  567. .B \-\-mode server
  568. mode. Use a
  569. .B \-\-client\-connect
  570. script instead.
  571. See the "Environmental Variables" section below for
  572. additional parameters passed as environmental variables.
  573. If you are running in a dynamic IP address environment where
  574. the IP addresses of either peer could change without notice,
  575. you can use this script, for example, to edit the
  576. .I /etc/hosts
  577. file with the current address of the peer. The script will
  578. be run every time the remote peer changes its IP address.
  579. Similarly if
  580. .I our
  581. IP address changes due to DHCP, we should configure
  582. our IP address change script (see man page for
  583. .BR dhcpcd (8)
  584. ) to deliver a
  585. .B SIGHUP
  586. or
  587. .B SIGUSR1
  588. signal to OpenVPN. OpenVPN will then
  589. reestablish a connection with its most recently authenticated
  590. peer on its new IP address.
  591. .\"*********************************************************
  592. .TP
  593. .B \-\-port port
  594. TCP/UDP port number or port name for both local and remote (sets both
  595. .B \-\-lport
  596. and
  597. .B \-\-rport
  598. options to given port). The current
  599. default of 1194 represents the official IANA port number
  600. assignment for OpenVPN and has been used since version 2.0\-beta17.
  601. Previous versions used port 5000 as the default.
  602. .\"*********************************************************
  603. .TP
  604. .B \-\-lport port
  605. Set local TCP/UDP port number or name. Cannot be used together with
  606. .B \-\-nobind
  607. option.
  608. .\"*********************************************************
  609. .TP
  610. .B \-\-rport port
  611. Set TCP/UDP port number or name used by the
  612. .B \-\-remote
  613. option. The port can also be set directly using the
  614. .B \-\-remote
  615. option.
  616. .\"*********************************************************
  617. .TP
  618. .B \-\-bind [ipv6only]
  619. Bind to local address and port. This is the default unless any of
  620. .B \-\-proto tcp\-client
  621. ,
  622. .B \-\-http\-proxy
  623. or
  624. .B \-\-socks\-proxy
  625. are used.
  626. If the
  627. .B ipv6only
  628. keyword is present OpenVPN will bind only to IPv6 (as oposed
  629. to IPv6 and IPv4) when a IPv6 socket is opened.
  630. .\"*********************************************************
  631. .TP
  632. .B \-\-nobind
  633. Do not bind to local address and port. The IP stack will allocate
  634. a dynamic port for returning packets. Since the value of the dynamic port
  635. could not be known in advance by a peer, this option is only suitable for
  636. peers which will be initiating connections by using the
  637. .B \-\-remote
  638. option.
  639. .\"*********************************************************
  640. .TP
  641. .B \-\-dev tunX | tapX | null
  642. TUN/TAP virtual network device (
  643. .B X
  644. can be omitted for a dynamic device.)
  645. See examples section below
  646. for an example on setting up a TUN device.
  647. You must use either tun devices on both ends of the connection
  648. or tap devices on both ends. You cannot mix them, as they
  649. represent different underlying network layers.
  650. .B tun
  651. devices encapsulate IPv4 or IPv6 (OSI Layer 3) while
  652. .B tap
  653. devices encapsulate Ethernet 802.3 (OSI Layer 2).
  654. .\"*********************************************************
  655. .TP
  656. .B \-\-dev\-type device\-type
  657. Which device type are we using?
  658. .B device\-type
  659. should be
  660. .B tun
  661. (OSI Layer 3)
  662. or
  663. .B tap
  664. (OSI Layer 2).
  665. Use this option only if the TUN/TAP device used with
  666. .B \-\-dev
  667. does not begin with
  668. .B tun
  669. or
  670. .B tap.
  671. .\"*********************************************************
  672. .TP
  673. .B \-\-topology mode
  674. Configure virtual addressing topology when running in
  675. .B \-\-dev tun
  676. mode. This directive has no meaning in
  677. .B \-\-dev tap
  678. mode, which always uses a
  679. .B subnet
  680. topology.
  681. If you set this directive on the server, the
  682. .B \-\-server
  683. and
  684. .B \-\-server\-bridge
  685. directives will automatically push your chosen topology setting to clients
  686. as well. This directive can also be manually pushed to clients. Like the
  687. .B \-\-dev
  688. directive, this directive must always be compatible between client and server.
  689. .B mode
  690. can be one of:
  691. .B net30 \-\-
  692. Use a point\-to\-point topology, by allocating one /30 subnet per client.
  693. This is designed to allow point\-to\-point semantics when some
  694. or all of the connecting clients might be Windows systems. This is the
  695. default on OpenVPN 2.0.
  696. .B p2p \-\-
  697. Use a point\-to\-point topology where the remote endpoint of the client's
  698. tun interface always points to the local endpoint of the server's tun interface.
  699. This mode allocates a single IP address per connecting client.
  700. Only use
  701. when none of the connecting clients are Windows systems. This mode
  702. is functionally equivalent to the
  703. .B \-\-ifconfig\-pool\-linear
  704. directive which is available in OpenVPN 2.0, is deprecated and will be
  705. removed in OpenVPN 2.5
  706. .B subnet \-\-
  707. Use a subnet rather than a point\-to\-point topology by
  708. configuring the tun interface with a local IP address and subnet mask,
  709. similar to the topology used in
  710. .B \-\-dev tap
  711. and ethernet bridging mode.
  712. This mode allocates a single IP address per connecting client and works on
  713. Windows as well. Only available when server and clients are OpenVPN 2.1 or
  714. higher, or OpenVPN 2.0.x which has been manually patched with the
  715. .B \-\-topology
  716. directive code. When used on Windows, requires version 8.2 or higher
  717. of the TAP\-Win32 driver. When used on *nix, requires that the tun
  718. driver supports an
  719. .BR ifconfig (8)
  720. command which sets a subnet instead of a remote endpoint IP address.
  721. This option exists in OpenVPN 2.1 or higher.
  722. Note: Using
  723. .B \-\-topology subnet
  724. changes the interpretation of the arguments of
  725. .B \-\-ifconfig
  726. to mean "address netmask", no longer "local remote".
  727. .\"*********************************************************
  728. .TP
  729. .B \-\-dev\-node node
  730. Explicitly set the device node rather than using
  731. /dev/net/tun, /dev/tun, /dev/tap, etc. If OpenVPN
  732. cannot figure out whether
  733. .B node
  734. is a TUN or TAP device based on the name, you should
  735. also specify
  736. .B \-\-dev\-type tun
  737. or
  738. .B \-\-dev\-type tap.
  739. Under Mac OS X this option can be used to specify the default tun
  740. implementation. Using
  741. .B \-\-dev\-node utun
  742. forces usage of the native Darwin tun kernel support. Use
  743. .B \-\-dev\-node utunN
  744. to select a specific utun instance. To force using the tun.kext (/dev/tunX) use
  745. .B \-\-dev\-node tun\fR.
  746. When not specifying a
  747. .B \-\-dev\-node
  748. option openvpn will first try to open utun, and fall back to tun.kext.
  749. On Windows systems, select the TAP\-Win32 adapter which
  750. is named
  751. .B node
  752. in the Network Connections Control Panel or the
  753. raw GUID of the adapter enclosed by braces.
  754. The
  755. .B \-\-show\-adapters
  756. option under Windows can also be used
  757. to enumerate all available TAP\-Win32
  758. adapters and will show both the network
  759. connections control panel name and the GUID for
  760. each TAP\-Win32 adapter.
  761. .TP
  762. .B \-\-lladdr address
  763. Specify the link layer address, more commonly known as the MAC address.
  764. Only applied to TAP devices.
  765. .\"*********************************************************
  766. .TP
  767. .B \-\-iproute cmd
  768. Set alternate command to execute instead of default iproute2 command.
  769. May be used in order to execute OpenVPN in unprivileged environment.
  770. .\"*********************************************************
  771. .TP
  772. .B \-\-ifconfig l rn
  773. Set TUN/TAP adapter parameters.
  774. .B l
  775. is the IP address of the local VPN endpoint.
  776. For TUN devices in point\-to\-point mode,
  777. .B rn
  778. is the IP address of the remote VPN endpoint.
  779. For TAP devices, or TUN devices used with
  780. .B \-\-topology subnet,
  781. .B rn
  782. is the subnet mask of the virtual network segment
  783. which is being created or connected to.
  784. For TUN devices, which facilitate virtual
  785. point\-to\-point IP connections (when used in
  786. .B \-\-topology net30
  787. or
  788. .B p2p
  789. mode),
  790. the proper usage of
  791. .B \-\-ifconfig
  792. is to use two private IP addresses
  793. which are not a member of any
  794. existing subnet which is in use.
  795. The IP addresses may be consecutive
  796. and should have their order reversed
  797. on the remote peer. After the VPN
  798. is established, by pinging
  799. .B rn,
  800. you will be pinging across the VPN.
  801. For TAP devices, which provide
  802. the ability to create virtual
  803. ethernet segments, or TUN devices in
  804. .B \-\-topology subnet
  805. mode (which create virtual "multipoint networks"),
  806. .B \-\-ifconfig
  807. is used to set an IP address and
  808. subnet mask just as a physical
  809. ethernet adapter would be
  810. similarly configured. If you are
  811. attempting to connect to a remote
  812. ethernet bridge, the IP address
  813. and subnet should be set to values
  814. which would be valid on the
  815. the bridged ethernet segment (note
  816. also that DHCP can be used for the
  817. same purpose).
  818. This option, while primarily a proxy for the
  819. .BR ifconfig (8)
  820. command, is designed to simplify TUN/TAP
  821. tunnel configuration by providing a
  822. standard interface to the different
  823. ifconfig implementations on different
  824. platforms.
  825. .B \-\-ifconfig
  826. parameters which are IP addresses can
  827. also be specified as a DNS or /etc/hosts
  828. file resolvable name.
  829. For TAP devices,
  830. .B \-\-ifconfig
  831. should not be used if the TAP interface will be
  832. getting an IP address lease from a DHCP
  833. server.
  834. .\"*********************************************************
  835. .TP
  836. .B \-\-ifconfig\-noexec
  837. Don't actually execute ifconfig/netsh commands, instead
  838. pass
  839. .B \-\-ifconfig
  840. parameters to scripts using environmental variables.
  841. .\"*********************************************************
  842. .TP
  843. .B \-\-ifconfig\-nowarn
  844. Don't output an options consistency check warning
  845. if the
  846. .B \-\-ifconfig
  847. option on this side of the
  848. connection doesn't match the remote side. This is useful
  849. when you want to retain the overall benefits of the
  850. options consistency check (also see
  851. .B \-\-disable\-occ
  852. option) while only disabling the ifconfig component of
  853. the check.
  854. For example,
  855. if you have a configuration where the local host uses
  856. .B \-\-ifconfig
  857. but the remote host does not, use
  858. .B \-\-ifconfig\-nowarn
  859. on the local host.
  860. This option will also silence warnings about potential
  861. address conflicts which occasionally annoy more experienced
  862. users by triggering "false positive" warnings.
  863. .\"*********************************************************
  864. .TP
  865. .B \-\-route network/IP [netmask] [gateway] [metric]
  866. Add route to routing table after connection is established.
  867. Multiple routes can be specified. Routes will be
  868. automatically torn down in reverse order prior to
  869. TUN/TAP device close.
  870. This option is intended as
  871. a convenience proxy for the
  872. .BR route (8)
  873. shell command,
  874. while at the same time providing portable semantics
  875. across OpenVPN's platform space.
  876. .B netmask
  877. default \-\- 255.255.255.255
  878. .B gateway
  879. default \-\- taken from
  880. .B \-\-route\-gateway
  881. or the second parameter to
  882. .B \-\-ifconfig
  883. when
  884. .B \-\-dev tun
  885. is specified.
  886. .B metric
  887. default \-\- taken from
  888. .B \-\-route\-metric
  889. otherwise 0.
  890. The default can be specified by leaving an option blank or setting
  891. it to "default".
  892. The
  893. .B network
  894. and
  895. .B gateway
  896. parameters can
  897. also be specified as a DNS or /etc/hosts
  898. file resolvable name, or as one of three special keywords:
  899. .B vpn_gateway
  900. \-\- The remote VPN endpoint address
  901. (derived either from
  902. .B \-\-route\-gateway
  903. or the second parameter to
  904. .B \-\-ifconfig
  905. when
  906. .B \-\-dev tun
  907. is specified).
  908. .B net_gateway
  909. \-\- The pre\-existing IP default gateway, read from the routing
  910. table (not supported on all OSes).
  911. .B remote_host
  912. \-\- The
  913. .B \-\-remote
  914. address if OpenVPN is being run in client mode, and is undefined in server mode.
  915. .\"*********************************************************
  916. .TP
  917. .B \-\-route\-gateway gw|'dhcp'
  918. Specify a default gateway
  919. .B gw
  920. for use with
  921. .B \-\-route.
  922. If
  923. .B dhcp
  924. is specified as the parameter,
  925. the gateway address will be extracted from a DHCP
  926. negotiation with the OpenVPN server\-side LAN.
  927. .\"*********************************************************
  928. .TP
  929. .B \-\-route\-metric m
  930. Specify a default metric
  931. .B m
  932. for use with
  933. .B \-\-route.
  934. .\"*********************************************************
  935. .TP
  936. .B \-\-route\-delay [n] [w]
  937. Delay
  938. .B n
  939. seconds (default=0) after connection
  940. establishment, before adding routes. If
  941. .B n
  942. is 0, routes will be added immediately upon connection
  943. establishment. If
  944. .B \-\-route\-delay
  945. is omitted, routes will be added immediately after TUN/TAP device
  946. open and
  947. .B \-\-up
  948. script execution, before any
  949. .B \-\-user
  950. or
  951. .B \-\-group
  952. privilege downgrade (or
  953. .B \-\-chroot
  954. execution.)
  955. This option is designed to be useful in scenarios where DHCP is
  956. used to set
  957. tap adapter addresses. The delay will give the DHCP handshake
  958. time to complete before routes are added.
  959. On Windows,
  960. .B \-\-route\-delay
  961. tries to be more intelligent by waiting
  962. .B w
  963. seconds (w=30 by default)
  964. for the TAP\-Win32 adapter to come up before adding routes.
  965. .\"*********************************************************
  966. .TP
  967. .B \-\-route\-up cmd
  968. Run command
  969. .B cmd
  970. after routes are added, subject to
  971. .B \-\-route\-delay.
  972. .B cmd
  973. consists of a path to script (or executable program), optionally
  974. followed by arguments. The path and arguments may be single\- or double\-quoted
  975. and/or escaped using a backslash, and should be separated by one or more spaces.
  976. See the "Environmental Variables" section below for
  977. additional parameters passed as environmental variables.
  978. .\"*********************************************************
  979. .TP
  980. .B \-\-route\-pre\-down cmd
  981. Run command
  982. .B cmd
  983. before routes are removed upon disconnection.
  984. .B cmd
  985. consists of a path to script (or executable program), optionally
  986. followed by arguments. The path and arguments may be single\- or double\-quoted
  987. and/or escaped using a backslash, and should be separated by one or more spaces.
  988. See the "Environmental Variables" section below for
  989. additional parameters passed as environmental variables.
  990. .\"*********************************************************
  991. .TP
  992. .B \-\-route\-noexec
  993. Don't add or remove routes automatically. Instead pass routes to
  994. .B \-\-route\-up
  995. script using environmental variables.
  996. .\"*********************************************************
  997. .TP
  998. .B \-\-route\-nopull
  999. When used with
  1000. .B \-\-client
  1001. or
  1002. .B \-\-pull,
  1003. accept options pushed by server EXCEPT for routes, block\-outside\-dns and dhcp
  1004. options like DNS servers.
  1005. When used on the client, this option effectively bars the
  1006. server from adding routes to the client's routing table,
  1007. however note that this option still allows the server
  1008. to set the TCP/IP properties of the client's TUN/TAP interface.
  1009. .\"*********************************************************
  1010. .TP
  1011. .B \-\-allow\-pull\-fqdn
  1012. Allow client to pull DNS names from server (rather than being limited
  1013. to IP address) for
  1014. .B \-\-ifconfig,
  1015. .B \-\-route,
  1016. and
  1017. .B \-\-route\-gateway.
  1018. .\"*********************************************************
  1019. .TP
  1020. .B \-\-client\-nat snat|dnat network netmask alias
  1021. This pushable client option sets up a stateless one\-to\-one NAT
  1022. rule on packet addresses (not ports), and is useful in cases
  1023. where routes or ifconfig settings pushed to the client would
  1024. create an IP numbering conflict.
  1025. .B network/netmask
  1026. (for example 192.168.0.0/255.255.0.0)
  1027. defines the local view of a resource from the client perspective, while
  1028. .B alias/netmask
  1029. (for example 10.64.0.0/255.255.0.0)
  1030. defines the remote view from the server perspective.
  1031. Use
  1032. .B snat
  1033. (source NAT) for resources owned by the client and
  1034. .B dnat
  1035. (destination NAT) for remote resources.
  1036. Set
  1037. .B \-\-verb 6
  1038. for debugging info showing the transformation of src/dest
  1039. addresses in packets.
  1040. .\"*********************************************************
  1041. .TP
  1042. .B \-\-redirect\-gateway flags...
  1043. Automatically execute routing commands to cause all outgoing IP traffic
  1044. to be redirected over the VPN. This is a client\-side option.
  1045. This option performs three steps:
  1046. .B (1)
  1047. Create a static route for the
  1048. .B \-\-remote
  1049. address which forwards to the pre\-existing default gateway.
  1050. This is done so that
  1051. .B (3)
  1052. will not create a routing loop.
  1053. .B (2)
  1054. Delete the default gateway route.
  1055. .B (3)
  1056. Set the new default gateway to be the VPN endpoint address (derived either from
  1057. .B \-\-route\-gateway
  1058. or the second parameter to
  1059. .B \-\-ifconfig
  1060. when
  1061. .B \-\-dev tun
  1062. is specified).
  1063. When the tunnel is torn down, all of the above steps are reversed so
  1064. that the original default route is restored.
  1065. Option flags:
  1066. .B local \-\-
  1067. Add the
  1068. .B local
  1069. flag if both OpenVPN peers are directly connected via a common subnet,
  1070. such as with wireless. The
  1071. .B local
  1072. flag will cause step
  1073. .B 1
  1074. above to be omitted.
  1075. .B autolocal \-\-
  1076. Try to automatically determine whether to enable
  1077. .B local
  1078. flag above.
  1079. .B def1 \-\-
  1080. Use this flag to override
  1081. the default gateway by using 0.0.0.0/1 and 128.0.0.0/1
  1082. rather than 0.0.0.0/0. This has the benefit of overriding
  1083. but not wiping out the original default gateway.
  1084. .B bypass\-dhcp \-\-
  1085. Add a direct route to the DHCP server (if it is non\-local) which
  1086. bypasses the tunnel
  1087. (Available on Windows clients, may not be available
  1088. on non\-Windows clients).
  1089. .B bypass\-dns \-\-
  1090. Add a direct route to the DNS server(s) (if they are non\-local) which
  1091. bypasses the tunnel
  1092. (Available on Windows clients, may not be available
  1093. on non\-Windows clients).
  1094. .B block\-local \-\-
  1095. Block access to local LAN when the tunnel is active, except for
  1096. the LAN gateway itself. This is accomplished by routing the local
  1097. LAN (except for the LAN gateway address) into the tunnel.
  1098. .B ipv6 \-\-
  1099. Redirect IPv6 routing into the tunnel. This works similar to the
  1100. .B def1
  1101. flag, that is, more specific IPv6 routes are added (2000::/4, 3000::/4),
  1102. covering the whole IPv6 unicast space.
  1103. .B !ipv4 \-\-
  1104. Do not redirect IPv4 traffic \- typically used in the flag pair
  1105. .B "ipv6 !ipv4"
  1106. to redirect IPv6\-only.
  1107. .\"*********************************************************
  1108. .TP
  1109. .B \-\-link\-mtu n
  1110. Sets an upper bound on the size of UDP packets which are sent
  1111. between OpenVPN peers. It's best not to set this parameter unless
  1112. you know what you're doing.
  1113. .\"*********************************************************
  1114. .\"*********************************************************
  1115. .TP
  1116. .B \-\-redirect\-private [flags]
  1117. Like \-\-redirect\-gateway, but omit actually changing the default
  1118. gateway. Useful when pushing private subnets.
  1119. .\"*********************************************************
  1120. .TP
  1121. .B \-\-tun\-mtu n
  1122. Take the TUN device MTU to be
  1123. .B n
  1124. and derive the link MTU
  1125. from it (default=1500). In most cases, you will probably want to
  1126. leave this parameter set to its default value.
  1127. The MTU (Maximum Transmission Units) is
  1128. the maximum datagram size in bytes that can be sent unfragmented
  1129. over a particular network path. OpenVPN requires that packets
  1130. on the control or data channels be sent unfragmented.
  1131. MTU problems often manifest themselves as connections which
  1132. hang during periods of active usage.
  1133. It's best to use the
  1134. .B \-\-fragment
  1135. and/or
  1136. .B \-\-mssfix
  1137. options to deal with MTU sizing issues.
  1138. .\"*********************************************************
  1139. .TP
  1140. .B \-\-tun\-mtu\-extra n
  1141. Assume that the TUN/TAP device might return as many as
  1142. .B n
  1143. bytes more than the
  1144. .B \-\-tun\-mtu
  1145. size on read. This parameter defaults to 0, which is sufficient for
  1146. most TUN devices. TAP devices may introduce additional overhead in excess
  1147. of the MTU size, and a setting of 32 is the default when TAP devices are used.
  1148. This parameter only controls internal OpenVPN buffer sizing,
  1149. so there is no transmission overhead associated with using a larger value.
  1150. .\"*********************************************************
  1151. .TP
  1152. .B \-\-mtu\-disc type
  1153. Should we do Path MTU discovery on TCP/UDP channel? Only supported on OSes such
  1154. as Linux that supports the necessary system call to set.
  1155. .B 'no'
  1156. \-\- Never send DF (Don't Fragment) frames
  1157. .br
  1158. .B 'maybe'
  1159. \-\- Use per\-route hints
  1160. .br
  1161. .B 'yes'
  1162. \-\- Always DF (Don't Fragment)
  1163. .br
  1164. .\"*********************************************************
  1165. .TP
  1166. .B \-\-mtu\-test
  1167. To empirically measure MTU on connection startup,
  1168. add the
  1169. .B \-\-mtu\-test
  1170. option to your configuration.
  1171. OpenVPN will send ping packets of various sizes
  1172. to the remote peer and measure the largest packets
  1173. which were successfully received. The
  1174. .B \-\-mtu\-test
  1175. process normally takes about 3 minutes to complete.
  1176. .\"*********************************************************
  1177. .TP
  1178. .B \-\-fragment max
  1179. Enable internal datagram fragmentation so
  1180. that no UDP datagrams are sent which
  1181. are larger than
  1182. .B max
  1183. bytes.
  1184. The
  1185. .B max
  1186. parameter is interpreted in the same way as the
  1187. .B \-\-link\-mtu
  1188. parameter, i.e. the UDP packet size after encapsulation
  1189. overhead has been added in, but not including
  1190. the UDP header itself.
  1191. The
  1192. .B \-\-fragment
  1193. option only makes sense when you are using the UDP protocol (
  1194. .B \-\-proto udp
  1195. ).
  1196. .B \-\-fragment
  1197. adds 4 bytes of overhead per datagram.
  1198. See the
  1199. .B \-\-mssfix
  1200. option below for an important related option to
  1201. .B \-\-fragment.
  1202. It should also be noted that this option is not meant to replace
  1203. UDP fragmentation at the IP stack level. It is only meant as a
  1204. last resort when path MTU discovery is broken. Using this option
  1205. is less efficient than fixing path MTU discovery for your IP link and
  1206. using native IP fragmentation instead.
  1207. Having said that, there are circumstances where using OpenVPN's
  1208. internal fragmentation capability may be your only option, such
  1209. as tunneling a UDP multicast stream which requires fragmentation.
  1210. .\"*********************************************************
  1211. .TP
  1212. .B \-\-mssfix max
  1213. Announce to TCP sessions running over the tunnel that they should limit
  1214. their send packet sizes such that after OpenVPN has encapsulated them,
  1215. the resulting UDP packet size that OpenVPN sends to its peer will not
  1216. exceed
  1217. .B max
  1218. bytes. The default value is
  1219. .B 1450.
  1220. The
  1221. .B max
  1222. parameter is interpreted in the same way as the
  1223. .B \-\-link\-mtu
  1224. parameter, i.e. the UDP packet size after encapsulation
  1225. overhead has been added in, but not including
  1226. the UDP header itself. Resulting packet would be at most 28
  1227. bytes larger for IPv4 and 48 bytes for IPv6 (20/40 bytes for IP
  1228. header and 8 bytes for UDP header). Default value of 1450 allows
  1229. IPv4 packets to be transmitted over a link with MTU 1473 or higher
  1230. without IP level fragmentation.
  1231. The
  1232. .B \-\-mssfix
  1233. option only makes sense when you are using the UDP protocol
  1234. for OpenVPN peer\-to\-peer communication, i.e.
  1235. .B \-\-proto udp.
  1236. .B \-\-mssfix
  1237. and
  1238. .B \-\-fragment
  1239. can be ideally used together, where
  1240. .B \-\-mssfix
  1241. will try to keep TCP from needing
  1242. packet fragmentation in the first place,
  1243. and if big packets come through anyhow
  1244. (from protocols other than TCP),
  1245. .B \-\-fragment
  1246. will internally fragment them.
  1247. Both
  1248. .B \-\-fragment
  1249. and
  1250. .B \-\-mssfix
  1251. are designed to work around cases where Path MTU discovery
  1252. is broken on the network path between OpenVPN peers.
  1253. The usual symptom of such a breakdown is an OpenVPN
  1254. connection which successfully starts, but then stalls
  1255. during active usage.
  1256. If
  1257. .B \-\-fragment
  1258. and
  1259. .B \-\-mssfix
  1260. are used together,
  1261. .B \-\-mssfix
  1262. will take its default
  1263. .B max
  1264. parameter from the
  1265. .B \-\-fragment max
  1266. option.
  1267. Therefore, one could lower the maximum UDP packet size
  1268. to 1300 (a good first try for solving MTU\-related
  1269. connection problems) with the following options:
  1270. .B \-\-tun\-mtu 1500 \-\-fragment 1300 \-\-mssfix
  1271. .\"*********************************************************
  1272. .TP
  1273. .B \-\-sndbuf size
  1274. Set the TCP/UDP socket send buffer size.
  1275. Defaults to operation system default.
  1276. .\"*********************************************************
  1277. .TP
  1278. .B \-\-rcvbuf size
  1279. Set the TCP/UDP socket receive buffer size.
  1280. Defaults to operation system default.
  1281. .\"*********************************************************
  1282. .TP
  1283. .B \-\-mark value
  1284. Mark encrypted packets being sent with value. The mark value can be
  1285. matched in policy routing and packetfilter rules. This option is
  1286. only supported in Linux and does nothing on other operating systems.
  1287. .\"*********************************************************
  1288. .TP
  1289. .B \-\-socket\-flags flags...
  1290. Apply the given flags to the OpenVPN transport socket.
  1291. Currently, only
  1292. .B TCP_NODELAY
  1293. is supported.
  1294. The
  1295. .B TCP_NODELAY
  1296. socket flag is useful in TCP mode, and causes the kernel
  1297. to send tunnel packets immediately over the TCP connection without
  1298. trying to group several smaller packets into a larger packet.
  1299. This can result in a considerably improvement in latency.
  1300. This option is pushable from server to client, and should be used
  1301. on both client and server for maximum effect.
  1302. .\"*********************************************************
  1303. .TP
  1304. .B \-\-txqueuelen n
  1305. (Linux only) Set the TX queue length on the TUN/TAP interface.
  1306. Currently defaults to 100.
  1307. .\"*********************************************************
  1308. .TP
  1309. .B \-\-shaper n
  1310. Limit bandwidth of outgoing tunnel data to
  1311. .B n
  1312. bytes per second on the TCP/UDP port.
  1313. Note that this will only work if mode is set to p2p.
  1314. If you want to limit the bandwidth
  1315. in both directions, use this option on both peers.
  1316. OpenVPN uses the following algorithm to implement
  1317. traffic shaping: Given a shaper rate of
  1318. .I n
  1319. bytes per second, after a datagram write of
  1320. .I b
  1321. bytes is queued on the TCP/UDP port, wait a minimum of
  1322. .I (b / n)
  1323. seconds before queuing the next write.
  1324. It should be noted that OpenVPN supports multiple
  1325. tunnels between the same two peers, allowing you
  1326. to construct full\-speed and reduced bandwidth tunnels
  1327. at the same time,
  1328. routing low\-priority data such as off\-site backups
  1329. over the reduced bandwidth tunnel, and other data
  1330. over the full\-speed tunnel.
  1331. Also note that for low bandwidth tunnels
  1332. (under 1000 bytes per second), you should probably
  1333. use lower MTU values as well (see above), otherwise
  1334. the packet latency will grow so large as to trigger
  1335. timeouts in the TLS layer and TCP connections running
  1336. over the tunnel.
  1337. OpenVPN allows
  1338. .B n
  1339. to be between 100 bytes/sec and 100 Mbytes/sec.
  1340. .\"*********************************************************
  1341. .TP
  1342. .B \-\-inactive n [bytes]
  1343. Causes OpenVPN to exit after
  1344. .B n
  1345. seconds of inactivity on the TUN/TAP device. The time length of
  1346. inactivity is measured since the last incoming or outgoing tunnel
  1347. packet. The default value is 0 seconds, which disables this feature.
  1348. If the optional
  1349. .B bytes
  1350. parameter is included,
  1351. exit if less than
  1352. .B bytes
  1353. of combined in/out traffic are produced on the tun/tap device
  1354. in
  1355. .B n
  1356. seconds.
  1357. In any case, OpenVPN's internal ping packets (which are just
  1358. keepalives) and TLS control packets are not considered
  1359. "activity", nor are they counted as traffic, as they are used
  1360. internally by OpenVPN and are not an indication of actual user
  1361. activity.
  1362. .\"*********************************************************
  1363. .TP
  1364. .B \-\-ping n
  1365. Ping remote over the TCP/UDP control channel
  1366. if no packets have been sent for at least
  1367. .B n
  1368. seconds (specify
  1369. .B \-\-ping
  1370. on both peers to cause ping packets to be sent in both directions since
  1371. OpenVPN ping packets are not echoed like IP ping packets).
  1372. When used in one of OpenVPN's secure modes (where
  1373. .B \-\-secret, \-\-tls\-server,
  1374. or
  1375. .B \-\-tls\-client
  1376. is specified), the ping packet
  1377. will be cryptographically secure.
  1378. This option has two intended uses:
  1379. (1) Compatibility
  1380. with stateful firewalls. The periodic ping will ensure that
  1381. a stateful firewall rule which allows OpenVPN UDP packets to
  1382. pass will not time out.
  1383. (2) To provide a basis for the remote to test the existence
  1384. of its peer using the
  1385. .B \-\-ping\-exit
  1386. option.
  1387. .\"*********************************************************
  1388. .TP
  1389. .B \-\-ping\-exit n
  1390. Causes OpenVPN to exit after
  1391. .B n
  1392. seconds pass without reception of a ping
  1393. or other packet from remote.
  1394. This option can be combined with
  1395. .B \-\-inactive, \-\-ping,
  1396. and
  1397. .B \-\-ping\-exit
  1398. to create a two\-tiered inactivity disconnect.
  1399. For example,
  1400. .B openvpn [options...] \-\-inactive 3600 \-\-ping 10 \-\-ping\-exit 60
  1401. when used on both peers will cause OpenVPN to exit within 60
  1402. seconds if its peer disconnects, but will exit after one
  1403. hour if no actual tunnel data is exchanged.
  1404. .\"*********************************************************
  1405. .TP
  1406. .B \-\-ping\-restart n
  1407. Similar to
  1408. .B \-\-ping\-exit,
  1409. but trigger a
  1410. .B SIGUSR1
  1411. restart after
  1412. .B n
  1413. seconds pass without reception of a ping
  1414. or other packet from remote.
  1415. This option is useful in cases
  1416. where the remote peer has a dynamic IP address and
  1417. a low\-TTL DNS name is used to track the IP address using
  1418. a service such as
  1419. .I http://dyndns.org/
  1420. + a dynamic DNS client such
  1421. as
  1422. .B ddclient.
  1423. If the peer cannot be reached, a restart will be triggered, causing
  1424. the hostname used with
  1425. .B \-\-remote
  1426. to be re\-resolved (if
  1427. .B \-\-resolv\-retry
  1428. is also specified).
  1429. In server mode,
  1430. .B \-\-ping\-restart, \-\-inactive,
  1431. or any other type of internally generated signal will always be
  1432. applied to
  1433. individual client instance objects, never to whole server itself.
  1434. Note also in server mode that any internally generated signal
  1435. which would normally cause a restart, will cause the deletion
  1436. of the client instance object instead.
  1437. In client mode, the
  1438. .B \-\-ping\-restart
  1439. parameter is set to 120 seconds by default. This default will
  1440. hold until the client pulls a replacement value from the server, based on
  1441. the
  1442. .B \-\-keepalive
  1443. setting in the server configuration.
  1444. To disable the 120 second default, set
  1445. .B \-\-ping\-restart 0
  1446. on the client.
  1447. See the signals section below for more information
  1448. on
  1449. .B SIGUSR1.
  1450. Note that the behavior of
  1451. .B SIGUSR1
  1452. can be modified by the
  1453. .B \-\-persist\-tun, \-\-persist\-key, \-\-persist\-local\-ip,
  1454. and
  1455. .B \-\-persist\-remote\-ip
  1456. options.
  1457. Also note that
  1458. .B \-\-ping\-exit
  1459. and
  1460. .B \-\-ping\-restart
  1461. are mutually exclusive and cannot be used together.
  1462. .\"*********************************************************
  1463. .TP
  1464. .B \-\-keepalive interval timeout
  1465. A helper directive designed to simplify the expression of
  1466. .B \-\-ping
  1467. and
  1468. .B \-\-ping\-restart.
  1469. This option can be used on both client and server side, but it is
  1470. enough to add this on the server side as it will push appropriate
  1471. .B \-\-ping
  1472. and
  1473. .B \-\-ping\-restart
  1474. options to the client. If used on both server and client,
  1475. the values pushed from server will override the client local values.
  1476. The
  1477. .B timeout
  1478. argument will be twice as long on the server side. This ensures that
  1479. a timeout is detected on client side before the server side drops
  1480. the connection.
  1481. For example,
  1482. .B \-\-keepalive 10 60
  1483. expands as follows:
  1484. .nf
  1485. .ft 3
  1486. .in +4
  1487. if mode server:
  1488. ping 10 # Argument: interval
  1489. ping\-restart 120 # Argument: timeout*2
  1490. push "ping 10" # Argument: interval
  1491. push "ping\-restart 60" # Argument: timeout
  1492. else
  1493. ping 10 # Argument: interval
  1494. ping\-restart 60 # Argument: timeout
  1495. .in -4
  1496. .ft
  1497. .fi
  1498. .\"*********************************************************
  1499. .TP
  1500. .B \-\-ping\-timer\-rem
  1501. Run the
  1502. .B \-\-ping\-exit
  1503. /
  1504. .B \-\-ping\-restart
  1505. timer only if we have a remote address. Use this option if you are
  1506. starting the daemon in listen mode (i.e. without an explicit
  1507. .B \-\-remote
  1508. peer), and you don't want to start clocking timeouts until a remote
  1509. peer connects.
  1510. .\"*********************************************************
  1511. .TP
  1512. .B \-\-persist\-tun
  1513. Don't close and reopen TUN/TAP device or run up/down scripts
  1514. across
  1515. .B SIGUSR1
  1516. or
  1517. .B \-\-ping\-restart
  1518. restarts.
  1519. .B SIGUSR1
  1520. is a restart signal similar to
  1521. .B SIGHUP,
  1522. but which offers finer\-grained control over
  1523. reset options.
  1524. .\"*********************************************************
  1525. .TP
  1526. .B \-\-persist\-key
  1527. Don't re\-read key files across
  1528. .B SIGUSR1
  1529. or
  1530. .B \-\-ping\-restart.
  1531. This option can be combined with
  1532. .B \-\-user nobody
  1533. to allow restarts triggered by the
  1534. .B SIGUSR1
  1535. signal.
  1536. Normally if you drop root privileges in OpenVPN,
  1537. the daemon cannot be restarted since it will now be unable to re\-read protected
  1538. key files.
  1539. This option solves the problem by persisting keys across
  1540. .B SIGUSR1
  1541. resets, so they don't need to be re\-read.
  1542. .\"*********************************************************
  1543. .TP
  1544. .B \-\-persist\-local\-ip
  1545. Preserve initially resolved local IP address and port number
  1546. across
  1547. .B SIGUSR1
  1548. or
  1549. .B \-\-ping\-restart
  1550. restarts.
  1551. .\"*********************************************************
  1552. .TP
  1553. .B \-\-persist\-remote\-ip
  1554. Preserve most recently authenticated remote IP address and port number
  1555. across
  1556. .B SIGUSR1
  1557. or
  1558. .B \-\-ping\-restart
  1559. restarts.
  1560. .\"*********************************************************
  1561. .TP
  1562. .B \-\-mlock
  1563. Disable paging by calling the POSIX mlockall function.
  1564. Requires that OpenVPN be initially run as root (though
  1565. OpenVPN can subsequently downgrade its UID using the
  1566. .B \-\-user
  1567. option).
  1568. Using this option ensures that key material and tunnel
  1569. data are never written to disk due to virtual
  1570. memory paging operations which occur under most
  1571. modern operating systems. It ensures that even if an
  1572. attacker was able to crack the box running OpenVPN, he
  1573. would not be able to scan the system swap file to
  1574. recover previously used
  1575. ephemeral keys, which are used for a period of time
  1576. governed by the
  1577. .B \-\-reneg
  1578. options (see below), then are discarded.
  1579. The downside
  1580. of using
  1581. .B \-\-mlock
  1582. is that it will reduce the amount of physical
  1583. memory available to other applications.
  1584. .\"*********************************************************
  1585. .TP
  1586. .B \-\-up cmd
  1587. Run command
  1588. .B cmd
  1589. after successful TUN/TAP device open
  1590. (pre
  1591. .B \-\-user
  1592. UID change).
  1593. .B cmd
  1594. consists of a path to script (or executable program), optionally
  1595. followed by arguments. The path and arguments may be single\- or double\-quoted
  1596. and/or escaped using a backslash, and should be separated by one or more spaces.
  1597. The up command is useful for specifying route
  1598. commands which route IP traffic destined for
  1599. private subnets which exist at the other
  1600. end of the VPN connection into the tunnel.
  1601. For
  1602. .B \-\-dev tun
  1603. execute as:
  1604. .B cmd tun_dev tun_mtu link_mtu ifconfig_local_ip ifconfig_remote_ip [ init | restart ]
  1605. For
  1606. .B \-\-dev tap
  1607. execute as:
  1608. .B cmd tap_dev tap_mtu link_mtu ifconfig_local_ip ifconfig_netmask [ init | restart ]
  1609. See the "Environmental Variables" section below for
  1610. additional parameters passed as environmental variables.
  1611. Note that if
  1612. .B cmd
  1613. includes arguments, all OpenVPN\-generated arguments will be appended
  1614. to them to build an argument list with which the executable will be
  1615. called.
  1616. Typically,
  1617. .B cmd
  1618. will run a script to add routes to the tunnel.
  1619. Normally the up script is called after the TUN/TAP device is opened.
  1620. In this context, the last command line parameter passed to the script
  1621. will be
  1622. .I init.
  1623. If the
  1624. .B \-\-up\-restart
  1625. option is also used, the up script will be called for restarts as
  1626. well. A restart is considered to be a partial reinitialization
  1627. of OpenVPN where the TUN/TAP instance is preserved (the
  1628. .B \-\-persist\-tun
  1629. option will enable such preservation). A restart
  1630. can be generated by a SIGUSR1 signal, a
  1631. .B \-\-ping\-restart
  1632. timeout, or a connection reset when the TCP protocol is enabled
  1633. with the
  1634. .B \-\-proto
  1635. option. If a restart occurs, and
  1636. .B \-\-up\-restart
  1637. has been specified, the up script will be called with
  1638. .I restart
  1639. as the last parameter.
  1640. NOTE: on restart, OpenVPN will not pass the full set of environment
  1641. variables to the script. Namely, everything related to routing and
  1642. gateways will not be passed, as nothing needs to be done anyway \- all
  1643. the routing setup is already in place. Additionally, the up\-restart
  1644. script will run with the downgraded UID/GID settings (if configured).
  1645. The following standalone example shows how the
  1646. .B \-\-up
  1647. script can be called in both an initialization and restart context.
  1648. (NOTE: for security reasons, don't run the following example unless UDP port
  1649. 9999 is blocked by your firewall. Also, the example will run indefinitely,
  1650. so you should abort with control\-c).
  1651. .B openvpn \-\-dev tun \-\-port 9999 \-\-verb 4 \-\-ping\-restart 10 \-\-up 'echo up' \-\-down 'echo down' \-\-persist\-tun \-\-up\-restart
  1652. Note that OpenVPN also provides the
  1653. .B \-\-ifconfig
  1654. option to automatically ifconfig the TUN device,
  1655. eliminating the need to define an
  1656. .B \-\-up
  1657. script, unless you also want to configure routes
  1658. in the
  1659. .B \-\-up
  1660. script.
  1661. If
  1662. .B \-\-ifconfig
  1663. is also specified, OpenVPN will pass the ifconfig local
  1664. and remote endpoints on the command line to the
  1665. .B \-\-up
  1666. script so that they can be used to configure routes such as:
  1667. .B route add \-net 10.0.0.0 netmask 255.255.255.0 gw $5
  1668. .\"*********************************************************
  1669. .TP
  1670. .B \-\-up\-delay
  1671. Delay TUN/TAP open and possible
  1672. .B \-\-up
  1673. script execution
  1674. until after TCP/UDP connection establishment with peer.
  1675. In
  1676. .B \-\-proto udp
  1677. mode, this option normally requires the use of
  1678. .B \-\-ping
  1679. to allow connection initiation to be sensed in the absence
  1680. of tunnel data, since UDP is a "connectionless" protocol.
  1681. On Windows, this option will delay the TAP\-Win32 media state
  1682. transitioning to "connected" until connection establishment,
  1683. i.e. the receipt of the first authenticated packet from the peer.
  1684. .\"*********************************************************
  1685. .TP
  1686. .B \-\-down cmd
  1687. Run command
  1688. .B cmd
  1689. after TUN/TAP device close
  1690. (post
  1691. .B \-\-user
  1692. UID change and/or
  1693. .B \-\-chroot
  1694. ).
  1695. .B cmd
  1696. consists of a path to script (or executable program), optionally
  1697. followed by arguments. The path and arguments may be single\- or double\-quoted
  1698. and/or escaped using a backslash, and should be separated by one or more spaces.
  1699. Called with the same parameters and environmental
  1700. variables as the
  1701. .B \-\-up
  1702. option above.
  1703. Note that if you reduce privileges by using
  1704. .B \-\-user
  1705. and/or
  1706. .B \-\-group,
  1707. your
  1708. .B \-\-down
  1709. script will also run at reduced privilege.
  1710. .\"*********************************************************
  1711. .TP
  1712. .B \-\-down\-pre
  1713. Call
  1714. .B \-\-down
  1715. cmd/script before, rather than after, TUN/TAP close.
  1716. .\"*********************************************************
  1717. .TP
  1718. .B \-\-up\-restart
  1719. Enable the
  1720. .B \-\-up
  1721. and
  1722. .B \-\-down
  1723. scripts to be called for restarts as well as initial program start.
  1724. This option is described more fully above in the
  1725. .B \-\-up
  1726. option documentation.
  1727. .\"*********************************************************
  1728. .TP
  1729. .B \-\-setenv name value
  1730. Set a custom environmental variable
  1731. .B name=value
  1732. to pass to script.
  1733. .\"*********************************************************
  1734. .TP
  1735. .B \-\-setenv FORWARD_COMPATIBLE 1
  1736. Relax config file syntax checking so that unknown directives
  1737. will trigger a warning but not a fatal error,
  1738. on the assumption that a given unknown directive might be valid
  1739. in future OpenVPN versions.
  1740. This option should be used with caution, as there are good security
  1741. reasons for having OpenVPN fail if it detects problems in a
  1742. config file. Having said that, there are valid reasons for wanting
  1743. new software features to gracefully degrade when encountered by
  1744. older software versions.
  1745. It is also possible to tag a single directive so as not to trigger
  1746. a fatal error if the directive isn't recognized. To do this,
  1747. prepend the following before the directive:
  1748. .B setenv opt
  1749. Versions prior to OpenVPN 2.3.3 will always ignore options set with the
  1750. .B setenv opt
  1751. directive.
  1752. See also
  1753. .B \-\-ignore\-unknown\-option
  1754. .\"*********************************************************
  1755. .TP
  1756. .B \-\-setenv\-safe name value
  1757. Set a custom environmental variable
  1758. .B OPENVPN_name=value
  1759. to pass to script.
  1760. This directive is designed to be pushed by the server to clients,
  1761. and the prepending of "OPENVPN_" to the environmental variable
  1762. is a safety precaution to prevent a LD_PRELOAD style attack
  1763. from a malicious or compromised server.
  1764. .\"*********************************************************
  1765. .TP
  1766. .B \-\-ignore\-unknown\-option opt1 opt2 opt3 ... optN
  1767. When one of options
  1768. .B opt1 ... optN
  1769. is encountered in the configuration file the configuration
  1770. file parsing does not fail if this OpenVPN version does not
  1771. support the option. Multiple
  1772. .B \-\-ignore\-unknown\-option
  1773. options can be given to support a larger number of options to ignore.
  1774. This option should be used with caution, as there are good security
  1775. reasons for having OpenVPN fail if it detects problems in a
  1776. config file. Having said that, there are valid reasons for wanting
  1777. new software features to gracefully degrade when encountered by
  1778. older software versions.
  1779. .B \-\-ignore\-unknown\-option
  1780. is available since OpenVPN 2.3.3.
  1781. .\"*********************************************************
  1782. .TP
  1783. .B \-\-script\-security level
  1784. This directive offers policy\-level control over OpenVPN's usage of external programs
  1785. and scripts. Lower
  1786. .B level
  1787. values are more restrictive, higher values are more permissive. Settings for
  1788. .B level:
  1789. .B 0 \-\-
  1790. Strictly no calling of external programs.
  1791. .br
  1792. .B 1 \-\-
  1793. (Default) Only call built\-in executables such as ifconfig, ip, route, or netsh.
  1794. .br
  1795. .B 2 \-\-
  1796. Allow calling of built\-in executables and user\-defined scripts.
  1797. .br
  1798. .B 3 \-\-
  1799. Allow passwords to be passed to scripts via environmental variables (potentially unsafe).
  1800. OpenVPN releases before v2.3 also supported a
  1801. .B method
  1802. flag which indicated how OpenVPN should call external commands and scripts. This
  1803. could be either
  1804. .B execve
  1805. or
  1806. .B system.
  1807. As of OpenVPN 2.3, this flag is no longer accepted. In most *nix environments the execve()
  1808. approach has been used without any issues.
  1809. Some directives such as \-\-up allow options to be passed to the external
  1810. script. In these cases make sure the script name does not contain any spaces or
  1811. the configuration parser will choke because it can't determine where the script
  1812. name ends and script options start.
  1813. To run scripts in Windows in earlier OpenVPN
  1814. versions you needed to either add a full path to the script interpreter which can parse the
  1815. script or use the
  1816. .B system
  1817. flag to run these scripts. As of OpenVPN 2.3 it is now a strict requirement to have
  1818. full path to the script interpreter when running non\-executables files.
  1819. This is not needed for executable files, such as .exe, .com, .bat or .cmd files. For
  1820. example, if you have a Visual Basic script, you must use this syntax now:
  1821. .nf
  1822. .ft 3
  1823. .in +4
  1824. \-\-up 'C:\\\\Windows\\\\System32\\\\wscript.exe C:\\\\Program\\ Files\\\\OpenVPN\\\\config\\\\my\-up\-script.vbs'
  1825. .in -4
  1826. .ft
  1827. .fi
  1828. Please note the single quote marks and the escaping of the backslashes (\\) and
  1829. the space character.
  1830. The reason the support for the
  1831. .B system
  1832. flag was removed is due to the security implications with shell expansions
  1833. when executing scripts via the system() call.
  1834. .\"*********************************************************
  1835. .TP
  1836. .B \-\-disable\-occ
  1837. Don't output a warning message if option inconsistencies are detected between
  1838. peers. An example of an option inconsistency would be where one peer uses
  1839. .B \-\-dev tun
  1840. while the other peer uses
  1841. .B \-\-dev tap.
  1842. Use of this option is discouraged, but is provided as
  1843. a temporary fix in situations where a recent version of OpenVPN must
  1844. connect to an old version.
  1845. .\"*********************************************************
  1846. .TP
  1847. .B \-\-user user
  1848. Change the user ID of the OpenVPN process to
  1849. .B user
  1850. after initialization, dropping privileges in the process.
  1851. This option is useful to protect the system
  1852. in the event that some hostile party was able to gain control of
  1853. an OpenVPN session. Though OpenVPN's security features make
  1854. this unlikely, it is provided as a second line of defense.
  1855. By setting
  1856. .B user
  1857. to
  1858. .I nobody
  1859. or somebody similarly unprivileged, the hostile party would be
  1860. limited in what damage they could cause. Of course once
  1861. you take away privileges, you cannot return them
  1862. to an OpenVPN session. This means, for example, that if
  1863. you want to reset an OpenVPN daemon with a
  1864. .B SIGUSR1
  1865. signal
  1866. (for example in response
  1867. to a DHCP reset), you should make use of one or more of the
  1868. .B \-\-persist
  1869. options to ensure that OpenVPN doesn't need to execute any privileged
  1870. operations in order to restart (such as re\-reading key files
  1871. or running
  1872. .BR ifconfig
  1873. on the TUN device).
  1874. .\"*********************************************************
  1875. .TP
  1876. .B \-\-group group
  1877. Similar to the
  1878. .B \-\-user
  1879. option,
  1880. this option changes the group ID of the OpenVPN process to
  1881. .B group
  1882. after initialization.
  1883. .\"*********************************************************
  1884. .TP
  1885. .B \-\-cd dir
  1886. Change directory to
  1887. .B dir
  1888. prior to reading any files such as
  1889. configuration files, key files, scripts, etc.
  1890. .B dir
  1891. should be an absolute path, with a leading "/",
  1892. and without any references
  1893. to the current directory such as "." or "..".
  1894. This option is useful when you are running
  1895. OpenVPN in
  1896. .B \-\-daemon
  1897. mode, and you want to consolidate all of
  1898. your OpenVPN control files in one location.
  1899. .\"*********************************************************
  1900. .TP
  1901. .B \-\-chroot dir
  1902. Chroot to
  1903. .B dir
  1904. after initialization.
  1905. .B \-\-chroot
  1906. essentially redefines
  1907. .B dir
  1908. as being the top
  1909. level directory tree (/). OpenVPN will therefore
  1910. be unable to access any files outside this tree.
  1911. This can be desirable from a security standpoint.
  1912. Since the chroot operation is delayed until after
  1913. initialization, most OpenVPN options that reference
  1914. files will operate in a pre\-chroot context.
  1915. In many cases, the
  1916. .B dir
  1917. parameter can point to an empty directory, however
  1918. complications can result when scripts or restarts
  1919. are executed after the chroot operation.
  1920. Note: The SSL library will probably need /dev/urandom to be available inside
  1921. the chroot directory
  1922. .B dir.
  1923. This is because SSL libraries occasionally need to collect fresh random. Newer
  1924. linux kernels and some BSDs implement a getrandom() or getentropy() syscall
  1925. that removes the need for /dev/urandom to be available.
  1926. .\"*********************************************************
  1927. .TP
  1928. .B \-\-setcon context
  1929. Apply SELinux
  1930. .B context
  1931. after initialization. This
  1932. essentially provides the ability to restrict OpenVPN's
  1933. rights to only network I/O operations, thanks to
  1934. SELinux. This goes further than
  1935. .B \-\-user
  1936. and
  1937. .B \-\-chroot
  1938. in that those two, while being great security features,
  1939. unfortunately do not protect against privilege escalation
  1940. by exploitation of a vulnerable system call. You can of
  1941. course combine all three, but please note that since
  1942. setcon requires access to /proc you will have to provide
  1943. it inside the chroot directory (e.g. with mount \-\-bind).
  1944. Since the setcon operation is delayed until after
  1945. initialization, OpenVPN can be restricted to just
  1946. network\-related system calls, whereas by applying the
  1947. context before startup (such as the OpenVPN one provided
  1948. in the SELinux Reference Policies) you will have to
  1949. allow many things required only during initialization.
  1950. Like with chroot, complications can result when scripts
  1951. or restarts are executed after the setcon operation,
  1952. which is why you should really consider using the
  1953. .B \-\-persist\-key
  1954. and
  1955. .B \-\-persist\-tun
  1956. options.
  1957. .\"*********************************************************
  1958. .TP
  1959. .B \-\-daemon [progname]
  1960. Become a daemon after all initialization functions are completed.
  1961. This option will cause all message and error output to
  1962. be sent to the syslog file (such as /var/log/messages),
  1963. except for the output of scripts and
  1964. ifconfig commands,
  1965. which will go to /dev/null unless otherwise redirected.
  1966. The syslog redirection occurs immediately at the point
  1967. that
  1968. .B \-\-daemon
  1969. is parsed on the command line even though
  1970. the daemonization point occurs later. If one of the
  1971. .B \-\-log
  1972. options is present, it will supercede syslog
  1973. redirection.
  1974. The optional
  1975. .B progname
  1976. parameter will cause OpenVPN to report its program name
  1977. to the system logger as
  1978. .B progname.
  1979. This can be useful in linking OpenVPN messages
  1980. in the syslog file with specific tunnels.
  1981. When unspecified,
  1982. .B progname
  1983. defaults to "openvpn".
  1984. When OpenVPN is run with the
  1985. .B \-\-daemon
  1986. option, it will try to delay daemonization until the majority of initialization
  1987. functions which are capable of generating fatal errors are complete. This means
  1988. that initialization scripts can test the return status of the
  1989. openvpn command for a fairly reliable indication of whether the command
  1990. has correctly initialized and entered the packet forwarding event loop.
  1991. In OpenVPN, the vast majority of errors which occur after initialization are non\-fatal.
  1992. Note: as soon as OpenVPN has daemonized, it can not ask for usernames,
  1993. passwords, or key pass phrases anymore. This has certain consequences,
  1994. namely that using a password\-protected private key will fail unless the
  1995. .B \-\-askpass
  1996. option is used to tell OpenVPN to ask for the pass phrase (this
  1997. requirement is new in v2.3.7, and is a consequence of calling daemon()
  1998. before initializing the crypto layer).
  1999. Further, using
  2000. .B \-\-daemon
  2001. together with
  2002. .B \-\-auth\-user\-pass
  2003. (entered on console) and
  2004. .B \-\-auth\-nocache
  2005. will fail as soon as key renegotiation (and reauthentication) occurs.
  2006. .\"*********************************************************
  2007. .TP
  2008. .B \-\-syslog [progname]
  2009. Direct log output to system logger, but do not become a daemon.
  2010. See
  2011. .B \-\-daemon
  2012. directive above for description of
  2013. .B progname
  2014. parameter.
  2015. .TP
  2016. .B \-\-errors\-to\-stderr
  2017. Output errors to stderr instead of stdout unless log output is redirected by one of the
  2018. .B \-\-log
  2019. options.
  2020. .\"*********************************************************
  2021. .TP
  2022. .B \-\-passtos
  2023. Set the TOS field of the tunnel packet to what the payload's TOS is.
  2024. .\"*********************************************************
  2025. .TP
  2026. .B \-\-inetd [wait|nowait] [progname]
  2027. Use this option when OpenVPN is being run from the inetd or
  2028. .BR xinetd(8)
  2029. server.
  2030. The
  2031. .B wait/nowait
  2032. option must match what is specified in the inetd/xinetd
  2033. config file. The
  2034. .B nowait
  2035. mode can only be used with
  2036. .B \-\-proto tcp\-server.
  2037. The default is
  2038. .B wait.
  2039. The
  2040. .B nowait
  2041. mode can be used to instantiate the OpenVPN daemon as a classic TCP server,
  2042. where client connection requests are serviced on a single
  2043. port number. For additional information on this kind of configuration,
  2044. see the OpenVPN FAQ:
  2045. .I http://openvpn.net/faq.html#oneport
  2046. This option precludes the use of
  2047. .B \-\-daemon, \-\-local,
  2048. or
  2049. .B \-\-remote.
  2050. Note that this option causes message and error output to be handled in the same
  2051. way as the
  2052. .B \-\-daemon
  2053. option. The optional
  2054. .B progname
  2055. parameter is also handled exactly as in
  2056. .B \-\-daemon.
  2057. Also note that in
  2058. .B wait
  2059. mode, each OpenVPN tunnel requires a separate TCP/UDP port and
  2060. a separate inetd or xinetd entry. See the OpenVPN 1.x HOWTO for an example
  2061. on using OpenVPN with xinetd:
  2062. .I http://openvpn.net/1xhowto.html
  2063. .\"*********************************************************
  2064. .TP
  2065. .B \-\-log file
  2066. Output logging messages to
  2067. .B file,
  2068. including output to stdout/stderr which
  2069. is generated by called scripts.
  2070. If
  2071. .B file
  2072. already exists it will be truncated.
  2073. This option takes effect
  2074. immediately when it is parsed in the command line
  2075. and will supercede syslog output if
  2076. .B \-\-daemon
  2077. or
  2078. .B \-\-inetd
  2079. is also specified.
  2080. This option is persistent over the entire course of
  2081. an OpenVPN instantiation and will not be reset by SIGHUP,
  2082. SIGUSR1, or
  2083. .B \-\-ping\-restart.
  2084. Note that on Windows, when OpenVPN is started as a service,
  2085. logging occurs by default without the need to specify
  2086. this option.
  2087. .\"*********************************************************
  2088. .TP
  2089. .B \-\-log\-append file
  2090. Append logging messages to
  2091. .B file.
  2092. If
  2093. .B file
  2094. does not exist, it will be created.
  2095. This option behaves exactly like
  2096. .B \-\-log
  2097. except that it appends to rather
  2098. than truncating the log file.
  2099. .\"*********************************************************
  2100. .TP
  2101. .B \-\-suppress\-timestamps
  2102. Avoid writing timestamps to log messages, even when they
  2103. otherwise would be prepended. In particular, this applies to
  2104. log messages sent to stdout.
  2105. .\"*********************************************************
  2106. .TP
  2107. .B \-\-machine\-readable\-output
  2108. Always write timestamps and message flags to log messages, even when they
  2109. otherwise would not be prefixed. In particular, this applies to
  2110. log messages sent to stdout.
  2111. .\"*********************************************************
  2112. .TP
  2113. .B \-\-writepid file
  2114. Write OpenVPN's main process ID to
  2115. .B file.
  2116. .\"*********************************************************
  2117. .TP
  2118. .B \-\-nice n
  2119. Change process priority after initialization
  2120. (
  2121. .B n
  2122. greater than 0 is lower priority,
  2123. .B n
  2124. less than zero is higher priority).
  2125. .\"*********************************************************
  2126. .\".TP
  2127. .\".B \-\-nice\-work n
  2128. .\"Change priority of background TLS work thread. The TLS thread
  2129. .\"feature is enabled when OpenVPN is built
  2130. .\"with pthread support, and you are running OpenVPN
  2131. .\"in TLS mode (i.e. with
  2132. .\".B \-\-tls\-client
  2133. .\"or
  2134. .\".B \-\-tls\-server
  2135. .\"specified).
  2136. .\"
  2137. .\"Using a TLS thread offloads the CPU\-intensive process of SSL/TLS\-based
  2138. .\"key exchange to a background thread so that it does not become
  2139. .\"a latency bottleneck in the tunnel packet forwarding process.
  2140. .\"
  2141. .\"The parameter
  2142. .\".B n
  2143. .\"is interpreted exactly as with the
  2144. .\".B \-\-nice
  2145. .\"option above, but in relation to the work thread rather
  2146. .\"than the main thread.
  2147. .\"*********************************************************
  2148. .TP
  2149. .B \-\-fast\-io
  2150. (Experimental) Optimize TUN/TAP/UDP I/O writes by avoiding
  2151. a call to poll/epoll/select prior to the write operation. The purpose
  2152. of such a call would normally be to block until the device
  2153. or socket is ready to accept the write. Such blocking is unnecessary
  2154. on some platforms which don't support write blocking on UDP sockets
  2155. or TUN/TAP devices. In such cases, one can optimize the event loop
  2156. by avoiding the poll/epoll/select call, improving CPU efficiency
  2157. by 5% to 10%.
  2158. This option can only be used on non\-Windows systems, when
  2159. .B \-\-proto udp
  2160. is specified, and when
  2161. .B \-\-shaper
  2162. is NOT specified.
  2163. .\"*********************************************************
  2164. .TP
  2165. .B \-\-multihome
  2166. Configure a multi\-homed UDP server. This option needs to be used when
  2167. a server has more than one IP address (e.g. multiple interfaces, or
  2168. secondary IP addresses), and is not using
  2169. .B \-\-local
  2170. to force binding to one specific address only. This option will
  2171. add some extra lookups to the packet path to ensure that the UDP reply
  2172. packets are always sent from the address that the client is
  2173. talking to. This is not supported on all platforms, and it adds more
  2174. processing, so it's not enabled by default.
  2175. Note: this option is only relevant for UDP servers.
  2176. Note 2: if you do an IPv6+IPv4 dual\-stack bind on a Linux machine with
  2177. multiple IPv4 address, connections to IPv4 addresses will not work
  2178. right on kernels before 3.15, due to missing kernel support for the
  2179. IPv4\-mapped case (some distributions have ported this to earlier kernel
  2180. versions, though).
  2181. .\"*********************************************************
  2182. .TP
  2183. .B \-\-echo [parms...]
  2184. Echo
  2185. .B parms
  2186. to log output.
  2187. Designed to be used to send messages to a controlling application
  2188. which is receiving the OpenVPN log output.
  2189. .\"*********************************************************
  2190. .TP
  2191. .B \-\-remap\-usr1 signal
  2192. Control whether internally or externally
  2193. generated SIGUSR1 signals are remapped to
  2194. SIGHUP (restart without persisting state) or
  2195. SIGTERM (exit).
  2196. .B signal
  2197. can be set to "SIGHUP" or "SIGTERM". By default, no remapping
  2198. occurs.
  2199. .\"*********************************************************
  2200. .TP
  2201. .B \-\-verb n
  2202. Set output verbosity to
  2203. .B n
  2204. (default=1). Each level shows all info from the previous levels.
  2205. Level 3 is recommended if you want a good summary
  2206. of what's happening without being swamped by output.
  2207. .B 0 \-\-
  2208. No output except fatal errors.
  2209. .br
  2210. .B 1 to 4 \-\-
  2211. Normal usage range.
  2212. .br
  2213. .B 5 \-\-
  2214. Output
  2215. .B R
  2216. and
  2217. .B W
  2218. characters to the console for each packet read and write, uppercase is
  2219. used for TCP/UDP packets and lowercase is used for TUN/TAP packets.
  2220. .br
  2221. .B 6 to 11 \-\-
  2222. Debug info range (see errlevel.h for additional
  2223. information on debug levels).
  2224. .\"*********************************************************
  2225. .TP
  2226. .B \-\-status file [n]
  2227. Write operational status to
  2228. .B file
  2229. every
  2230. .B n
  2231. seconds.
  2232. Status can also be written to the syslog by sending a
  2233. .B SIGUSR2
  2234. signal.
  2235. With multi\-client capability enabled on a server, the status file includes a
  2236. list of clients and a routing table. The output format can be controlled by the
  2237. .B \-\-status\-version
  2238. option in that case.
  2239. For clients or instances running in point\-to\-point mode, it will contain the
  2240. traffic statistics.
  2241. .\"*********************************************************
  2242. .TP
  2243. .B \-\-status\-version [n]
  2244. Set the status file format version number to
  2245. .B n\fR.
  2246. This only affects the status file on servers with multi\-client capability
  2247. enabled.
  2248. .B 1
  2249. \-\- traditional format (default). The client list contains the following
  2250. fields comma\-separated: Common Name, Real Address, Bytes Received, Bytes Sent,
  2251. Connected Since.
  2252. .br
  2253. .B 2
  2254. \-\- a more reliable format for external processing. Compared to version 1, the
  2255. client list contains some additional fields: Virtual Address, Virtual IPv6
  2256. Address, Username, Client ID, Peer ID.
  2257. Future versions may extend the number of fields.
  2258. .br
  2259. .B 3
  2260. \-\- identical to 2, but fields are tab\-separated.
  2261. .\"*********************************************************
  2262. .TP
  2263. .B \-\-mute n
  2264. Log at most
  2265. .B n
  2266. consecutive messages in the same category. This is useful to
  2267. limit repetitive logging of similar message types.
  2268. .\"*********************************************************
  2269. .TP
  2270. .B \-\-compress [algorithm]
  2271. Enable a compression algorithm.
  2272. The
  2273. .B algorithm
  2274. parameter may be "lzo", "lz4", or empty. LZO and LZ4
  2275. are different compression algorithms, with LZ4 generally
  2276. offering the best performance with least CPU usage.
  2277. For backwards compatibility with OpenVPN versions before v2.4, use "lzo"
  2278. (which is identical to the older option "\-\-comp\-lzo yes").
  2279. If the
  2280. .B algorithm
  2281. parameter is empty, compression will be turned off, but the packet
  2282. framing for compression will still be enabled, allowing a different
  2283. setting to be pushed later.
  2284. .B Security Considerations
  2285. Compression and encryption is a tricky combination. If an attacker knows or is
  2286. able to control (parts of) the plaintext of packets that contain secrets, the
  2287. attacker might be able to extract the secret if compression is enabled. See
  2288. e.g. the CRIME and BREACH attacks on TLS which also leverage compression to
  2289. break encryption. If you are not entirely sure that the above does not apply
  2290. to your traffic, you are advised to *not* enable compression.
  2291. .\"*********************************************************
  2292. .TP
  2293. .B \-\-comp\-lzo [mode]
  2294. .B DEPRECATED
  2295. This option will be removed in a future OpenVPN release. Use the
  2296. newer
  2297. .B \-\-compress
  2298. instead.
  2299. Use LZO compression \-\- may add up to 1 byte per
  2300. packet for incompressible data.
  2301. .B mode
  2302. may be "yes", "no", or "adaptive" (default).
  2303. In a server mode setup, it is possible to selectively turn
  2304. compression on or off for individual clients.
  2305. First, make sure the client\-side config file enables selective
  2306. compression by having at least one
  2307. .B \-\-comp\-lzo
  2308. directive, such as
  2309. .B \-\-comp\-lzo no.
  2310. This will turn off compression by default,
  2311. but allow a future directive push from the server to
  2312. dynamically change the
  2313. on/off/adaptive setting.
  2314. Next in a
  2315. .B \-\-client\-config\-dir
  2316. file, specify the compression setting for the client,
  2317. for example:
  2318. .nf
  2319. .ft 3
  2320. .in +4
  2321. comp\-lzo yes
  2322. push "comp\-lzo yes"
  2323. .in -4
  2324. .ft
  2325. .fi
  2326. The first line sets the
  2327. .B comp\-lzo
  2328. setting for the server
  2329. side of the link, the second sets the client side.
  2330. .\"*********************************************************
  2331. .TP
  2332. .B \-\-comp\-noadapt
  2333. When used in conjunction with
  2334. .B \-\-comp\-lzo,
  2335. this option will disable OpenVPN's adaptive compression algorithm.
  2336. Normally, adaptive compression is enabled with
  2337. .B \-\-comp\-lzo.
  2338. Adaptive compression tries to optimize the case where you have
  2339. compression enabled, but you are sending predominantly incompressible
  2340. (or pre\-compressed) packets over the tunnel, such as an FTP or rsync transfer
  2341. of a large, compressed file. With adaptive compression,
  2342. OpenVPN will periodically sample the compression process to measure its
  2343. efficiency. If the data being sent over the tunnel is already compressed,
  2344. the compression efficiency will be very low, triggering openvpn to disable
  2345. compression for a period of time until the next re\-sample test.
  2346. .\"*********************************************************
  2347. .TP
  2348. .B \-\-management socket\-name unix [pw\-file] \ \ \ \ \ (recommended)
  2349. .TQ
  2350. .B \-\-management IP port [pw\-file]
  2351. Enable a management server on a
  2352. .B socket\-name
  2353. Unix socket on those platforms supporting it, or on
  2354. a designated TCP port.
  2355. .B pw\-file
  2356. , if specified, is a password file where the password must be on first line.
  2357. Instead of a filename it can use the keyword stdin which will prompt the user
  2358. for a password to use when OpenVPN is starting.
  2359. For unix sockets, the default behaviour is to create a unix domain socket
  2360. that may be connected to by any process. Use the
  2361. .B \-\-management\-client\-user
  2362. and
  2363. .B \-\-management\-client\-group
  2364. directives to restrict access.
  2365. The management interface provides a special mode where the TCP management link
  2366. can operate over the tunnel itself. To enable this mode, set IP to
  2367. .B tunnel.
  2368. Tunnel mode will cause the management interface to listen for a
  2369. TCP connection on the local VPN address of the TUN/TAP interface.
  2370. .B BEWARE
  2371. of enabling the management interface over TCP. In these cases you should
  2372. .I ALWAYS
  2373. make use of
  2374. .B pw\-file
  2375. to password protect the management interface. Any user who can connect to this
  2376. TCP
  2377. .B IP:port
  2378. will be able to manage and control (and interfere with) the OpenVPN process.
  2379. It is also strongly recommended to set IP to 127.0.0.1 (localhost) to restrict
  2380. accessibility of the management server to local clients.
  2381. While the management port is designed for programmatic control of OpenVPN by
  2382. other applications, it is possible to telnet to the port, using a telnet client
  2383. in "raw" mode. Once connected, type "help" for a list of commands.
  2384. For detailed documentation on the management interface, see the
  2385. .I management\-notes.txt
  2386. file in the management folder of the OpenVPN source distribution.
  2387. .TP
  2388. .B \-\-management\-client
  2389. Management interface will connect as a TCP/unix domain client to
  2390. .B IP:port
  2391. specified by
  2392. .B \-\-management
  2393. rather than listen as a TCP server or on a unix domain socket.
  2394. If the client connection fails to connect or is disconnected,
  2395. a SIGTERM signal will be generated causing OpenVPN to quit.
  2396. .\"*********************************************************
  2397. .TP
  2398. .B \-\-management\-query\-passwords
  2399. Query management channel for private key password and
  2400. .B \-\-auth\-user\-pass
  2401. username/password. Only query the management channel
  2402. for inputs which ordinarily would have been queried from the
  2403. console.
  2404. .\"*********************************************************
  2405. .TP
  2406. .B \-\-management\-query\-proxy
  2407. Query management channel for proxy server information for a specific
  2408. .B \-\-remote
  2409. (client\-only).
  2410. .\"*********************************************************
  2411. .TP
  2412. .B \-\-management\-query\-remote
  2413. Allow management interface to override
  2414. .B \-\-remote
  2415. directives (client\-only).
  2416. .\"*********************************************************
  2417. .TP
  2418. .B \-\-management\-external\-key
  2419. Allows usage for external private key file instead of
  2420. .B \-\-key
  2421. option (client\-only).
  2422. .\"*********************************************************
  2423. .TP
  2424. .B \-\-management\-external\-cert certificate\-hint
  2425. Allows usage for external certificate instead of
  2426. .B \-\-cert
  2427. option (client\-only).
  2428. .B certificate\-hint
  2429. is an arbitrary string which is passed to a management
  2430. interface client as an argument of NEED\-CERTIFICATE notification.
  2431. Requires \-\-management\-external\-key.
  2432. .\"*********************************************************
  2433. .TP
  2434. .B \-\-management\-forget\-disconnect
  2435. Make OpenVPN forget passwords when management session
  2436. disconnects.
  2437. This directive does not affect the
  2438. .B \-\-http\-proxy
  2439. username/password. It is always cached.
  2440. .\"*********************************************************
  2441. .TP
  2442. .B \-\-management\-hold
  2443. Start OpenVPN in a hibernating state, until a client
  2444. of the management interface explicitly starts it
  2445. with the
  2446. .B hold release
  2447. command.
  2448. .\"*********************************************************
  2449. .TP
  2450. .B \-\-management\-signal
  2451. Send SIGUSR1 signal to OpenVPN if management session disconnects.
  2452. This is useful when you wish to disconnect an OpenVPN session on
  2453. user logoff. For \-\-management\-client this option is not needed since
  2454. a disconnect will always generate a SIGTERM.
  2455. .\"*********************************************************
  2456. .TP
  2457. .B \-\-management\-log\-cache n
  2458. Cache the most recent
  2459. .B n
  2460. lines of log file history for usage
  2461. by the management channel.
  2462. .\"*********************************************************
  2463. .TP
  2464. .B \-\-management\-up\-down
  2465. Report tunnel up/down events to management interface.
  2466. .B
  2467. .\"*********************************************************
  2468. .TP
  2469. .B \-\-management\-client\-auth
  2470. Gives management interface client the responsibility
  2471. to authenticate clients after their client certificate
  2472. has been verified. See management\-notes.txt in OpenVPN
  2473. distribution for detailed notes.
  2474. .\"*********************************************************
  2475. .TP
  2476. .B \-\-management\-client\-pf
  2477. Management interface clients must specify a packet
  2478. filter file for each connecting client. See management\-notes.txt
  2479. in OpenVPN distribution for detailed notes.
  2480. .\"*********************************************************
  2481. .TP
  2482. .B \-\-management\-client\-user u
  2483. When the management interface is listening on a unix domain socket,
  2484. only allow connections from user
  2485. .B u.
  2486. .\"*********************************************************
  2487. .TP
  2488. .B \-\-management\-client\-group g
  2489. When the management interface is listening on a unix domain socket,
  2490. only allow connections from group
  2491. .B g.
  2492. .\"*********************************************************
  2493. .TP
  2494. .B \-\-plugin module\-pathname [init\-string]
  2495. Load plug\-in module from the file
  2496. .B module\-pathname,
  2497. passing
  2498. .B init\-string
  2499. as an argument
  2500. to the module initialization function. Multiple
  2501. plugin modules may be loaded into one OpenVPN
  2502. process.
  2503. The
  2504. .B module\-pathname
  2505. argument can be just a filename or a filename with a relative
  2506. or absolute path. The format of the filename and path defines
  2507. if the plug\-in will be loaded from a default plug\-in directory
  2508. or outside this directory.
  2509. .nf
  2510. .ft 3
  2511. .in +4
  2512. .B \-\-plugin path\ \ \ \ \ \ \ \ Effective directory used
  2513. ====================================================
  2514. myplug.so DEFAULT_DIR/myplug.so
  2515. subdir/myplug.so DEFAULT_DIR/subdir/myplug.so
  2516. ./subdir/myplug.so CWD/subdir/myplug.so
  2517. /usr/lib/my/plug.so /usr/lib/my/plug.so
  2518. .in -4
  2519. .fi
  2520. DEFAULT_DIR is replaced by the default plug\-in directory,
  2521. which is configured at the build time of OpenVPN. CWD is the
  2522. current directory where OpenVPN was started or the directory
  2523. OpenVPN have swithed into via the
  2524. .B \-\-cd
  2525. option before the
  2526. .B \-\-plugin
  2527. option.
  2528. For more information and examples on how to build OpenVPN
  2529. plug\-in modules, see the README file in the
  2530. .B plugin
  2531. folder of the OpenVPN source distribution.
  2532. If you are using an RPM install of OpenVPN, see
  2533. /usr/share/openvpn/plugin. The documentation is
  2534. in
  2535. .B doc
  2536. and the actual plugin modules are in
  2537. .B lib.
  2538. Multiple plugin modules can be cascaded, and modules can be
  2539. used in tandem with scripts. The modules will be called by
  2540. OpenVPN in the order that they are declared in the config
  2541. file. If both a plugin and script are configured for the same
  2542. callback, the script will be called last. If the
  2543. return code of the module/script controls an authentication
  2544. function (such as tls\-verify, auth\-user\-pass\-verify, or
  2545. client\-connect), then
  2546. every module and script must return success (0) in order for
  2547. the connection to be authenticated.
  2548. .\"*********************************************************
  2549. .TP
  2550. .B \-\-keying\-material\-exporter label len
  2551. Save Exported Keying Material [RFC5705] of len bytes (must be
  2552. between 16 and 4095 bytes) using label in environment
  2553. (exported_keying_material) for use by plugins in
  2554. OPENVPN_PLUGIN_TLS_FINAL callback.
  2555. Note that exporter labels have the potential to collide with existing PRF
  2556. labels. In order to prevent this, labels MUST begin with "EXPORTER".
  2557. This option requires OpenSSL 1.0.1 or newer.
  2558. .\"*********************************************************
  2559. .SS Server Mode
  2560. Starting with OpenVPN 2.0, a multi\-client TCP/UDP server mode
  2561. is supported, and can be enabled with the
  2562. .B \-\-mode server
  2563. option. In server mode, OpenVPN will listen on a single
  2564. port for incoming client connections. All client
  2565. connections will be routed through a single tun or tap
  2566. interface. This mode is designed for scalability and should
  2567. be able to support hundreds or even thousands of clients
  2568. on sufficiently fast hardware. SSL/TLS authentication must
  2569. be used in this mode.
  2570. .\"*********************************************************
  2571. .TP
  2572. .B \-\-server network netmask ['nopool']
  2573. A helper directive designed to simplify the configuration
  2574. of OpenVPN's server mode. This directive will set up an
  2575. OpenVPN server which will allocate addresses to clients
  2576. out of the given network/netmask. The server itself
  2577. will take the ".1" address of the given network
  2578. for use as the server\-side endpoint of the local
  2579. TUN/TAP interface.
  2580. For example,
  2581. .B \-\-server 10.8.0.0 255.255.255.0
  2582. expands as follows:
  2583. .nf
  2584. .ft 3
  2585. .in +4
  2586. mode server
  2587. tls\-server
  2588. push "topology [topology]"
  2589. if dev tun AND (topology == net30 OR topology == p2p):
  2590. ifconfig 10.8.0.1 10.8.0.2
  2591. if !nopool:
  2592. ifconfig\-pool 10.8.0.4 10.8.0.251
  2593. route 10.8.0.0 255.255.255.0
  2594. if client\-to\-client:
  2595. push "route 10.8.0.0 255.255.255.0"
  2596. else if topology == net30:
  2597. push "route 10.8.0.1"
  2598. if dev tap OR (dev tun AND topology == subnet):
  2599. ifconfig 10.8.0.1 255.255.255.0
  2600. if !nopool:
  2601. ifconfig\-pool 10.8.0.2 10.8.0.253 255.255.255.0
  2602. push "route\-gateway 10.8.0.1"
  2603. if route\-gateway unset:
  2604. route\-gateway 10.8.0.2
  2605. .in -4
  2606. .ft
  2607. .fi
  2608. Don't use
  2609. .B \-\-server
  2610. if you are ethernet bridging. Use
  2611. .B \-\-server\-bridge
  2612. instead.
  2613. .\"*********************************************************
  2614. .TP
  2615. .B \-\-server\-bridge gateway netmask pool\-start\-IP pool\-end\-IP
  2616. .TP
  2617. .B \-\-server\-bridge ['nogw']
  2618. A helper directive similar to
  2619. .B \-\-server
  2620. which is designed to simplify the configuration
  2621. of OpenVPN's server mode in ethernet bridging configurations.
  2622. If
  2623. .B \-\-server\-bridge
  2624. is used without any parameters, it will enable a DHCP\-proxy
  2625. mode, where connecting OpenVPN clients will receive an IP
  2626. address for their TAP adapter from the DHCP server running
  2627. on the OpenVPN server\-side LAN.
  2628. Note that only clients that support
  2629. the binding of a DHCP client with the TAP adapter (such as
  2630. Windows) can support this mode. The optional
  2631. .B nogw
  2632. flag (advanced) indicates that gateway information should not be
  2633. pushed to the client.
  2634. To configure ethernet bridging, you
  2635. must first use your OS's bridging capability
  2636. to bridge the TAP interface with the ethernet
  2637. NIC interface. For example, on Linux this is done
  2638. with the
  2639. .B brctl
  2640. tool, and with Windows XP it is done in the Network
  2641. Connections Panel by selecting the ethernet and
  2642. TAP adapters and right\-clicking on "Bridge Connections".
  2643. Next you you must manually set the
  2644. IP/netmask on the bridge interface. The
  2645. .B gateway
  2646. and
  2647. .B netmask
  2648. parameters to
  2649. .B \-\-server\-bridge
  2650. can be set to either the IP/netmask of the
  2651. bridge interface, or the IP/netmask of the
  2652. default gateway/router on the bridged
  2653. subnet.
  2654. Finally, set aside a IP range in the bridged
  2655. subnet,
  2656. denoted by
  2657. .B pool\-start\-IP
  2658. and
  2659. .B pool\-end\-IP,
  2660. for OpenVPN to allocate to connecting
  2661. clients.
  2662. For example,
  2663. .B server\-bridge 10.8.0.4 255.255.255.0 10.8.0.128 10.8.0.254
  2664. expands as follows:
  2665. .nf
  2666. .ft 3
  2667. .in +4
  2668. mode server
  2669. tls\-server
  2670. ifconfig\-pool 10.8.0.128 10.8.0.254 255.255.255.0
  2671. push "route\-gateway 10.8.0.4"
  2672. .in -4
  2673. .ft
  2674. .fi
  2675. In another example,
  2676. .B \-\-server\-bridge
  2677. (without parameters) expands as follows:
  2678. .nf
  2679. .ft 3
  2680. .in +4
  2681. mode server
  2682. tls\-server
  2683. push "route\-gateway dhcp"
  2684. .in -4
  2685. .ft
  2686. .fi
  2687. Or
  2688. .B \-\-server\-bridge nogw
  2689. expands as follows:
  2690. .nf
  2691. .ft 3
  2692. .in +4
  2693. mode server
  2694. tls\-server
  2695. .in -4
  2696. .ft
  2697. .fi
  2698. .\"*********************************************************
  2699. .TP
  2700. .B \-\-push "option"
  2701. Push a config file option back to the client for remote
  2702. execution. Note that
  2703. .B
  2704. option
  2705. must be enclosed in double quotes (""). The client must specify
  2706. .B \-\-pull
  2707. in its config file. The set of options which can be
  2708. pushed is limited by both feasibility and security.
  2709. Some options such as those which would execute scripts
  2710. are banned, since they would effectively allow a compromised
  2711. server to execute arbitrary code on the client.
  2712. Other options such as TLS or MTU parameters
  2713. cannot be pushed because the client needs to know
  2714. them before the connection to the server can be initiated.
  2715. This is a partial list of options which can currently be pushed:
  2716. .B \-\-route, \-\-route\-gateway, \-\-route\-delay, \-\-redirect\-gateway,
  2717. .B \-\-ip\-win32, \-\-dhcp\-option,
  2718. .B \-\-inactive, \-\-ping, \-\-ping\-exit, \-\-ping\-restart,
  2719. .B \-\-setenv,
  2720. .B \-\-auth\-token,
  2721. .B \-\-persist\-key, \-\-persist\-tun, \-\-echo,
  2722. .B \-\-comp\-lzo,
  2723. .B \-\-socket\-flags,
  2724. .B \-\-sndbuf, \-\-rcvbuf
  2725. .\"*********************************************************
  2726. .TP
  2727. .B \-\-push\-reset
  2728. Don't inherit the global push list for a specific client instance.
  2729. Specify this option in a client\-specific context such
  2730. as with a
  2731. .B \-\-client\-config\-dir
  2732. configuration file. This option will ignore
  2733. .B \-\-push
  2734. options at the global config file level.
  2735. .\"*********************************************************
  2736. .TP
  2737. .B \-\-push\-remove opt
  2738. selectively remove all
  2739. .B \-\-push
  2740. options matching "opt" from the option list for a client. "opt" is matched
  2741. as a substring against the whole option string to\-be\-pushed to the client, so
  2742. .B \-\-push\-remove route
  2743. would remove all
  2744. .B \-\-push route ...
  2745. and
  2746. .B \-\-push route\-ipv6 ...
  2747. statements, while
  2748. .B \-\-push\-remove 'route\-ipv6 2001:'
  2749. would only remove IPv6 routes for 2001:... networks.
  2750. .B \-\-push\-remove
  2751. can only be used in a client\-specific context, like in a
  2752. .B \-\-client\-config\-dir
  2753. file, or
  2754. .B \-\-client\-connect
  2755. script or plugin \-\- similar to
  2756. .B \-\-push\-reset,
  2757. just more selective.
  2758. NOTE: to
  2759. .I change
  2760. an option,
  2761. .B \-\-push\-remove
  2762. can be used to first remove the old value, and then add a new
  2763. .B \-\-push
  2764. option with the new value.
  2765. .\"*********************************************************
  2766. .TP
  2767. .B \-\-push\-peer\-info
  2768. Push additional information about the client to server.
  2769. The following data is always pushed to the server:
  2770. IV_VER=<version> \-\- the client OpenVPN version
  2771. IV_PLAT=[linux|solaris|openbsd|mac|netbsd|freebsd|win] \-\- the client OS platform
  2772. IV_LZO_STUB=1 \-\- if client was built with LZO stub capability
  2773. IV_LZ4=1 \-\- if the client supports LZ4 compressions.
  2774. IV_PROTO=2 \-\- if the client supports peer\-id floating mechansim
  2775. IV_NCP=2 \-\- negotiable ciphers, client supports
  2776. .B \-\-cipher
  2777. pushed by the server, a value of 2 or greater indicates client
  2778. supports AES\-GCM\-128 and AES\-GCM\-256.
  2779. IV_GUI_VER=<gui_id> <version> \-\- the UI version of a UI if one is
  2780. running, for example "de.blinkt.openvpn 0.5.47" for the
  2781. Android app.
  2782. When
  2783. .B \-\-push\-peer\-info
  2784. is enabled the additional information consists of the following data:
  2785. IV_HWADDR=<mac address> \-\- the MAC address of clients default gateway
  2786. IV_SSL=<version string> \-\- the ssl version used by the client, e.g. "OpenSSL 1.0.2f 28 Jan 2016".
  2787. IV_PLAT_VER=x.y \- the version of the operating system, e.g. 6.1 for Windows 7.
  2788. UV_<name>=<value> \-\- client environment variables whose names start with "UV_"
  2789. .\"*********************************************************
  2790. .TP
  2791. .B \-\-disable
  2792. Disable a particular client (based on the common name)
  2793. from connecting. Don't use this option to disable a client
  2794. due to key or password compromise. Use a CRL (certificate
  2795. revocation list) instead (see the
  2796. .B \-\-crl\-verify
  2797. option).
  2798. This option must be associated with a specific client instance,
  2799. which means that it must be specified either in a client
  2800. instance config file using
  2801. .B \-\-client\-config\-dir
  2802. or dynamically generated using a
  2803. .B \-\-client\-connect
  2804. script.
  2805. .\"*********************************************************
  2806. .TP
  2807. .B \-\-ifconfig\-pool start\-IP end\-IP [netmask]
  2808. Set aside a pool of subnets to be
  2809. dynamically allocated to connecting clients, similar
  2810. to a DHCP server. For tun\-style
  2811. tunnels, each client will be given a /30 subnet (for
  2812. interoperability with Windows clients). For tap\-style
  2813. tunnels, individual addresses will be allocated, and the
  2814. optional
  2815. .B netmask
  2816. parameter will also be pushed to clients.
  2817. .\"*********************************************************
  2818. .TP
  2819. .B \-\-ifconfig\-pool\-persist file [seconds]
  2820. Persist/unpersist ifconfig\-pool
  2821. data to
  2822. .B file,
  2823. at
  2824. .B seconds
  2825. intervals (default=600), as well as on program startup and
  2826. shutdown.
  2827. The goal of this option is to provide a long\-term association
  2828. between clients (denoted by their common name) and the virtual
  2829. IP address assigned to them from the ifconfig\-pool.
  2830. Maintaining a long\-term
  2831. association is good for clients because it allows them
  2832. to effectively use the
  2833. .B \-\-persist\-tun
  2834. option.
  2835. .B file
  2836. is a comma\-delimited ASCII file, formatted as
  2837. <Common\-Name>,<IP\-address>.
  2838. If
  2839. .B seconds
  2840. = 0,
  2841. .B file
  2842. will be treated as read\-only. This is useful if
  2843. you would like to treat
  2844. .B file
  2845. as a configuration file.
  2846. Note that the entries in this file are treated by OpenVPN as
  2847. suggestions only, based on past associations between
  2848. a common name and IP address. They do not guarantee that the given common
  2849. name will always receive the given IP address. If you want guaranteed
  2850. assignment, use
  2851. .B \-\-ifconfig\-push
  2852. .\"*********************************************************
  2853. .TP
  2854. .B \-\-ifconfig\-pool\-linear
  2855. .B DEPRECATED
  2856. This option will be removed in OpenVPN 2.5
  2857. Modifies the
  2858. .B \-\-ifconfig\-pool
  2859. directive to
  2860. allocate individual TUN interface addresses for
  2861. clients rather than /30 subnets. NOTE: This option
  2862. is incompatible with Windows clients.
  2863. This option is deprecated, and should be replaced with
  2864. .B \-\-topology p2p
  2865. which is functionally equivalent.
  2866. .\"*********************************************************
  2867. .TP
  2868. .B \-\-ifconfig\-push local remote\-netmask [alias]
  2869. Push virtual IP endpoints for client tunnel,
  2870. overriding the \-\-ifconfig\-pool dynamic allocation.
  2871. The parameters
  2872. .B local
  2873. and
  2874. .B remote\-netmask
  2875. are set according to the
  2876. .B \-\-ifconfig
  2877. directive which you want to execute on the client machine to
  2878. configure the remote end of the tunnel. Note that the parameters
  2879. .B local
  2880. and
  2881. .B remote\-netmask
  2882. are from the perspective of the client, not the server. They may be
  2883. DNS names rather than IP addresses, in which case they will be resolved
  2884. on the server at the time of client connection.
  2885. The optional
  2886. .B alias
  2887. parameter may be used in cases where NAT causes the client view
  2888. of its local endpoint to differ from the server view. In this case
  2889. .B local/remote\-netmask
  2890. will refer to the server view while
  2891. .B alias/remote\-netmask
  2892. will refer to the client view.
  2893. This option must be associated with a specific client instance,
  2894. which means that it must be specified either in a client
  2895. instance config file using
  2896. .B \-\-client\-config\-dir
  2897. or dynamically generated using a
  2898. .B \-\-client\-connect
  2899. script.
  2900. Remember also to include a
  2901. .B \-\-route
  2902. directive in the main OpenVPN config file which encloses
  2903. .B local,
  2904. so that the kernel will know to route it
  2905. to the server's TUN/TAP interface.
  2906. OpenVPN's internal client IP address selection algorithm works as
  2907. follows:
  2908. .B 1
  2909. \-\- Use
  2910. .B \-\-client\-connect script
  2911. generated file for static IP (first choice).
  2912. .br
  2913. .B 2
  2914. \-\- Use
  2915. .B \-\-client\-config\-dir
  2916. file for static IP (next choice).
  2917. .br
  2918. .B 3
  2919. \-\- Use
  2920. .B \-\-ifconfig\-pool
  2921. allocation for dynamic IP (last choice).
  2922. .br
  2923. .\"*********************************************************
  2924. .TP
  2925. .B \-\-iroute network [netmask]
  2926. Generate an internal route to a specific
  2927. client. The
  2928. .B netmask
  2929. parameter, if omitted, defaults to 255.255.255.255.
  2930. This directive can be used to route a fixed subnet from
  2931. the server to a particular client, regardless
  2932. of where the client is connecting from. Remember
  2933. that you must also add the route to the system
  2934. routing table as well (such as by using the
  2935. .B \-\-route
  2936. directive). The reason why two routes are needed
  2937. is that the
  2938. .B \-\-route
  2939. directive routes the packet from the kernel
  2940. to OpenVPN. Once in OpenVPN, the
  2941. .B \-\-iroute
  2942. directive routes to the specific client.
  2943. This option must be specified either in a client
  2944. instance config file using
  2945. .B \-\-client\-config\-dir
  2946. or dynamically generated using a
  2947. .B \-\-client\-connect
  2948. script.
  2949. The
  2950. .B \-\-iroute
  2951. directive also has an important interaction with
  2952. .B \-\-push
  2953. "route ...".
  2954. .B \-\-iroute
  2955. essentially defines a subnet which is owned by a
  2956. particular client (we will call this client A).
  2957. If you would like other clients to be able to reach A's
  2958. subnet, you can use
  2959. .B \-\-push
  2960. "route ..."
  2961. together with
  2962. .B \-\-client\-to\-client
  2963. to effect this. In order for all clients to see
  2964. A's subnet, OpenVPN must push this route to all clients
  2965. EXCEPT for A, since the subnet is already owned by A.
  2966. OpenVPN accomplishes this by not
  2967. not pushing a route to a client
  2968. if it matches one of the client's iroutes.
  2969. .\"*********************************************************
  2970. .TP
  2971. .B \-\-client\-to\-client
  2972. Because the OpenVPN server mode handles multiple clients
  2973. through a single tun or tap interface, it is effectively
  2974. a router. The
  2975. .B \-\-client\-to\-client
  2976. flag tells OpenVPN to internally route client\-to\-client
  2977. traffic rather than pushing all client\-originating traffic
  2978. to the TUN/TAP interface.
  2979. When this option is used, each client will "see" the other
  2980. clients which are currently connected. Otherwise, each
  2981. client will only see the server. Don't use this option
  2982. if you want to firewall tunnel traffic using
  2983. custom, per\-client rules.
  2984. .\"*********************************************************
  2985. .TP
  2986. .B \-\-duplicate\-cn
  2987. Allow multiple clients with the same common name to concurrently connect.
  2988. In the absence of this option, OpenVPN will disconnect a client instance
  2989. upon connection of a new client having the same common name.
  2990. .\"*********************************************************
  2991. .TP
  2992. .B \-\-client\-connect cmd
  2993. Run
  2994. .B command cmd
  2995. on client connection.
  2996. .B cmd
  2997. consists of a path to script (or executable program), optionally
  2998. followed by arguments. The path and arguments may be single\- or double\-quoted
  2999. and/or escaped using a backslash, and should be separated by one or more spaces.
  3000. The command is passed the common name
  3001. and IP address of the just\-authenticated client
  3002. as environmental variables (see environmental variable section
  3003. below). The command is also passed
  3004. the pathname of a freshly created temporary file as the last argument
  3005. (after any arguments specified in
  3006. .B cmd
  3007. ), to be used by the command
  3008. to pass dynamically generated config file directives back to OpenVPN.
  3009. If the script wants to generate a dynamic config file
  3010. to be applied on the server when the client connects,
  3011. it should write it to the file named by the last argument.
  3012. See the
  3013. .B \-\-client\-config\-dir
  3014. option below for options which
  3015. can be legally used in a dynamically generated config file.
  3016. Note that the return value of
  3017. .B script
  3018. is significant. If
  3019. .B script
  3020. returns a non\-zero error status, it will cause the client
  3021. to be disconnected.
  3022. .\"*********************************************************
  3023. .TP
  3024. .B \-\-client\-disconnect cmd
  3025. Like
  3026. .B \-\-client\-connect
  3027. but called on client instance shutdown. Will not be called
  3028. unless the
  3029. .B \-\-client\-connect
  3030. script and plugins (if defined)
  3031. were previously called on this instance with
  3032. successful (0) status returns.
  3033. The exception to this rule is if the
  3034. .B \-\-client\-disconnect
  3035. command or plugins are cascaded, and at least one client\-connect
  3036. function succeeded, then ALL of the client\-disconnect functions for
  3037. scripts and plugins will be called on client instance object deletion,
  3038. even in cases where some of the related client\-connect functions returned
  3039. an error status.
  3040. The
  3041. .B \-\-client\-disconnect
  3042. command is passed the same pathname as the corresponding
  3043. .B \-\-client\-connect
  3044. command as its last argument. (after any arguments specified in
  3045. .B cmd
  3046. ).
  3047. .B
  3048. .\"*********************************************************
  3049. .TP
  3050. .B \-\-client\-config\-dir dir
  3051. Specify a directory
  3052. .B dir
  3053. for custom client config files. After
  3054. a connecting client has been authenticated, OpenVPN will
  3055. look in this directory for a file having the same name
  3056. as the client's X509 common name. If a matching file
  3057. exists, it will be opened and parsed for client\-specific
  3058. configuration options. If no matching file is found, OpenVPN
  3059. will instead try to open and parse a default file called
  3060. "DEFAULT", which may be provided but is not required. Note that
  3061. the configuration files must be readable by the OpenVPN process
  3062. after it has dropped it's root privileges.
  3063. This file can specify a fixed IP address for a given
  3064. client using
  3065. .B \-\-ifconfig\-push,
  3066. as well as fixed subnets owned by the client using
  3067. .B \-\-iroute.
  3068. One of the useful properties of this option is that it
  3069. allows client configuration files to be conveniently
  3070. created, edited, or removed while the server is live,
  3071. without needing to restart the server.
  3072. The following
  3073. options are legal in a client\-specific context:
  3074. .B \-\-push, \-\-push\-reset, \-\-push\-remove, \-\-iroute, \-\-ifconfig\-push,
  3075. and
  3076. .B \-\-config.
  3077. .\"*********************************************************
  3078. .TP
  3079. .B \-\-ccd\-exclusive
  3080. Require, as a
  3081. condition of authentication, that a connecting client has a
  3082. .B \-\-client\-config\-dir
  3083. file.
  3084. .\"*********************************************************
  3085. .TP
  3086. .B \-\-tmp\-dir dir
  3087. Specify a directory
  3088. .B dir
  3089. for temporary files. This directory will be used by
  3090. openvpn processes and script to communicate temporary
  3091. data with openvpn main process. Note that
  3092. the directory must be writable by the OpenVPN process
  3093. after it has dropped it's root privileges.
  3094. This directory will be used by in the following cases:
  3095. *
  3096. .B \-\-client\-connect
  3097. scripts to dynamically generate client\-specific
  3098. configuration files.
  3099. *
  3100. .B OPENVPN_PLUGIN_AUTH_USER_PASS_VERIFY
  3101. plugin hook to return success/failure via auth_control_file
  3102. when using deferred auth method
  3103. *
  3104. .B OPENVPN_PLUGIN_ENABLE_PF
  3105. plugin hook to pass filtering rules via pf_file
  3106. .\"*********************************************************
  3107. .TP
  3108. .B \-\-hash\-size r v
  3109. Set the size of the real address hash table to
  3110. .B r
  3111. and the virtual address table to
  3112. .B v.
  3113. By default, both tables are sized at 256 buckets.
  3114. .\"*********************************************************
  3115. .TP
  3116. .B \-\-bcast\-buffers n
  3117. Allocate
  3118. .B n
  3119. buffers for broadcast datagrams (default=256).
  3120. .\"*********************************************************
  3121. .TP
  3122. .B \-\-tcp\-queue\-limit n
  3123. Maximum number of output packets queued before TCP (default=64).
  3124. When OpenVPN is tunneling data from a TUN/TAP device to a
  3125. remote client over a TCP connection, it is possible that the TUN/TAP device
  3126. might produce data at a faster rate than the TCP connection
  3127. can support. When the number of output packets queued before sending to
  3128. the TCP socket reaches this limit for a given client connection,
  3129. OpenVPN will start to drop outgoing packets directed
  3130. at this client.
  3131. .\"*********************************************************
  3132. .TP
  3133. .B \-\-tcp\-nodelay
  3134. This macro sets the TCP_NODELAY socket flag on the server
  3135. as well as pushes it to connecting clients. The TCP_NODELAY
  3136. flag disables the Nagle algorithm on TCP sockets causing
  3137. packets to be transmitted immediately with low latency,
  3138. rather than waiting a short period of time in order
  3139. to aggregate several packets into a larger containing
  3140. packet. In VPN applications over TCP, TCP_NODELAY
  3141. is generally a good latency optimization.
  3142. The macro expands as follows:
  3143. .nf
  3144. .ft 3
  3145. .in +4
  3146. if mode server:
  3147. socket\-flags TCP_NODELAY
  3148. push "socket\-flags TCP_NODELAY"
  3149. .in -4
  3150. .ft
  3151. .fi
  3152. .\"*********************************************************
  3153. .TP
  3154. .B \-\-max\-clients n
  3155. Limit server to a maximum of
  3156. .B n
  3157. concurrent clients.
  3158. .\"*********************************************************
  3159. .TP
  3160. .B \-\-max\-routes\-per\-client n
  3161. Allow a maximum of
  3162. .B n
  3163. internal routes per client (default=256).
  3164. This is designed to
  3165. help contain DoS attacks where an authenticated client floods the
  3166. server with packets appearing to come from many unique MAC addresses,
  3167. forcing the server to deplete
  3168. virtual memory as its internal routing table expands.
  3169. This directive can be used in a
  3170. .B \-\-client\-config\-dir
  3171. file or auto\-generated by a
  3172. .B \-\-client\-connect
  3173. script to override the global value for a particular client.
  3174. Note that this
  3175. directive affects OpenVPN's internal routing table, not the
  3176. kernel routing table.
  3177. .\"*********************************************************
  3178. .TP
  3179. .B \-\-stale\-routes\-check n [t]
  3180. Remove routes haven't had activity for
  3181. .B n
  3182. seconds (i.e. the ageing time).
  3183. This check is ran every
  3184. .B t
  3185. seconds (i.e. check interval).
  3186. If
  3187. .B t
  3188. is not present it defaults to
  3189. .B n
  3190. This option helps to keep the dynamic routing table small.
  3191. See also
  3192. .B \-\-max\-routes\-per\-client
  3193. .\"*********************************************************
  3194. .TP
  3195. .B \-\-connect\-freq n sec
  3196. Allow a maximum of
  3197. .B n
  3198. new connections per
  3199. .B sec
  3200. seconds from clients. This is designed to contain DoS attacks which flood
  3201. the server with connection requests using certificates which
  3202. will ultimately fail to authenticate.
  3203. This is an imperfect solution however, because in a real
  3204. DoS scenario, legitimate connections might also be refused.
  3205. For the best protection against DoS attacks in server mode,
  3206. use
  3207. .B \-\-proto udp
  3208. and either
  3209. .B \-\-tls\-auth
  3210. or
  3211. .B \-\-tls\-crypt\fR.
  3212. .\"*********************************************************
  3213. .TP
  3214. .B \-\-learn\-address cmd
  3215. Run command
  3216. .B cmd
  3217. to validate client virtual addresses or routes.
  3218. .B cmd
  3219. consists of a path to script (or executable program), optionally
  3220. followed by arguments. The path and arguments may be single\- or double\-quoted
  3221. and/or escaped using a backslash, and should be separated by one or more spaces.
  3222. Three arguments will be appended to any arguments in
  3223. .B cmd
  3224. as follows:
  3225. .B [1] operation \-\-
  3226. "add", "update", or "delete" based on whether or not
  3227. the address is being added to, modified, or deleted from
  3228. OpenVPN's internal routing table.
  3229. .br
  3230. .B [2] address \-\-
  3231. The address being learned or unlearned. This can be
  3232. an IPv4 address such as "198.162.10.14", an IPv4 subnet
  3233. such as "198.162.10.0/24", or an ethernet MAC address (when
  3234. .B \-\-dev tap
  3235. is being used) such as "00:FF:01:02:03:04".
  3236. .br
  3237. .B [3] common name \-\-
  3238. The common name on the certificate associated with the
  3239. client linked to this address. Only present for "add"
  3240. or "update" operations, not "delete".
  3241. On "add" or "update" methods, if the script returns
  3242. a failure code (non\-zero), OpenVPN will reject the address
  3243. and will not modify its internal routing table.
  3244. Normally, the
  3245. .B cmd
  3246. script will use the information provided above to set
  3247. appropriate firewall entries on the VPN TUN/TAP interface.
  3248. Since OpenVPN provides the association between virtual IP
  3249. or MAC address and the client's authenticated common name,
  3250. it allows a user\-defined script to configure firewall access
  3251. policies with regard to the client's high\-level common name,
  3252. rather than the low level client virtual addresses.
  3253. .\"*********************************************************
  3254. .TP
  3255. .B \-\-auth\-user\-pass\-verify cmd method
  3256. Require the client to provide a username/password (possibly
  3257. in addition to a client certificate) for authentication.
  3258. OpenVPN will run
  3259. .B command cmd
  3260. to validate the username/password
  3261. provided by the client.
  3262. .B cmd
  3263. consists of a path to script (or executable program), optionally
  3264. followed by arguments. The path and arguments may be single\- or double\-quoted
  3265. and/or escaped using a backslash, and should be separated by one or more spaces.
  3266. If
  3267. .B method
  3268. is set to "via\-env", OpenVPN will call
  3269. .B script
  3270. with the environmental variables
  3271. .B username
  3272. and
  3273. .B password
  3274. set to the username/password strings provided by the client.
  3275. Be aware that this method is insecure on some platforms which
  3276. make the environment of a process publicly visible to other
  3277. unprivileged processes.
  3278. If
  3279. .B method
  3280. is set to "via\-file", OpenVPN will write the username and
  3281. password to the first two lines of a temporary file. The filename
  3282. will be passed as an argument to
  3283. .B script,
  3284. and the file will be automatically deleted by OpenVPN after
  3285. the script returns. The location of the temporary file is
  3286. controlled by the
  3287. .B \-\-tmp\-dir
  3288. option, and will default to the current directory if unspecified.
  3289. For security, consider setting
  3290. .B \-\-tmp\-dir
  3291. to a volatile storage medium such as
  3292. .B /dev/shm
  3293. (if available) to prevent the username/password file from touching the hard drive.
  3294. The script should examine the username
  3295. and password,
  3296. returning a success exit code (0) if the
  3297. client's authentication request is to be accepted, or a failure
  3298. code (1) to reject the client.
  3299. This directive is designed to enable a plugin\-style interface
  3300. for extending OpenVPN's authentication capabilities.
  3301. To protect against a client passing a maliciously formed
  3302. username or password string, the username string must
  3303. consist only of these characters: alphanumeric, underbar
  3304. ('_'), dash ('\-'), dot ('.'), or at ('@'). The password
  3305. string can consist of any printable characters except for
  3306. CR or LF. Any illegal characters in either the username
  3307. or password string will be converted to underbar ('_').
  3308. Care must be taken by any user\-defined scripts to avoid
  3309. creating a security vulnerability in the way that these
  3310. strings are handled. Never use these strings in such a way
  3311. that they might be escaped or evaluated by a shell interpreter.
  3312. For a sample script that performs PAM authentication, see
  3313. .B sample\-scripts/auth\-pam.pl
  3314. in the OpenVPN source distribution.
  3315. .\"*********************************************************
  3316. .TP
  3317. .B \-\-auth\-gen\-token [lifetime]
  3318. After successful user/password authentication, the OpenVPN
  3319. server will with this option generate a temporary
  3320. authentication token and push that to client. On the following
  3321. renegotiations, the OpenVPN client will pass this token instead
  3322. of the users password. On the server side the server will do
  3323. the token authentication internally and it will NOT do any
  3324. additional authentications against configured external
  3325. user/password authentication mechanisms.
  3326. The
  3327. .B lifetime
  3328. argument defines how long the generated token is valid. The
  3329. lifetime is defined in seconds. If lifetime is not set
  3330. or it is set to 0, the token will never expire.
  3331. This feature is useful for environments which is configured
  3332. to use One Time Passwords (OTP) as part of the user/password
  3333. authentications and that authentication mechanism does not
  3334. implement any auth\-token support.
  3335. .\"*********************************************************
  3336. .TP
  3337. .B \-\-opt\-verify
  3338. Clients that connect with options that are incompatible
  3339. with those of the server will be disconnected.
  3340. Options that will be compared for compatibility include
  3341. dev\-type, link\-mtu, tun\-mtu, proto, ifconfig,
  3342. comp\-lzo, fragment, keydir, cipher, auth, keysize, secret,
  3343. no\-replay, no\-iv, tls\-auth, key\-method, tls\-server, and tls\-client.
  3344. This option requires that
  3345. .B \-\-disable\-occ
  3346. NOT be used.
  3347. .\"*********************************************************
  3348. .TP
  3349. .B \-\-auth\-user\-pass\-optional
  3350. Allow connections by clients that do not specify a username/password.
  3351. Normally, when
  3352. .B \-\-auth\-user\-pass\-verify
  3353. or
  3354. .B \-\-management\-client\-auth
  3355. is specified (or an authentication plugin module), the
  3356. OpenVPN server daemon will require connecting clients to specify a
  3357. username and password. This option makes the submission of a username/password
  3358. by clients optional, passing the responsibility to the user\-defined authentication
  3359. module/script to accept or deny the client based on other factors
  3360. (such as the setting of X509 certificate fields). When this option is used,
  3361. and a connecting client does not submit a username/password, the user\-defined
  3362. authentication module/script will see the username and password as being set
  3363. to empty strings (""). The authentication module/script MUST have logic
  3364. to detect this condition and respond accordingly.
  3365. .\"*********************************************************
  3366. .TP
  3367. .B \-\-client\-cert\-not\-required
  3368. .B DEPRECATED
  3369. This option will be removed in OpenVPN 2.5
  3370. Don't require client certificate, client will authenticate
  3371. using username/password only. Be aware that using this directive
  3372. is less secure than requiring certificates from all clients.
  3373. .B Please note:
  3374. This is replaced by
  3375. .B \-\-verify\-client\-cert
  3376. which allows for more flexibility. The option
  3377. .B \-\-verify\-client\-cert none
  3378. is functionally equivalent to
  3379. .B \-\-client\-cert\-not\-required
  3380. .
  3381. .\"*********************************************************
  3382. .TP
  3383. .B \-\-verify\-client\-cert none|optional|require
  3384. Specify whether the client is required to supply a valid certificate.
  3385. Possible options are
  3386. .B none
  3387. : a client certificate is not required. the client need to authenticate
  3388. using username/password only. Be aware that using this directive
  3389. is less secure than requiring certificates from all clients.
  3390. If you use this directive, the
  3391. entire responsibility of authentication will rest on your
  3392. .B \-\-auth\-user\-pass\-verify
  3393. script, so keep in mind that bugs in your script
  3394. could potentially compromise the security of your VPN.
  3395. .B \-\-verify\-client\-cert none
  3396. is functionally equivalent to
  3397. .B \-\-client\-cert\-not\-required.
  3398. .B optional
  3399. : a client may present a certificate but it is not required to do so.
  3400. When using this directive, you should also use a
  3401. .B \-\-auth\-user\-pass\-verify
  3402. script to ensure that clients are authenticated using a
  3403. certificate, a username and password, or possibly even both.
  3404. Again, the entire responsibility of authentication will rest on your
  3405. .B \-\-auth\-user\-pass\-verify
  3406. script, so keep in mind that bugs in your script
  3407. could potentially compromise the security of your VPN.
  3408. .B require
  3409. : this is the default option. A client is required to present a
  3410. certificate, otherwise VPN access is refused.
  3411. If you don't use this directive (or use
  3412. .B \-\-verify\-client\-cert require
  3413. ) but you also specify an
  3414. .B \-\-auth\-user\-pass\-verify
  3415. script, then OpenVPN will perform double authentication. The
  3416. client certificate verification AND the
  3417. .B \-\-auth\-user\-pass\-verify
  3418. script will need to succeed in order for a client to be
  3419. authenticated and accepted onto the VPN.
  3420. .\"*********************************************************
  3421. .TP
  3422. .B \-\-username\-as\-common\-name
  3423. For
  3424. .B \-\-auth\-user\-pass\-verify
  3425. authentication, use
  3426. the authenticated username as the common name,
  3427. rather than the common name from the client cert.
  3428. .\"*********************************************************
  3429. .TP
  3430. .B \-\-compat\-names [no\-remapping]
  3431. .B DEPRECATED
  3432. This option will be removed in OpenVPN 2.5
  3433. Until OpenVPN v2.3 the format of the X.509 Subject fields was formatted
  3434. like this:
  3435. .IP
  3436. .B
  3437. /C=US/L=Somewhere/CN=John Doe/emailAddress=john@example.com
  3438. .IP
  3439. In addition the old behaviour was to remap any character other than
  3440. alphanumeric, underscore ('_'), dash ('\-'), dot ('.'), and slash ('/') to
  3441. underscore ('_'). The X.509 Subject string as returned by the
  3442. .B tls_id
  3443. environmental variable, could additionally contain colon (':') or equal ('=').
  3444. .IP
  3445. When using the
  3446. .B \-\-compat\-names
  3447. option, this old formatting and remapping will be re\-enabled again. This is
  3448. purely implemented for compatibility reasons when using older plug\-ins or
  3449. scripts which does not handle the new formatting or UTF\-8 characters.
  3450. .IP
  3451. In OpenVPN 2.3 the formatting of these fields changed into a more
  3452. standardised format. It now looks like:
  3453. .IP
  3454. .B
  3455. C=US, L=Somewhere, CN=John Doe, emailAddress=john@example.com
  3456. .IP
  3457. The new default format in OpenVPN 2.3 also does not do the character remapping
  3458. which happened earlier. This new format enables proper support for UTF\-8
  3459. characters in the usernames, X.509 Subject fields and Common Name variables and
  3460. it complies to the RFC 2253, UTF\-8 String Representation of Distinguished
  3461. Names.
  3462. The
  3463. .B no\-remapping
  3464. mode flag can be used with the
  3465. .B
  3466. \-\-compat\-names
  3467. option to be compatible with the now deprecated \-\-no\-name\-remapping option.
  3468. It is only available at the server. When this mode flag is used, the Common Name,
  3469. Subject, and username strings are allowed to include any printable character
  3470. including space, but excluding control characters such as tab, newline, and
  3471. carriage\-return. no\-remapping is only available on the server side.
  3472. .B Please note:
  3473. This option is immediately deprecated. It is only implemented
  3474. to make the transition to the new formatting less intrusive. It will be
  3475. removed in OpenVPN 2.5. So please update your scripts/plug\-ins where necessary.
  3476. .\"*********************************************************
  3477. .TP
  3478. .B \-\-no\-name\-remapping
  3479. .B DEPRECATED
  3480. This option will be removed in OpenVPN 2.5
  3481. The
  3482. .B \-\-no\-name\-remapping
  3483. option is an alias for
  3484. .B \-\-compat\-names\ no\-remapping.
  3485. It ensures compatibility with server configurations using the
  3486. .B \-\-no\-name\-remapping
  3487. option.
  3488. .B Please note:
  3489. This option is now deprecated. It will be removed in OpenVPN 2.5.
  3490. So please make sure you support the new X.509 name formatting
  3491. described with the
  3492. .B \-\-compat\-names
  3493. option as soon as possible.
  3494. .\"*********************************************************
  3495. .TP
  3496. .B \-\-port\-share host port [dir]
  3497. When run in TCP server mode, share the OpenVPN port with
  3498. another application, such as an HTTPS server. If OpenVPN
  3499. senses a connection to its port which is using a non\-OpenVPN
  3500. protocol, it will proxy the connection to the server at
  3501. .B host:port.
  3502. Currently only designed to work with HTTP/HTTPS,
  3503. though it would be theoretically possible to extend to
  3504. other protocols such as ssh.
  3505. .B dir
  3506. specifies an optional directory where a temporary file with name N
  3507. containing content C will be dynamically generated for each proxy
  3508. connection, where N is the source IP:port of the client connection
  3509. and C is the source IP:port of the connection to the proxy
  3510. receiver. This directory can be used as a dictionary by
  3511. the proxy receiver to determine the origin of the connection.
  3512. Each generated file will be automatically deleted when the proxied
  3513. connection is torn down.
  3514. Not implemented on Windows.
  3515. .\"*********************************************************
  3516. .SS Client Mode
  3517. Use client mode when connecting to an OpenVPN server
  3518. which has
  3519. .B \-\-server, \-\-server\-bridge,
  3520. or
  3521. .B \-\-mode server
  3522. in it's configuration.
  3523. .\"*********************************************************
  3524. .TP
  3525. .B \-\-client
  3526. A helper directive designed to simplify the configuration
  3527. of OpenVPN's client mode. This directive is equivalent to:
  3528. .nf
  3529. .ft 3
  3530. .in +4
  3531. pull
  3532. tls\-client
  3533. .in -4
  3534. .ft
  3535. .fi
  3536. .\"*********************************************************
  3537. .TP
  3538. .B \-\-pull
  3539. This option must be used on a client which is connecting
  3540. to a multi\-client server. It indicates to OpenVPN that it
  3541. should accept options pushed by the server, provided they
  3542. are part of the legal set of pushable options (note that the
  3543. .B \-\-pull
  3544. option is implied by
  3545. .B \-\-client
  3546. ).
  3547. In particular,
  3548. .B \-\-pull
  3549. allows the server to push routes to the client, so you should
  3550. not use
  3551. .B \-\-pull
  3552. or
  3553. .B \-\-client
  3554. in situations where you don't trust the server to have control
  3555. over the client's routing table.
  3556. .\"*********************************************************
  3557. .TP
  3558. .B \-\-pull\-filter accept|ignore|reject \fItext\fR
  3559. Filter options received from the server if the option starts with
  3560. \fItext\fR. Runs on client. The action flag
  3561. .B accept
  3562. allows the option,
  3563. .B ignore
  3564. removes it and
  3565. .B reject
  3566. flags an error and triggers a SIGUSR1 restart.
  3567. The filters may be specified multiple times, and each filter is
  3568. applied in the order it is specified. The filtering of each
  3569. option stops as soon as a match is found. Unmatched options are accepted
  3570. by default.
  3571. Prefix comparison is used to match \fItext\fR against the
  3572. received option so that
  3573. .nf
  3574. .ft 3
  3575. .in +4
  3576. \-\-pull\-filter ignore "route"
  3577. .in -4
  3578. .ft
  3579. .fi
  3580. would remove all pushed options starting with
  3581. .B route
  3582. which would include, for example,
  3583. .B route\-gateway.
  3584. Enclose \fItext\fR in quotes to embed spaces.
  3585. .nf
  3586. .ft 3
  3587. .in +4
  3588. \-\-pull\-filter accept "route 192.168.1."
  3589. \-\-pull\-filter ignore "route "
  3590. .in -4
  3591. .ft
  3592. .fi
  3593. would remove all routes that do not start with 192.168.1.
  3594. This option may be used only on clients.
  3595. Note that
  3596. .B reject
  3597. may result in a repeated cycle of failure and reconnect,
  3598. unless multiple remotes are specified and connection to the next remote
  3599. succeeds. To silently ignore an option pushed by the server, use
  3600. .B ignore.
  3601. .\"*********************************************************
  3602. .TP
  3603. .B \-\-auth\-user\-pass [up]
  3604. Authenticate with server using username/password.
  3605. .B up
  3606. is a file containing username/password on 2 lines. If the
  3607. password line is missing, OpenVPN will prompt for one.
  3608. If
  3609. .B up
  3610. is omitted, username/password will be prompted from the
  3611. console.
  3612. The server configuration must specify an
  3613. .B \-\-auth\-user\-pass\-verify
  3614. script to verify the username/password provided by
  3615. the client.
  3616. .\"*********************************************************
  3617. .TP
  3618. .B \-\-auth\-retry type
  3619. Controls how OpenVPN responds to username/password verification
  3620. errors such as the client\-side response to an AUTH_FAILED message from the server
  3621. or verification failure of the private key password.
  3622. Normally used to prevent auth errors from being fatal
  3623. on the client side, and to permit username/password requeries in case
  3624. of error.
  3625. An AUTH_FAILED message is generated by the server if the client
  3626. fails
  3627. .B \-\-auth\-user\-pass
  3628. authentication, or if the server\-side
  3629. .B \-\-client\-connect
  3630. script returns an error status when the client
  3631. tries to connect.
  3632. .B type
  3633. can be one of:
  3634. .B none \-\-
  3635. Client will exit with a fatal error (this is the default).
  3636. .br
  3637. .B nointeract \-\-
  3638. Client will retry the connection without requerying for an
  3639. .B \-\-auth\-user\-pass
  3640. username/password. Use this option for unattended clients.
  3641. .br
  3642. .B interact \-\-
  3643. Client will requery for an
  3644. .B \-\-auth\-user\-pass
  3645. username/password and/or private key password before attempting a reconnection.
  3646. Note that while this option cannot be pushed, it can be controlled
  3647. from the management interface.
  3648. .\"*********************************************************
  3649. .TP
  3650. .B \-\-static\-challenge t e
  3651. Enable static challenge/response protocol using challenge text
  3652. .B t,
  3653. with
  3654. echo flag given by
  3655. .B e
  3656. (0|1).
  3657. The echo flag indicates whether or not the user's response
  3658. to the challenge should be echoed.
  3659. See management\-notes.txt in the OpenVPN distribution for a
  3660. description of the OpenVPN challenge/response protocol.
  3661. .\"*********************************************************
  3662. .TP
  3663. \fB\-\-server\-poll\-timeout n\fR, \fB\-\-connect\-timeout n\fR
  3664. When connecting to a remote server do not wait for more than
  3665. .B n
  3666. seconds waiting for a response before trying the next server.
  3667. The default value is 120s. This timeout includes proxy and TCP
  3668. connect timeouts.
  3669. .\"*********************************************************
  3670. .TP
  3671. .B \-\-explicit\-exit\-notify [n]
  3672. In UDP client mode or point\-to\-point mode, send server/peer an exit notification
  3673. if tunnel is restarted or OpenVPN process is exited. In client mode, on
  3674. exit/restart, this
  3675. option will tell the server to immediately close its client instance object
  3676. rather than waiting for a timeout. The
  3677. .B n
  3678. parameter (default=1) controls the maximum number of attempts that the client
  3679. will try to resend the exit notification message.
  3680. In UDP server mode, send RESTART control channel command to connected clients. The
  3681. .B n
  3682. parameter (default=1) controls client behavior. With
  3683. .B n
  3684. = 1 client will attempt to reconnect
  3685. to the same server, with
  3686. .B n
  3687. = 2 client will advance to the next server.
  3688. OpenVPN will not send any exit
  3689. notifications unless this option is enabled.
  3690. .TP
  3691. .B \-\-allow\-recursive\-routing
  3692. When this option is set, OpenVPN will not drop incoming tun packets
  3693. with same destination as host.
  3694. .\"*********************************************************
  3695. .SS Data Channel Encryption Options:
  3696. These options are meaningful for both Static & TLS\-negotiated key modes
  3697. (must be compatible between peers).
  3698. .\"*********************************************************
  3699. .TP
  3700. .B \-\-secret file [direction]
  3701. Enable Static Key encryption mode (non\-TLS).
  3702. Use pre\-shared secret
  3703. .B file
  3704. which was generated with
  3705. .B \-\-genkey.
  3706. The optional
  3707. .B direction
  3708. parameter enables the use of 4 distinct keys
  3709. (HMAC\-send, cipher\-encrypt, HMAC\-receive, cipher\-decrypt), so that
  3710. each data flow direction has a different set of HMAC and cipher keys.
  3711. This has a number of desirable security properties including
  3712. eliminating certain kinds of DoS and message replay attacks.
  3713. When the
  3714. .B direction
  3715. parameter is omitted, 2 keys are used bidirectionally, one for HMAC
  3716. and the other for encryption/decryption.
  3717. The
  3718. .B direction
  3719. parameter should always be complementary on either side of the connection,
  3720. i.e. one side should use "0" and the other should use "1", or both sides
  3721. should omit it altogether.
  3722. The
  3723. .B direction
  3724. parameter requires that
  3725. .B file
  3726. contains a 2048 bit key. While pre\-1.5 versions of OpenVPN
  3727. generate 1024 bit key files, any version of OpenVPN which
  3728. supports the
  3729. .B direction
  3730. parameter, will also support 2048 bit key file generation
  3731. using the
  3732. .B \-\-genkey
  3733. option.
  3734. Static key encryption mode has certain advantages,
  3735. the primary being ease of configuration.
  3736. There are no certificates
  3737. or certificate authorities or complicated negotiation handshakes and protocols.
  3738. The only requirement is that you have a pre\-existing secure channel with
  3739. your peer (such as
  3740. .B ssh
  3741. ) to initially copy the key. This requirement, along with the
  3742. fact that your key never changes unless you manually generate a new one,
  3743. makes it somewhat less secure than TLS mode (see below). If an attacker
  3744. manages to steal your key, everything that was ever encrypted with
  3745. it is compromised. Contrast that to the perfect forward secrecy features of
  3746. TLS mode (using Diffie Hellman key exchange), where even if an attacker
  3747. was able to steal your private key, he would gain no information to help
  3748. him decrypt past sessions.
  3749. Another advantageous aspect of Static Key encryption mode is that
  3750. it is a handshake\-free protocol
  3751. without any distinguishing signature or feature
  3752. (such as a header or protocol handshake sequence)
  3753. that would mark the ciphertext packets as being
  3754. generated by OpenVPN. Anyone eavesdropping on the wire
  3755. would see nothing
  3756. but random\-looking data.
  3757. .\"*********************************************************
  3758. .TP
  3759. .B \-\-key\-direction
  3760. Alternative way of specifying the optional direction parameter for the
  3761. .B \-\-tls\-auth
  3762. and
  3763. .B \-\-secret
  3764. options. Useful when using inline files (See section on inline files).
  3765. .\"*********************************************************
  3766. .TP
  3767. .B \-\-auth alg
  3768. Authenticate data channel packets and (if enabled)
  3769. .B tls\-auth
  3770. control channel packets with HMAC using message digest algorithm
  3771. .B alg.
  3772. (The default is
  3773. .B SHA1
  3774. ).
  3775. HMAC is a commonly used message authentication algorithm (MAC) that uses
  3776. a data string, a secure hash algorithm, and a key, to produce
  3777. a digital signature.
  3778. The OpenVPN data channel protocol uses encrypt\-then\-mac (i.e. first encrypt a
  3779. packet, then HMAC the resulting ciphertext), which prevents padding oracle
  3780. attacks.
  3781. If an AEAD cipher mode (e.g. GCM) is chosen, the specified
  3782. .B \-\-auth
  3783. algorithm is ignored for the data channel, and the authentication method of the
  3784. AEAD cipher is used instead. Note that
  3785. .B alg
  3786. still specifies the digest used for
  3787. .B tls\-auth\fR.
  3788. In static\-key encryption mode, the HMAC key
  3789. is included in the key file generated by
  3790. .B \-\-genkey.
  3791. In TLS mode, the HMAC key is dynamically generated and shared
  3792. between peers via the TLS control channel. If OpenVPN receives a packet with
  3793. a bad HMAC it will drop the packet.
  3794. HMAC usually adds 16 or 20 bytes per packet.
  3795. Set
  3796. .B alg=none
  3797. to disable authentication.
  3798. For more information on HMAC see
  3799. .I http://www.cs.ucsd.edu/users/mihir/papers/hmac.html
  3800. .\"*********************************************************
  3801. .TP
  3802. .B \-\-cipher alg
  3803. Encrypt data channel packets with cipher algorithm
  3804. .B alg.
  3805. The default is
  3806. .B BF\-CBC,
  3807. an abbreviation for Blowfish in Cipher Block Chaining mode. When cipher
  3808. negotiation (NCP) is allowed, OpenVPN 2.4 and newer on both client and server
  3809. side will automatically upgrade to
  3810. .B AES\-256\-GCM.
  3811. See
  3812. .B \-\-ncp\-ciphers
  3813. and
  3814. .B \-\-ncp\-disable
  3815. for more details on NCP.
  3816. Using
  3817. .B BF\-CBC
  3818. is no longer recommended, because of its 64\-bit block size. This
  3819. small block size allows attacks based on collisions, as demonstrated by SWEET32.
  3820. See https://community.openvpn.net/openvpn/wiki/SWEET32 for details. Due to
  3821. this, support for
  3822. .B BF\-CBC, DES, CAST5, IDEA
  3823. and
  3824. .B RC2
  3825. ciphers will be removed in OpenVPN 2.6.
  3826. To see other ciphers that are available with OpenVPN, use the
  3827. .B \-\-show\-ciphers
  3828. option.
  3829. Set
  3830. .B alg=none
  3831. to disable encryption.
  3832. .\"*********************************************************
  3833. .TP
  3834. .B \-\-ncp\-ciphers cipher_list
  3835. Restrict the allowed ciphers to be negotiated to the ciphers in
  3836. .B cipher_list\fR.
  3837. .B cipher_list
  3838. is a colon\-separated list of ciphers, and defaults to
  3839. "AES\-256\-GCM:AES\-128\-GCM".
  3840. For servers, the first cipher from
  3841. .B cipher_list
  3842. will be pushed to clients that support cipher negotiation.
  3843. Cipher negotiation is enabled in client\-server mode only. I.e. if
  3844. .B \-\-mode
  3845. is set to 'server' (server\-side, implied by setting
  3846. .B \-\-server
  3847. ), or if
  3848. .B \-\-pull
  3849. is specified (client\-side, implied by setting \-\-client).
  3850. If both peers support and do not disable NCP, the negotiated cipher will
  3851. override the cipher specified by
  3852. .B \-\-cipher\fR.
  3853. Additionally, to allow for more smooth transition, if NCP is enabled, OpenVPN
  3854. will inherit the cipher of the peer if that cipher is different from the local
  3855. .B \-\-cipher
  3856. setting, but the peer cipher is one of the ciphers specified in
  3857. .B \-\-ncp\-ciphers\fR.
  3858. E.g. a non\-NCP client (<=v2.3, or with \-\-ncp\-disabled set) connecting to a
  3859. NCP server (v2.4+) with "\-\-cipher BF\-CBC" and "\-\-ncp\-ciphers
  3860. AES\-256\-GCM:AES\-256\-CBC" set can either specify "\-\-cipher BF\-CBC" or
  3861. "\-\-cipher AES\-256\-CBC" and both will work.
  3862. .\"*********************************************************
  3863. .TP
  3864. .B \-\-ncp\-disable
  3865. Disable "negotiable crypto parameters". This completely disables cipher
  3866. negotiation.
  3867. .\"*********************************************************
  3868. .TP
  3869. .B \-\-keysize n
  3870. .B DEPRECATED
  3871. This option will be removed in OpenVPN 2.6.
  3872. Size of cipher key in bits (optional).
  3873. If unspecified, defaults to cipher\-specific default. The
  3874. .B \-\-show\-ciphers
  3875. option (see below) shows all available OpenSSL ciphers,
  3876. their default key sizes, and whether the key size can
  3877. be changed. Use care in changing a cipher's default
  3878. key size. Many ciphers have not been extensively
  3879. cryptanalyzed with non\-standard key lengths, and a
  3880. larger key may offer no real guarantee of greater
  3881. security, or may even reduce security.
  3882. .\"*********************************************************
  3883. .TP
  3884. .B \-\-prng alg [nsl]
  3885. (Advanced) For PRNG (Pseudo\-random number generator),
  3886. use digest algorithm
  3887. .B alg
  3888. (default=sha1), and set
  3889. .B nsl
  3890. (default=16)
  3891. to the size in bytes of the nonce secret length (between 16 and 64).
  3892. Set
  3893. .B alg=none
  3894. to disable the PRNG and use the OpenSSL RAND_bytes function
  3895. instead for all of OpenVPN's pseudo\-random number needs.
  3896. .\"*********************************************************
  3897. .TP
  3898. .B \-\-engine [engine\-name]
  3899. Enable OpenSSL hardware\-based crypto engine functionality.
  3900. If
  3901. .B engine\-name
  3902. is specified,
  3903. use a specific crypto engine. Use the
  3904. .B \-\-show\-engines
  3905. standalone option to list the crypto engines which are
  3906. supported by OpenSSL.
  3907. .\"*********************************************************
  3908. .TP
  3909. .B \-\-no\-replay
  3910. .B DEPRECATED
  3911. This option will be removed in OpenVPN 2.5.
  3912. (Advanced) Disable OpenVPN's protection against replay attacks.
  3913. Don't use this option unless you are prepared to make
  3914. a tradeoff of greater efficiency in exchange for less
  3915. security.
  3916. OpenVPN provides datagram replay protection by default.
  3917. Replay protection is accomplished
  3918. by tagging each outgoing datagram with an identifier
  3919. that is guaranteed to be unique for the key being used.
  3920. The peer that receives the datagram will check for
  3921. the uniqueness of the identifier. If the identifier
  3922. was already received in a previous datagram, OpenVPN
  3923. will drop the packet. Replay protection is important
  3924. to defeat attacks such as a SYN flood attack, where
  3925. the attacker listens in the wire, intercepts a TCP
  3926. SYN packet (identifying it by the context in which
  3927. it occurs in relation to other packets), then floods
  3928. the receiving peer with copies of this packet.
  3929. OpenVPN's replay protection is implemented in slightly
  3930. different ways, depending on the key management mode
  3931. you have selected.
  3932. In Static Key mode
  3933. or when using an CFB or OFB mode cipher, OpenVPN uses a
  3934. 64 bit unique identifier that combines a time stamp with
  3935. an incrementing sequence number.
  3936. When using TLS mode for key exchange and a CBC cipher
  3937. mode, OpenVPN uses only a 32 bit sequence number without
  3938. a time stamp, since OpenVPN can guarantee the uniqueness
  3939. of this value for each key. As in IPSec, if the sequence number is
  3940. close to wrapping back to zero, OpenVPN will trigger
  3941. a new key exchange.
  3942. To check for replays, OpenVPN uses
  3943. the
  3944. .I sliding window
  3945. algorithm used
  3946. by IPSec.
  3947. .\"*********************************************************
  3948. .TP
  3949. .B \-\-replay\-window n [t]
  3950. Use a replay protection sliding\-window of size
  3951. .B n
  3952. and a time window of
  3953. .B t
  3954. seconds.
  3955. By default
  3956. .B n
  3957. is 64 (the IPSec default) and
  3958. .B t
  3959. is 15 seconds.
  3960. This option is only relevant in UDP mode, i.e.
  3961. when either
  3962. .B \-\-proto udp
  3963. is specified, or no
  3964. .B \-\-proto
  3965. option is specified.
  3966. When OpenVPN tunnels IP packets over UDP, there is the possibility that
  3967. packets might be dropped or delivered out of order. Because OpenVPN, like IPSec,
  3968. is emulating the physical network layer,
  3969. it will accept an out\-of\-order packet sequence, and
  3970. will deliver such packets in the same order they were received to
  3971. the TCP/IP protocol stack, provided they satisfy several constraints.
  3972. .B (a)
  3973. The packet cannot be a replay (unless
  3974. .B \-\-no\-replay
  3975. is specified, which disables replay protection altogether).
  3976. .B (b)
  3977. If a packet arrives out of order, it will only be accepted if the difference
  3978. between its sequence number and the highest sequence number received
  3979. so far is less than
  3980. .B n.
  3981. .B (c)
  3982. If a packet arrives out of order, it will only be accepted if it arrives no later
  3983. than
  3984. .B t
  3985. seconds after any packet containing a higher sequence number.
  3986. If you are using a network link with a large pipeline (meaning that
  3987. the product of bandwidth and latency is high), you may want to use
  3988. a larger value for
  3989. .B n.
  3990. Satellite links in particular often require this.
  3991. If you run OpenVPN at
  3992. .B \-\-verb 4,
  3993. you will see the message "Replay\-window backtrack occurred [x]"
  3994. every time the maximum sequence number backtrack seen thus far
  3995. increases. This can be used to calibrate
  3996. .B n.
  3997. There is some controversy on the appropriate method of handling packet
  3998. reordering at the security layer.
  3999. Namely, to what extent should the
  4000. security layer protect the encapsulated protocol from attacks which masquerade
  4001. as the kinds of normal packet loss and reordering that occur over IP networks?
  4002. The IPSec and OpenVPN approach is to allow packet reordering within a certain
  4003. fixed sequence number window.
  4004. OpenVPN adds to the IPSec model by limiting the window size in time as well as
  4005. sequence space.
  4006. OpenVPN also adds TCP transport as an option (not offered by IPSec) in which
  4007. case OpenVPN can adopt a very strict attitude towards message deletion and
  4008. reordering: Don't allow it. Since TCP guarantees reliability, any packet
  4009. loss or reordering event can be assumed to be an attack.
  4010. In this sense, it could be argued that TCP tunnel transport is preferred when
  4011. tunneling non\-IP or UDP application protocols which might be vulnerable to a
  4012. message deletion or reordering attack which falls within the normal
  4013. operational parameters of IP networks.
  4014. So I would make the statement that one should never tunnel a non\-IP protocol
  4015. or UDP application protocol over UDP, if the protocol might be vulnerable to a
  4016. message deletion or reordering attack that falls within the normal operating
  4017. parameters of what is to be expected from the physical IP layer. The problem
  4018. is easily fixed by simply using TCP as the VPN transport layer.
  4019. .\"*********************************************************
  4020. .TP
  4021. .B \-\-mute\-replay\-warnings
  4022. Silence the output of replay warnings, which are a common
  4023. false alarm on WiFi networks. This option preserves
  4024. the security of the replay protection code without
  4025. the verbosity associated with warnings about duplicate
  4026. packets.
  4027. .\"*********************************************************
  4028. .TP
  4029. .B \-\-replay\-persist file
  4030. Persist replay\-protection state across sessions using
  4031. .B file
  4032. to save and reload the state.
  4033. This option will strengthen protection against replay attacks,
  4034. especially when you are using OpenVPN in a dynamic context (such
  4035. as with
  4036. .B \-\-inetd)
  4037. when OpenVPN sessions are frequently started and stopped.
  4038. This option will keep a disk copy of the current replay protection
  4039. state (i.e. the most recent packet timestamp and sequence number
  4040. received from the remote peer), so that if an OpenVPN session
  4041. is stopped and restarted, it will reject any replays of packets
  4042. which were already received by the prior session.
  4043. This option only makes sense when replay protection is enabled
  4044. (the default) and you are using either
  4045. .B \-\-secret
  4046. (shared\-secret key mode) or TLS mode with
  4047. .B \-\-tls\-auth.
  4048. .\"*********************************************************
  4049. .TP
  4050. .B \-\-no\-iv
  4051. .B DEPRECATED
  4052. This option will be removed in OpenVPN 2.5.
  4053. (Advanced) Disable OpenVPN's use of IV (cipher initialization vector).
  4054. Don't use this option unless you are prepared to make
  4055. a tradeoff of greater efficiency in exchange for less
  4056. security.
  4057. OpenVPN uses an IV by default, and requires it for CFB and
  4058. OFB cipher modes (which are totally insecure without it).
  4059. Using an IV is important for security when multiple
  4060. messages are being encrypted/decrypted with the same key.
  4061. IV is implemented differently depending on the cipher mode used.
  4062. In CBC mode, OpenVPN uses a pseudo\-random IV for each packet.
  4063. In CFB/OFB mode, OpenVPN uses a unique sequence number and time stamp
  4064. as the IV. In fact, in CFB/OFB mode, OpenVPN uses a datagram
  4065. space\-saving optimization that uses the unique identifier for
  4066. datagram replay protection as the IV.
  4067. .\"*********************************************************
  4068. .TP
  4069. .B \-\-use\-prediction\-resistance
  4070. Enable prediction resistance on mbed TLS's RNG.
  4071. Enabling prediction resistance causes the RNG to reseed in each
  4072. call for random. Reseeding this often can quickly deplete the kernel
  4073. entropy pool.
  4074. If you need this option, please consider running a daemon that adds
  4075. entropy to the kernel pool.
  4076. .\"*********************************************************
  4077. .TP
  4078. .B \-\-test\-crypto
  4079. Do a self\-test of OpenVPN's crypto options by encrypting and
  4080. decrypting test packets using the data channel encryption options
  4081. specified above. This option does not require a peer to function,
  4082. and therefore can be specified without
  4083. .B \-\-dev
  4084. or
  4085. .B \-\-remote.
  4086. The typical usage of
  4087. .B \-\-test\-crypto
  4088. would be something like this:
  4089. .B openvpn \-\-test\-crypto \-\-secret key
  4090. or
  4091. .B openvpn \-\-test\-crypto \-\-secret key \-\-verb 9
  4092. This option is very useful to test OpenVPN after it has been ported to
  4093. a new platform, or to isolate problems in the compiler, OpenSSL
  4094. crypto library, or OpenVPN's crypto code. Since it is a self\-test mode,
  4095. problems with encryption and authentication can be debugged independently
  4096. of network and tunnel issues.
  4097. .\"*********************************************************
  4098. .SS TLS Mode Options:
  4099. TLS mode is the most powerful crypto mode of OpenVPN in both security and flexibility.
  4100. TLS mode works by establishing control and
  4101. data channels which are multiplexed over a single TCP/UDP port. OpenVPN initiates
  4102. a TLS session over the control channel and uses it to exchange cipher
  4103. and HMAC keys to protect the data channel. TLS mode uses a robust reliability
  4104. layer over the UDP connection for all control channel communication, while
  4105. the data channel, over which encrypted tunnel data passes, is forwarded without
  4106. any mediation. The result is the best of both worlds: a fast data channel
  4107. that forwards over UDP with only the overhead of encrypt,
  4108. decrypt, and HMAC functions,
  4109. and a control channel that provides all of the security features of TLS,
  4110. including certificate\-based authentication and Diffie Hellman forward secrecy.
  4111. To use TLS mode, each peer that runs OpenVPN should have its own local
  4112. certificate/key pair (
  4113. .B \-\-cert
  4114. and
  4115. .B \-\-key
  4116. ), signed by the root certificate which is specified
  4117. in
  4118. .B \-\-ca.
  4119. When two OpenVPN peers connect, each presents its local certificate to the
  4120. other. Each peer will then check that its partner peer presented a
  4121. certificate which was signed by the master root certificate as specified in
  4122. .B \-\-ca.
  4123. If that check on both peers succeeds, then the TLS negotiation
  4124. will succeed, both OpenVPN
  4125. peers will exchange temporary session keys, and the tunnel will begin
  4126. passing data.
  4127. The OpenVPN project provides a set of scripts for
  4128. managing RSA certificates & keys:
  4129. .I https://github.com/OpenVPN/easy\-rsa
  4130. .\"*********************************************************
  4131. .TP
  4132. .B \-\-tls\-server
  4133. Enable TLS and assume server role during TLS handshake. Note that
  4134. OpenVPN is designed as a peer\-to\-peer application. The designation
  4135. of client or server is only for the purpose of negotiating the TLS
  4136. control channel.
  4137. .\"*********************************************************
  4138. .TP
  4139. .B \-\-tls\-client
  4140. Enable TLS and assume client role during TLS handshake.
  4141. .\"*********************************************************
  4142. .TP
  4143. .B \-\-ca file
  4144. Certificate authority (CA) file in .pem format, also referred to as the
  4145. .I root
  4146. certificate. This file can have multiple
  4147. certificates in .pem format, concatenated together. You can construct your own
  4148. certificate authority certificate and private key by using a command such as:
  4149. .B openssl req \-nodes \-new \-x509 \-keyout ca.key \-out ca.crt
  4150. Then edit your openssl.cnf file and edit the
  4151. .B certificate
  4152. variable to point to your new root certificate
  4153. .B ca.crt.
  4154. For testing purposes only, the OpenVPN distribution includes a sample
  4155. CA certificate (ca.crt).
  4156. Of course you should never use
  4157. the test certificates and test keys distributed with OpenVPN in a
  4158. production environment, since by virtue of the fact that
  4159. they are distributed with OpenVPN, they are totally insecure.
  4160. .\"*********************************************************
  4161. .TP
  4162. .B \-\-capath dir
  4163. Directory containing trusted certificates (CAs and CRLs).
  4164. Not available with mbed TLS.
  4165. CAs in the capath directory are expected to be named <hash>.<n>. CRLs are
  4166. expected to be named <hash>.r<n>. See the
  4167. .B \-CApath
  4168. option of
  4169. .B openssl verify
  4170. , and the
  4171. .B \-hash
  4172. option of
  4173. .B openssl x509
  4174. ,
  4175. .B openssl crl
  4176. and
  4177. .BR X509_LOOKUP_hash_dir (3)
  4178. for more information.
  4179. Similarly to the
  4180. .B \-\-crl\-verify
  4181. option CRLs are not mandatory \- OpenVPN will log the usual warning in the logs
  4182. if the relevant CRL is missing, but the connection will be allowed.
  4183. .\"*********************************************************
  4184. .TP
  4185. .B \-\-dh file
  4186. File containing Diffie Hellman parameters
  4187. in .pem format (required for
  4188. .B \-\-tls\-server
  4189. only).
  4190. Set
  4191. .B file=none
  4192. to disable Diffie Hellman key exchange (and use ECDH only). Note that this
  4193. requires peers to be using an SSL library that supports ECDH TLS cipher suites
  4194. (e.g. OpenSSL 1.0.1+, or mbed TLS 2.0+).
  4195. Use
  4196. .B openssl dhparam \-out dh2048.pem 2048
  4197. to generate 2048\-bit DH parameters. Diffie Hellman parameters may be considered
  4198. public.
  4199. .\"*********************************************************
  4200. .TP
  4201. .B \-\-ecdh\-curve name
  4202. Specify the curve to use for elliptic curve Diffie Hellman. Available
  4203. curves can be listed with
  4204. .BR \-\-show\-curves .
  4205. The specified curve will only be used for ECDH TLS\-ciphers.
  4206. This option is not supported in mbed TLS builds of OpenVPN.
  4207. .\"*********************************************************
  4208. .TP
  4209. .B \-\-cert file
  4210. Local peer's signed certificate in .pem format \-\- must be signed
  4211. by a certificate authority whose certificate is in
  4212. .B \-\-ca file.
  4213. Each peer in an OpenVPN link running in TLS mode should have its own
  4214. certificate and private key file. In addition, each certificate should
  4215. have been signed by the key of a certificate
  4216. authority whose public key resides in the
  4217. .B \-\-ca
  4218. certificate authority file.
  4219. You can easily make your own certificate authority (see above) or pay money
  4220. to use a commercial service such as thawte.com (in which case you will be
  4221. helping to finance the world's second space tourist :).
  4222. To generate a certificate,
  4223. you can use a command such as:
  4224. .B openssl req \-nodes \-new \-keyout mycert.key \-out mycert.csr
  4225. If your certificate authority private key lives on another machine, copy
  4226. the certificate signing request (mycert.csr) to this other machine (this can
  4227. be done over an insecure channel such as email). Now sign the certificate
  4228. with a command such as:
  4229. .B openssl ca \-out mycert.crt \-in mycert.csr
  4230. Now copy the certificate (mycert.crt)
  4231. back to the peer which initially generated the .csr file (this
  4232. can be over a public medium).
  4233. Note that the
  4234. .B openssl ca
  4235. command reads the location of the certificate authority key from its
  4236. configuration file such as
  4237. .B /usr/share/ssl/openssl.cnf
  4238. \-\- note also
  4239. that for certificate authority functions, you must set up the files
  4240. .B index.txt
  4241. (may be empty) and
  4242. .B serial
  4243. (initialize to
  4244. .B
  4245. 01
  4246. ).
  4247. .\"*********************************************************
  4248. .TP
  4249. .B \-\-extra\-certs file
  4250. Specify a
  4251. .B file
  4252. containing one or more PEM certs (concatenated together)
  4253. that complete the
  4254. local certificate chain.
  4255. This option is useful for "split" CAs, where the CA for server
  4256. certs is different than the CA for client certs. Putting certs
  4257. in this file allows them to be used to complete the local
  4258. certificate chain without trusting them to verify the peer\-submitted
  4259. certificate, as would be the case if the certs were placed in the
  4260. .B ca
  4261. file.
  4262. .\"*********************************************************
  4263. .TP
  4264. .B \-\-key file
  4265. Local peer's private key in .pem format. Use the private key which was generated
  4266. when you built your peer's certificate (see
  4267. .B \-\-cert file
  4268. above).
  4269. .\"*********************************************************
  4270. .TP
  4271. .B \-\-tls\-version\-min version ['or\-highest']
  4272. Sets the minimum
  4273. TLS version we will accept from the peer (default is "1.0").
  4274. Examples for version
  4275. include "1.0", "1.1", or "1.2". If 'or\-highest' is specified
  4276. and version is not recognized, we will only accept the highest TLS
  4277. version supported by the local SSL implementation.
  4278. .\"*********************************************************
  4279. .TP
  4280. .B \-\-tls\-version\-max version
  4281. Set the maximum TLS version we will use (default is the highest version
  4282. supported). Examples for version include "1.0", "1.1", or "1.2".
  4283. .\"*********************************************************
  4284. .TP
  4285. .B \-\-pkcs12 file
  4286. Specify a PKCS #12 file containing local private key,
  4287. local certificate, and root CA certificate.
  4288. This option can be used instead of
  4289. .B \-\-ca, \-\-cert,
  4290. and
  4291. .B \-\-key.
  4292. Not available with mbed TLS.
  4293. .\"*********************************************************
  4294. .TP
  4295. .B \-\-verify\-hash hash [algo]
  4296. Specify SHA1 or SHA256 fingerprint for level\-1 cert. The level\-1 cert is the
  4297. CA (or intermediate cert) that signs the leaf certificate, and is
  4298. one removed from the leaf certificate in the direction of the root.
  4299. When accepting a connection from a peer, the level\-1 cert
  4300. fingerprint must match
  4301. .B hash
  4302. or certificate verification will fail. Hash is specified
  4303. as XX:XX:... For example:
  4304. .nf
  4305. .ft 3
  4306. .in +4
  4307. AD:B0:95:D8:09:C8:36:45:12:A9:89:C8:90:09:CB:13:72:A6:AD:16
  4308. .in -4
  4309. .ft
  4310. .fi
  4311. The
  4312. .B algo
  4313. flag can be either SHA1 or SHA256. If not provided, it defaults to SHA1.
  4314. .\"*********************************************************
  4315. .TP
  4316. .B \-\-pkcs11\-cert\-private [0|1]...
  4317. Set if access to certificate object should be performed after login.
  4318. Every provider has its own setting.
  4319. .\"*********************************************************
  4320. .TP
  4321. .B \-\-pkcs11\-id name
  4322. Specify the serialized certificate id to be used. The id can be gotten
  4323. by the standalone
  4324. .B \-\-show\-pkcs11\-ids
  4325. option.
  4326. .\"*********************************************************
  4327. .TP
  4328. .B \-\-pkcs11\-id\-management
  4329. Acquire PKCS#11 id from management interface. In this case a NEED\-STR 'pkcs11\-id\-request'
  4330. real\-time message will be triggered, application may use pkcs11\-id\-count command to
  4331. retrieve available number of certificates, and pkcs11\-id\-get command to retrieve certificate
  4332. id and certificate body.
  4333. .\"*********************************************************
  4334. .TP
  4335. .B \-\-pkcs11\-pin\-cache seconds
  4336. Specify how many seconds the PIN can be cached, the default is until the token is removed.
  4337. .\"*********************************************************
  4338. .TP
  4339. .B \-\-pkcs11\-protected\-authentication [0|1]...
  4340. Use PKCS#11 protected authentication path, useful for biometric and external
  4341. keypad devices.
  4342. Every provider has its own setting.
  4343. .\"*********************************************************
  4344. .TP
  4345. .B \-\-pkcs11\-providers provider...
  4346. Specify a RSA Security Inc. PKCS #11 Cryptographic Token Interface (Cryptoki) providers
  4347. to load.
  4348. This option can be used instead of
  4349. .B \-\-cert, \-\-key,
  4350. and
  4351. .B \-\-pkcs12.
  4352. If p11\-kit is present on the system, its
  4353. .B p11\-kit\-proxy.so
  4354. module will be loaded by default if either the
  4355. .B \-\-pkcs11\-id
  4356. or
  4357. .B \-\-pkcs11\-id\-management
  4358. options are specified without
  4359. .B \-\-pkcs11\-provider
  4360. being given.
  4361. .\"*********************************************************
  4362. .TP
  4363. .B \-\-pkcs11\-private\-mode mode...
  4364. Specify which method to use in order to perform private key operations.
  4365. A different mode can be specified for each provider.
  4366. Mode is encoded as hex number, and can be a mask one of the following:
  4367. .B 0
  4368. (default) \-\- Try to determine automatically.
  4369. .br
  4370. .B 1
  4371. \-\- Use sign.
  4372. .br
  4373. .B 2
  4374. \-\- Use sign recover.
  4375. .br
  4376. .B 4
  4377. \-\- Use decrypt.
  4378. .br
  4379. .B 8
  4380. \-\- Use unwrap.
  4381. .br
  4382. .\"*********************************************************
  4383. .TP
  4384. .B \-\-cryptoapicert select\-string
  4385. Load the certificate and private key from the
  4386. Windows Certificate System Store (Windows/OpenSSL Only).
  4387. Use this option instead of
  4388. .B \-\-cert
  4389. and
  4390. .B \-\-key.
  4391. This makes
  4392. it possible to use any smart card, supported by Windows, but also any
  4393. kind of certificate, residing in the Cert Store, where you have access to
  4394. the private key. This option has been tested with a couple of different
  4395. smart cards (GemSAFE, Cryptoflex, and Swedish Post Office eID) on the
  4396. client side, and also an imported PKCS12 software certificate on the
  4397. server side.
  4398. To select a certificate, based on a substring search in the
  4399. certificate's subject:
  4400. .B cryptoapicert
  4401. "SUBJ:Peter Runestig"
  4402. To select a certificate, based on certificate's thumbprint:
  4403. .B cryptoapicert
  4404. "THUMB:f6 49 24 41 01 b4 ..."
  4405. The thumbprint hex string can easily be copy\-and\-pasted from the Windows
  4406. Certificate Store GUI.
  4407. .\"*********************************************************
  4408. .TP
  4409. .B \-\-key\-method m
  4410. .B DEPRECATED
  4411. This option will be removed in OpenVPN 2.5
  4412. Use data channel key negotiation method
  4413. .B m.
  4414. The key method must match on both sides of the connection.
  4415. After OpenVPN negotiates a TLS session, a new set of keys
  4416. for protecting the tunnel data channel is generated and
  4417. exchanged over the TLS session.
  4418. In method 1 (the default for OpenVPN 1.x), both sides generate
  4419. random encrypt and HMAC\-send keys which are forwarded to
  4420. the other host over the TLS channel. Method 1 is
  4421. .B deprecated in OpenVPN 2.4
  4422. , and
  4423. .B will be removed in OpenVPN 2.5\fR.
  4424. In method 2, (the default for OpenVPN 2.0)
  4425. the client generates a random key. Both client
  4426. and server also generate some random seed material. All key source
  4427. material is exchanged over the TLS channel. The actual
  4428. keys are generated using the TLS PRF function, taking source
  4429. entropy from both client and server. Method 2 is designed to
  4430. closely parallel the key generation process used by TLS 1.0.
  4431. Note that in TLS mode, two separate levels
  4432. of keying occur:
  4433. (1) The TLS connection is initially negotiated, with both sides
  4434. of the connection producing certificates and verifying the certificate
  4435. (or other authentication info provided) of
  4436. the other side. The
  4437. .B \-\-key\-method
  4438. parameter has no effect on this process.
  4439. (2) After the TLS connection is established, the tunnel session keys are
  4440. separately negotiated over the existing secure TLS channel. Here,
  4441. .B \-\-key\-method
  4442. determines the derivation of the tunnel session keys.
  4443. .\"*********************************************************
  4444. .TP
  4445. .B \-\-tls\-cipher l
  4446. .TQ
  4447. .B \-\-tls\-ciphersuites l
  4448. A list
  4449. .B l
  4450. of allowable TLS ciphers delimited by a colon (":").
  4451. These setting can be used to ensure that certain cipher suites are used (or
  4452. not used) for the TLS connection. OpenVPN uses TLS to secure the control
  4453. channel, over which the keys that are used to protect the actual VPN traffic
  4454. are exchanged.
  4455. The supplied list of ciphers is (after potential OpenSSL/IANA name translation)
  4456. simply supplied to the crypto library. Please see the OpenSSL and/or mbed TLS
  4457. documentation for details on the cipher list interpretation.
  4458. For OpenSSL, the
  4459. .B \-\-tls-cipher
  4460. is used for TLS 1.2 and below. For TLS 1.3 and up, the
  4461. .B \-\-tls\-ciphersuites
  4462. setting is used. mbed TLS has no TLS 1.3 support yet and only the
  4463. .B \-\-tls-cipher
  4464. setting is used.
  4465. Use
  4466. .B \-\-show\-tls
  4467. to see a list of TLS ciphers supported by your crypto library.
  4468. Warning!
  4469. .B \-\-tls\-cipher
  4470. and
  4471. .B \-\-tls\-ciphersuites
  4472. are expert features, which \- if used correcly \- can improve the security of
  4473. your VPN connection. But it is also easy to unwittingly use them to carefully
  4474. align a gun with your foot, or just break your connection. Use with care!
  4475. The default for \-\-tls\-cipher is to use mbed TLS's default cipher list
  4476. when using mbed TLS or
  4477. "DEFAULT:!EXP:!LOW:!MEDIUM:!kDH:!kECDH:!DSS:!PSK:!SRP:!kRSA" when using
  4478. OpenSSL.
  4479. The default for \-\-tls\-ciphersuites is to use the crypto library's default.
  4480. .\"*********************************************************
  4481. .TP
  4482. .B \-\-tls\-cert\-profile profile
  4483. Set the allowed cryptographic algorithms for certificates according to
  4484. .B profile\fN.
  4485. The following profiles are supported:
  4486. .B legacy
  4487. (default): SHA1 and newer, RSA 2048-bit+, any elliptic curve.
  4488. .B preferred
  4489. : SHA2 and newer, RSA 2048-bit+, any elliptic curve.
  4490. .B suiteb
  4491. : SHA256/SHA384, ECDSA with P-256 or P-384.
  4492. This option is only fully supported for mbed TLS builds. OpenSSL builds use
  4493. the following approximation:
  4494. .B legacy
  4495. (default): sets "security level 1"
  4496. .B preferred
  4497. : sets "security level 2"
  4498. .B suiteb
  4499. : sets "security level 3" and \-\-tls\-cipher "SUITEB128".
  4500. OpenVPN will migrate to 'preferred' as default in the future. Please ensure
  4501. that your keys already comply.
  4502. .\"*********************************************************
  4503. .TP
  4504. .B \-\-tls\-timeout n
  4505. Packet retransmit timeout on TLS control channel
  4506. if no acknowledgment from remote within
  4507. .B n
  4508. seconds (default=2). When OpenVPN sends a control
  4509. packet to its peer, it will expect to receive an
  4510. acknowledgement within
  4511. .B n
  4512. seconds or it will retransmit the packet, subject
  4513. to a TCP\-like exponential backoff algorithm. This parameter
  4514. only applies to control channel packets. Data channel
  4515. packets (which carry encrypted tunnel data) are never
  4516. acknowledged, sequenced, or retransmitted by OpenVPN because
  4517. the higher level network protocols running on top of the tunnel
  4518. such as TCP expect this role to be left to them.
  4519. .\"*********************************************************
  4520. .TP
  4521. .B \-\-reneg\-bytes n
  4522. Renegotiate data channel key after
  4523. .B n
  4524. bytes sent or received (disabled by default with an exception, see below).
  4525. OpenVPN allows the lifetime of a key
  4526. to be expressed as a number of bytes encrypted/decrypted, a number of packets,
  4527. or a number of seconds. A key renegotiation will be forced
  4528. if any of these three criteria are met by either peer.
  4529. If using ciphers with cipher block sizes less than 128\-bits, \-\-reneg\-bytes is
  4530. set to 64MB by default, unless it is explicitly disabled by setting the value to
  4531. 0, but this is
  4532. .B HIGHLY DISCOURAGED
  4533. as this is designed to add some protection against the SWEET32 attack vector.
  4534. For more information see the \-\-cipher option.
  4535. .\"*********************************************************
  4536. .TP
  4537. .B \-\-reneg\-pkts n
  4538. Renegotiate data channel key after
  4539. .B n
  4540. packets sent and received (disabled by default).
  4541. .\"*********************************************************
  4542. .TP
  4543. .B \-\-reneg\-sec n
  4544. Renegotiate data channel key after
  4545. .B n
  4546. seconds (default=3600).
  4547. When using dual\-factor authentication, note that this default value may
  4548. cause the end user to be challenged to reauthorize once per hour.
  4549. Also, keep in mind that this option can be used on both the client and server,
  4550. and whichever uses the lower value will be the one to trigger the renegotiation.
  4551. A common mistake is to set
  4552. .B \-\-reneg\-sec
  4553. to a higher value on either the client or server, while the other side of the connection
  4554. is still using the default value of 3600 seconds, meaning that the renegotiation will
  4555. still occur once per 3600 seconds. The solution is to increase \-\-reneg\-sec on both the
  4556. client and server, or set it to 0 on one side of the connection (to disable), and to
  4557. your chosen value on the other side.
  4558. .\"*********************************************************
  4559. .TP
  4560. .B \-\-hand\-window n
  4561. Handshake Window \-\- the TLS\-based key exchange must finalize within
  4562. .B n
  4563. seconds
  4564. of handshake initiation by any peer (default = 60 seconds).
  4565. If the handshake fails
  4566. we will attempt to reset our connection with our peer and try again.
  4567. Even in the event of handshake failure we will still use
  4568. our expiring key for up to
  4569. .B \-\-tran\-window
  4570. seconds to maintain continuity of transmission of tunnel
  4571. data.
  4572. .\"*********************************************************
  4573. .TP
  4574. .B \-\-tran\-window n
  4575. Transition window \-\- our old key can live this many seconds
  4576. after a new a key renegotiation begins (default = 3600 seconds).
  4577. This feature allows for a graceful transition from old to new
  4578. key, and removes the key renegotiation sequence from the critical
  4579. path of tunnel data forwarding.
  4580. .\"*********************************************************
  4581. .TP
  4582. .B \-\-single\-session
  4583. After initially connecting to a remote peer, disallow any new connections.
  4584. Using this
  4585. option means that a remote peer cannot connect, disconnect, and then
  4586. reconnect.
  4587. If the daemon is reset by a signal or
  4588. .B \-\-ping\-restart,
  4589. it will allow one new connection.
  4590. .B \-\-single\-session
  4591. can be used with
  4592. .B \-\-ping\-exit
  4593. or
  4594. .B \-\-inactive
  4595. to create a single dynamic session that will exit when finished.
  4596. .\"*********************************************************
  4597. .TP
  4598. .B \-\-tls\-exit
  4599. Exit on TLS negotiation failure.
  4600. .\"*********************************************************
  4601. .TP
  4602. .B \-\-tls\-auth file [direction]
  4603. Add an additional layer of HMAC authentication on top of the TLS control channel
  4604. to mitigate DoS attacks and attacks on the TLS stack.
  4605. In a nutshell,
  4606. .B \-\-tls\-auth
  4607. enables a kind of "HMAC firewall" on OpenVPN's TCP/UDP port,
  4608. where TLS control channel packets
  4609. bearing an incorrect HMAC signature can be dropped immediately without
  4610. response.
  4611. .B file
  4612. (required) is a file in OpenVPN static key format which can be generated by
  4613. .B \-\-genkey
  4614. Older versions (up to OpenVPN 2.3) supported a freeform passphrase file.
  4615. This is no longer supported in newer versions (v2.4+).
  4616. See the
  4617. .B \-\-secret
  4618. option for more information on the optional
  4619. .B direction
  4620. parameter.
  4621. .B \-\-tls\-auth
  4622. is recommended when you are running OpenVPN in a mode where
  4623. it is listening for packets from any IP address, such as when
  4624. .B \-\-remote
  4625. is not specified, or
  4626. .B \-\-remote
  4627. is specified with
  4628. .B \-\-float.
  4629. The rationale for
  4630. this feature is as follows. TLS requires a multi\-packet exchange
  4631. before it is able to authenticate a peer. During this time
  4632. before authentication, OpenVPN is allocating resources (memory
  4633. and CPU) to this potential peer. The potential peer is also
  4634. exposing many parts of OpenVPN and the OpenSSL library to the packets
  4635. it is sending. Most successful network attacks today seek
  4636. to either exploit bugs in programs (such as buffer overflow attacks) or
  4637. force a program to consume so many resources that it becomes unusable.
  4638. Of course the first line of defense is always to produce clean,
  4639. well\-audited code. OpenVPN has been written with buffer overflow
  4640. attack prevention as a top priority.
  4641. But as history has shown, many of the most widely used
  4642. network applications have, from time to time,
  4643. fallen to buffer overflow attacks.
  4644. So as a second line of defense, OpenVPN offers
  4645. this special layer of authentication on top of the TLS control channel so that
  4646. every packet on the control channel is authenticated by an
  4647. HMAC signature and a unique ID for replay protection.
  4648. This signature will also help protect against DoS (Denial of Service) attacks.
  4649. An important rule of thumb in reducing vulnerability to DoS attacks is to
  4650. minimize the amount of resources a potential, but as yet unauthenticated,
  4651. client is able to consume.
  4652. .B \-\-tls\-auth
  4653. does this by signing every TLS control channel packet with an HMAC signature,
  4654. including packets which are sent before the TLS level has had a chance
  4655. to authenticate the peer.
  4656. The result is that packets without
  4657. the correct signature can be dropped immediately upon reception,
  4658. before they have a chance to consume additional system resources
  4659. such as by initiating a TLS handshake.
  4660. .B \-\-tls\-auth
  4661. can be strengthened by adding the
  4662. .B \-\-replay\-persist
  4663. option which will keep OpenVPN's replay protection state
  4664. in a file so that it is not lost across restarts.
  4665. It should be emphasized that this feature is optional and that the
  4666. key file used with
  4667. .B \-\-tls\-auth
  4668. gives a peer nothing more than the power to initiate a TLS
  4669. handshake. It is not used to encrypt or authenticate any tunnel data.
  4670. Use
  4671. .B \-\-tls\-crypt
  4672. instead if you want to use the key file to not only authenticate, but also
  4673. encrypt the TLS control channel.
  4674. .\"*********************************************************
  4675. .TP
  4676. .B \-\-tls\-crypt keyfile
  4677. Encrypt and authenticate all control channel packets with the key from
  4678. .B keyfile.
  4679. (See
  4680. .B \-\-tls\-auth
  4681. for more background.)
  4682. Encrypting (and authenticating) control channel packets:
  4683. .RS
  4684. .IP \[bu] 2
  4685. provides more privacy by hiding the certificate used for the TLS connection,
  4686. .IP \[bu]
  4687. makes it harder to identify OpenVPN traffic as such,
  4688. .IP \[bu]
  4689. provides "poor\-man's" post\-quantum security, against attackers who will never
  4690. know the pre\-shared key (i.e. no forward secrecy).
  4691. .RE
  4692. .IP
  4693. In contrast to
  4694. .B \-\-tls\-auth\fR,
  4695. .B \-\-tls\-crypt
  4696. does *not* require the user to set
  4697. .B \-\-key\-direction\fR.
  4698. .B Security Considerations
  4699. All peers use the same
  4700. .B \-\-tls\-crypt
  4701. pre\-shared group key to authenticate and encrypt control channel messages. To
  4702. ensure that IV collisions remain unlikely, this key should not be used to
  4703. encrypt more than 2^48 client\-to\-server or 2^48 server\-to\-client control
  4704. channel messages. A typical initial negotiation is about 10 packets in each
  4705. direction. Assuming both initial negotiation and renegotiations are at most
  4706. 2^16 (65536) packets (to be conservative), and (re)negotiations happen each
  4707. minute for each user (24/7), this limits the tls\-crypt key lifetime to 8171
  4708. years divided by the number of users. So a setup with 1000 users should rotate
  4709. the key at least once each eight years. (And a setup with 8000 users each
  4710. year.)
  4711. If IV collisions were to occur, this could result in the security of
  4712. .B \-\-tls\-crypt
  4713. degrading to the same security as using
  4714. .B \-\-tls\-auth\fR.
  4715. That is, the control channel still benefits from the extra protection against
  4716. active man\-in\-the\-middle\-attacks and DoS attacks, but may no longer offer
  4717. extra privacy and post\-quantum security on top of what TLS itself offers.
  4718. .\"*********************************************************
  4719. .TP
  4720. .B \-\-askpass [file]
  4721. Get certificate password from console or
  4722. .B file
  4723. before we daemonize.
  4724. For the extremely
  4725. security conscious, it is possible to protect your private key with
  4726. a password. Of course this means that every time the OpenVPN
  4727. daemon is started you must be there to type the password. The
  4728. .B \-\-askpass
  4729. option allows you to start OpenVPN from the command line. It will
  4730. query you for a password before it daemonizes. To protect a private
  4731. key with a password you should omit the
  4732. .B \-nodes
  4733. option when you use the
  4734. .B openssl
  4735. command line tool to manage certificates and private keys.
  4736. If
  4737. .B file
  4738. is specified, read the password from the first line of
  4739. .B file.
  4740. Keep in mind that storing your password in a file
  4741. to a certain extent invalidates the extra security provided by
  4742. using an encrypted key.
  4743. .\"*********************************************************
  4744. .TP
  4745. .B \-\-auth\-nocache
  4746. Don't cache
  4747. .B \-\-askpass
  4748. or
  4749. .B \-\-auth\-user\-pass
  4750. username/passwords in virtual memory.
  4751. If specified, this directive will cause OpenVPN to immediately
  4752. forget username/password inputs after they are used. As a result,
  4753. when OpenVPN needs a username/password, it will prompt for input
  4754. from stdin, which may be multiple times during the duration of an
  4755. OpenVPN session.
  4756. When using \-\-auth\-nocache in combination with a user/password file
  4757. and \-\-chroot or \-\-daemon, make sure to use an absolute path.
  4758. This directive does not affect the
  4759. .B \-\-http\-proxy
  4760. username/password. It is always cached.
  4761. .\"*********************************************************
  4762. .TP
  4763. .B \-\-auth\-token token
  4764. This is not an option to be used directly in any configuration files,
  4765. but rather push this option from a
  4766. .B \-\-client\-connect
  4767. script or a
  4768. .B \-\-plugin
  4769. which hooks into the OPENVPN_PLUGIN_CLIENT_CONNECT or
  4770. OPENVPN_PLUGIN_CLIENT_CONNECT_V2 calls. This option provides
  4771. a possibility to replace the clients password with an authentication
  4772. token during the lifetime of the OpenVPN client.
  4773. Whenever the connection is renegotiated and the
  4774. .B \-\-auth\-user\-pass\-verify
  4775. script or
  4776. .B \-\-plugin
  4777. making use of the OPENVPN_PLUGIN_AUTH_USER_PASS_VERIFY hook is
  4778. triggered, it will pass over this token as the password
  4779. instead of the password the user provided. The authentication
  4780. token can only be reset by a full reconnect where the server
  4781. can push new options to the client. The password the user entered
  4782. is never preserved once an authentication token have been set. If
  4783. the OpenVPN server side rejects the authentication token, the
  4784. client will receive an AUTH_FAIL and disconnect.
  4785. The purpose of this is to enable two factor authentication
  4786. methods, such as HOTP or TOTP, to be used without needing to
  4787. retrieve a new OTP code each time the connection is renegotiated.
  4788. Another use case is to cache authentication data on the client
  4789. without needing to have the users password cached in memory
  4790. during the life time of the session.
  4791. To make use of this feature, the
  4792. .B \-\-client\-connect
  4793. script or
  4794. .B \-\-plugin
  4795. needs to put
  4796. .nf
  4797. .ft 3
  4798. .in +4
  4799. push "auth\-token UNIQUE_TOKEN_VALUE"
  4800. .in -4
  4801. .ft
  4802. .fi
  4803. into the file/buffer for dynamic configuration data. This
  4804. will then make the OpenVPN server to push this value to the
  4805. client, which replaces the local password with the
  4806. UNIQUE_TOKEN_VALUE.
  4807. Newer clients (2.4.7+) will fall back to the original password method
  4808. after a failed auth. Older clients will keep using the token value
  4809. and react acording to
  4810. .B \-\-auth-retry
  4811. .
  4812. .\"*********************************************************
  4813. .TP
  4814. .B \-\-tls\-verify cmd
  4815. Run command
  4816. .B cmd
  4817. to verify the X509 name of a
  4818. pending TLS connection that has otherwise passed all other
  4819. tests of certification (except for revocation via
  4820. .B \-\-crl\-verify
  4821. directive; the revocation test occurs after the
  4822. .B \-\-tls\-verify
  4823. test).
  4824. .B cmd
  4825. should return 0 to allow the TLS handshake to proceed, or 1 to fail.
  4826. .B cmd
  4827. consists of a path to script (or executable program), optionally
  4828. followed by arguments. The path and arguments may be single\- or double\-quoted
  4829. and/or escaped using a backslash, and should be separated by one or more spaces.
  4830. When
  4831. .B cmd
  4832. is executed two arguments are appended after any arguments specified in
  4833. .B cmd
  4834. , as follows:
  4835. .B cmd certificate_depth subject
  4836. These arguments are, respectively, the current certificate depth and
  4837. the X509 subject distinguished name (dn) of the peer.
  4838. This feature is useful if the peer you want to trust has a certificate
  4839. which was signed by a certificate authority who also signed many
  4840. other certificates, where you don't necessarily want to trust all of them,
  4841. but rather be selective about which
  4842. peer certificate you will accept. This feature allows you to write a script
  4843. which will test the X509 name on a certificate and decide whether or
  4844. not it should be accepted. For a simple perl script which will test
  4845. the common name field on the certificate, see the file
  4846. .B verify\-cn
  4847. in the OpenVPN distribution.
  4848. See the "Environmental Variables" section below for
  4849. additional parameters passed as environmental variables.
  4850. .\"*********************************************************
  4851. .TP
  4852. .B \-\-tls\-export\-cert directory
  4853. Store the certificates the clients uses upon connection to this
  4854. directory. This will be done before \-\-tls\-verify is called. The
  4855. certificates will use a temporary name and will be deleted when
  4856. the tls\-verify script returns. The file name used for the certificate
  4857. is available via the peer_cert environment variable.
  4858. .\"*********************************************************
  4859. .TP
  4860. .B \-\-x509\-username\-field [ext:\]fieldname
  4861. Field in the X.509 certificate subject to be used as the username (default=CN).
  4862. Typically, this option is specified with
  4863. .B fieldname
  4864. as either of the following:
  4865. .B \-\-x509\-username\-field
  4866. emailAddress
  4867. .br
  4868. .B \-\-x509\-username\-field ext:\fRsubjectAltName
  4869. The first example uses the value of the "emailAddress" attribute in the
  4870. certificate's Subject field as the username. The second example uses
  4871. the
  4872. .B ext:
  4873. prefix to signify that the X.509 extension
  4874. .B fieldname
  4875. "subjectAltName" be searched for an rfc822Name (email) field to be used
  4876. as the username. In cases where there are multiple email addresses
  4877. in
  4878. .B ext:fieldname\fR,
  4879. the last occurrence is chosen.
  4880. When this option is used, the
  4881. .B \-\-verify\-x509\-name
  4882. option will match against the chosen
  4883. .B fieldname
  4884. instead of the Common Name.
  4885. Only the subjectAltName and issuerAltName X.509 extensions are supported.
  4886. .B Please note:
  4887. This option has a feature which will convert an all\-lowercase
  4888. .B fieldname
  4889. to uppercase characters, e.g., ou \-> OU. A mixed\-case
  4890. .B fieldname
  4891. or one having the
  4892. .B ext:
  4893. prefix will be left as\-is. This automatic upcasing feature
  4894. is deprecated and will be removed in a future release.
  4895. .\"*********************************************************
  4896. .TP
  4897. .B \-\-verify\-x509\-name name type
  4898. Accept connections only if a host's X.509 name is equal to
  4899. .B name.
  4900. The remote host must also pass all other tests of verification.
  4901. Which X.509 name is compared to
  4902. .B name
  4903. depends on the setting of type.
  4904. .B type
  4905. can be "subject" to match the complete subject DN (default),
  4906. "name" to match a subject RDN or "name\-prefix" to match a subject RDN prefix.
  4907. Which RDN is verified as name depends on the
  4908. .B \-\-x509\-username\-field
  4909. option. But it defaults to the common name (CN), e.g. a certificate with a
  4910. subject DN "C=KG, ST=NA, L=Bishkek, CN=Server\-1" would be matched by:
  4911. .B \-\-verify\-x509\-name 'C=KG, ST=NA, L=Bishkek, CN=Server\-1'
  4912. and
  4913. .B \-\-verify\-x509\-name Server\-1 name
  4914. or you could use
  4915. .B \-\-verify\-x509\-name Server\- name\-prefix
  4916. if you want a client to only accept connections to "Server\-1", "Server\-2", etc.
  4917. .B \-\-verify\-x509\-name
  4918. is a useful replacement for the
  4919. .B \-\-tls\-verify
  4920. option to verify the remote host, because
  4921. .B \-\-verify\-x509\-name
  4922. works in a
  4923. .B \-\-chroot
  4924. environment without any dependencies.
  4925. Using a name prefix is a useful alternative to managing
  4926. a CRL (Certificate Revocation List) on the client, since it allows the client
  4927. to refuse all certificates except for those associated
  4928. with designated servers.
  4929. .B NOTE:
  4930. Test against a name prefix only when you are using OpenVPN with
  4931. a custom CA certificate that is under your control.
  4932. Never use this option with type "name\-prefix" when your client certificates
  4933. are signed by a third party, such as a commercial web CA.
  4934. .\"*********************************************************
  4935. .TP
  4936. .B \-\-x509\-track attribute
  4937. Save peer X509
  4938. .B attribute
  4939. value in environment for use by plugins and management interface.
  4940. Prepend a '+' to
  4941. .B attribute
  4942. to save values from full cert chain. Values will be encoded
  4943. as X509_<depth>_<attribute>=<value>. Multiple
  4944. .B \-\-x509\-track
  4945. options can be defined to track multiple attributes.
  4946. .\"*********************************************************
  4947. .TP
  4948. .B \-\-ns\-cert\-type client|server
  4949. .B DEPRECATED
  4950. This option will be removed in OpenVPN 2.5. Use the more modern equivalent
  4951. .B \-\-remote\-cert\-tls
  4952. instead. This option will be removed in OpenVPN 2.5.
  4953. Require that peer certificate was signed with an explicit
  4954. .B nsCertType
  4955. designation of "client" or "server".
  4956. This is a useful security option for clients, to ensure that
  4957. the host they connect with is a designated server.
  4958. See the easy\-rsa/build\-key\-server script for an example
  4959. of how to generate a certificate with the
  4960. .B nsCertType
  4961. field set to "server".
  4962. If the server certificate's nsCertType field is set
  4963. to "server", then the clients can verify this with
  4964. .B \-\-ns\-cert\-type server.
  4965. This is an important security precaution to protect against
  4966. a man\-in\-the\-middle attack where an authorized client
  4967. attempts to connect to another client by impersonating the server.
  4968. The attack is easily prevented by having clients verify
  4969. the server certificate using any one of
  4970. .B \-\-ns\-cert\-type, \-\-verify\-x509\-name,
  4971. or
  4972. .B \-\-tls\-verify.
  4973. .\"*********************************************************
  4974. .TP
  4975. .B \-\-remote\-cert\-ku [v...]
  4976. Require that peer certificate was signed with an explicit
  4977. .B key usage.
  4978. If present in the certificate, the keyUsage value is validated by the TLS
  4979. library during the TLS handshake. Specifying this option without arguments
  4980. requires this extension to be present (so the TLS library will verify it).
  4981. If the list
  4982. .B v...
  4983. is also supplied, the keyUsage field must have
  4984. .B at least
  4985. the same bits set as the bits in
  4986. .B one of
  4987. the values supplied in the list
  4988. .B v...
  4989. The key usage values in the list must be encoded in hex, e.g.
  4990. "\-\-remote\-cert\-ku a0"
  4991. .\"*********************************************************
  4992. .TP
  4993. .B \-\-remote\-cert\-eku oid
  4994. Require that peer certificate was signed with an explicit
  4995. .B extended key usage.
  4996. This is a useful security option for clients, to ensure that
  4997. the host they connect to is a designated server.
  4998. The extended key usage should be encoded in oid notation, or
  4999. OpenSSL symbolic representation.
  5000. .\"*********************************************************
  5001. .TP
  5002. .B \-\-remote\-cert\-tls client|server
  5003. Require that peer certificate was signed with an explicit
  5004. .B key usage
  5005. and
  5006. .B extended key usage
  5007. based on RFC3280 TLS rules.
  5008. This is a useful security option for clients, to ensure that the host they
  5009. connect to is a designated server. Or the other way around; for a server to
  5010. verify that only hosts with a client certificate can connect.
  5011. The
  5012. .B \-\-remote\-cert\-tls client
  5013. option is equivalent to
  5014. .B
  5015. \-\-remote\-cert\-ku \-\-remote\-cert\-eku "TLS Web Client Authentication"
  5016. The
  5017. .B \-\-remote\-cert\-tls server
  5018. option is equivalent to
  5019. .B
  5020. \-\-remote\-cert\-ku \-\-remote\-cert\-eku "TLS Web Server Authentication"
  5021. This is an important security precaution to protect against
  5022. a man\-in\-the\-middle attack where an authorized client
  5023. attempts to connect to another client by impersonating the server.
  5024. The attack is easily prevented by having clients verify
  5025. the server certificate using any one of
  5026. .B \-\-remote\-cert\-tls, \-\-verify\-x509\-name,
  5027. or
  5028. .B \-\-tls\-verify.
  5029. .\"*********************************************************
  5030. .TP
  5031. .B \-\-crl\-verify crl ['dir']
  5032. Check peer certificate against the file
  5033. .B crl
  5034. in PEM format.
  5035. A CRL (certificate revocation list) is used when a particular key is
  5036. compromised but when the overall PKI is still intact.
  5037. Suppose you had a PKI consisting of a CA, root certificate, and a number of
  5038. client certificates. Suppose a laptop computer containing a client key and
  5039. certificate was stolen. By adding the stolen certificate to the CRL file,
  5040. you could reject any connection which attempts to use it, while preserving the
  5041. overall integrity of the PKI.
  5042. The only time when it would be necessary to rebuild the entire PKI from scratch would be
  5043. if the root certificate key itself was compromised.
  5044. The option is not mandatory \- if the relevant CRL is missing, OpenVPN will log
  5045. a warning in the logs \- e.g. "\fIVERIFY WARNING: depth=0, unable to get
  5046. certificate CRL\fR" \- but the connection will be allowed.
  5047. If the optional
  5048. .B dir
  5049. flag is specified, enable a different mode where
  5050. .B crl
  5051. is a directory containing files named as revoked serial numbers
  5052. (the files may be empty, the contents are never read). If a client
  5053. requests a connection, where the client certificate serial number
  5054. (decimal string) is the name of a file present in the directory,
  5055. it will be rejected.
  5056. Note: As the crl file (or directory) is read every time a peer connects,
  5057. if you are dropping root privileges with
  5058. .B \-\-user,
  5059. make sure that this user has sufficient privileges to read the file.
  5060. .\"*********************************************************
  5061. .SS SSL Library information:
  5062. .\"*********************************************************
  5063. .TP
  5064. .B \-\-show\-ciphers
  5065. (Standalone)
  5066. Show all cipher algorithms to use with the
  5067. .B \-\-cipher
  5068. option.
  5069. .\"*********************************************************
  5070. .TP
  5071. .B \-\-show\-digests
  5072. (Standalone)
  5073. Show all message digest algorithms to use with the
  5074. .B \-\-auth
  5075. option.
  5076. .\"*********************************************************
  5077. .TP
  5078. .B \-\-show\-tls
  5079. (Standalone)
  5080. Show all TLS ciphers supported by the crypto library. OpenVPN uses TLS to
  5081. secure the control channel, over which the keys that are used to protect the
  5082. actual VPN traffic are exchanged. The TLS ciphers will be sorted from highest
  5083. preference (most secure) to lowest.
  5084. Be aware that whether a cipher suite in this list can actually work depends on
  5085. the specific setup of both peers (e.g. both peers must support the cipher, and
  5086. an ECDSA cipher suite will not work if you are using an RSA certificate, etc.).
  5087. .\"*********************************************************
  5088. .TP
  5089. .B \-\-show\-engines
  5090. (Standalone)
  5091. Show currently available hardware\-based crypto acceleration
  5092. engines supported by the OpenSSL library.
  5093. .\"*********************************************************
  5094. .TP
  5095. .B \-\-show\-curves
  5096. (Standalone)
  5097. Show all available elliptic curves to use with the
  5098. .B \-\-ecdh\-curve
  5099. option.
  5100. .\"*********************************************************
  5101. .SS Generate a random key:
  5102. Used only for non\-TLS static key encryption mode.
  5103. .\"*********************************************************
  5104. .TP
  5105. .B \-\-genkey
  5106. (Standalone)
  5107. Generate a random key to be used as a shared secret,
  5108. for use with the
  5109. .B \-\-secret
  5110. option. This file must be shared with the
  5111. peer over a pre\-existing secure channel such as
  5112. .BR scp (1)
  5113. .
  5114. .\"*********************************************************
  5115. .TP
  5116. .B \-\-secret file
  5117. Write key to
  5118. .B file.
  5119. .\"*********************************************************
  5120. .SS TUN/TAP persistent tunnel config mode:
  5121. Available with Linux 2.4.7+. These options comprise a standalone mode
  5122. of OpenVPN which can be used to create and delete persistent tunnels.
  5123. .\"*********************************************************
  5124. .TP
  5125. .B \-\-mktun
  5126. (Standalone)
  5127. Create a persistent tunnel on platforms which support them such
  5128. as Linux. Normally TUN/TAP tunnels exist only for
  5129. the period of time that an application has them open. This option
  5130. takes advantage of the TUN/TAP driver's ability to build persistent
  5131. tunnels that live through multiple instantiations of OpenVPN and die
  5132. only when they are deleted or the machine is rebooted.
  5133. One of the advantages of persistent tunnels is that they eliminate the
  5134. need for separate
  5135. .B \-\-up
  5136. and
  5137. .B \-\-down
  5138. scripts to run the appropriate
  5139. .BR ifconfig (8)
  5140. and
  5141. .BR route (8)
  5142. commands. These commands can be placed in the the same shell script
  5143. which starts or terminates an OpenVPN session.
  5144. Another advantage is that open connections through the TUN/TAP\-based tunnel
  5145. will not be reset if the OpenVPN peer restarts. This can be useful to
  5146. provide uninterrupted connectivity through the tunnel in the event of a DHCP
  5147. reset of the peer's public IP address (see the
  5148. .B \-\-ipchange
  5149. option above).
  5150. One disadvantage of persistent tunnels is that it is harder to automatically
  5151. configure their MTU value (see
  5152. .B \-\-link\-mtu
  5153. and
  5154. .B \-\-tun\-mtu
  5155. above).
  5156. On some platforms such as Windows, TAP\-Win32 tunnels are persistent by
  5157. default.
  5158. .\"*********************************************************
  5159. .TP
  5160. .B \-\-rmtun
  5161. (Standalone)
  5162. Remove a persistent tunnel.
  5163. .\"*********************************************************
  5164. .TP
  5165. .B \-\-dev tunX | tapX
  5166. TUN/TAP device
  5167. .\"*********************************************************
  5168. .TP
  5169. .B \-\-user user
  5170. Optional user to be owner of this tunnel.
  5171. .\"*********************************************************
  5172. .TP
  5173. .B \-\-group group
  5174. Optional group to be owner of this tunnel.
  5175. .\"*********************************************************
  5176. .SS Windows\-Specific Options:
  5177. .\"*********************************************************
  5178. .TP
  5179. .B \-\-win\-sys path
  5180. Set the Windows system directory pathname to use when looking for system
  5181. executables such as
  5182. .B route.exe
  5183. and
  5184. .B netsh.exe.
  5185. By default, if this directive is
  5186. not specified, OpenVPN will use the SystemRoot environment variable.
  5187. This option have changed behaviour in OpenVPN 2.3. Earlier you had to
  5188. define
  5189. .B \-\-win\-sys env
  5190. to use the SystemRoot environment variable, otherwise it defaulted to C:\\WINDOWS.
  5191. It is not needed to use the
  5192. .B env
  5193. keyword any more, and it will just be ignored. A warning is logged when this
  5194. is found in the configuration file.
  5195. .\"*********************************************************
  5196. .TP
  5197. .B \-\-ip\-win32 method
  5198. When using
  5199. .B \-\-ifconfig
  5200. on Windows, set the TAP\-Win32 adapter
  5201. IP address and netmask using
  5202. .B method.
  5203. Don't use this option unless you are also using
  5204. .B \-\-ifconfig.
  5205. .B manual \-\-
  5206. Don't set the IP address or netmask automatically.
  5207. Instead output a message
  5208. to the console telling the user to configure the
  5209. adapter manually and indicating the IP/netmask which
  5210. OpenVPN expects the adapter to be set to.
  5211. .B dynamic [offset] [lease\-time] \-\-
  5212. Automatically set the IP address and netmask by replying to
  5213. DHCP query messages generated by the kernel. This mode is
  5214. probably the "cleanest" solution
  5215. for setting the TCP/IP properties since it uses the well\-known
  5216. DHCP protocol. There are, however, two prerequisites for using
  5217. this mode: (1) The TCP/IP properties for the TAP\-Win32
  5218. adapter must be set to "Obtain an IP address automatically," and
  5219. (2) OpenVPN needs to claim an IP address in the subnet for use
  5220. as the virtual DHCP server address. By default in
  5221. .B \-\-dev tap
  5222. mode, OpenVPN will
  5223. take the normally unused first address in the subnet. For example,
  5224. if your subnet is 192.168.4.0 netmask 255.255.255.0, then
  5225. OpenVPN will take the IP address 192.168.4.0 to use as the
  5226. virtual DHCP server address. In
  5227. .B \-\-dev tun
  5228. mode, OpenVPN will cause the DHCP server to masquerade as if it were
  5229. coming from the remote endpoint. The optional offset parameter is
  5230. an integer which is > \-256 and < 256 and which defaults to \-1.
  5231. If offset is positive, the DHCP server will masquerade as the IP
  5232. address at network address + offset.
  5233. If offset is negative, the DHCP server will masquerade as the IP
  5234. address at broadcast address + offset. The Windows
  5235. .B ipconfig /all
  5236. command can be used to show what Windows thinks the DHCP server
  5237. address is. OpenVPN will "claim" this address, so make sure to
  5238. use a free address. Having said that, different OpenVPN instantiations,
  5239. including different ends of the same connection, can share the same
  5240. virtual DHCP server address. The
  5241. .B lease\-time
  5242. parameter controls the lease time of the DHCP assignment given to
  5243. the TAP\-Win32 adapter, and is denoted in seconds.
  5244. Normally a very long lease time is preferred
  5245. because it prevents routes involving the TAP\-Win32 adapter from
  5246. being lost when the system goes to sleep. The default
  5247. lease time is one year.
  5248. .B netsh \-\-
  5249. Automatically set the IP address and netmask using
  5250. the Windows command\-line "netsh"
  5251. command. This method appears to work correctly on
  5252. Windows XP but not Windows 2000.
  5253. .B ipapi \-\-
  5254. Automatically set the IP address and netmask using the
  5255. Windows IP Helper API. This approach
  5256. does not have ideal semantics, though testing has indicated
  5257. that it works okay in practice. If you use this option,
  5258. it is best to leave the TCP/IP properties for the TAP\-Win32
  5259. adapter in their default state, i.e. "Obtain an IP address
  5260. automatically."
  5261. .B adaptive \-\-
  5262. (Default) Try
  5263. .B dynamic
  5264. method initially and fail over to
  5265. .B netsh
  5266. if the DHCP negotiation with the TAP\-Win32 adapter does
  5267. not succeed in 20 seconds. Such failures have been known
  5268. to occur when certain third\-party firewall packages installed
  5269. on the client machine block the DHCP negotiation used by
  5270. the TAP\-Win32 adapter.
  5271. Note that if the
  5272. .B netsh
  5273. failover occurs, the TAP\-Win32 adapter
  5274. TCP/IP properties will be reset from DHCP to static, and this
  5275. will cause future OpenVPN startups using the
  5276. .B adaptive
  5277. mode to use
  5278. .B netsh
  5279. immediately, rather than trying
  5280. .B dynamic
  5281. first. To "unstick" the
  5282. .B adaptive
  5283. mode from using
  5284. .B netsh,
  5285. run OpenVPN at least once using the
  5286. .B dynamic
  5287. mode to restore the TAP\-Win32 adapter TCP/IP properties
  5288. to a DHCP configuration.
  5289. .\"*********************************************************
  5290. .TP
  5291. .B \-\-route\-method m
  5292. Which method
  5293. .B m
  5294. to use for adding routes on Windows?
  5295. .B adaptive
  5296. (default) \-\- Try IP helper API first. If that fails, fall
  5297. back to the route.exe shell command.
  5298. .br
  5299. .B ipapi
  5300. \-\- Use IP helper API.
  5301. .br
  5302. .B exe
  5303. \-\- Call the route.exe shell command.
  5304. .\"*********************************************************
  5305. .TP
  5306. .B \-\-dhcp\-option type [parm]
  5307. Set extended TAP\-Win32 TCP/IP properties, must
  5308. be used with
  5309. .B \-\-ip\-win32 dynamic
  5310. or
  5311. .B \-\-ip\-win32 adaptive.
  5312. This option can be used to set additional TCP/IP properties
  5313. on the TAP\-Win32 adapter, and is particularly useful for
  5314. configuring an OpenVPN client to access a Samba server
  5315. across the VPN.
  5316. .B DOMAIN name \-\-
  5317. Set Connection\-specific DNS Suffix.
  5318. .B DNS addr \-\-
  5319. Set primary domain name server IPv4 or IPv6 address. Repeat
  5320. this option to set secondary DNS server addresses.
  5321. Note: DNS IPv6 servers are currently set using netsh (the existing
  5322. DHCP code can only do IPv4 DHCP, and that protocol only permits IPv4
  5323. addresses anywhere). The option will be put into the environment, so
  5324. an
  5325. .B \-\-up
  5326. script could act upon it if needed.
  5327. .B WINS addr \-\-
  5328. Set primary WINS server address (NetBIOS over TCP/IP Name Server).
  5329. Repeat this option to set secondary WINS server addresses.
  5330. .B NBDD addr \-\-
  5331. Set primary NBDD server address (NetBIOS over TCP/IP Datagram Distribution Server)
  5332. Repeat this option
  5333. to set secondary NBDD server addresses.
  5334. .B NTP addr \-\-
  5335. Set primary NTP server address (Network Time Protocol).
  5336. Repeat this option
  5337. to set secondary NTP server addresses.
  5338. .B NBT type \-\-
  5339. Set NetBIOS over TCP/IP Node type. Possible options:
  5340. .B 1
  5341. = b\-node (broadcasts),
  5342. .B 2
  5343. = p\-node (point\-to\-point
  5344. name queries to a WINS server),
  5345. .B 4
  5346. = m\-node (broadcast
  5347. then query name server), and
  5348. .B 8
  5349. = h\-node (query name server, then broadcast).
  5350. .B NBS scope\-id \-\-
  5351. Set NetBIOS over TCP/IP Scope. A NetBIOS Scope ID provides an extended
  5352. naming service for the NetBIOS over TCP/IP (Known as NBT) module. The
  5353. primary purpose of a NetBIOS scope ID is to isolate NetBIOS traffic on
  5354. a single network to only those nodes with the same NetBIOS scope ID.
  5355. The NetBIOS scope ID is a character string that is appended to the NetBIOS
  5356. name. The NetBIOS scope ID on two hosts must match, or the two hosts
  5357. will not be able to communicate. The NetBIOS Scope ID also allows
  5358. computers to use the same computer name, as they have different
  5359. scope IDs. The Scope ID becomes a part of the NetBIOS name, making the name unique.
  5360. (This description of NetBIOS scopes courtesy of NeonSurge@abyss.com)
  5361. .B DISABLE\-NBT \-\-
  5362. Disable Netbios\-over\-TCP/IP.
  5363. Note that if
  5364. .B \-\-dhcp\-option
  5365. is pushed via
  5366. .B \-\-push
  5367. to a non\-windows client, the option will be saved in the client's
  5368. environment before the up script is called, under
  5369. the name "foreign_option_{n}".
  5370. .\"*********************************************************
  5371. .TP
  5372. .B \-\-tap\-sleep n
  5373. Cause OpenVPN to sleep for
  5374. .B n
  5375. seconds immediately after the TAP\-Win32 adapter state
  5376. is set to "connected".
  5377. This option is intended to be used to troubleshoot problems
  5378. with the
  5379. .B \-\-ifconfig
  5380. and
  5381. .B \-\-ip\-win32
  5382. options, and is used to give
  5383. the TAP\-Win32 adapter time to come up before
  5384. Windows IP Helper API operations are applied to it.
  5385. .\"*********************************************************
  5386. .TP
  5387. .B \-\-show\-net\-up
  5388. Output OpenVPN's view of the system routing table and network
  5389. adapter list to the syslog or log file after the TUN/TAP adapter
  5390. has been brought up and any routes have been added.
  5391. .\"*********************************************************
  5392. .TP
  5393. .B \-\-block\-outside\-dns
  5394. Block DNS servers on other network adapters to prevent
  5395. DNS leaks. This option prevents any application from accessing
  5396. TCP or UDP port 53 except one inside the tunnel. It uses
  5397. Windows Filtering Platform (WFP) and works on Windows Vista or
  5398. later.
  5399. This option is considered unknown on non\-Windows platforms
  5400. and unsupported on Windows XP, resulting in fatal error.
  5401. You may want to use
  5402. .B \-\-setenv opt
  5403. or
  5404. .B \-\-ignore\-unknown\-option
  5405. (not suitable for Windows XP) to ignore said error.
  5406. Note that pushing unknown options from server does not trigger
  5407. fatal errors.
  5408. .\"*********************************************************
  5409. .TP
  5410. .B \-\-dhcp\-renew
  5411. Ask Windows to renew the TAP adapter lease on startup.
  5412. This option is normally unnecessary, as Windows automatically
  5413. triggers a DHCP renegotiation on the TAP adapter when it
  5414. comes up, however if you set the TAP\-Win32 adapter
  5415. Media Status property to "Always Connected", you may need this
  5416. flag.
  5417. .\"*********************************************************
  5418. .TP
  5419. .B \-\-dhcp\-release
  5420. Ask Windows to release the TAP adapter lease on shutdown.
  5421. This option has no effect now, as it is enabled by default starting with OpenVPN 2.4.1.
  5422. .\"*********************************************************
  5423. .TP
  5424. .B \-\-register\-dns
  5425. Run ipconfig /flushdns and ipconfig /registerdns on connection initiation.
  5426. This is known to kick Windows into
  5427. recognizing pushed DNS servers.
  5428. .\"*********************************************************
  5429. .TP
  5430. .B \-\-pause\-exit
  5431. Put up a "press any key to continue" message on the console prior
  5432. to OpenVPN program exit. This option is automatically used by the
  5433. Windows explorer when OpenVPN is run on a configuration
  5434. file using the right\-click explorer menu.
  5435. .\"*********************************************************
  5436. .TP
  5437. .B \-\-service exit\-event [0|1]
  5438. Should be used when OpenVPN is being automatically executed by another
  5439. program in such
  5440. a context that no interaction with the user via display or keyboard
  5441. is possible. In general, end\-users should never need to explicitly
  5442. use this option, as it is automatically added by the OpenVPN service wrapper
  5443. when a given OpenVPN configuration is being run as a service.
  5444. .B exit\-event
  5445. is the name of a Windows global event object, and OpenVPN will continuously
  5446. monitor the state of this event object and exit when it becomes signaled.
  5447. The second parameter indicates the initial state of
  5448. .B exit\-event
  5449. and normally defaults to 0.
  5450. Multiple OpenVPN processes can be simultaneously executed with the same
  5451. .B exit\-event
  5452. parameter. In any case, the controlling process can signal
  5453. .B exit\-event,
  5454. causing all such OpenVPN processes to exit.
  5455. When executing an OpenVPN process using the
  5456. .B \-\-service
  5457. directive, OpenVPN will probably not have a console
  5458. window to output status/error
  5459. messages, therefore it is useful to use
  5460. .B \-\-log
  5461. or
  5462. .B \-\-log\-append
  5463. to write these messages to a file.
  5464. .\"*********************************************************
  5465. .TP
  5466. .B \-\-show\-adapters
  5467. (Standalone)
  5468. Show available TAP\-Win32 adapters which can be selected using the
  5469. .B \-\-dev\-node
  5470. option. On non\-Windows systems, the
  5471. .BR ifconfig (8)
  5472. command provides similar functionality.
  5473. .\"*********************************************************
  5474. .TP
  5475. .B \-\-allow\-nonadmin [TAP\-adapter]
  5476. (Standalone)
  5477. Set
  5478. .B TAP\-adapter
  5479. to allow access from non\-administrative accounts. If
  5480. .B TAP\-adapter
  5481. is omitted, all TAP adapters on the system will be configured to allow
  5482. non\-admin access.
  5483. The non\-admin access setting will only persist for the length of time that
  5484. the TAP\-Win32 device object and driver remain loaded, and will need
  5485. to be re\-enabled after a reboot, or if the driver is unloaded
  5486. and reloaded.
  5487. This directive can only be used by an administrator.
  5488. .\"*********************************************************
  5489. .TP
  5490. .B \-\-show\-valid\-subnets
  5491. (Standalone)
  5492. Show valid subnets for
  5493. .B \-\-dev tun
  5494. emulation. Since the TAP\-Win32 driver
  5495. exports an ethernet interface to Windows, and since TUN devices are
  5496. point\-to\-point in nature, it is necessary for the TAP\-Win32 driver
  5497. to impose certain constraints on TUN endpoint address selection.
  5498. Namely, the point\-to\-point endpoints used in TUN device emulation
  5499. must be the middle two addresses of a /30 subnet (netmask 255.255.255.252).
  5500. .\"*********************************************************
  5501. .TP
  5502. .B \-\-show\-net
  5503. (Standalone)
  5504. Show OpenVPN's view of the system routing table and network
  5505. adapter list.
  5506. .\"*********************************************************
  5507. .SS PKCS#11 Standalone Options:
  5508. .\"*********************************************************
  5509. .TP
  5510. .B \-\-show\-pkcs11\-ids [provider] [cert_private]
  5511. (Standalone)
  5512. Show PKCS#11 token object list. Specify cert_private as 1
  5513. if certificates are stored as private objects.
  5514. If p11\-kit is present on the system, the
  5515. .B provider
  5516. argument is optional; if omitted the default
  5517. .B p11\-kit\-proxy.so
  5518. module will be queried.
  5519. .B \-\-verb
  5520. option can be used BEFORE this option to produce debugging information.
  5521. .\"*********************************************************
  5522. .SS Standalone Debug Options:
  5523. .\"*********************************************************
  5524. .TP
  5525. .B \-\-show\-gateway [v6target]
  5526. (Standalone)
  5527. Show current IPv4 and IPv6 default gateway and interface towards the
  5528. gateway (if the protocol in question is enabled). If an IPv6 address
  5529. is passed as argument, the IPv6 route for this host is reported.
  5530. .\"*********************************************************
  5531. .SS IPv6 Related Options
  5532. .\"*********************************************************
  5533. The following options exist to support IPv6 tunneling in peer\-to\-peer
  5534. and client\-server mode. All options are modeled after their IPv4
  5535. counterparts, so more detailed explanations given there apply here
  5536. as well (except for
  5537. .B \-\-topology
  5538. , which has no effect on IPv6).
  5539. .TP
  5540. .B \-\-ifconfig\-ipv6 ipv6addr/bits ipv6remote
  5541. configure IPv6 address
  5542. .B ipv6addr/bits
  5543. on the ``tun'' device. The second parameter is used as route target for
  5544. .B \-\-route\-ipv6
  5545. if no gateway is specified.
  5546. .TP
  5547. .B \-\-route\-ipv6 ipv6addr/bits [gateway] [metric]
  5548. setup IPv6 routing in the system to send the specified IPv6 network
  5549. into OpenVPN's ``tun''. The gateway parameter is only used for
  5550. IPv6 routes across ``tap'' devices, and if missing, the ``ipv6remote''
  5551. field from
  5552. .B \-\-ifconfig\-ipv6
  5553. is used.
  5554. .TP
  5555. .B \-\-server\-ipv6 ipv6addr/bits
  5556. convenience\-function to enable a number of IPv6 related options at
  5557. once, namely
  5558. .B \-\-ifconfig\-ipv6, \-\-ifconfig\-ipv6\-pool
  5559. and
  5560. .B \-\-push tun\-ipv6
  5561. Is only accepted if ``\-\-mode server'' or ``\-\-server'' is set. Pushing of the
  5562. .B \-\-tun\-ipv6
  5563. directive is done for older clients which require an explicit
  5564. ``\-\-tun\-ipv6'' in their configuration.
  5565. .TP
  5566. .B \-\-ifconfig\-ipv6\-pool ipv6addr/bits
  5567. Specify an IPv6 address pool for dynamic assignment to clients. The
  5568. pool starts at
  5569. .B ipv6addr
  5570. and matches the offset determined from the start of the IPv4 pool.
  5571. .TP
  5572. .B \-\-ifconfig\-ipv6\-push ipv6addr/bits ipv6remote
  5573. for ccd/ per\-client static IPv6 interface configuration, see
  5574. .B \-\-client\-config\-dir
  5575. and
  5576. .B \-\-ifconfig\-push
  5577. for more details.
  5578. .TP
  5579. .B \-\-iroute\-ipv6 ipv6addr/bits
  5580. for ccd/ per\-client static IPv6 route configuration, see
  5581. .B \-\-iroute
  5582. for more details how to setup and use this, and how
  5583. .B \-\-iroute
  5584. and
  5585. .B \-\-route
  5586. interact.
  5587. .\"*********************************************************
  5588. .SH SCRIPTING AND ENVIRONMENTAL VARIABLES
  5589. OpenVPN exports a series
  5590. of environmental variables for use by user\-defined scripts.
  5591. .\"*********************************************************
  5592. .SS Script Order of Execution
  5593. .\"*********************************************************
  5594. .TP
  5595. .B \-\-up
  5596. Executed after TCP/UDP socket bind and TUN/TAP open.
  5597. .\"*********************************************************
  5598. .TP
  5599. .B \-\-tls\-verify
  5600. Executed when we have a still untrusted remote peer.
  5601. .\"*********************************************************
  5602. .TP
  5603. .B \-\-ipchange
  5604. Executed after connection authentication, or remote IP address change.
  5605. .\"*********************************************************
  5606. .TP
  5607. .B \-\-client\-connect
  5608. Executed in
  5609. .B \-\-mode server
  5610. mode immediately after client authentication.
  5611. .\"*********************************************************
  5612. .TP
  5613. .B \-\-route\-up
  5614. Executed after connection authentication, either
  5615. immediately after, or some number of seconds after
  5616. as defined by the
  5617. .B \-\-route\-delay
  5618. option.
  5619. .\"*********************************************************
  5620. .TP
  5621. .B \-\-route\-pre\-down
  5622. Executed right before the routes are removed.
  5623. .\"*********************************************************
  5624. .TP
  5625. .B \-\-client\-disconnect
  5626. Executed in
  5627. .B \-\-mode server
  5628. mode on client instance shutdown.
  5629. .\"*********************************************************
  5630. .TP
  5631. .B \-\-down
  5632. Executed after TCP/UDP and TUN/TAP close.
  5633. .\"*********************************************************
  5634. .TP
  5635. .B \-\-learn\-address
  5636. Executed in
  5637. .B \-\-mode server
  5638. mode whenever an IPv4 address/route or MAC address is added to OpenVPN's
  5639. internal routing table.
  5640. .\"*********************************************************
  5641. .TP
  5642. .B \-\-auth\-user\-pass\-verify
  5643. Executed in
  5644. .B \-\-mode server
  5645. mode on new client connections, when the client is
  5646. still untrusted.
  5647. .\"*********************************************************
  5648. .SS String Types and Remapping
  5649. In certain cases, OpenVPN will perform remapping of characters
  5650. in strings. Essentially, any characters outside the set of
  5651. permitted characters for each string type will be converted
  5652. to underbar ('_').
  5653. .B Q:
  5654. Why is string remapping necessary?
  5655. .B A:
  5656. It's an important security feature to prevent the malicious coding of
  5657. strings from untrusted sources to be passed as parameters to scripts,
  5658. saved in the environment, used as a common name, translated to a filename,
  5659. etc.
  5660. .B Q:
  5661. Can string remapping be disabled?
  5662. .B A:
  5663. Yes, by using the
  5664. .B \-\-no\-name\-remapping
  5665. option, however this should be considered an advanced option.
  5666. Here is a brief rundown of OpenVPN's current string types and the
  5667. permitted character class for each string:
  5668. .B X509 Names:
  5669. Alphanumeric, underbar ('_'), dash ('\-'), dot ('.'), at
  5670. ('@'), colon (':'), slash ('/'), and equal ('='). Alphanumeric is defined
  5671. as a character which will cause the C library isalnum() function to return
  5672. true.
  5673. .B Common Names:
  5674. Alphanumeric, underbar ('_'), dash ('\-'), dot ('.'), and at
  5675. ('@').
  5676. .B \-\-auth\-user\-pass username:
  5677. Same as Common Name, with one exception: starting with OpenVPN 2.0.1,
  5678. the username is passed to the OPENVPN_PLUGIN_AUTH_USER_PASS_VERIFY plugin in its raw form,
  5679. without string remapping.
  5680. .B \-\-auth\-user\-pass password:
  5681. Any "printable" character except CR or LF.
  5682. Printable is defined to be a character which will cause the C library
  5683. isprint() function to return true.
  5684. .B \-\-client\-config\-dir filename as derived from common name or username:
  5685. Alphanumeric, underbar ('_'), dash ('\-'), and dot ('.') except for "." or
  5686. ".." as standalone strings. As of v2.0.1\-rc6, the at ('@') character has
  5687. been added as well for compatibility with the common name character class.
  5688. .B Environmental variable names:
  5689. Alphanumeric or underbar ('_').
  5690. .B Environmental variable values:
  5691. Any printable character.
  5692. For all cases, characters in a string which are not members of the legal
  5693. character class for that string type will be remapped to underbar ('_').
  5694. .\"*********************************************************
  5695. .SS Environmental Variables
  5696. Once set, a variable is persisted
  5697. indefinitely until it is reset by a new value or a restart,
  5698. As of OpenVPN 2.0\-beta12, in server mode, environmental
  5699. variables set by OpenVPN
  5700. are scoped according to the client objects
  5701. they are
  5702. associated with, so there should not be any issues with
  5703. scripts having access to stale, previously set variables
  5704. which refer to different client instances.
  5705. .\"*********************************************************
  5706. .TP
  5707. .B bytes_received
  5708. Total number of bytes received from client during VPN session.
  5709. Set prior to execution of the
  5710. .B \-\-client\-disconnect
  5711. script.
  5712. .\"*********************************************************
  5713. .TP
  5714. .B bytes_sent
  5715. Total number of bytes sent to client during VPN session.
  5716. Set prior to execution of the
  5717. .B \-\-client\-disconnect
  5718. script.
  5719. .\"*********************************************************
  5720. .TP
  5721. .B common_name
  5722. The X509 common name of an authenticated client.
  5723. Set prior to execution of
  5724. .B \-\-client\-connect, \-\-client\-disconnect,
  5725. and
  5726. .B \-\-auth\-user\-pass\-verify
  5727. scripts.
  5728. .\"*********************************************************
  5729. .TP
  5730. .B config
  5731. Name of first
  5732. .B \-\-config
  5733. file.
  5734. Set on program initiation and reset on SIGHUP.
  5735. .\"*********************************************************
  5736. .TP
  5737. .B daemon
  5738. Set to "1" if the
  5739. .B \-\-daemon
  5740. directive is specified, or "0" otherwise.
  5741. Set on program initiation and reset on SIGHUP.
  5742. .\"*********************************************************
  5743. .TP
  5744. .B daemon_log_redirect
  5745. Set to "1" if the
  5746. .B \-\-log
  5747. or
  5748. .B \-\-log\-append
  5749. directives are specified, or "0" otherwise.
  5750. Set on program initiation and reset on SIGHUP.
  5751. .\"*********************************************************
  5752. .TP
  5753. .B dev
  5754. The actual name of the TUN/TAP device, including
  5755. a unit number if it exists.
  5756. Set prior to
  5757. .B \-\-up
  5758. or
  5759. .B \-\-down
  5760. script execution.
  5761. .\"*********************************************************
  5762. .TP
  5763. .B dev_idx
  5764. On Windows, the device index of the TUN/TAP adapter (to
  5765. be used in netsh.exe calls which sometimes just do not work
  5766. right with interface names).
  5767. Set prior to
  5768. .B \-\-up
  5769. or
  5770. .B \-\-down
  5771. script execution.
  5772. .\"*********************************************************
  5773. .TP
  5774. .B foreign_option_{n}
  5775. An option pushed via
  5776. .B \-\-push
  5777. to a client which does not natively support it,
  5778. such as
  5779. .B \-\-dhcp\-option
  5780. on a non\-Windows system, will be recorded to this
  5781. environmental variable sequence prior to
  5782. .B \-\-up
  5783. script execution.
  5784. .\"*********************************************************
  5785. .TP
  5786. .B ifconfig_broadcast
  5787. The broadcast address for the virtual
  5788. ethernet segment which is derived from the
  5789. .B \-\-ifconfig
  5790. option when
  5791. .B \-\-dev tap
  5792. is used.
  5793. Set prior to OpenVPN calling the
  5794. .I ifconfig
  5795. or
  5796. .I netsh
  5797. (windows version of ifconfig) commands which
  5798. normally occurs prior to
  5799. .B \-\-up
  5800. script execution.
  5801. .\"*********************************************************
  5802. .TP
  5803. .B ifconfig_ipv6_local
  5804. The local VPN endpoint IPv6 address specified in the
  5805. .B \-\-ifconfig\-ipv6
  5806. option (first parameter).
  5807. Set prior to OpenVPN calling the
  5808. .I ifconfig
  5809. or
  5810. .I netsh
  5811. (windows version of ifconfig) commands which
  5812. normally occurs prior to
  5813. .B \-\-up
  5814. script execution.
  5815. .\"*********************************************************
  5816. .TP
  5817. .B ifconfig_ipv6_netbits
  5818. The prefix length of the IPv6 network on the VPN interface. Derived from
  5819. the /nnn parameter of the IPv6 address in the
  5820. .B \-\-ifconfig\-ipv6
  5821. option (first parameter).
  5822. Set prior to OpenVPN calling the
  5823. .I ifconfig
  5824. or
  5825. .I netsh
  5826. (windows version of ifconfig) commands which
  5827. normally occurs prior to
  5828. .B \-\-up
  5829. script execution.
  5830. .\"*********************************************************
  5831. .TP
  5832. .B ifconfig_ipv6_remote
  5833. The remote VPN endpoint IPv6 address specified in the
  5834. .B \-\-ifconfig\-ipv6
  5835. option (second parameter).
  5836. Set prior to OpenVPN calling the
  5837. .I ifconfig
  5838. or
  5839. .I netsh
  5840. (windows version of ifconfig) commands which
  5841. normally occurs prior to
  5842. .B \-\-up
  5843. script execution.
  5844. .\"*********************************************************
  5845. .TP
  5846. .B ifconfig_local
  5847. The local VPN endpoint IP address specified in the
  5848. .B \-\-ifconfig
  5849. option (first parameter).
  5850. Set prior to OpenVPN calling the
  5851. .I ifconfig
  5852. or
  5853. .I netsh
  5854. (windows version of ifconfig) commands which
  5855. normally occurs prior to
  5856. .B \-\-up
  5857. script execution.
  5858. .\"*********************************************************
  5859. .TP
  5860. .B ifconfig_remote
  5861. The remote VPN endpoint IP address specified in the
  5862. .B \-\-ifconfig
  5863. option (second parameter) when
  5864. .B \-\-dev tun
  5865. is used.
  5866. Set prior to OpenVPN calling the
  5867. .I ifconfig
  5868. or
  5869. .I netsh
  5870. (windows version of ifconfig) commands which
  5871. normally occurs prior to
  5872. .B \-\-up
  5873. script execution.
  5874. .\"*********************************************************
  5875. .TP
  5876. .B ifconfig_netmask
  5877. The subnet mask of the virtual ethernet segment
  5878. that is specified as the second parameter to
  5879. .B \-\-ifconfig
  5880. when
  5881. .B \-\-dev tap
  5882. is being used.
  5883. Set prior to OpenVPN calling the
  5884. .I ifconfig
  5885. or
  5886. .I netsh
  5887. (windows version of ifconfig) commands which
  5888. normally occurs prior to
  5889. .B \-\-up
  5890. script execution.
  5891. .\"*********************************************************
  5892. .TP
  5893. .B ifconfig_pool_local_ip
  5894. The local
  5895. virtual IP address for the TUN/TAP tunnel taken from an
  5896. .B \-\-ifconfig\-push
  5897. directive if specified, or otherwise from
  5898. the ifconfig pool (controlled by the
  5899. .B \-\-ifconfig\-pool
  5900. config file directive).
  5901. Only set for
  5902. .B \-\-dev tun
  5903. tunnels.
  5904. This option is set on the server prior to execution
  5905. of the
  5906. .B \-\-client\-connect
  5907. and
  5908. .B \-\-client\-disconnect
  5909. scripts.
  5910. .\"*********************************************************
  5911. .TP
  5912. .B ifconfig_pool_netmask
  5913. The
  5914. virtual IP netmask for the TUN/TAP tunnel taken from an
  5915. .B \-\-ifconfig\-push
  5916. directive if specified, or otherwise from
  5917. the ifconfig pool (controlled by the
  5918. .B \-\-ifconfig\-pool
  5919. config file directive).
  5920. Only set for
  5921. .B \-\-dev tap
  5922. tunnels.
  5923. This option is set on the server prior to execution
  5924. of the
  5925. .B \-\-client\-connect
  5926. and
  5927. .B \-\-client\-disconnect
  5928. scripts.
  5929. .\"*********************************************************
  5930. .TP
  5931. .B ifconfig_pool_remote_ip
  5932. The remote
  5933. virtual IP address for the TUN/TAP tunnel taken from an
  5934. .B \-\-ifconfig\-push
  5935. directive if specified, or otherwise from
  5936. the ifconfig pool (controlled by the
  5937. .B \-\-ifconfig\-pool
  5938. config file directive).
  5939. This option is set on the server prior to execution
  5940. of the
  5941. .B \-\-client\-connect
  5942. and
  5943. .B \-\-client\-disconnect
  5944. scripts.
  5945. .\"*********************************************************
  5946. .TP
  5947. .B link_mtu
  5948. The maximum packet size (not including the IP header)
  5949. of tunnel data in UDP tunnel transport mode.
  5950. Set prior to
  5951. .B \-\-up
  5952. or
  5953. .B \-\-down
  5954. script execution.
  5955. .\"*********************************************************
  5956. .TP
  5957. .B local
  5958. The
  5959. .B \-\-local
  5960. parameter.
  5961. Set on program initiation and reset on SIGHUP.
  5962. .\"*********************************************************
  5963. .TP
  5964. .B local_port
  5965. The local port number or name, specified by
  5966. .B \-\-port
  5967. or
  5968. .B \-\-lport.
  5969. Set on program initiation and reset on SIGHUP.
  5970. .\"*********************************************************
  5971. .TP
  5972. .B password
  5973. The password provided by a connecting client.
  5974. Set prior to
  5975. .B \-\-auth\-user\-pass\-verify
  5976. script execution only when the
  5977. .B via\-env
  5978. modifier is specified, and deleted from the environment
  5979. after the script returns.
  5980. .\"*********************************************************
  5981. .TP
  5982. .B proto
  5983. The
  5984. .B \-\-proto
  5985. parameter.
  5986. Set on program initiation and reset on SIGHUP.
  5987. .\"*********************************************************
  5988. .TP
  5989. .B remote_{n}
  5990. The
  5991. .B \-\-remote
  5992. parameter.
  5993. Set on program initiation and reset on SIGHUP.
  5994. .\"*********************************************************
  5995. .TP
  5996. .B remote_port_{n}
  5997. The remote port number, specified by
  5998. .B \-\-port
  5999. or
  6000. .B \-\-rport.
  6001. Set on program initiation and reset on SIGHUP.
  6002. .\"*********************************************************
  6003. .TP
  6004. .B route_net_gateway
  6005. The pre\-existing default IP gateway in the system routing
  6006. table.
  6007. Set prior to
  6008. .B \-\-up
  6009. script execution.
  6010. .\"*********************************************************
  6011. .TP
  6012. .B route_vpn_gateway
  6013. The default gateway used by
  6014. .B \-\-route
  6015. options, as specified in either the
  6016. .B \-\-route\-gateway
  6017. option or the second parameter to
  6018. .B \-\-ifconfig
  6019. when
  6020. .B \-\-dev tun
  6021. is specified.
  6022. Set prior to
  6023. .B \-\-up
  6024. script execution.
  6025. .\"*********************************************************
  6026. .TP
  6027. .B route_{parm}_{n}
  6028. A set of variables which define each route to be added, and
  6029. are set prior to
  6030. .B \-\-up
  6031. script execution.
  6032. .B parm
  6033. will be one of "network", "netmask", "gateway", or "metric".
  6034. .B n
  6035. is the OpenVPN route number, starting from 1.
  6036. If the network or gateway are resolvable DNS names,
  6037. their IP address translations will be recorded rather
  6038. than their names as denoted on the command line
  6039. or configuration file.
  6040. .\"*********************************************************
  6041. .TP
  6042. .B route_ipv6_{parm}_{n}
  6043. A set of variables which define each IPv6 route to be added, and
  6044. are set prior to
  6045. .B \-\-up
  6046. script execution.
  6047. .B parm
  6048. will be one of "network" or "gateway" ("netmask" is contained as "/nnn"
  6049. in the route_ipv6_network_{n}, unlike IPv4 where it is passed in a separate
  6050. environment variable).
  6051. .B n
  6052. is the OpenVPN route number, starting from 1.
  6053. If the network or gateway are resolvable DNS names,
  6054. their IP address translations will be recorded rather
  6055. than their names as denoted on the command line
  6056. or configuration file.
  6057. .\"*********************************************************
  6058. .TP
  6059. .B peer_cert
  6060. Temporary file name containing the client certificate upon
  6061. connection. Useful in conjunction with \-\-tls\-verify
  6062. .\"*********************************************************
  6063. .TP
  6064. .B script_context
  6065. Set to "init" or "restart" prior to up/down script execution.
  6066. For more information, see
  6067. documentation for
  6068. .B \-\-up.
  6069. .\"*********************************************************
  6070. .TP
  6071. .B script_type
  6072. Prior to execution of any script, this variable is set to the type of
  6073. script being run. It can be one of the following:
  6074. .B up, down, ipchange, route\-up, tls\-verify, auth\-user\-pass\-verify,
  6075. .B client\-connect, client\-disconnect,
  6076. or
  6077. .B learn\-address.
  6078. Set prior to execution of any script.
  6079. .\"*********************************************************
  6080. .TP
  6081. .B signal
  6082. The reason for exit or restart. Can be one of
  6083. .B sigusr1, sighup, sigterm, sigint, inactive
  6084. (controlled by
  6085. .B \-\-inactive
  6086. option),
  6087. .B ping\-exit
  6088. (controlled by
  6089. .B \-\-ping\-exit
  6090. option),
  6091. .B ping\-restart
  6092. (controlled by
  6093. .B \-\-ping\-restart
  6094. option),
  6095. .B connection\-reset
  6096. (triggered on TCP connection reset),
  6097. .B error,
  6098. or
  6099. .B unknown
  6100. (unknown signal). This variable is set just prior to down script execution.
  6101. .\"*********************************************************
  6102. .TP
  6103. .B time_ascii
  6104. Client connection timestamp, formatted as a human\-readable
  6105. time string.
  6106. Set prior to execution of the
  6107. .B \-\-client\-connect
  6108. script.
  6109. .\"*********************************************************
  6110. .TP
  6111. .B time_duration
  6112. The duration (in seconds) of the client session which is now
  6113. disconnecting.
  6114. Set prior to execution of the
  6115. .B \-\-client\-disconnect
  6116. script.
  6117. .\"*********************************************************
  6118. .TP
  6119. .B time_unix
  6120. Client connection timestamp, formatted as a unix integer
  6121. date/time value.
  6122. Set prior to execution of the
  6123. .B \-\-client\-connect
  6124. script.
  6125. .\"*********************************************************
  6126. .TP
  6127. .B tls_digest_{n} / tls_digest_sha256_{n}
  6128. Contains the certificate SHA1 / SHA256 fingerprint, where
  6129. .B n
  6130. is the verification level. Only set for TLS connections. Set prior
  6131. to execution of
  6132. .B \-\-tls\-verify
  6133. script.
  6134. .\"*********************************************************
  6135. .TP
  6136. .B tls_id_{n}
  6137. A series of certificate fields from the remote peer,
  6138. where
  6139. .B n
  6140. is the verification level. Only set for TLS connections. Set prior
  6141. to execution of
  6142. .B \-\-tls\-verify
  6143. script.
  6144. .\"*********************************************************
  6145. .TP
  6146. .B tls_serial_{n}
  6147. The serial number of the certificate from the remote peer,
  6148. where
  6149. .B n
  6150. is the verification level. Only set for TLS connections. Set prior
  6151. to execution of
  6152. .B \-\-tls\-verify
  6153. script. This is in the form of a decimal string like "933971680", which is
  6154. suitable for doing serial\-based OCSP queries (with OpenSSL, do not
  6155. prepend "0x" to the string) If something goes wrong while reading
  6156. the value from the certificate it will be an empty string, so your
  6157. code should check that.
  6158. See the contrib/OCSP_check/OCSP_check.sh script for an example.
  6159. .\"*********************************************************
  6160. .TP
  6161. .B tls_serial_hex_{n}
  6162. Like
  6163. .B tls_serial_{n}\fR,
  6164. but in hex form (e.g. "12:34:56:78:9A").
  6165. .\"*********************************************************
  6166. .TP
  6167. .B tun_mtu
  6168. The MTU of the TUN/TAP device.
  6169. Set prior to
  6170. .B \-\-up
  6171. or
  6172. .B \-\-down
  6173. script execution.
  6174. .\"*********************************************************
  6175. .TP
  6176. .B trusted_ip (or trusted_ip6)
  6177. Actual IP address of connecting client or peer which has been authenticated.
  6178. Set prior to execution of
  6179. .B \-\-ipchange, \-\-client\-connect,
  6180. and
  6181. .B \-\-client\-disconnect
  6182. scripts.
  6183. If using ipv6 endpoints (udp6, tcp6),
  6184. .B trusted_ip6
  6185. will be set instead.
  6186. .\"*********************************************************
  6187. .TP
  6188. .B trusted_port
  6189. Actual port number of connecting client or peer which has been authenticated.
  6190. Set prior to execution of
  6191. .B \-\-ipchange, \-\-client\-connect,
  6192. and
  6193. .B \-\-client\-disconnect
  6194. scripts.
  6195. .\"*********************************************************
  6196. .TP
  6197. .B untrusted_ip (or untrusted_ip6)
  6198. Actual IP address of connecting client or peer which has not been authenticated
  6199. yet. Sometimes used to
  6200. .B nmap
  6201. the connecting host in a
  6202. .B \-\-tls\-verify
  6203. script to ensure it is firewalled properly.
  6204. Set prior to execution of
  6205. .B \-\-tls\-verify
  6206. and
  6207. .B \-\-auth\-user\-pass\-verify
  6208. scripts.
  6209. If using ipv6 endpoints (udp6, tcp6),
  6210. .B untrusted_ip6
  6211. will be set instead.
  6212. .\"*********************************************************
  6213. .TP
  6214. .B untrusted_port
  6215. Actual port number of connecting client or peer which has not been authenticated
  6216. yet.
  6217. Set prior to execution of
  6218. .B \-\-tls\-verify
  6219. and
  6220. .B \-\-auth\-user\-pass\-verify
  6221. scripts.
  6222. .\"*********************************************************
  6223. .TP
  6224. .B username
  6225. The username provided by a connecting client.
  6226. Set prior to
  6227. .B \-\-auth\-user\-pass\-verify
  6228. script execution only when the
  6229. .B via\-env
  6230. modifier is specified.
  6231. .\"*********************************************************
  6232. .TP
  6233. .B X509_{n}_{subject_field}
  6234. An X509 subject field from the remote peer certificate,
  6235. where
  6236. .B n
  6237. is the verification level. Only set for TLS connections. Set prior
  6238. to execution of
  6239. .B \-\-tls\-verify
  6240. script. This variable is similar to
  6241. .B tls_id_{n}
  6242. except the component X509 subject fields are broken out, and
  6243. no string remapping occurs on these field values (except for remapping
  6244. of control characters to "_").
  6245. For example, the following variables would be set on the
  6246. OpenVPN server using the sample client certificate
  6247. in sample\-keys (client.crt).
  6248. Note that the verification level is 0 for the client certificate
  6249. and 1 for the CA certificate.
  6250. .nf
  6251. .ft 3
  6252. .in +4
  6253. X509_0_emailAddress=me@myhost.mydomain
  6254. X509_0_CN=Test\-Client
  6255. X509_0_O=OpenVPN\-TEST
  6256. X509_0_ST=NA
  6257. X509_0_C=KG
  6258. X509_1_emailAddress=me@myhost.mydomain
  6259. X509_1_O=OpenVPN\-TEST
  6260. X509_1_L=BISHKEK
  6261. X509_1_ST=NA
  6262. X509_1_C=KG
  6263. .in -4
  6264. .ft
  6265. .fi
  6266. .\"*********************************************************
  6267. .SH INLINE FILE SUPPORT
  6268. OpenVPN allows including files in the main configuration for the
  6269. .B \-\-ca, \-\-cert, \-\-dh, \-\-extra\-certs, \-\-key, \-\-pkcs12, \-\-secret,
  6270. .B \-\-crl\-verify, \-\-http\-proxy\-user\-pass, \-\-tls\-auth
  6271. and
  6272. .B \-\-tls\-crypt
  6273. options.
  6274. Each inline file started by the line
  6275. .B <option>
  6276. and ended by the line
  6277. .B </option>
  6278. Here is an example of an inline file usage
  6279. .nf
  6280. .ft 3
  6281. .in +4
  6282. <cert>
  6283. \-\-\-\-\-BEGIN CERTIFICATE\-\-\-\-\-
  6284. [...]
  6285. \-\-\-\-\-END CERTIFICATE\-\-\-\-\-
  6286. </cert>
  6287. .in -4
  6288. .ft
  6289. .fi
  6290. When using the inline file feature with
  6291. .B \-\-pkcs12
  6292. the inline file has to be base64 encoded. Encoding of a .p12 file into base64 can be done for example with OpenSSL by running
  6293. .B openssl base64 \-in input.p12
  6294. .SH SIGNALS
  6295. .TP
  6296. .B SIGHUP
  6297. Cause OpenVPN to close all TUN/TAP and
  6298. network connections,
  6299. restart, re\-read the configuration file (if any),
  6300. and reopen TUN/TAP and network connections.
  6301. .\"*********************************************************
  6302. .TP
  6303. .B SIGUSR1
  6304. Like
  6305. .B SIGHUP,
  6306. except don't re\-read configuration file, and possibly don't close and reopen TUN/TAP
  6307. device, re\-read key files, preserve local IP address/port, or preserve most recently authenticated
  6308. remote IP address/port based on
  6309. .B \-\-persist\-tun, \-\-persist\-key, \-\-persist\-local\-ip,
  6310. and
  6311. .B \-\-persist\-remote\-ip
  6312. options respectively (see above).
  6313. This signal may also be internally generated by a timeout condition, governed
  6314. by the
  6315. .B \-\-ping\-restart
  6316. option.
  6317. This signal, when combined with
  6318. .B \-\-persist\-remote\-ip,
  6319. may be
  6320. sent when the underlying parameters of the host's network interface change
  6321. such as when the host is a DHCP client and is assigned a new IP address.
  6322. See
  6323. .B \-\-ipchange
  6324. above for more information.
  6325. .\"*********************************************************
  6326. .TP
  6327. .B SIGUSR2
  6328. Causes OpenVPN to display its current statistics (to the syslog
  6329. file if
  6330. .B \-\-daemon
  6331. is used, or stdout otherwise).
  6332. .\"*********************************************************
  6333. .TP
  6334. .B SIGINT, SIGTERM
  6335. Causes OpenVPN to exit gracefully.
  6336. .\"*********************************************************
  6337. .SH TUN/TAP DRIVER SETUP
  6338. If you are running Linux 2.4.7 or higher, you probably have the TUN/TAP driver
  6339. already installed. If so, there are still a few things you need to do:
  6340. Make device:
  6341. .B mknod /dev/net/tun c 10 200
  6342. Load driver:
  6343. .B modprobe tun
  6344. .\"*********************************************************
  6345. .SH EXAMPLES
  6346. Prior to running these examples, you should have OpenVPN installed on two
  6347. machines with network connectivity between them. If you have not
  6348. yet installed OpenVPN, consult the INSTALL file included in the OpenVPN
  6349. distribution.
  6350. .\"*********************************************************
  6351. .SS TUN/TAP Setup:
  6352. If you are using Linux 2.4 or higher,
  6353. make the tun device node and load the tun module:
  6354. .IP
  6355. .B mknod /dev/net/tun c 10 200
  6356. .LP
  6357. .IP
  6358. .B modprobe tun
  6359. .LP
  6360. If you installed from RPM, the
  6361. .B mknod
  6362. step may be omitted, because the RPM install does that for you.
  6363. Only Linux 2.4 and newer are supported.
  6364. For other platforms, consult the INSTALL file at
  6365. .I http://openvpn.net/install.html
  6366. for more information.
  6367. .\"*********************************************************
  6368. .SS Firewall Setup:
  6369. If firewalls exist between
  6370. the two machines, they should be set to forward UDP port 1194
  6371. in both directions. If you do not have control over the firewalls
  6372. between the two machines, you may still be able to use OpenVPN by adding
  6373. .B \-\-ping 15
  6374. to each of the
  6375. .B openvpn
  6376. commands used below in the examples (this will cause each peer to send out
  6377. a UDP ping to its remote peer once every 15 seconds which will cause many
  6378. stateful firewalls to forward packets in both directions
  6379. without an explicit firewall rule).
  6380. If you are using a Linux iptables\-based firewall, you may need to enter
  6381. the following command to allow incoming packets on the TUN device:
  6382. .IP
  6383. .B iptables \-A INPUT \-i tun+ \-j ACCEPT
  6384. .LP
  6385. See the firewalls section below for more information on configuring firewalls
  6386. for use with OpenVPN.
  6387. .\"*********************************************************
  6388. .SS VPN Address Setup:
  6389. For purposes
  6390. of our example, our two machines will be called
  6391. .B bob.example.com
  6392. and
  6393. .B alice.example.com.
  6394. If you are constructing a VPN over the internet, then replace
  6395. .B bob.example.com
  6396. and
  6397. .B alice.example.com
  6398. with the internet hostname or IP address that each machine will use
  6399. to contact the other over the internet.
  6400. Now we will choose the tunnel endpoints. Tunnel endpoints are
  6401. private IP addresses that only have meaning in the context of
  6402. the VPN. Each machine will use the tunnel endpoint of the other
  6403. machine to access it over the VPN. In our example,
  6404. the tunnel endpoint for bob.example.com
  6405. will be 10.4.0.1 and for alice.example.com, 10.4.0.2.
  6406. Once the VPN is established, you have essentially
  6407. created a secure alternate path between the two hosts
  6408. which is addressed by using the tunnel endpoints. You can
  6409. control which network
  6410. traffic passes between the hosts
  6411. (a) over the VPN or (b) independently of the VPN, by choosing whether to use
  6412. (a) the VPN endpoint address or (b) the public internet address,
  6413. to access the remote host. For example if you are on bob.example.com and you wish to connect to alice.example.com
  6414. via
  6415. .B ssh
  6416. without using the VPN (since
  6417. .B ssh
  6418. has its own built\-in security) you would use the command
  6419. .B ssh alice.example.com.
  6420. However in the same scenario, you could also use the command
  6421. .B telnet 10.4.0.2
  6422. to create a telnet session with alice.example.com over the VPN, that would
  6423. use the VPN to secure the session rather than
  6424. .B ssh.
  6425. You can use any address you wish for the
  6426. tunnel endpoints
  6427. but make sure that they are private addresses
  6428. (such as those that begin with 10 or 192.168) and that they are
  6429. not part of any existing subnet on the networks of
  6430. either peer, unless you are bridging. If you use an address that is part of
  6431. your local subnet for either of the tunnel endpoints,
  6432. you will get a weird feedback loop.
  6433. .\"*********************************************************
  6434. .SS Example 1: A simple tunnel without security
  6435. .LP
  6436. On bob:
  6437. .IP
  6438. .B openvpn \-\-remote alice.example.com \-\-dev tun1 \-\-ifconfig 10.4.0.1 10.4.0.2 \-\-verb 9
  6439. .LP
  6440. On alice:
  6441. .IP
  6442. .B openvpn \-\-remote bob.example.com \-\-dev tun1 \-\-ifconfig 10.4.0.2 10.4.0.1 \-\-verb 9
  6443. .LP
  6444. Now verify the tunnel is working by pinging across the tunnel.
  6445. .LP
  6446. On bob:
  6447. .IP
  6448. .B ping 10.4.0.2
  6449. .LP
  6450. On alice:
  6451. .IP
  6452. .B ping 10.4.0.1
  6453. .LP
  6454. The
  6455. .B \-\-verb 9
  6456. option will produce verbose output, similar to the
  6457. .BR tcpdump (8)
  6458. program. Omit the
  6459. .B \-\-verb 9
  6460. option to have OpenVPN run quietly.
  6461. .\"*********************************************************
  6462. .SS Example 2: A tunnel with static\-key security (i.e. using a pre\-shared secret)
  6463. First build a static key on bob.
  6464. .IP
  6465. .B openvpn \-\-genkey \-\-secret key
  6466. .LP
  6467. This command will build a random key file called
  6468. .B key
  6469. (in ascii format).
  6470. Now copy
  6471. .B key
  6472. to alice over a secure medium such as by
  6473. using the
  6474. .BR scp (1)
  6475. program.
  6476. .LP
  6477. On bob:
  6478. .IP
  6479. .B openvpn \-\-remote alice.example.com \-\-dev tun1 \-\-ifconfig 10.4.0.1 10.4.0.2 \-\-verb 5 \-\-secret key
  6480. .LP
  6481. On alice:
  6482. .IP
  6483. .B openvpn \-\-remote bob.example.com \-\-dev tun1 \-\-ifconfig 10.4.0.2 10.4.0.1 \-\-verb 5 \-\-secret key
  6484. .LP
  6485. Now verify the tunnel is working by pinging across the tunnel.
  6486. .LP
  6487. On bob:
  6488. .IP
  6489. .B ping 10.4.0.2
  6490. .LP
  6491. On alice:
  6492. .IP
  6493. .B ping 10.4.0.1
  6494. .\"*********************************************************
  6495. .SS Example 3: A tunnel with full TLS\-based security
  6496. For this test, we will designate
  6497. .B bob
  6498. as the TLS client and
  6499. .B alice
  6500. as the TLS server.
  6501. .I Note that client or server designation only has meaning for the TLS subsystem. It has no bearing on OpenVPN's peer\-to\-peer, UDP\-based communication model.
  6502. First, build a separate certificate/key pair
  6503. for both bob and alice (see above where
  6504. .B \-\-cert
  6505. is discussed for more info). Then construct
  6506. Diffie Hellman parameters (see above where
  6507. .B \-\-dh
  6508. is discussed for more info). You can also use the
  6509. included test files client.crt, client.key,
  6510. server.crt, server.key and ca.crt.
  6511. The .crt files are certificates/public\-keys, the .key
  6512. files are private keys, and ca.crt is a certification
  6513. authority who has signed both
  6514. client.crt and server.crt. For Diffie Hellman
  6515. parameters you can use the included file dh1024.pem.
  6516. .I Note that all client, server, and certificate authority certificates and keys included in the OpenVPN distribution are totally insecure and should be used for testing only.
  6517. .LP
  6518. On bob:
  6519. .IP
  6520. .B openvpn \-\-remote alice.example.com \-\-dev tun1 \-\-ifconfig 10.4.0.1 10.4.0.2 \-\-tls\-client \-\-ca ca.crt \-\-cert client.crt \-\-key client.key \-\-reneg\-sec 60 \-\-verb 5
  6521. .LP
  6522. On alice:
  6523. .IP
  6524. .B openvpn \-\-remote bob.example.com \-\-dev tun1 \-\-ifconfig 10.4.0.2 10.4.0.1 \-\-tls\-server \-\-dh dh1024.pem \-\-ca ca.crt \-\-cert server.crt \-\-key server.key \-\-reneg\-sec 60 \-\-verb 5
  6525. .LP
  6526. Now verify the tunnel is working by pinging across the tunnel.
  6527. .LP
  6528. On bob:
  6529. .IP
  6530. .B ping 10.4.0.2
  6531. .LP
  6532. On alice:
  6533. .IP
  6534. .B ping 10.4.0.1
  6535. .LP
  6536. Notice the
  6537. .B \-\-reneg\-sec 60
  6538. option we used above. That tells OpenVPN to renegotiate
  6539. the data channel keys every minute.
  6540. Since we used
  6541. .B \-\-verb 5
  6542. above, you will see status information on each new key negotiation.
  6543. For production operations, a key renegotiation interval of 60 seconds
  6544. is probably too frequent. Omit the
  6545. .B \-\-reneg\-sec 60
  6546. option to use OpenVPN's default key renegotiation interval of one hour.
  6547. .\"*********************************************************
  6548. .SS Routing:
  6549. Assuming you can ping across the tunnel,
  6550. the next step is to route a real subnet over
  6551. the secure tunnel. Suppose that bob and alice have two network
  6552. interfaces each, one connected
  6553. to the internet, and the other to a private
  6554. network. Our goal is to securely connect
  6555. both private networks. We will assume that bob's private subnet
  6556. is 10.0.0.0/24 and alice's is 10.0.1.0/24.
  6557. .LP
  6558. First, ensure that IP forwarding is enabled on both peers.
  6559. On Linux, enable routing:
  6560. .IP
  6561. .B echo 1 > /proc/sys/net/ipv4/ip_forward
  6562. .LP
  6563. and enable TUN packet forwarding through the firewall:
  6564. .IP
  6565. .B iptables \-A FORWARD \-i tun+ \-j ACCEPT
  6566. .LP
  6567. On bob:
  6568. .IP
  6569. .B route add \-net 10.0.1.0 netmask 255.255.255.0 gw 10.4.0.2
  6570. .LP
  6571. On alice:
  6572. .IP
  6573. .B route add \-net 10.0.0.0 netmask 255.255.255.0 gw 10.4.0.1
  6574. .LP
  6575. Now any machine on the 10.0.0.0/24 subnet can
  6576. access any machine on the 10.0.1.0/24 subnet
  6577. over the secure tunnel (or vice versa).
  6578. In a production environment, you could put the route command(s)
  6579. in a script and execute with the
  6580. .B \-\-up
  6581. option.
  6582. .\"*********************************************************
  6583. .SH FIREWALLS
  6584. OpenVPN's usage of a single UDP port makes it fairly firewall\-friendly.
  6585. You should add an entry to your firewall rules to allow incoming OpenVPN
  6586. packets. On Linux 2.4+:
  6587. .IP
  6588. .B iptables \-A INPUT \-p udp \-s 1.2.3.4 \-\-dport 1194 \-j ACCEPT
  6589. .LP
  6590. This will allow incoming packets on UDP port 1194 (OpenVPN's default UDP port)
  6591. from an OpenVPN peer at 1.2.3.4.
  6592. If you are using HMAC\-based packet authentication (the default in any of
  6593. OpenVPN's secure modes), having the firewall filter on source
  6594. address can be considered optional, since HMAC packet authentication
  6595. is a much more secure method of verifying the authenticity of
  6596. a packet source. In that case:
  6597. .IP
  6598. .B iptables \-A INPUT \-p udp \-\-dport 1194 \-j ACCEPT
  6599. .LP
  6600. would be adequate and would not render the host inflexible with
  6601. respect to its peer having a dynamic IP address.
  6602. OpenVPN also works well on stateful firewalls. In some cases, you may
  6603. not need to add any static rules to the firewall list if you are
  6604. using a stateful firewall that knows how to track UDP connections.
  6605. If you specify
  6606. .B \-\-ping n,
  6607. OpenVPN will be guaranteed
  6608. to send a packet to its peer at least once every
  6609. .B n
  6610. seconds. If
  6611. .B n
  6612. is less than the stateful firewall connection timeout, you can
  6613. maintain an OpenVPN connection indefinitely without explicit
  6614. firewall rules.
  6615. You should also add firewall rules to allow incoming IP traffic on
  6616. TUN or TAP devices such as:
  6617. .IP
  6618. .B iptables \-A INPUT \-i tun+ \-j ACCEPT
  6619. .LP
  6620. to allow input packets from tun devices,
  6621. .IP
  6622. .B iptables \-A FORWARD \-i tun+ \-j ACCEPT
  6623. .LP
  6624. to allow input packets from tun devices to be forwarded to
  6625. other hosts on the local network,
  6626. .IP
  6627. .B iptables \-A INPUT \-i tap+ \-j ACCEPT
  6628. .LP
  6629. to allow input packets from tap devices, and
  6630. .IP
  6631. .B iptables \-A FORWARD \-i tap+ \-j ACCEPT
  6632. .LP
  6633. to allow input packets from tap devices to be forwarded to
  6634. other hosts on the local network.
  6635. These rules are secure if you use packet authentication,
  6636. since no incoming packets will arrive on a TUN or TAP
  6637. virtual device
  6638. unless they first pass an HMAC authentication test.
  6639. .\"*********************************************************
  6640. .SH FAQ
  6641. .I http://openvpn.net/faq.html
  6642. .\"*********************************************************
  6643. .SH HOWTO
  6644. For a more comprehensive guide to setting up OpenVPN
  6645. in a production setting, see the OpenVPN HOWTO at
  6646. .I http://openvpn.net/howto.html
  6647. .\"*********************************************************
  6648. .SH PROTOCOL
  6649. For a description of OpenVPN's underlying protocol,
  6650. see
  6651. .I http://openvpn.net/security.html
  6652. .\"*********************************************************
  6653. .SH WEB
  6654. OpenVPN's web site is at
  6655. .I http://openvpn.net/
  6656. Go here to download the latest version of OpenVPN, subscribe
  6657. to the mailing lists, read the mailing list
  6658. archives, or browse the SVN repository.
  6659. .\"*********************************************************
  6660. .SH BUGS
  6661. Report all bugs to the OpenVPN team <info@openvpn.net>.
  6662. .\"*********************************************************
  6663. .SH "SEE ALSO"
  6664. .BR dhcpcd (8),
  6665. .BR ifconfig (8),
  6666. .BR openssl (1),
  6667. .BR route (8),
  6668. .BR scp (1)
  6669. .BR ssh (1)
  6670. .\"*********************************************************
  6671. .SH NOTES
  6672. .LP
  6673. This product includes software developed by the
  6674. OpenSSL Project (
  6675. .I http://www.openssl.org/
  6676. )
  6677. For more information on the TLS protocol, see
  6678. .I http://www.ietf.org/rfc/rfc2246.txt
  6679. For more information on the LZO real\-time compression library see
  6680. .I http://www.oberhumer.com/opensource/lzo/
  6681. .\"*********************************************************
  6682. .SH COPYRIGHT
  6683. Copyright (C) 2002\-2018 OpenVPN Inc This program is free software;
  6684. you can redistribute it and/or modify
  6685. it under the terms of the GNU General Public License version 2
  6686. as published by the Free Software Foundation.
  6687. .\"*********************************************************
  6688. .SH AUTHORS
  6689. James Yonan <jim@yonan.net>