ipsec.conf.5
来自「This a good VPN source」· 5 代码 · 共 1,422 行 · 第 1/3 页
5
1,422 行
.TH IPSEC.CONF 5 "26 Nov 2001".\" RCSID $Id: ipsec.conf.5,v 1.108 2004/11/01 22:40:05 ken Exp $.SH NAMEipsec.conf \- IPsec configuration and connections.SH DESCRIPTIONThe optional.I ipsec.conffilespecifies most configuration and control information for theOpenswan IPsec subsystem.(The major exception is secrets for authentication;see.IR ipsec.secrets (5).)Its contents are not security-sensitive.I unlessmanual keying is being done for more than just testing,in which case the encryption/authentication keys in thedescriptions for the manually-keyed connections are very sensitive(and those connection descriptionsare probably best kept in a separate file,via the include facility described below)..PPThe file is a text file, consisting of one or more.IR sections .White space followed by.B #followed by anything to the end of the lineis a comment and is ignored,as are empty lines which are not within a section..PPA line which contains.B includeand a file name, separated by white space,is replaced by the contents of that file,preceded and followed by empty lines.If the file name is not a full pathname,it is considered to be relative to the directory containing theincluding file.Such inclusions can be nested.Only a single filename may be supplied, and it may not contain white space,but it may include shell wildcards (see.IR sh (1));for example:.PP.B include.B "ipsec.*.conf".PPThe intention of the include facility is mostly to permit keepinginformation on connections, or sets of connections,separate from the main configuration file.This permits such connection descriptions to be changed,copied to the other security gateways involved, etc.,without having to constantly extract them from the configurationfile and then insert them back into it.Note also the.B alsoand.B alsoflipparameters (described below) which permit splitting a single logical section(e.g. a connection description) into several actual sections..PPThe first significant line of the file must specify the versionof this specification that it conforms to:.PP\fBversion 2\fP.PPA sectionbegins with a line of the form:.PP.I type.I name.PPwhere.I typeindicates what type of section follows, and.I nameis an arbitrary name which distinguishes the section from othersof the same type.(Names must start with a letter and may contain onlyletters, digits, periods, underscores, and hyphens.)All subsequent non-empty lineswhich begin with white space are part of the section;comments within a section must begin with white space too.There may be only one section of a given type with a given name..PPLines within the section are generally of the form.PP\ \ \ \ \ \fIparameter\fB=\fIvalue\fR.PP(note the mandatory preceding white space).There can be white space on either side of the.BR = .Parameter names follow the same syntax as section names,and are specific to a section type.Unless otherwise explicitly specified,no parameter name may appear more than once in a section..PPAn empty.I valuestands for the system default value (if any) of the parameter,i.e. it is roughly equivalent to omitting the parameter line entirely.A.I valuemay contain white space only if the entire.I valueis enclosed in double quotes (\fB"\fR);a.I valuecannot itself contain a double quote,nor may it be continued across more than one line..PPNumeric values are specified to be either an ``integer''(a sequence of digits) or a ``decimal number''(sequence of digits optionally followed by `.' and another sequence of digits)..PPThere is currently one parameter which is available in any type ofsection:.TP.B alsothe value is a section name;the parameters of that section are appended to this section,as if they had been written as part of it.The specified section must exist, must follow the current one,and must have the same section type.(Nesting is permitted,and there may be more than one.B alsoin a single section,although it is forbidden to append the same section more than once.)This allows, for example, keeping the encryption keysfor a connection in a separate filefrom the rest of the description, by using both an.B alsoparameter and an.B includeline.(Caution, see BUGS below for some restrictions.).TP.B alsoflipcan be used in a.B connsection.It acts like an.B alsothat flips the referenced section's entries left-for-right..PPParameter names beginning with.B x-(or.BR X- ,or.BR x_ ,or.BR X_ )are reserved for user extensions and will never be assigned meaningsby IPsec.Parameters with such names must still observe the syntax rules(limits on characters used in the name;no white space in a non-quoted value;no newlines or double quotes within the value).All other as-yet-unused parameter names are reserved for future IPsecimprovements..PPA section with name.B %defaultspecifies defaults for sections of the same type.For each parameter in it,any section of that type which does not have a parameter of the same namegets a copy of the one from the.B %defaultsection.There may be multiple.B %defaultsections of a given type,but only one default may be supplied for any specific parameter name,and all.B %defaultsections of a given type must precede all non-\c.B %defaultsections of that type..B %defaultsections may not contain.B alsoor.B alsoflipparameters..PPCurrently there are two types of section:a.B configsection specifies general configuration information for IPsec,while a.B connsection specifies an IPsec connection..SH "CONN SECTIONS"A.B connsection contains a.IR "connection specification" ,defining a network connection to be made using IPsec.The name given is arbitrary, and is used to identify the connection to.IR ipsec_auto (8)and.IR ipsec_manual (8).Here's a simple example:.PP.ne 10.nf.ft B.ta 1cconn snt left=10.11.11.1 leftsubnet=10.0.1.0/24 leftnexthop=172.16.55.66 right=192.168.22.1 rightsubnet=10.0.2.0/24 rightnexthop=172.16.88.99 keyingtries=%forever.ft.fi.PPA note on terminology...In automatic keying, there are two kinds of communications going on:transmission of user IP packets, and gateway-to-gateway negotiations forkeying, rekeying, and general control.The data path (a set of ``IPsec SAs'') used for user packets is hereinreferred to as the ``connection'';the path used for negotiations (built with ``ISAKMP SAs'') is referred to asthe ``keying channel''..PPTo avoid trivial editing of the configuration file to suit it to each systeminvolved in a connection,connection specifications are written in terms of.I leftand.I rightparticipants,rather than in terms of local and remote.Which participant is considered.I leftor.I rightis arbitrary;IPsec figures out which one it is being run on based on internal information.This permits using identical connection specifications on both ends.There are cases where there is no symmetry; a good convention is touse.I leftfor the local side and.I rightfor the remote side (the first letters are a good mnemonic)..PPMany of the parameters relate to one participant or the other;only the ones for.I leftare listed here, but every parameter whose name begins with.B lefthas a.B rightcounterpart,whose description is the same but with.B leftand.B rightreversed..PPParameters are optional unless marked ``(required)'';a parameter required for manual keying need not be included fora connection which will use only automatic keying, and vice versa..SS "CONN PARAMETERS: GENERAL"The following parameters are relevant to both automatic and manual keying.Unless otherwise noted,for a connection to work,in general it is necessary for the two ends to agree exactlyon the values of these parameters..TP 14.B typethe type of the connection; currently the accepted valuesare.B tunnel(the default)signifying a host-to-host, host-to-subnet, or subnet-to-subnet tunnel;.BR transport ,signifying host-to-host transport mode;.BR passthrough ,signifying that no IPsec processing should be done at all;.BR drop ,signifying that packets should be discarded; and.BR reject ,signifying that packets should be discarded and a diagnostic ICMP returned..TP.B left(required)the IP address of the left participant's public-network interface,in any form accepted by.IR ipsec_ttoaddr (3)or one of several magic values.If it is.BR %defaultroute ,andthe.B config.B setupsection's,.B interfacesspecification contains.BR %defaultroute,.B leftwill be filled in automatically with the local addressof the default-route interface (as determined at IPsec startup time);this also overrides any value supplied for.BR leftnexthop .(Either.B leftor.B rightmay be.BR %defaultroute ,but not both.)The value.B %anysignifies an address to be filled in (by automatic keying) duringnegotiation.The value.B %opportunisticsignifies that both.B leftand.B leftnexthopare to be filled in (by automatic keying) from DNS data for.BR left 'sclient.The values.B %groupand.B %opportunisticgroupmakes this a policy group conn: one that will be instantiatedinto a regular or opportunistic conn for each CIDR block listed in thepolicy group file with the same name as the conn..TP.B leftsubnetprivate subnet behind the left participant, expressed as\fInetwork\fB/\fInetmask\fR(actually, any form acceptable to.IR ipsec_ttosubnet (3));if omitted, essentially assumed to be \fIleft\fB/32\fR,signifying that the left end of the connection goes to the left participant only.TP.B leftnexthopnext-hop gateway IP address for the left participant's connectionto the public network;defaults to.B %direct(meaning.IR right ).If the value is to be overridden by the.B left=%defaultroutemethod (see above),an explicit value must.I notbe given.If that method is not being used,but.B leftnexthopis.BR %defaultroute ,and.B interfaces=%defaultrouteis used in the.B config.B setupsection,the next-hop gateway address of the default-route interfacewill be used.The magic value.B %directsignifies a value to be filled in (by automatic keying)with the peer's address.Relevant only locally, other end need not agree on it..TP.B leftupdownwhat ``updown'' script to run to adjust routing and/or firewallingwhen the status of the connectionchanges (default.BR "ipsec _updown" ).May include positional parameters separated by white space(although this requires enclosing the whole string in quotes);including shell metacharacters is unwise.See.IR ipsec_pluto (8)for details.Relevant only locally, other end need not agree on it..TP.PPIf one or both security gateways are doing forwarding firewalling(possibly including masquerading),and this is specified using the firewall parameters,tunnels established with IPsec are exempted from itso that packets can flow unchanged through the tunnels.(This means that all subnets connected in this manner must havedistinct, non-overlapping subnet address blocks.)This is done by the default.I updownscript (see.IR ipsec_pluto (8))..PP.SS "CONN PARAMETERS: AUTOMATIC KEYING"The following parameters are relevant only to automatic keying,and are ignored in manual keying.Unless otherwise noted,for a connection to work,in general it is necessary for the two ends to agree exactlyon the values of these parameters..TP 14.B keyexchangemethod of key exchange;the default and currently the only accepted value is.B ike.TP.B autowhat operation, if any, should be done automatically at IPsec startup;currently-accepted values are.B add(signifying an.B ipsec auto.BR \-\-add ),.B route(signifying that plus an.B ipsec auto.BR \-\-route ),.B start(signifying that plus an.B ipsec auto.BR \-\-up ),.B manual(signifying an.B ipsec.B manual.BR \-\-up ),and.B ignore(also the default) (signifying no automatic startup operation).See the.B config.B setupdiscussion below.Relevant only locally, other end need not agree on it(but in general, for an intended-to-be-permanent connection,both ends should use.B auto=startto ensure that any reboot causes immediate renegotiation)..TP.B authwhether authentication should be done as part ofESP encryption, or separately using the AH protocol;acceptable values are.B esp(the default) and.BR ah ..TP.B authbyhow the two security gateways should authenticate each other;acceptable values are.B secretfor shared secrets,.B rsasigfor RSA digital signatures (the default),.B secret|rsasigfor either, and.B neverif negotiation is never to be attempted or accepted (useful for shunt-only conns).Digital signatures are superior in every way to shared secrets..TP.B leftid
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?