]> git.ipfire.org Git - people/ms/strongswan.git/blame - src/starter/ipsec.conf.5
implemented reauthentication using the new reauth=yes|no parameter
[people/ms/strongswan.git] / src / starter / ipsec.conf.5
CommitLineData
fea5e716
MW
1.TH IPSEC.CONF 5 "20 Jan 2006"
2.\" RCSID $Id: ipsec.conf.5,v 1.2 2006/01/22 15:33:46 as Exp $
3.SH NAME
4ipsec.conf \- IPsec configuration and connections
5.SH DESCRIPTION
6The optional
7.I ipsec.conf
8file
9specifies most configuration and control information for the
10strongSwan IPsec subsystem.
11(The major exception is secrets for authentication;
12see
13.IR ipsec.secrets (5).)
14Its contents are not security-sensitive
15.I unless
16manual keying is being done for more than just testing,
17in which case the encryption/authentication keys in the
18descriptions for the manually-keyed connections are very sensitive
19(and those connection descriptions
20are probably best kept in a separate file,
21via the include facility described below).
22.PP
23The file is a text file, consisting of one or more
24.IR sections .
25White space followed by
26.B #
27followed by anything to the end of the line
28is a comment and is ignored,
29as are empty lines which are not within a section.
30.PP
31A line which contains
32.B include
33and a file name, separated by white space,
34is replaced by the contents of that file,
35preceded and followed by empty lines.
36If the file name is not a full pathname,
37it is considered to be relative to the directory containing the
38including file.
39Such inclusions can be nested.
40Only a single filename may be supplied, and it may not contain white space,
41but it may include shell wildcards (see
42.IR sh (1));
43for example:
44.PP
45.B include
46.B "ipsec.*.conf"
47.PP
48The intention of the include facility is mostly to permit keeping
49information on connections, or sets of connections,
50separate from the main configuration file.
51This permits such connection descriptions to be changed,
52copied to the other security gateways involved, etc.,
53without having to constantly extract them from the configuration
54file and then insert them back into it.
55Note also the
56.B also
57parameter (described below) which permits splitting a single logical
58section (e.g. a connection description) into several actual sections.
59.PP
60The first significant line of the file must specify the version
61of this specification that it conforms to:
62.PP
63\fBversion 2\fP
64.PP
65A section
66begins with a line of the form:
67.PP
68.I type
69.I name
70.PP
71where
72.I type
73indicates what type of section follows, and
74.I name
75is an arbitrary name which distinguishes the section from others
76of the same type.
77(Names must start with a letter and may contain only
78letters, digits, periods, underscores, and hyphens.)
79All subsequent non-empty lines
80which begin with white space are part of the section;
81comments within a section must begin with white space too.
82There may be only one section of a given type with a given name.
83.PP
84Lines within the section are generally of the form
85.PP
86\ \ \ \ \ \fIparameter\fB=\fIvalue\fR
87.PP
88(note the mandatory preceding white space).
89There can be white space on either side of the
90.BR = .
91Parameter names follow the same syntax as section names,
92and are specific to a section type.
93Unless otherwise explicitly specified,
94no parameter name may appear more than once in a section.
95.PP
96An empty
97.I value
98stands for the system default value (if any) of the parameter,
99i.e. it is roughly equivalent to omitting the parameter line entirely.
100A
101.I value
102may contain white space only if the entire
103.I value
104is enclosed in double quotes (\fB"\fR);
105a
106.I value
107cannot itself contain a double quote,
108nor may it be continued across more than one line.
109.PP
110Numeric values are specified to be either an ``integer''
111(a sequence of digits) or a ``decimal number''
112(sequence of digits optionally followed by `.' and another sequence of digits).
113.PP
114There is currently one parameter which is available in any type of
115section:
116.TP
117.B also
118the value is a section name;
119the parameters of that section are appended to this section,
120as if they had been written as part of it.
121The specified section must exist, must follow the current one,
122and must have the same section type.
123(Nesting is permitted,
124and there may be more than one
125.B also
126in a single section,
127although it is forbidden to append the same section more than once.)
128This allows, for example, keeping the encryption keys
129for a connection in a separate file
130from the rest of the description, by using both an
131.B also
132parameter and an
133.B include
134line.
135.PP
136Parameter names beginning with
137.B x-
138(or
139.BR X- ,
140or
141.BR x_ ,
142or
143.BR X_ )
144are reserved for user extensions and will never be assigned meanings
145by IPsec.
146Parameters with such names must still observe the syntax rules
147(limits on characters used in the name;
148no white space in a non-quoted value;
149no newlines or double quotes within the value).
150All other as-yet-unused parameter names are reserved for future IPsec
151improvements.
152.PP
153A section with name
154.B %default
155specifies defaults for sections of the same type.
156For each parameter in it,
157any section of that type which does not have a parameter of the same name
158gets a copy of the one from the
159.B %default
160section.
161There may be multiple
162.B %default
163sections of a given type,
164but only one default may be supplied for any specific parameter name,
165and all
166.B %default
167sections of a given type must precede all non-\c
168.B %default
169sections of that type.
170.B %default
171sections may not contain the
172.B also
173parameter.
174.PP
175Currently there are three types of sections:
176a
177.B config
178section specifies general configuration information for IPsec, a
179.B conn
180section specifies an IPsec connection, while a
181.B ca
182section specifies special properties a certification authority.
183.SH "CONN SECTIONS"
184A
185.B conn
186section contains a
187.IR "connection specification" ,
188defining a network connection to be made using IPsec.
189The name given is arbitrary, and is used to identify the connection to
190.IR ipsec_auto (8)
191and
192.IR ipsec_manual (8).
193Here's a simple example:
194.PP
195.ne 10
196.nf
197.ft B
198.ta 1c
199conn snt
200 left=10.11.11.1
201 leftsubnet=10.0.1.0/24
202 leftnexthop=172.16.55.66
203 right=192.168.22.1
204 rightsubnet=10.0.2.0/24
205 rightnexthop=172.16.88.99
206 keyingtries=%forever
207.ft
208.fi
209.PP
210A note on terminology...
211In automatic keying, there are two kinds of communications going on:
212transmission of user IP packets, and gateway-to-gateway negotiations for
213keying, rekeying, and general control.
214The data path (a set of ``IPsec SAs'') used for user packets is herein
215referred to as the ``connection'';
216the path used for negotiations (built with ``ISAKMP SAs'') is referred to as
217the ``keying channel''.
218.PP
219To avoid trivial editing of the configuration file to suit it to each system
220involved in a connection,
221connection specifications are written in terms of
222.I left
223and
224.I right
225participants,
226rather than in terms of local and remote.
227Which participant is considered
228.I left
229or
230.I right
231is arbitrary;
232IPsec figures out which one it is being run on based on internal information.
233This permits using identical connection specifications on both ends.
234There are cases where there is no symmetry; a good convention is to
235use
236.I left
237for the local side and
238.I right
239for the remote side (the first letters are a good mnemonic).
240.PP
241Many of the parameters relate to one participant or the other;
242only the ones for
243.I left
244are listed here, but every parameter whose name begins with
245.B left
246has a
247.B right
248counterpart,
249whose description is the same but with
250.B left
251and
252.B right
253reversed.
254.PP
255Parameters are optional unless marked ``(required)'';
256a parameter required for manual keying need not be included for
257a connection which will use only automatic keying, and vice versa.
258.SS "CONN PARAMETERS: GENERAL"
259The following parameters are relevant to both automatic and manual keying.
260Unless otherwise noted,
261for a connection to work,
262in general it is necessary for the two ends to agree exactly
263on the values of these parameters.
264.TP 14
265.B type
266the type of the connection; currently the accepted values
267are
268.B tunnel
269(the default)
270signifying a host-to-host, host-to-subnet, or subnet-to-subnet tunnel;
271.BR transport ,
272signifying host-to-host transport mode;
273.BR passthrough ,
274signifying that no IPsec processing should be done at all;
275.BR drop ,
276signifying that packets should be discarded; and
277.BR reject ,
278signifying that packets should be discarded and a diagnostic ICMP returned.
279.TP
280.B left
281(required)
282the IP address of the left participant's public-network interface,
283in any form accepted by
284.IR ipsec_ttoaddr (3)
285or one of several magic values.
286If it is
287.BR %defaultroute ,
288and
289the
290.B config
291.B setup
292section's,
293.B interfaces
294specification contains
295.BR %defaultroute,
296.B left
297will be filled in automatically with the local address
298of the default-route interface (as determined at IPsec startup time);
299this also overrides any value supplied for
300.BR leftnexthop .
301(Either
302.B left
303or
304.B right
305may be
306.BR %defaultroute ,
307but not both.)
308The value
309.B %any
310signifies an address to be filled in (by automatic keying) during
311negotiation.
312The value
313.B %opportunistic
314signifies that both
315.B left
316and
317.B leftnexthop
318are to be filled in (by automatic keying) from DNS data for
319.BR left 's
320client.
321The values
322.B %group
323and
324.B %opportunisticgroup
325makes this a policy group conn: one that will be instantiated
326into a regular or opportunistic conn for each CIDR block listed in the
327policy group file with the same name as the conn.
328.TP
329.B leftsubnet
330private subnet behind the left participant, expressed as
331\fInetwork\fB/\fInetmask\fR
332(actually, any form acceptable to
333.IR ipsec_ttosubnet (3));
334if omitted, essentially assumed to be \fIleft\fB/32\fR,
335signifying that the left end of the connection goes to the left participant only
336.TP
337.B leftnexthop
338next-hop gateway IP address for the left participant's connection
339to the public network;
340defaults to
341.B %direct
342(meaning
343.IR right ).
344If the value is to be overridden by the
345.B left=%defaultroute
346method (see above),
347an explicit value must
348.I not
349be given.
350If that method is not being used,
351but
352.B leftnexthop
353is
354.BR %defaultroute ,
355and
356.B interfaces=%defaultroute
357is used in the
358.B config
359.B setup
360section,
361the next-hop gateway address of the default-route interface
362will be used.
363The magic value
364.B %direct
365signifies a value to be filled in (by automatic keying)
366with the peer's address.
367Relevant only locally, other end need not agree on it.
368.TP
369.B leftupdown
370what ``updown'' script to run to adjust routing and/or firewalling
371when the status of the connection
372changes (default
373.BR "ipsec _updown" ).
374May include positional parameters separated by white space
375(although this requires enclosing the whole string in quotes);
376including shell metacharacters is unwise.
377See
378.IR ipsec_pluto (8)
379for details.
380Relevant only locally, other end need not agree on it.
381.TP
382.B leftfirewall
383whether the left participant is doing forwarding-firewalling
384(including masquerading) for traffic from \fIleftsubnet\fR,
385which should be turned off (for traffic to the other subnet)
386once the connection is established;
387acceptable values are
388.B yes
389and (the default)
390.BR no .
391May not be used in the same connection description with
392.BR leftupdown .
393Implemented as a parameter to the default
394.I updown
395script.
396See notes below.
397Relevant only locally, other end need not agree on it.
398.PP
399If one or both security gateways are doing forwarding firewalling
400(possibly including masquerading),
401and this is specified using the firewall parameters,
402tunnels established with IPsec are exempted from it
403so that packets can flow unchanged through the tunnels.
404(This means that all subnets connected in this manner must have
405distinct, non-overlapping subnet address blocks.)
406This is done by the default
407.I updown
408script (see
409.IR ipsec_pluto (8)).
410.PP
411The implementation of this makes certain assumptions about firewall setup,
412notably the use of the old
413.I ipfwadm
414interface to the firewall.
415In situations calling for more control,
416it may be preferable for the user to supply his own
417.I updown
418script,
419which makes the appropriate adjustments for his system.
420.SS "CONN PARAMETERS: AUTOMATIC KEYING"
421The following parameters are relevant only to automatic keying,
422and are ignored in manual keying.
423Unless otherwise noted,
424for a connection to work,
425in general it is necessary for the two ends to agree exactly
426on the values of these parameters.
427.TP 14
428.B auto
429what operation, if any, should be done automatically at IPsec startup;
430currently-accepted values are
431.B add
432(signifying an
433.B ipsec auto
434.BR \-\-add ),
435.B route
436(signifying that plus an
437.B ipsec auto
438.BR \-\-route ),
439.B start
440(signifying that plus an
441.B ipsec auto
442.BR \-\-up ),
443.B manual
444(signifying an
445.B ipsec
446.B manual
447.BR \-\-up ),
448and
449.B ignore
450(also the default) (signifying no automatic startup operation).
451See the
452.B config
453.B setup
454discussion below.
455Relevant only locally, other end need not agree on it
456(but in general, for an intended-to-be-permanent connection,
457both ends should use
458.B auto=start
459to ensure that any reboot causes immediate renegotiation).
460.TP
461.B auth
462whether authentication should be done as part of
463ESP encryption, or separately using the AH protocol;
464acceptable values are
465.B esp
466(the default) and
467.BR ah .
468.TP
469.B authby
470how the two security gateways should authenticate each other;
471acceptable values are
472.B secret
473for shared secrets,
474.B rsasig
475for RSA digital signatures (the default),
476.B secret|rsasig
477for either, and
478.B never
479if negotiation is never to be attempted or accepted (useful for shunt-only conns).
480Digital signatures are superior in every way to shared secrets.
481.TP
482.B compress
483whether IPComp compression of content is proposed on the connection
484(link-level compression does not work on encrypted data,
485so to be effective, compression must be done \fIbefore\fR encryption);
486acceptable values are
487.B yes
488and
489.B no
490(the default).
491The two ends need not agree.
492A value of
493.B yes
494causes IPsec to propose both compressed and uncompressed,
495and prefer compressed.
496A value of
497.B no
498prevents IPsec from proposing compression;
499a proposal to compress will still be accepted.
500.TP
fea5e716
MW
501.B dpdaction
502controls the use of the Dead Peer Detection protocol (DPD, RFC 3706) where
a655f5c0
MW
503R_U_THERE notification messages (IKEv1) or empty INFORMATIONAL messages (IKEv2)
504are periodically sent in order to check the
505liveliness of the IPsec peer. The values
fea5e716
MW
506.B clear
507and
508.B hold
509both activate DPD. If no activity is detected, all connections with a dead peer
510are stopped and unrouted (
511.B clear
512) or put in the hold state (
513.B hold
a655f5c0
MW
514). For
515.B IKEv1
516, the default is
517.B none
518which disables the active sending of R_U_THERE notifications.
519Nevertheless pluto will always send the DPD Vendor ID during connection set up
520in order to signal the readiness to act passively as a responder if the peer
521wants to use DPD. For
522.B IKEv2, none
523does't make sense, as all messages are used to detect dead peers. If specified,
524it has the same meaning as the default (
525.B clear
fea5e716
MW
526).
527.TP
528.B dpddelay
a655f5c0
MW
529defines the period time interval with which R_U_THERE messages/INFORMATIONAL
530exchanges are sent to the peer. These are only sent if no other traffic is
531received. In IKEv2, a value of 0 sends no additional INFORMATIONAL
532messages and uses only standard messages (such as those to rekey) to detect
533dead peers.
fea5e716
MW
534.TP
535.B dpdtimeout
536defines the timeout interval, after which all connections to a peer are deleted
a655f5c0
MW
537in case of inactivity. This only applies to IKEv1, in IKEv2 the default
538retransmission timeout applies, as every exchange is used to detect dead peers.
fea5e716
MW
539.TP
540.B failureshunt
541what to do with packets when negotiation fails.
542The default is
543.BR none :
544no shunt;
545.BR passthrough ,
546.BR drop ,
547and
548.B reject
549have the obvious meanings.
550.TP
551.B ikelifetime
552how long the keying channel of a connection (buzzphrase: ``ISAKMP SA'')
553should last before being renegotiated.
554.TP
555.B keyexchange
556method of key exchange;
3572b3b6 557which protocol should be used to initialize the connection. Connections marked with
fea5e716 558.B ikev1
3572b3b6 559are initiated with pluto, those marked with
fea5e716 560.B ikev2
3572b3b6
MW
561with charon. An incoming request from the remote peer is handled by the correct
562daemon, unaffected from the
fea5e716 563.B keyexchange
3572b3b6 564setting. The default value
fea5e716
MW
565.B ike
566currently behaves exactly as
567.B ikev1.
568.TP
569.B keylife
570(default set by
571.IR ipsec_pluto (8),
572currently
573.BR 3h ,
574maximum
575.BR 24h ).
576The two-ends-disagree case is similar to that of
577.BR keylife .
578.TP
579.B keyingtries
580how many attempts (a whole number or \fB%forever\fP) should be made to
581negotiate a connection, or a replacement for one, before giving up
582(default
583.BR %forever ).
584The value \fB%forever\fP
585means ``never give up'' (obsolete: this can be written \fB0\fP).
586Relevant only locally, other end need not agree on it.
587.TP
588.B keylife
589how long a particular instance of a connection
590(a set of encryption/authentication keys for user packets) should last,
591from successful negotiation to expiry;
592acceptable values are an integer optionally followed by
593.BR s
594(a time in seconds)
595or a decimal number followed by
596.BR m ,
597.BR h ,
598or
599.B d
600(a time
601in minutes, hours, or days respectively)
602(default
603.BR 1h ,
604maximum
605.BR 24h ).
606Normally, the connection is renegotiated (via the keying channel)
607before it expires.
608The two ends need not exactly agree on
609.BR keylife ,
610although if they do not,
611there will be some clutter of superseded connections on the end
612which thinks the lifetime is longer.
613.TP
614.B leftca
615the distinguished name of a certificate authority which is required to
616lie in the trust path going from the left participant's certificate up
617to the root certification authority.
618.TP
619.B leftcert
620the path to the left participant's X.509 certificate. The file can be coded either in
621PEM or DER format. OpenPGP certificates are supported as well.
622Both absolute paths or paths relative to
623.B /etc/ipsec.d/certs
624are accepted. By default
625.B leftcert
626sets
627.B leftid
628to the distinguished name of the certificate's subject and
629.B leftca
630to the distinguished name of the certificate's issuer.
631The left participant's ID can be overriden by specifying a
632.B leftid
633value which must be certified by the certificate, though.
634.TP
635.B leftgroups
636a comma separated list of group names. If the
637.B leftgroups
638parameter is present then the peer must be a member of at least one
639of the groups defined by the parameter. Group membership must be certified
640by a valid attribute certificate stored in \fI/etc/ipsec.d/acerts\fP thas has been
641issued to the peer by a trusted Authorization Authority stored in
642\fI/etc/ipsec.d/aacerts\fP.
643.TP
644.B leftid
645how
646the left participant
647should be identified for authentication;
648defaults to
649.BR left .
650Can be an IP address (in any
651.IR ipsec_ttoaddr (3)
652syntax)
653or a fully-qualified domain name preceded by
654.B @
655(which is used as a literal string and not resolved).
656The magic value
657.B %myid
658stands for the current setting of \fImyid\fP.
659This is set in \fBconfig setup\fP or by \fIipsec_whack\fP(8)), or, if not set,
660it is the IP address in \fB%defaultroute\fP (if that is supported by a TXT record in its reverse domain), or otherwise
661it is the system's hostname (if that is supported by a TXT record in its forward domain), or otherwise it is undefined.
662.TP
663.B leftrsasigkey
664the left participant's
665public key for RSA signature authentication,
666in RFC 2537 format using
667.IR ipsec_ttodata (3)
668encoding.
669The magic value
670.B %none
671means the same as not specifying a value (useful to override a default).
672The value
673.B %cert
674(the default)
675means that the key is extracted from a certificate.
676The value
677.B %dnsondemand
678means the key is to be fetched from DNS at the time it is needed.
679The value
680.B %dnsonload
681means the key is to be fetched from DNS at the time
682the connection description is read from
683.IR ipsec.conf ;
684currently this will be treated as
685.B %none
686if
687.B right=%any
688or
689.BR right=%opportunistic .
690The value
691.B %dns
692is currently treated as
693.B %dnsonload
694but will change to
695.B %dnsondemand
696in the future.
697The identity used for the left participant
698must be a specific host, not
699.B %any
700or another magic value.
701.B Caution:
702if two connection descriptions
703specify different public keys for the same
704.BR leftid ,
705confusion and madness will ensue.
706.TP
707.B leftrsasigkey2
708if present, a second public key.
709Either key can authenticate the signature, allowing for key rollover.
710.TP
711.B leftsourceip
712.TP
713.B leftsubnetwithin
714.TP
715.B pfs
716whether Perfect Forward Secrecy of keys is desired on the connection's
717keying channel
718(with PFS, penetration of the key-exchange protocol
719does not compromise keys negotiated earlier);
720acceptable values are
721.B yes
722(the default)
723and
724.BR no .
725.TP
726.B rekey
727whether a connection should be renegotiated when it is about to expire;
728acceptable values are
729.B yes
730(the default)
731and
732.BR no .
733The two ends need not agree,
734but while a value of
735.B no
6fe03b0a 736prevents Pluto/Charon from requesting renegotiation,
fea5e716
MW
737it does not prevent responding to renegotiation requested from the other end,
738so
739.B no
740will be largely ineffective unless both ends agree on it.
741.TP
6fe03b0a
MW
742.B reauth
743whether rekeying of an IKE_SA should also reauthenticate the peer. In IKEv1,
744reauthentication is always done. In IKEv2, a value of
745.B no
746rekeys without uninstalling the IPsec SAs, a value of
747.B yes
748(the default) creates a new IKE_SA from scratch and tries to recreate
749all IPsec SAs.
750.TP
fea5e716
MW
751.B rekeyfuzz
752maximum percentage by which
753.B rekeymargin
754should be randomly increased to randomize rekeying intervals
755(important for hosts with many connections);
756acceptable values are an integer,
757which may exceed 100,
758followed by a `%'
759(default set by
760.IR ipsec_pluto (8),
761currently
762.BR 100% ).
763The value of
764.BR rekeymargin ,
765after this random increase,
766must not exceed
767.BR keylife .
768The value
769.B 0%
770will suppress time randomization.
771Relevant only locally, other end need not agree on it.
772.TP
773.B rekeymargin
774how long before connection expiry or keying-channel expiry
775should attempts to
776negotiate a replacement
777begin; acceptable values as for
778.B keylife
779(default
780.BR 9m ).
781Relevant only locally, other end need not agree on it.
782.SS "CONN PARAMETERS: MANUAL KEYING"
783The following parameters are relevant only to manual keying,
784and are ignored in automatic keying.
785Unless otherwise noted,
786for a connection to work,
787in general it is necessary for the two ends to agree exactly
788on the values of these parameters.
789A manually-keyed
790connection must specify at least one of AH or ESP.
791.TP 14
792.B spi
793(this or
794.B spibase
795required for manual keying)
796the SPI number to be used for the connection (see
797.IR ipsec_manual (8));
798must be of the form \fB0x\fIhex\fB\fR,
799where
800.I hex
801is one or more hexadecimal digits
802(note, it will generally be necessary to make
803.I spi
804at least
805.B 0x100
806to be acceptable to KLIPS,
807and use of SPIs in the range
808.BR 0x100 - 0xfff
809is recommended)
810.TP 14
811.B spibase
812(this or
813.B spi
814required for manual keying)
815the base number for the SPIs to be used for the connection (see
816.IR ipsec_manual (8));
817must be of the form \fB0x\fIhex\fB0\fR,
818where
819.I hex
820is one or more hexadecimal digits
821(note, it will generally be necessary to make
822.I spibase
823at least
824.B 0x100
825for the resulting SPIs
826to be acceptable to KLIPS,
827and use of numbers in the range
828.BR 0x100 - 0xff0
829is recommended)
830.TP
831.B esp
832ESP encryption/authentication algorithm to be used
833for the connection, e.g.
834.B 3des-md5-96
835(must be suitable as a value of
836.IR ipsec_spi (8)'s
837.B \-\-esp
838option);
839default is not to use ESP
840.TP
841.B espenckey
842ESP encryption key
843(must be suitable as a value of
844.IR ipsec_spi (8)'s
845.B \-\-enckey
846option)
847(may be specified separately for each direction using
848.B leftespenckey
849(leftward SA)
850and
851.B rightespenckey
852parameters)
853.TP
854.B espauthkey
855ESP authentication key
856(must be suitable as a value of
857.IR ipsec_spi (8)'s
858.B \-\-authkey
859option)
860(may be specified separately for each direction using
861.B leftespauthkey
862(leftward SA)
863and
864.B rightespauthkey
865parameters)
866.TP
867.B espreplay_window
868ESP replay-window setting,
869an integer from
870.B 0
871(the
872.IR ipsec_manual
873default, which turns off replay protection) to
874.BR 64 ;
875relevant only if ESP authentication is being used
876.TP
877.B leftespspi
878SPI to be used for the leftward ESP SA, overriding
879automatic assignment using
880.B spi
881or
882.BR spibase ;
883typically a hexadecimal number beginning with
884.B 0x
885.TP
886.B ah
887AH authentication algorithm to be used
888for the connection, e.g.
889.B hmac-md5-96
890(must be suitable as a value of
891.IR ipsec_spi (8)'s
892.B \-\-ah
893option);
894default is not to use AH
895.TP
896.B ahkey
897(required if
898.B ah
899is present) AH authentication key
900(must be suitable as a value of
901.IR ipsec_spi (8)'s
902.B \-\-authkey
903option)
904(may be specified separately for each direction using
905.B leftahkey
906(leftward SA)
907and
908.B rightahkey
909parameters)
910.TP
911.B ahreplay_window
912AH replay-window setting,
913an integer from
914.B 0
915(the
916.I ipsec_manual
917default, which turns off replay protection) to
918.B 64
919.TP
920.B leftahspi
921SPI to be used for the leftward AH SA, overriding
922automatic assignment using
923.B spi
924or
925.BR spibase ;
926typically a hexadecimal number beginning with
927.B 0x
928.SH "CA SECTIONS"
929This are optional sections that can be used to assign special
930parameters to a Certification Authority (CA).
931.TP 10
932.B auto
933currently can have either the value
934.B ignore
935or
936.B add
937.
938.TP
939.B cacert
940defines a path to the CA certificate either relative to
941\fI/etc/ipsec.d/cacerts\fP or as an absolute path.
942.TP
943.B crluri
944defines a CRL distribution point (ldap, http, or file URI)
945.TP
946.B crluri2
947defines an alternative CRL distribution point (ldap, http, or file URI)
948.TP
949.B ldaphost
950defines an ldap host.
951.TP
952.B ocspuri
953defines an OCSP URI.
954.SH "CONFIG SECTIONS"
955At present, the only
956.B config
957section known to the IPsec software is the one named
958.BR setup ,
959which contains information used when the software is being started
960(see
961.IR ipsec_setup (8)).
962Here's an example:
963.PP
964.ne 8
965.nf
966.ft B
967.ta 1c
968config setup
969 interfaces="ipsec0=eth1 ipsec1=ppp0"
970 klipsdebug=none
971 plutodebug=all
972 manualstart=
973.ft
974.fi
975.PP
976Parameters are optional unless marked ``(required)''.
977The currently-accepted
978.I parameter
979names in a
980.B config
981.B setup
982section are:
983.TP 14
984.B myid
985the identity to be used for
986.BR %myid .
987.B %myid
988is used in the implicit policy group conns and can be used as
989an identity in explicit conns.
990If unspecified,
991.B %myid
992is set to the IP address in \fB%defaultroute\fP (if that is supported by a TXT record in its reverse domain), or otherwise
993the system's hostname (if that is supported by a TXT record in its forward domain), or otherwise it is undefined.
994An explicit value generally starts with ``\fB@\fP''.
995.TP
996.B interfaces
997virtual and physical interfaces for IPsec to use:
998a single
999\fIvirtual\fB=\fIphysical\fR pair, a (quoted!) list of pairs separated
1000by white space, or
1001.BR %none .
1002One of the pairs may be written as
1003.BR %defaultroute ,
1004which means: find the interface \fId\fR that the default route points to,
1005and then act as if the value was ``\fBipsec0=\fId\fR''.
1006.B %defaultroute
1007is the default;
1008.B %none
1009must be used to denote no interfaces.
1010If
1011.B %defaultroute
1012is used (implicitly or explicitly)
1013information about the default route and its interface is noted for
1014use by
1015.IR ipsec_manual (8)
1016and
1017.IR ipsec_auto (8).)
1018.TP
1019.B forwardcontrol
1020whether
1021.I setup
1022should turn IP forwarding on
1023(if it's not already on) as IPsec is started,
1024and turn it off again (if it was off) as IPsec is stopped;
1025acceptable values are
1026.B yes
1027and (the default)
1028.BR no .
1029For this to have full effect, forwarding must be
1030disabled before the hardware interfaces are brought
1031up (e.g.,
1032.B "net.ipv4.ip_forward\ =\ 0"
1033in Red Hat 6.x
1034.IR /etc/sysctl.conf ),
1035because IPsec doesn't get control early enough to do that.
1036.TP
1037.B rp_filter
1038whether and how
1039.I setup
1040should adjust the reverse path filtering mechanism for the
1041physical devices to be used.
1042Values are \fB%unchanged\fP (to leave it alone)
1043or \fB0\fP, \fB1\fP, \fB2\fP (values to set it to).
1044\fI/proc/sys/net/ipv4/conf/PHYS/rp_filter\fP
1045is badly documented; it must be \fB0\fP in many cases
1046for ipsec to function.
1047The default value for the parameter is \fB0\fP.
1048.TP
1049.B syslog
1050the
1051.IR syslog (2)
1052``facility'' name and priority to use for
1053startup/shutdown log messages,
1054default
1055.BR daemon.error .
1056.TP
1057.B klipsdebug
1058how much KLIPS debugging output should be logged.
1059An empty value,
1060or the magic value
1061.BR none ,
1062means no debugging output (the default).
1063The magic value
1064.B all
1065means full output.
1066Otherwise only the specified types of output
1067(a quoted list, names separated by white space) are enabled;
1068for details on available debugging types, see
1069.IR ipsec_klipsdebug (8).
1070.TP
1071.B plutodebug
1072how much Pluto debugging output should be logged.
1073An empty value,
1074or the magic value
1075.BR none ,
1076means no debugging output (the default).
1077The magic value
1078.B all
1079means full output.
1080Otherwise only the specified types of output
1081(a quoted list, names without the
1082.B \-\-debug\-
1083prefix,
1084separated by white space) are enabled;
1085for details on available debugging types, see
1086.IR ipsec_pluto (8).
1087.TP
107936f5
MW
1088.B charondebug
1089how much Charon debugging output should be logged.
1090A comma separated list containing type level/pairs may
1091be specified, e.g:
1092.B dmn 3, ike 1, net -1.
1093Acceptable values for types are
1094.B dmn, mgr, ike, chd, job, cfg, knl, net, enc, lib
1095and the level is one of
1096.B -1, 0, 1, 2, 3, 4
1097(for silent, audit, control, controlmore, raw, private)
1098.TP
fea5e716
MW
1099.B plutoopts
1100additional options to pass to pluto upon startup. See
1101.IR ipsec_pluto (8).
1102.TP
1103.B plutostderrlog
1104do not use syslog, but rather log to stderr, and direct stderr to the
1105argument file.
1106.TP
1107.B dumpdir
1108in what directory should things started by
1109.I setup
1110(notably the Pluto daemon) be allowed to
1111dump core?
1112The empty value (the default) means they are not
1113allowed to.
1114.TP
1115.B manualstart
1116which manually-keyed connections to set up at startup
1117(empty, a name, or a quoted list of names separated by white space);
1118see
1119.IR ipsec_manual (8).
1120Default is none.
1121.TP
1122.B pluto
1123whether to start Pluto or not;
1124Values are
1125.B yes
1126(the default)
1127or
1128.B no
1129(useful only in special circumstances).
1130.TP
1131.B plutowait
1132should Pluto wait for each
1133negotiation attempt that is part of startup to
1134finish before proceeding with the next?
1135Values are
1136.B yes
1137or
1138.BR no
1139(the default).
1140.TP
1141.B prepluto
1142shell command to run before starting Pluto
1143(e.g., to decrypt an encrypted copy of the
1144.I ipsec.secrets
1145file).
1146It's run in a very simple way;
1147complexities like I/O redirection are best hidden within a script.
1148Any output is redirected for logging,
1149so running interactive commands is difficult unless they use
1150.I /dev/tty
1151or equivalent for their interaction.
1152Default is none.
1153.TP
1154.B postpluto
1155shell command to run after starting Pluto
1156(e.g., to remove a decrypted copy of the
1157.I ipsec.secrets
1158file).
1159It's run in a very simple way;
1160complexities like I/O redirection are best hidden within a script.
1161Any output is redirected for logging,
1162so running interactive commands is difficult unless they use
1163.I /dev/tty
1164or equivalent for their interaction.
1165Default is none.
1166.TP
1167.B fragicmp
1168whether a tunnel's need to fragment a packet should be reported
1169back with an ICMP message,
1170in an attempt to make the sender lower his PMTU estimate;
1171acceptable values are
1172.B yes
1173(the default)
1174and
1175.BR no .
1176.TP
1177.B hidetos
1178whether a tunnel packet's TOS field should be set to
1179.B 0
1180rather than copied from the user packet inside;
1181acceptable values are
1182.B yes
1183(the default)
1184and
1185.BR no .
1186.TP
1187.B uniqueids
1188whether a particular participant ID should be kept unique,
1189with any new (automatically keyed)
1190connection using an ID from a different IP address
1191deemed to replace all old ones using that ID;
1192acceptable values are
1193.B yes
1194(the default)
1195and
1196.BR no .
1197Participant IDs normally \fIare\fR unique,
1198so a new (automatically-keyed) connection using the same ID is
1199almost invariably intended to replace an old one.
1200.TP
1201.B overridemtu
1202value that the MTU of the ipsec\fIn\fR interface(s) should be set to,
1203overriding IPsec's (large) default.
1204This parameter is needed only in special situations.
1205.TP
1206.B nat_traversal
1207.TP
1208.B crlcheckinterval
1209.TP
1210.B strictcrlpolicy
1211.TP
1212.B pkcs11module
1213.TP
1214.B pkcs11keepstate
1215
1216.SH CHOOSING A CONNECTION
1217.PP
1218When choosing a connection to apply to an outbound packet caught with a
1219.BR %trap,
1220the system prefers the one with the most specific eroute that
1221includes the packet's source and destination IP addresses.
1222Source subnets are examined before destination subnets.
1223For initiating, only routed connections are considered. For responding,
1224unrouted but added connections are considered.
1225.PP
1226When choosing a connection to use to respond to a negotiation which
1227doesn't match an ordinary conn, an opportunistic connection
1228may be instantiated. Eventually, its instance will be /32 -> /32, but
1229for earlier stages of the negotiation, there will not be enough
1230information about the client subnets to complete the instantiation.
1231.SH FILES
1232.nf
1233/etc/ipsec.conf
1234/etc/ipsec.d/cacerts
1235/etc/ipsec.d/certs
1236/etc/ipsec.d/crls
1237/etc/ipsec.d/aacerts
1238/etc/ipsec.d/acerts
1239
1240.SH SEE ALSO
1241ipsec(8), ipsec_ttoaddr(8), ipsec_auto(8), ipsec_manual(8), ipsec_rsasigkey(8)
1242.SH HISTORY
1243Written for the FreeS/WAN project
1244<http://www.freeswan.org>
1245by Henry Spencer. Extended for the strongSwan project
1246<http://www.strongswan.org>
1247by Andreas Steffen.
1248.SH BUGS
1249.PP
1250When
1251.B type
1252or
1253.B failureshunt
1254is set to
1255.B drop
1256or
1257.BR reject,
1258strongSwan blocks outbound packets using eroutes, but assumes inbound
1259blocking is handled by the firewall. strongSwan offers firewall hooks
1260via an ``updown'' script. However, the default
1261.B ipsec _updown
1262provides no help in controlling a modern firewall.
1263.PP
1264Including attributes of the keying channel
1265(authentication methods,
1266.BR ikelifetime ,
1267etc.)
1268as an attribute of a connection,
1269rather than of a participant pair, is dubious and incurs limitations.
1270.PP
1271.IR Ipsec_manual
1272is not nearly as generous about the syntax of subnets,
1273addresses, etc. as the usual strongSwan user interfaces.
1274Four-component dotted-decimal must be used for all addresses.
1275It
1276.I is
1277smart enough to translate bit-count netmasks to dotted-decimal form.
1278.PP
1279It would be good to have a line-continuation syntax,
1280especially for the very long lines involved in
1281RSA signature keys.
1282.PP
1283The ability to specify different identities,
1284.BR authby ,
1285and public keys for different automatic-keyed connections
1286between the same participants is misleading;
1287this doesn't work dependably because the identity of the participants
1288is not known early enough.
1289This is especially awkward for the ``Road Warrior'' case,
1290where the remote IP address is specified as
1291.BR 0.0.0.0 ,
1292and that is considered to be the ``participant'' for such connections.
1293.PP
1294In principle it might be necessary to control MTU on an
1295interface-by-interface basis,
1296rather than with the single global override that
1297.B overridemtu
1298provides.
1299.PP
1300A number of features which \fIcould\fR be implemented in
1301both manual and automatic keying
1302actually are not yet implemented for manual keying.
1303This is unlikely to be fixed any time soon.
1304.PP
1305If conns are to be added before DNS is available,
1306\fBleft=\fP\fIFQDN\fP,
1307\fBleftnextop=\fP\fIFQDN\fP,
1308and
1309.B leftrsasigkey=%dnsonload
1310will fail.
1311.IR ipsec_pluto (8)
1312does not actually use the public key for our side of a conn but it
1313isn't generally known at a add-time which side is ours (Road Warrior
1314and Opportunistic conns are currently exceptions).
1315.PP
1316The \fBmyid\fP option does not affect explicit \fB ipsec auto \-\-add\fP or \fBipsec auto \-\-replace\fP commands for implicit conns.