]> git.ipfire.org Git - thirdparty/strongswan.git/blame - man/ipsec.conf.5.in
man: Document replay_window ipsec.conf option
[thirdparty/strongswan.git] / man / ipsec.conf.5.in
CommitLineData
8250fc10 1.TH IPSEC.CONF 5 "2012-06-26" "@PACKAGE_VERSION@" "strongSwan"
fea5e716
MW
2.SH NAME
3ipsec.conf \- IPsec configuration and connections
4.SH DESCRIPTION
5The optional
6.I ipsec.conf
7file
8specifies most configuration and control information for the
9strongSwan IPsec subsystem.
f115838b 10The major exception is secrets for authentication;
fea5e716 11see
f115838b 12.IR ipsec.secrets (5).
532f2347 13Its contents are not security-sensitive.
fea5e716
MW
14.PP
15The file is a text file, consisting of one or more
16.IR sections .
17White space followed by
18.B #
19followed by anything to the end of the line
20is a comment and is ignored,
21as are empty lines which are not within a section.
22.PP
23A line which contains
24.B include
25and a file name, separated by white space,
26is replaced by the contents of that file,
27preceded and followed by empty lines.
28If the file name is not a full pathname,
29it is considered to be relative to the directory containing the
30including file.
31Such inclusions can be nested.
32Only a single filename may be supplied, and it may not contain white space,
33but it may include shell wildcards (see
34.IR sh (1));
35for example:
36.PP
37.B include
38.B "ipsec.*.conf"
39.PP
40The intention of the include facility is mostly to permit keeping
41information on connections, or sets of connections,
42separate from the main configuration file.
43This permits such connection descriptions to be changed,
44copied to the other security gateways involved, etc.,
45without having to constantly extract them from the configuration
46file and then insert them back into it.
47Note also the
48.B also
49parameter (described below) which permits splitting a single logical
50section (e.g. a connection description) into several actual sections.
51.PP
fea5e716
MW
52A section
53begins with a line of the form:
54.PP
55.I type
56.I name
57.PP
58where
59.I type
60indicates what type of section follows, and
61.I name
62is an arbitrary name which distinguishes the section from others
63of the same type.
f115838b
TB
64Names must start with a letter and may contain only
65letters, digits, periods, underscores, and hyphens.
fea5e716
MW
66All subsequent non-empty lines
67which begin with white space are part of the section;
68comments within a section must begin with white space too.
69There may be only one section of a given type with a given name.
70.PP
71Lines within the section are generally of the form
72.PP
73\ \ \ \ \ \fIparameter\fB=\fIvalue\fR
74.PP
75(note the mandatory preceding white space).
76There can be white space on either side of the
77.BR = .
78Parameter names follow the same syntax as section names,
79and are specific to a section type.
80Unless otherwise explicitly specified,
81no parameter name may appear more than once in a section.
82.PP
83An empty
84.I value
85stands for the system default value (if any) of the parameter,
86i.e. it is roughly equivalent to omitting the parameter line entirely.
87A
88.I value
89may contain white space only if the entire
90.I value
91is enclosed in double quotes (\fB"\fR);
92a
93.I value
94cannot itself contain a double quote,
95nor may it be continued across more than one line.
96.PP
97Numeric values are specified to be either an ``integer''
98(a sequence of digits) or a ``decimal number''
99(sequence of digits optionally followed by `.' and another sequence of digits).
100.PP
101There is currently one parameter which is available in any type of
102section:
103.TP
104.B also
105the value is a section name;
106the parameters of that section are appended to this section,
107as if they had been written as part of it.
108The specified section must exist, must follow the current one,
109and must have the same section type.
110(Nesting is permitted,
111and there may be more than one
112.B also
113in a single section,
114although it is forbidden to append the same section more than once.)
fea5e716
MW
115.PP
116A section with name
117.B %default
118specifies defaults for sections of the same type.
119For each parameter in it,
120any section of that type which does not have a parameter of the same name
121gets a copy of the one from the
122.B %default
123section.
124There may be multiple
125.B %default
126sections of a given type,
127but only one default may be supplied for any specific parameter name,
128and all
129.B %default
130sections of a given type must precede all non-\c
131.B %default
132sections of that type.
133.B %default
134sections may not contain the
135.B also
136parameter.
137.PP
138Currently there are three types of sections:
139a
140.B config
141section specifies general configuration information for IPsec, a
142.B conn
143section specifies an IPsec connection, while a
144.B ca
7900ab1b 145section specifies special properties of a certification authority.
fea5e716
MW
146.SH "CONN SECTIONS"
147A
148.B conn
149section contains a
150.IR "connection specification" ,
151defining a network connection to be made using IPsec.
532f2347 152The name given is arbitrary, and is used to identify the connection.
fea5e716
MW
153Here's a simple example:
154.PP
155.ne 10
156.nf
157.ft B
158.ta 1c
159conn snt
7900ab1b
AS
160 left=192.168.0.1
161 leftsubnet=10.1.0.0/16
162 right=192.168.0.2
163 rightsubnet=10.1.0.0/16
fea5e716 164 keyingtries=%forever
7900ab1b 165 auto=add
fea5e716
MW
166.ft
167.fi
168.PP
532f2347 169A note on terminology: There are two kinds of communications going on:
fea5e716
MW
170transmission of user IP packets, and gateway-to-gateway negotiations for
171keying, rekeying, and general control.
f115838b
TB
172The path to control the connection is called 'ISAKMP SA' in IKEv1
173and 'IKE SA' in the IKEv2 protocol. That what is being negotiated, the kernel
174level data path, is called 'IPsec SA' or 'Child SA'.
75e3d90d
MW
175strongSwan previously used two separate keying daemons, \fIpluto\fP and
176\fIcharon\fP. This manual does not discuss \fIpluto\fP options anymore, but
177only \fIcharon\fP that since strongSwan 5.0 supports both IKEv1 and IKEv2.
fea5e716
MW
178.PP
179To avoid trivial editing of the configuration file to suit it to each system
180involved in a connection,
181connection specifications are written in terms of
182.I left
183and
184.I right
185participants,
186rather than in terms of local and remote.
187Which participant is considered
188.I left
189or
190.I right
191is arbitrary;
f115838b
TB
192for every connection description an attempt is made to figure out whether
193the local endpoint should act as the
194.I left
195or
196.I right
197endpoint. This is done by matching the IP addresses defined for both endpoints
198with the IP addresses assigned to local network interfaces. If a match is found
199then the role (left or right) that matches is going to be considered local.
200If no match is found during startup,
201.I left
202is considered local.
fea5e716
MW
203This permits using identical connection specifications on both ends.
204There are cases where there is no symmetry; a good convention is to
205use
206.I left
207for the local side and
208.I right
209for the remote side (the first letters are a good mnemonic).
210.PP
211Many of the parameters relate to one participant or the other;
212only the ones for
213.I left
214are listed here, but every parameter whose name begins with
215.B left
216has a
217.B right
218counterpart,
219whose description is the same but with
220.B left
221and
222.B right
223reversed.
224.PP
532f2347
MW
225Parameters are optional unless marked '(required)'.
226.SS "CONN PARAMETERS"
227Unless otherwise noted, for a connection to work,
fea5e716
MW
228in general it is necessary for the two ends to agree exactly
229on the values of these parameters.
6bcf6016
TB
230.TP
231.BR aaa_identity " = <id>"
64d7b073
MW
232defines the identity of the AAA backend used during IKEv2 EAP authentication.
233This is required if the EAP client uses a method that verifies the server
234identity (such as EAP-TLS), but it does not match the IKEv2 gateway identity.
235.TP
72970b45
TB
236.BR aggressive " = yes | " no
237whether to use IKEv1 Aggressive or Main Mode (the default).
238.TP
5fdbb3c6
MW
239.BR ah " = <cipher suites>"
240comma-separated list of AH algorithms to be used for the connection, e.g.
241.BR sha1-sha256-modp1024 .
242The notation is
243.BR integrity[-dhgroup] .
244For IKEv2, multiple algorithms (separated by -) of the same type can be included
245in a single proposal. IKEv1 only includes the first algorithm in a proposal.
246Only either the
247.B ah
248or
249.B esp
250keyword may be used, AH+ESP bundles are not supported.
251
252There is no default, by default ESP is used.
253The daemon adds its extensive default proposal to the configured value. To
254restrict it to the configured proposal an
255exclamation mark
256.RB ( ! )
257can be added at the end.
258
259If
260.B dh-group
261is specified, CHILD_SA/Quick Mode setup and rekeying include a separate
262Diffie-Hellman exchange.
263.TP
a5477a6f
TB
264.BR also " = <name>"
265includes conn section
266.BR <name> .
fea5e716 267.TP
5fdbb3c6
MW
268.BR auth " = <value>"
269was used by the
270.B pluto
271IKEv1 daemon to use AH integrity protection for ESP encrypted packets, but is
272not supported in charon. The
273.B ah
274keyword specifies algorithms to use for integrity protection with AH, but
275without encryption. AH+ESP bundles are not supported.
276.TP
2045a9d3 277.BR authby " = " pubkey " | rsasig | ecdsasig | psk | secret | never | xauthpsk | xauthrsasig"
fea5e716
MW
278how the two security gateways should authenticate each other;
279acceptable values are
7900ab1b 280.B psk
a5477a6f
TB
281or
282.B secret
c7f76958
AS
283for pre-shared secrets,
284.B pubkey
285(the default) for public key signatures as well as the synonyms
fea5e716 286.B rsasig
c7f76958
AS
287for RSA digital signatures and
288.B ecdsasig
289for Elliptic Curve DSA signatures.
fea5e716 290.B never
c7f76958
AS
291can be used if negotiation is never to be attempted or accepted (useful for
292shunt-only conns).
8015c91c 293Digital signatures are superior in every way to shared secrets.
7900ab1b
AS
294IKEv1 additionally supports the values
295.B xauthpsk
296and
297.B xauthrsasig
298that will enable eXtended AUTHentication (XAUTH) in addition to IKEv1 main mode
c8d46f29 299based on shared secrets or digital RSA signatures, respectively.
75e3d90d
MW
300This parameter is deprecated, as two peers do not need to agree on an
301authentication method in IKEv2. Use the
a44bb934 302.B leftauth
75e3d90d 303parameter instead to define authentication methods.
fea5e716 304.TP
6bcf6016 305.BR auto " = " ignore " | add | route | start"
c2bc2b27
AS
306what operation, if any, should be done automatically at IPsec startup;
307currently-accepted values are
f115838b
TB
308.BR add ,
309.BR route ,
c2bc2b27 310.B start
7900ab1b 311and
f115838b
TB
312.B ignore
313(the default).
c2bc2b27
AS
314.B add
315loads a connection without starting it.
316.B route
317loads a connection and installs kernel traps. If traffic is detected between
318.B leftsubnet
319and
72970b45
TB
320.BR rightsubnet ,
321a connection is established.
c2bc2b27 322.B start
f3bb1bd0 323loads a connection and brings it up immediately.
c2bc2b27 324.B ignore
72970b45 325ignores the connection. This is equal to deleting a connection from the config
8015c91c 326file.
66e12b92
TB
327Relevant only locally, other end need not agree on it.
328.TP
329.BR closeaction " = " none " | clear | hold | restart"
330defines the action to take if the remote peer unexpectedly closes a CHILD_SA
331(see
332.B dpdaction
333for meaning of values).
334A
335.B closeaction should not be
336used if the peer uses reauthentication or uniquids checking, as these events
b2dfa062 337might trigger the defined action when not desired.
7900ab1b 338.TP
6bcf6016 339.BR compress " = yes | " no
fea5e716
MW
340whether IPComp compression of content is proposed on the connection
341(link-level compression does not work on encrypted data,
342so to be effective, compression must be done \fIbefore\fR encryption);
343acceptable values are
344.B yes
345and
346.B no
532f2347 347(the default). A value of
fea5e716 348.B yes
18dac73f 349causes the daemon to propose both compressed and uncompressed,
fea5e716
MW
350and prefer compressed.
351A value of
352.B no
18dac73f 353prevents the daemon from proposing or accepting compression.
fea5e716 354.TP
6bcf6016 355.BR dpdaction " = " none " | clear | hold | restart"
fea5e716 356controls the use of the Dead Peer Detection protocol (DPD, RFC 3706) where
a655f5c0
MW
357R_U_THERE notification messages (IKEv1) or empty INFORMATIONAL messages (IKEv2)
358are periodically sent in order to check the
359liveliness of the IPsec peer. The values
7900ab1b
AS
360.BR clear ,
361.BR hold ,
8015c91c 362and
7900ab1b
AS
363.B restart
364all activate DPD. If no activity is detected, all connections with a dead peer
f115838b
TB
365are stopped and unrouted
366.RB ( clear ),
367put in the hold state
368.RB ( hold )
369or restarted
370.RB ( restart ).
75e3d90d 371The default is
7900ab1b 372.B none
75e3d90d 373which disables the active sending of DPD messages.
fea5e716 374.TP
6bcf6016 375.BR dpddelay " = " 30s " | <time>"
a655f5c0
MW
376defines the period time interval with which R_U_THERE messages/INFORMATIONAL
377exchanges are sent to the peer. These are only sent if no other traffic is
378received. In IKEv2, a value of 0 sends no additional INFORMATIONAL
379messages and uses only standard messages (such as those to rekey) to detect
380dead peers.
fea5e716 381.TP
66e12b92
TB
382.BR dpdtimeout " = " 150s " | <time>
383defines the timeout interval, after which all connections to a peer are deleted
384in case of inactivity. This only applies to IKEv1, in IKEv2 the default
385retransmission timeout applies, as every exchange is used to detect dead peers.
4876f896 386.TP
6bcf6016 387.BR inactivity " = <time>"
8015c91c 388defines the timeout interval, after which a CHILD_SA is closed if it did
d048a319
MW
389not send or receive any traffic. The inactivity counter is reset during CHILD_SA
390rekeying. This means that the inactivity timeout must be smaller than the
391rekeying interval to have any effect.
eea626ed 392.TP
6bcf6016 393.BR eap_identity " = <id>"
72970b45 394defines the identity the client uses to reply to an EAP Identity request.
82290106 395If defined on the EAP server, the defined identity will be used as peer
8015c91c 396identity during EAP authentication. The special value
82290106 397.B %identity
f115838b 398uses the EAP Identity method to ask the client for an EAP identity. If not
82290106
MW
399defined, the IKEv2 identity will be used as EAP identity.
400.TP
6bcf6016 401.BR esp " = <cipher suites>"
f115838b 402comma-separated list of ESP encryption/authentication algorithms to be used
c2bc2b27 403for the connection, e.g.
a5477a6f 404.BR aes128-sha256 .
f115838b 405The notation is
de13eab0 406.BR encryption-integrity[-dhgroup][-esnmode] .
5fdbb3c6
MW
407For IKEv2, multiple algorithms (separated by -) of the same type can be included
408in a single proposal. IKEv1 only includes the first algorithm in a proposal.
409Only either the
410.B ah
411or
412.B esp
413keyword may be used, AH+ESP bundles are not supported.
5b2e669b 414
de13eab0 415Defaults to
75e3d90d
MW
416.BR aes128-sha1,3des-sha1 .
417The daemon adds its extensive default proposal to this default
de13eab0
TB
418or the configured value. To restrict it to the configured proposal an
419exclamation mark
420.RB ( ! )
421can be added at the end.
5b2e669b 422
de13eab0 423.BR Note :
75e3d90d 424As a responder the daemon accepts the first supported proposal received from
de13eab0
TB
425the peer. In order to restrict a responder to only accept specific cipher
426suites, the strict flag
427.RB ( ! ,
428exclamation mark) can be used, e.g: aes256-sha512-modp4096!
f115838b
TB
429.br
430If
431.B dh-group
75e3d90d
MW
432is specified, CHILD_SA/Quick Mode setup and rekeying include a separate
433Diffie-Hellman exchange. Valid values for
de13eab0 434.B esnmode
37821954
MW
435(IKEv2 only) are
436.B esn
437and
de13eab0
TB
438.BR noesn .
439Specifying both negotiates Extended Sequence Number support with the peer,
440the default is
37821954 441.B noesn.
c2bc2b27 442.TP
6bcf6016 443.BR forceencaps " = yes | " no
a5477a6f 444force UDP encapsulation for ESP packets even if no NAT situation is detected.
f115838b 445This may help to surmount restrictive firewalls. In order to force the peer to
75e3d90d 446encapsulate packets, NAT detection payloads are faked.
9dae1bed 447.TP
365d9a6f 448.BR fragmentation " = yes | force | " no
97973f86
TB
449whether to use IKE fragmentation (proprietary IKEv1 extension). Acceptable
450values are
365d9a6f
TB
451.BR yes ,
452.B force
97973f86
TB
453and
454.B no
455(the default). Fragmented messages sent by a peer are always accepted
365d9a6f
TB
456irrespective of the value of this option. If set to
457.BR yes ,
458and the peer supports it, larger IKE messages will be sent in fragments.
459If set to
460.B force
461the initial IKE message will already be fragmented if required.
97973f86 462.TP
6bcf6016 463.BR ike " = <cipher suites>"
f115838b
TB
464comma-separated list of IKE/ISAKMP SA encryption/authentication algorithms
465to be used, e.g.
466.BR aes128-sha1-modp2048 .
467The notation is
5b2e669b
MW
468.BR encryption-integrity[-prf]-dhgroup .
469If no PRF is given, the algorithms defined for integrity are used for the PRF.
470The prf keywords are the same as the integrity algorithms, but have a
471.B prf
472prefix (such as
473.BR prfsha1 ,
474.B prfsha256
475or
476.BR prfaesxcbc ).
de13eab0 477.br
5b2e669b
MW
478In IKEv2, multiple algorithms and proposals may be included, such as
479.BR aes128-aes256-sha1-modp1536-modp2048,3des-sha1-md5-modp1024 .
480
de13eab0 481Defaults to
72970b45 482.BR aes128-sha1-modp2048,3des-sha1-modp1536 .
75e3d90d 483The daemon adds its extensive default proposal to this
de13eab0
TB
484default or the configured value. To restrict it to the configured proposal an
485exclamation mark
486.RB ( ! )
487can be added at the end.
5b2e669b 488
de13eab0 489.BR Note :
75e3d90d 490As a responder the daemon accepts the first supported proposal received from
de13eab0
TB
491the peer. In order to restrict a responder to only accept specific cipher
492suites, the strict flag
72970b45 493.RB ( ! ,
5b2e669b
MW
494exclamation mark) can be used, e.g:
495.BR aes256-sha512-modp4096!
c2bc2b27 496.TP
88f4cd39
MW
497.BR ikedscp " = " 000000 " | <DSCP field>"
498Differentiated Services Field Codepoint to set on outgoing IKE packets sent
499from this connection. The value is a six digit binary encoded string defining
500the Codepoint to set, as defined in RFC 2474.
501.TP
6bcf6016 502.BR ikelifetime " = " 3h " | <time>"
f115838b 503how long the keying channel of a connection (ISAKMP or IKE SA)
9f8ceffb 504should last before being renegotiated. Also see EXPIRY/REKEY below.
fea5e716 505.TP
6bcf6016 506.BR installpolicy " = " yes " | no"
75e3d90d
MW
507decides whether IPsec policies are installed in the kernel by the charon daemon
508for a given connection. Allows peaceful cooperation e.g. with
84bec926
AS
509the Mobile IPv6 daemon mip6d who wants to control the kernel policies.
510Acceptable values are
511.B yes
512(the default) and
513.BR no .
514.TP
6bcf6016 515.BR keyexchange " = " ike " | ikev1 | ikev2"
72970b45
TB
516which key exchange protocol should be used to initiate the connection.
517Connections marked with
fea5e716 518.B ike
75e3d90d 519use IKEv2 when initiating, but accept any protocol version when responding.
fea5e716 520.TP
bf870ffb 521.BR keyingtries " = " 3 " | <number> | %forever"
fea5e716
MW
522how many attempts (a whole number or \fB%forever\fP) should be made to
523negotiate a connection, or a replacement for one, before giving up
524(default
bf870ffb 525.BR 3 ).
fea5e716 526The value \fB%forever\fP
532f2347 527means 'never give up'.
fea5e716
MW
528Relevant only locally, other end need not agree on it.
529.TP
530.B keylife
deddfde9
TB
531synonym for
532.BR lifetime .
fea5e716 533.TP
6301ec0a
MW
534.BR left " = <ip address> | <fqdn> | " %any " | <range> | <subnet> "
535The IP address of the left participant's public-network interface
c2bc2b27 536or one of several magic values.
75e3d90d 537The value
f115838b 538.B %any
72970b45
TB
539(the default) for the local endpoint signifies an address to be filled in (by
540automatic keying) during negotiation. If the local peer initiates the
541connection setup the routing table will be queried to determine the correct
542local IP address.
f115838b
TB
543In case the local peer is responding to a connection setup then any IP address
544that is assigned to a local interface will be accepted.
66e12b92
TB
545
546The prefix
547.B %
548in front of a fully-qualified domain name or an IP address will implicitly set
549.BR leftallowany =yes.
f115838b
TB
550
551If
552.B %any
553is used for the remote endpoint it literally means any IP address.
554
6301ec0a
MW
555To limit the connection to a specific range of hosts, a range (
556.BR 10.1.0.0-10.2.255.255
557) or a subnet (
558.BR 10.1.0.0/16
559) can be specified, and multiple addresses, ranges and subnets can be separated
560by commas. While one can freely combine these items, to initiate the connection
561at least one non-range/subnet is required.
562
f115838b
TB
563Please note that with the usage of wildcards multiple connection descriptions
564might match a given incoming connection attempt. The most specific description
565is used in that case.
c2bc2b27 566.TP
66e12b92
TB
567.BR leftallowany " = yes | " no
568a modifier for
569.BR left ,
570making it behave as
571.B %any
572although a concrete IP address or domain name has been assigned.
573.TP
6bcf6016 574.BR leftauth " = <auth method>"
f115838b
TB
575Authentication method to use locally (left) or require from the remote (right)
576side.
75e3d90d 577Acceptable values are
a44bb934 578.B pubkey
8015c91c 579for public key authentication (RSA/ECDSA),
a44bb934 580.B psk
75e3d90d 581for pre-shared key authentication,
a44bb934 582.B eap
75e3d90d
MW
583to (require the) use of the Extensible Authentication Protocol in IKEv2, and
584.B xauth
585for IKEv1 eXtended Authentication.
44e513a3 586To require a trustchain public key strength for the remote side, specify the
7c4214bd
MW
587key type followed by the minimum strength in bits (for example
588.BR ecdsa-384
44e513a3 589or
7c4214bd
MW
590.BR rsa-2048-ecdsa-256 ).
591To limit the acceptable set of hashing algorithms for trustchain validation,
592append hash algorithms to
593.BR pubkey
594or a key strength definition (for example
595.BR pubkey-sha1-sha256
596or
597.BR rsa-2048-ecdsa-256-sha256-sha384-sha512 ).
44e513a3 598For
72970b45 599.BR eap ,
a44bb934 600an optional EAP method can be appended. Currently defined methods are
f115838b
TB
601.BR eap-aka ,
602.BR eap-gtc ,
603.BR eap-md5 ,
0293f095
AS
604.BR eap-mschapv2 ,
605.BR eap-peap ,
606.BR eap-sim ,
21079538 607.BR eap-tls ,
b24be296 608.BR eap-ttls ,
5f6ef5d5 609.BR eap-dynamic ,
a44bb934 610and
c8d46f29 611.BR eap-radius .
a44bb934
MW
612Alternatively, IANA assigned EAP method numbers are accepted. Vendor specific
613EAP methods are defined in the form
614.B eap-type-vendor
f115838b 615.RB "(e.g. " eap-7-12345 ).
75e3d90d
MW
616For
617.B xauth,
66e12b92 618an XAuth authentication backend can be specified, such as
75e3d90d
MW
619.B xauth-generic
620or
66e12b92 621.BR xauth-eap .
75e3d90d
MW
622If XAuth is used in
623.BR leftauth ,
624Hybrid authentication is used. For traditional XAuth authentication, define
625XAuth in
626.BR lefauth2 .
a44bb934 627.TP
6bcf6016 628.BR leftauth2 " = <auth method>"
8015c91c 629Same as
f115838b 630.BR leftauth ,
75e3d90d
MW
631but defines an additional authentication exchange. In IKEv1, only XAuth can be
632used in the second authentication round. IKEv2 supports multiple complete
a44bb934 633authentication rounds using "Multiple Authentication Exchanges" defined
72970b45 634in RFC 4739. This allows, for example, separated authentication
75e3d90d 635of host and user.
a44bb934 636.TP
6bcf6016 637.BR leftca " = <issuer dn> | %same"
fea5e716
MW
638the distinguished name of a certificate authority which is required to
639lie in the trust path going from the left participant's certificate up
8015c91c 640to the root certification authority.
72970b45
TB
641.B %same
642means that the value configured for the right participant should be reused.
fea5e716 643.TP
6bcf6016 644.BR leftca2 " = <issuer dn> | %same"
a44bb934 645Same as
6bcf6016 646.BR leftca ,
a44bb934
MW
647but for the second authentication round (IKEv2 only).
648.TP
6bcf6016 649.BR leftcert " = <path>"
f115838b
TB
650the path to the left participant's X.509 certificate. The file can be encoded
651either in PEM or DER format. OpenPGP certificates are supported as well.
7900ab1b 652Both absolute paths or paths relative to \fI/etc/ipsec.d/certs\fP
fea5e716
MW
653are accepted. By default
654.B leftcert
8015c91c 655sets
fea5e716 656.B leftid
72970b45 657to the distinguished name of the certificate's subject.
84545f6e 658The left participant's ID can be overridden by specifying a
fea5e716
MW
659.B leftid
660value which must be certified by the certificate, though.
05e266ea
MW
661.br
662A value in the form
f6d8fb36 663.B %smartcard[<slot nr>[@<module>]]:<keyid>
05e266ea 664defines a specific certificate to load from a PKCS#11 backend for this
f6d8fb36 665connection. See ipsec.secrets(5) for details about smartcard definitions.
05e266ea
MW
666.B leftcert
667is required only if selecting the certificate with
668.B leftid
669is not sufficient, for example if multiple certificates use the same subject.
11a7abf5
MW
670.br
671Multiple certificate paths or PKCS#11 backends can be specified in a comma
672separated list. The daemon chooses the certificate based on the received
673certificate requests if possible before enforcing the first.
fea5e716 674.TP
6bcf6016 675.BR leftcert2 " = <path>"
a44bb934
MW
676Same as
677.B leftcert,
678but for the second authentication round (IKEv2 only).
679.TP
6367de28 680.BR leftcertpolicy " = <OIDs>"
66e12b92
TB
681Comma separated list of certificate policy OIDs the peer's certificate must
682have.
683OIDs are specified using the numerical dotted representation.
6367de28 684.TP
c60f1da4
MW
685.BR leftdns " = <servers>"
686Comma separated list of DNS server addresses to exchange as configuration
72970b45
TB
687attributes. On the initiator, a server is a fixed IPv4/IPv6 address, or
688.BR %config4 / %config6
c60f1da4 689to request attributes without an address. On the responder,
72970b45 690only fixed IPv4/IPv6 addresses are allowed and define DNS servers assigned
c60f1da4
MW
691to the client.
692.TP
6bcf6016 693.BR leftfirewall " = yes | " no
c2bc2b27
AS
694whether the left participant is doing forwarding-firewalling
695(including masquerading) using iptables for traffic from \fIleftsubnet\fR,
696which should be turned off (for traffic to the other subnet)
697once the connection is established;
698acceptable values are
699.B yes
700and
701.B no
702(the default).
703May not be used in the same connection description with
704.BR leftupdown .
705Implemented as a parameter to the default \fBipsec _updown\fR script.
706See notes below.
707Relevant only locally, other end need not agree on it.
708
709If one or both security gateways are doing forwarding firewalling
710(possibly including masquerading),
711and this is specified using the firewall parameters,
712tunnels established with IPsec are exempted from it
713so that packets can flow unchanged through the tunnels.
714(This means that all subnets connected in this manner must have
715distinct, non-overlapping subnet address blocks.)
75e3d90d 716This is done by the default \fBipsec _updown\fR script.
c2bc2b27
AS
717
718In situations calling for more control,
719it may be preferable for the user to supply his own
720.I updown
721script,
722which makes the appropriate adjustments for his system.
723.TP
6bcf6016 724.BR leftgroups " = <group list>"
c2bc2b27
AS
725a comma separated list of group names. If the
726.B leftgroups
727parameter is present then the peer must be a member of at least one
75e3d90d 728of the groups defined by the parameter.
c2bc2b27 729.TP
46df61df
MW
730.BR leftgroups2 " = <group list>"
731Same as
732.B leftgroups,
733but for the second authentication round defined with
734.B leftauth2.
735.TP
6bcf6016 736.BR lefthostaccess " = yes | " no
c2bc2b27
AS
737inserts a pair of INPUT and OUTPUT iptables rules using the default
738\fBipsec _updown\fR script, thus allowing access to the host itself
739in the case where the host's internal interface is part of the
740negotiated client subnet.
741Acceptable values are
742.B yes
743and
744.B no
745(the default).
746.TP
6bcf6016 747.BR leftid " = <id>"
f115838b 748how the left participant should be identified for authentication;
c2bc2b27 749defaults to
66e12b92
TB
750.B left
751or the subject of the certificate configured with
752.BR leftcert .
753Can be an IP address, a fully-qualified domain name, an email address, or
72970b45
TB
754a keyid. If
755.B leftcert
756is configured the identity has to be confirmed by the certificate.
b7a500e9
TB
757
758For IKEv2 and
759.B rightid
760the prefix
761.B %
762in front of the identity prevents the daemon from sending IDr in its IKE_AUTH
763request and will allow it to verify the configured identity against the subject
764and subjectAltNames contained in the responder's certificate (otherwise it is
765only compared with the IDr returned by the responder). The IDr sent by the
766initiator might otherwise prevent the responder from finding a config if it
767has configured a different value for
768.BR leftid .
c2bc2b27 769.TP
6bcf6016 770.BR leftid2 " = <id>"
a44bb934
MW
771identity to use for a second authentication for the left participant
772(IKEv2 only); defaults to
773.BR leftid .
774.TP
6bcf6016 775.BR leftikeport " = <port>"
75e3d90d
MW
776UDP port the left participant uses for IKE communication.
777If unspecified, port 500 is used with the port floating
f115838b 778to 4500 if a NAT is detected or MOBIKE is enabled. Specifying a local IKE port
667b7372 779different from the default additionally requires a socket implementation that
72970b45 780listens on this port.
667b7372 781.TP
6bcf6016 782.BR leftprotoport " = <protocol>/<port>"
24df0678
MW
783restrict the traffic selector to a single protocol and/or port. This option
784is now deprecated, protocol/port information can be defined for each subnet
785directly in
786.BR leftsubnet .
7900ab1b 787.TP
87692be2
TB
788.BR leftsigkey " = <raw public key> | <path to public key>"
789the left participant's public key for public key signature authentication,
790in PKCS#1 format using hex (0x prefix) or base64 (0s prefix) encoding. With the
791optional
fa1d3d39
TB
792.B dns:
793or
794.B ssh:
795prefix in front of 0x or 0s, the public key is expected to be in either
87692be2
TB
796the RFC 3110 (not the full RR, only RSA key part) or RFC 4253 public key format,
797respectively.
fa1d3d39
TB
798Also accepted is the path to a file containing the public key in PEM or DER
799encoding.
66e12b92 800.TP
6bcf6016 801.BR leftsendcert " = never | no | " ifasked " | always | yes"
c2bc2b27
AS
802Accepted values are
803.B never
804or
805.BR no ,
806.B always
807or
808.BR yes ,
809and
a5477a6f 810.BR ifasked " (the default),"
f115838b
TB
811the latter meaning that the peer must send a certificate request payload in
812order to get a certificate in return.
fea5e716 813.TP
26bc6958
MW
814.BR leftsourceip " = %config4 | %config6 | <ip address>"
815Comma separated list of internal source IPs to use in a tunnel, also known as
816virtual IP. If the value is one of the synonyms
7900ab1b 817.BR %config ,
f115838b 818.BR %cfg ,
a5477a6f
TB
819.BR %modeconfig ,
820or
821.BR %modecfg ,
72970b45
TB
822an address (from the tunnel address family) is requested from the peer. With
823.B %config4
824and
825.B %config6
826an address of the given address family will be requested explicitly.
827If an IP address is configured, it will be requested from the responder,
828which is free to respond with a different address.
8e79d8d3 829.TP
6bcf6016 830.BR rightsourceip " = %config | <network>/<netmask> | %poolname"
26bc6958
MW
831Comma separated list of internal source IPs to use in a tunnel for the remote
832peer. If the value is
8e79d8d3 833.B %config
f115838b
TB
834on the responder side, the initiator must propose an address which is then
835echoed back. Also supported are address pools expressed as
b0103105 836\fInetwork\fB/\fInetmask\fR
f115838b
TB
837or the use of an external IP address pool using %\fIpoolname\fR,
838where \fIpoolname\fR is the name of the IP address pool used for the lookup.
fea5e716 839.TP
b7b5432f 840.BR leftsubnet " = <ip subnet>[[<proto/port>]][,...]"
c2bc2b27 841private subnet behind the left participant, expressed as
f115838b 842\fInetwork\fB/\fInetmask\fR;
c2bc2b27
AS
843if omitted, essentially assumed to be \fIleft\fB/32\fR,
844signifying that the left end of the connection goes to the left participant
66e12b92 845only. Configured subnets of the peers may differ, the protocol narrows it to
75e3d90d
MW
846the greatest common subnet. In IKEv1, this may lead to problems with other
847implementations, make sure to configure identical subnets in such
55f126fd
MW
848configurations. IKEv2 supports multiple subnets separated by commas. IKEv1 only
849interprets the first subnet of such a definition, unless the Cisco Unity
850extension plugin is enabled.
24df0678 851
b7b5432f
TB
852The optional part after each subnet enclosed in square brackets specifies a
853protocol/port to restrict the selector for that subnet.
24df0678 854
b7b5432f
TB
855Examples:
856.BR leftsubnet=10.0.0.1[tcp/http],10.0.0.2[6/80] " or"
857.BR leftsubnet=fec1::1[udp],10.0.0.0/16[/53] .
24df0678
MW
858Instead of omitting either value
859.B %any
860can be used to the same effect, e.g.
b7b5432f 861.BR leftsubnet=fec1::1[udp/%any],10.0.0.0/16[%any/53] .
24df0678 862
69560611
TB
863If the protocol is
864.B icmp
865or
866.B ipv6-icmp
867the port is interpreted as ICMP message type if it is less than 256 or as type
868and code if it is greater or equal to 256, with the type in the most significant
8698 bits and the code in the least significant 8 bits.
870
24df0678
MW
871The port value can alternatively take the value
872.B %opaque
873for RFC 4301 OPAQUE selectors, or a numerical range in the form
874.BR 1024-65535 .
875None of the kernel backends currently supports opaque or port ranges and uses
876.B %any
877for policy installation instead.
878
879Instead of specifying a subnet,
880.B %dynamic
881can be used to replace it with the IKE address, having the same effect
882as omitting
883.B leftsubnet
884completely. Using
885.B %dynamic
886can be used to define multiple dynamic selectors, each having a potentially
0ceb2888 887different protocol/port definition.
24df0678 888
c2bc2b27 889.TP
6bcf6016 890.BR leftupdown " = <path>"
c2bc2b27
AS
891what ``updown'' script to run to adjust routing and/or firewalling
892when the status of the connection
893changes (default
894.BR "ipsec _updown" ).
895May include positional parameters separated by white space
896(although this requires enclosing the whole string in quotes);
897including shell metacharacters is unwise.
75e3d90d 898Relevant only locally, other end need not agree on it. Charon uses the updown
f115838b 899script to insert firewall rules only, since routing has been implemented
75e3d90d 900directly into the daemon.
c2bc2b27 901.TP
6bcf6016 902.BR lifebytes " = <number>"
75e3d90d 903the number of bytes transmitted over an IPsec SA before it expires.
deddfde9 904.TP
6bcf6016 905.BR lifepackets " = <number>"
75e3d90d 906the number of packets transmitted over an IPsec SA before it expires.
deddfde9 907.TP
6bcf6016 908.BR lifetime " = " 1h " | <time>"
deddfde9
TB
909how long a particular instance of a connection
910(a set of encryption/authentication keys for user packets) should last,
911from successful negotiation to expiry;
912acceptable values are an integer optionally followed by
913.BR s
914(a time in seconds)
915or a decimal number followed by
916.BR m ,
917.BR h ,
918or
919.B d
920(a time
921in minutes, hours, or days respectively)
922(default
923.BR 1h ,
924maximum
925.BR 24h ).
926Normally, the connection is renegotiated (via the keying channel)
927before it expires (see
928.BR margintime ).
929The two ends need not exactly agree on
930.BR lifetime ,
931although if they do not,
932there will be some clutter of superseded connections on the end
9f8ceffb 933which thinks the lifetime is longer. Also see EXPIRY/REKEY below.
deddfde9 934.TP
6bcf6016 935.BR marginbytes " = <number>"
deddfde9
TB
936how many bytes before IPsec SA expiry (see
937.BR lifebytes )
75e3d90d 938should attempts to negotiate a replacement begin.
deddfde9 939.TP
6bcf6016 940.BR marginpackets " = <number>"
deddfde9
TB
941how many packets before IPsec SA expiry (see
942.BR lifepackets )
75e3d90d 943should attempts to negotiate a replacement begin.
deddfde9 944.TP
6bcf6016 945.BR margintime " = " 9m " | <time>"
deddfde9
TB
946how long before connection expiry or keying-channel expiry
947should attempts to
948negotiate a replacement
949begin; acceptable values as for
950.B lifetime
951(default
952.BR 9m ).
9f8ceffb
TB
953Relevant only locally, other end need not agree on it. Also see EXPIRY/REKEY
954below.
d5f29da3 955.TP
6bcf6016
TB
956.BR mark " = <value>[/<mask>]"
957sets an XFRM mark in the inbound and outbound
3255e489 958IPsec SAs and policies. If the mask is missing then a default
d5f29da3
AS
959mask of
960.B 0xffffffff
961is assumed.
962.TP
6bcf6016
TB
963.BR mark_in " = <value>[/<mask>]"
964sets an XFRM mark in the inbound IPsec SA and
a674c79a 965policy. If the mask is missing then a default mask of
d5f29da3
AS
966.B 0xffffffff
967is assumed.
968.TP
6bcf6016
TB
969.BR mark_out " = <value>[/<mask>]"
970sets an XFRM mark in the outbound IPsec SA and
a674c79a 971policy. If the mask is missing then a default mask of
d5f29da3
AS
972.B 0xffffffff
973is assumed.
deddfde9 974.TP
6bcf6016 975.BR mobike " = " yes " | no"
8c4339bd
AS
976enables the IKEv2 MOBIKE protocol defined by RFC 4555. Accepted values are
977.B yes
978(the default) and
979.BR no .
980If set to
981.BR no ,
75e3d90d 982the charon daemon will not actively propose MOBIKE as initiator and
78279973 983ignore the MOBIKE_SUPPORTED notify as responder.
8c4339bd 984.TP
6bcf6016 985.BR modeconfig " = push | " pull
7900ab1b
AS
986defines which mode is used to assign a virtual IP.
987Accepted values are
988.B push
989and
990.B pull
991(the default).
16149401 992Push mode is currently not supported with IKEv2.
fea5e716 993.TP
6bcf6016 994.BR reauth " = " yes " | no"
c2bc2b27
AS
995whether rekeying of an IKE_SA should also reauthenticate the peer. In IKEv1,
996reauthentication is always done. In IKEv2, a value of
997.B no
998rekeys without uninstalling the IPsec SAs, a value of
999.B yes
1000(the default) creates a new IKE_SA from scratch and tries to recreate
1001all IPsec SAs.
1002.TP
6bcf6016 1003.BR rekey " = " yes " | no"
fea5e716
MW
1004whether a connection should be renegotiated when it is about to expire;
1005acceptable values are
1006.B yes
1007(the default)
1008and
1009.BR no .
7900ab1b 1010The two ends need not agree, but while a value of
fea5e716 1011.B no
75e3d90d 1012prevents charon from requesting renegotiation,
fea5e716
MW
1013it does not prevent responding to renegotiation requested from the other end,
1014so
1015.B no
66e12b92
TB
1016will be largely ineffective unless both ends agree on it. Also see
1017.BR reauth .
fea5e716 1018.TP
6bcf6016 1019.BR rekeyfuzz " = " 100% " | <percentage>"
fea5e716 1020maximum percentage by which
deddfde9
TB
1021.BR marginbytes ,
1022.B marginpackets
1023and
1024.B margintime
fea5e716
MW
1025should be randomly increased to randomize rekeying intervals
1026(important for hosts with many connections);
1027acceptable values are an integer,
1028which may exceed 100,
1029followed by a `%'
deddfde9 1030(defaults to
fea5e716
MW
1031.BR 100% ).
1032The value of
deddfde9 1033.BR marginTYPE ,
fea5e716
MW
1034after this random increase,
1035must not exceed
deddfde9
TB
1036.B lifeTYPE
1037(where TYPE is one of
1038.IR bytes ,
1039.I packets
1040or
1041.IR time ).
fea5e716
MW
1042The value
1043.B 0%
deddfde9 1044will suppress randomization.
9f8ceffb
TB
1045Relevant only locally, other end need not agree on it. Also see EXPIRY/REKEY
1046below.
fea5e716
MW
1047.TP
1048.B rekeymargin
deddfde9
TB
1049synonym for
1050.BR margintime .
532f2347 1051.TP
8b123d2e
TB
1052.BR replay_window " = " \-1 " | <number>"
1053The IPsec replay window size for this connection. With the default of \-1
1054the value configured with
1055.I charon.replay_window
1056in
1057.BR strongswan.conf (5)
1058is used. Larger values than 32 are supported using the Netlink backend only,
1059a value of 0 disables IPsec replay protection.
1060.TP
6bcf6016 1061.BR reqid " = <number>"
b5be105a 1062sets the reqid for a given connection to a pre-configured fixed value.
a729d17a 1063.TP
6c302616
MW
1064.BR tfc " = <value>"
1065number of bytes to pad ESP payload data to. Traffic Flow Confidentiality
1066is currently supported in IKEv2 and applies to outgoing packets only. The
1067special value
1068.BR %mtu
1069fills up ESP packets with padding to have the size of the MTU.
1070.TP
6bcf6016 1071.BR type " = " tunnel " | transport | transport_proxy | passthrough | drop"
c2bc2b27
AS
1072the type of the connection; currently the accepted values
1073are
1074.B tunnel
1075(the default)
1076signifying a host-to-host, host-to-subnet, or subnet-to-subnet tunnel;
1077.BR transport ,
1078signifying host-to-host transport mode;
84bec926
AS
1079.BR transport_proxy ,
1080signifying the special Mobile IPv6 transport proxy mode;
c2bc2b27
AS
1081.BR passthrough ,
1082signifying that no IPsec processing should be done at all;
1083.BR drop ,
75e3d90d 1084signifying that packets should be discarded.
fea5e716 1085.TP
6bcf6016 1086.BR xauth " = " client " | server"
b768d6a4 1087specifies the role in the XAuth protocol if activated by
c2bc2b27
AS
1088.B authby=xauthpsk
1089or
1090.B authby=xauthrsasig.
1091Accepted values are
1092.B server
1093and
1094.B client
1095(the default).
b768d6a4
TB
1096.TP
1097.BR xauth_identity " = <id>"
1098defines the identity/username the client uses to reply to an XAuth request.
1099If not defined, the IKEv1 identity will be used as XAuth identity.
d5cc1758 1100
e74bc8e5 1101.SS "CONN PARAMETERS: IKEv2 MEDIATION EXTENSION"
8015c91c 1102The following parameters are relevant to IKEv2 Mediation Extension
e74bc8e5 1103operation only.
6bcf6016
TB
1104.TP
1105.BR mediation " = yes | " no
e74bc8e5 1106whether this connection is a mediation connection, ie. whether this
d5cc1758
TB
1107connection is used to mediate other connections. Mediation connections
1108create no child SA. Acceptable values are
1109.B no
1110(the default) and
1111.BR yes .
1112.TP
6bcf6016 1113.BR mediated_by " = <name>"
d5cc1758
TB
1114the name of the connection to mediate this connection through. If given,
1115the connection will be mediated through the named mediation connection.
1116The mediation connection must set
e74bc8e5 1117.BR mediation=yes .
d5cc1758 1118.TP
6bcf6016 1119.BR me_peerid " = <id>"
d5cc1758
TB
1120ID as which the peer is known to the mediation server, ie. which the other
1121end of this connection uses as its
1122.B leftid
1123on its connection to the mediation server. This is the ID we request the
1124mediation server to mediate us with. If
e74bc8e5 1125.B me_peerid
d5cc1758
TB
1126is not given, the
1127.B rightid
1128of this connection will be used as peer ID.
1129
fea5e716 1130.SH "CA SECTIONS"
bf3c3715
TB
1131These are optional sections that can be used to assign special
1132parameters to a Certification Authority (CA). Because the daemons
1133automatically import CA certificates from \fI/etc/ipsec.d/cacerts\fP,
1134there is no need to explicitly add them with a CA section, unless you
1135want to assign special parameters (like a CRL) to a CA.
6bcf6016 1136.TP
a5477a6f
TB
1137.BR also " = <name>"
1138includes ca section
1139.BR <name> .
1140.TP
6bcf6016 1141.BR auto " = " ignore " | add"
fea5e716
MW
1142currently can have either the value
1143.B ignore
6bcf6016
TB
1144(the default) or
1145.BR add .
fea5e716 1146.TP
6bcf6016 1147.BR cacert " = <path>"
8015c91c 1148defines a path to the CA certificate either relative to
fea5e716 1149\fI/etc/ipsec.d/cacerts\fP or as an absolute path.
f6d8fb36
MW
1150.br
1151A value in the form
1152.B %smartcard[<slot nr>[@<module>]]:<keyid>
1153defines a specific CA certificate to load from a PKCS#11 backend for this CA.
1154See ipsec.secrets(5) for details about smartcard definitions.
fea5e716 1155.TP
6bcf6016 1156.BR crluri " = <uri>"
fea5e716
MW
1157defines a CRL distribution point (ldap, http, or file URI)
1158.TP
7900ab1b
AS
1159.B crluri1
1160synonym for
1161.B crluri.
1162.TP
6bcf6016 1163.BR crluri2 " = <uri>"
fea5e716
MW
1164defines an alternative CRL distribution point (ldap, http, or file URI)
1165.TP
fea5e716 1166.TP
6bcf6016 1167.BR ocspuri " = <uri>"
fea5e716 1168defines an OCSP URI.
7900ab1b
AS
1169.TP
1170.B ocspuri1
1171synonym for
1172.B ocspuri.
1173.TP
6bcf6016 1174.BR ocspuri2 " = <uri>"
75e3d90d 1175defines an alternative OCSP URI.
f115838b 1176.TP
6bcf6016 1177.BR certuribase " = <uri>"
6439267a 1178defines the base URI for the Hash and URL feature supported by IKEv2.
72970b45 1179Instead of exchanging complete certificates, IKEv2 allows one to send an URI
6439267a
TB
1180that resolves to the DER encoded certificate. The certificate URIs are built
1181by appending the SHA1 hash of the DER encoded certificates to this base URI.
fea5e716
MW
1182.SH "CONFIG SECTIONS"
1183At present, the only
1184.B config
1185section known to the IPsec software is the one named
1186.BR setup ,
f115838b 1187which contains information used when the software is being started.
fea5e716
MW
1188The currently-accepted
1189.I parameter
1190names in a
1191.B config
1192.B setup
75e3d90d 1193section are:
fea5e716 1194.TP
72970b45
TB
1195.BR cachecrls " = yes | " no
1196if enabled, certificate revocation lists (CRLs) fetched via HTTP or LDAP will
1197be cached in
1198.I /etc/ipsec.d/crls/
1199under a unique file name derived from the certification authority's public key.
1200.TP
1201.BR charondebug " = <debug list>"
1202how much charon debugging output should be logged.
1203A comma separated list containing type/level-pairs may
1204be specified, e.g:
1205.B dmn 3, ike 1, net -1.
1206Acceptable values for types are
1207.B dmn, mgr, ike, chd, job, cfg, knl, net, asn, enc, lib, esp, tls,
1208.B tnc, imc, imv, pts
1209and the level is one of
1210.B -1, 0, 1, 2, 3, 4
1211(for silent, audit, control, controlmore, raw, private). By default, the level
1212is set to
1213.B 1
1214for all types. For more flexibility see LOGGER CONFIGURATION in
1215.IR strongswan.conf (5).
1216.TP
6bcf6016
TB
1217.BR strictcrlpolicy " = yes | ifuri | " no
1218defines if a fresh CRL must be available in order for the peer authentication
1219based on RSA signatures to succeed.
e0e7ef07
AS
1220IKEv2 additionally recognizes
1221.B ifuri
1222which reverts to
1223.B yes
1224if at least one CRL URI is defined and to
1225.B no
1226if no URI is known.
b360e393 1227.TP
f4cc7ea1 1228.BR uniqueids " = " yes " | no | never | replace | keep"
b360e393 1229whether a particular participant ID should be kept unique,
f4cc7ea1 1230with any new IKE_SA using an ID deemed to replace all old ones using that ID;
b360e393 1231acceptable values are
72970b45
TB
1232.B yes
1233(the default),
f4cc7ea1 1234.B no
b360e393 1235and
f4cc7ea1
TB
1236.BR never .
1237Participant IDs normally \fIare\fR unique, so a new IKE_SA using the same ID is
1238almost invariably intended to replace an old one. The difference between
1239.B no
1240and
1241.B never
72970b45
TB
1242is that the daemon will replace old IKE_SAs when receiving an INITIAL_CONTACT
1243notify if the option is
f4cc7ea1
TB
1244.B no
1245but will ignore these notifies if
1246.B never
1247is configured.
75e3d90d 1248The daemon also accepts the value
b360e393 1249.B replace
f3bb1bd0 1250which is identical to
b360e393
MW
1251.B yes
1252and the value
1253.B keep
1254to reject new IKE_SA setups and keep the duplicate established earlier.
a5477a6f 1255
75e3d90d 1256.SH SA EXPIRY/REKEY
9f8ceffb
TB
1257The IKE SAs and IPsec SAs negotiated by the daemon can be configured to expire
1258after a specific amount of time. For IPsec SAs this can also happen after a
1259specified number of transmitted packets or transmitted bytes. The following
1260settings can be used to configure this:
1261.TS
1262l r l r,- - - -,lB s lB s,a r a r.
1263Setting Default Setting Default
1264IKE SA IPsec SA
1265ikelifetime 3h lifebytes -
1266 lifepackets -
1267 lifetime 1h
1268.TE
1269.SS Rekeying
1270IKE SAs as well as IPsec SAs can be rekeyed before they expire. This can be
1271configured using the following settings:
1272.TS
1273l r l r,- - - -,lB s lB s,a r a r.
1274Setting Default Setting Default
1275IKE and IPsec SA IPsec SA
1276margintime 9m marginbytes -
1277 marginpackets -
1278.TE
1279.SS Randomization
1280To avoid collisions the specified margins are increased randomly before
1281subtracting them from the expiration limits (see formula below). This is
1282controlled by the
1283.B rekeyfuzz
1284setting:
1285.TS
1286l r,- -,lB s,a r.
1287Setting Default
1288IKE and IPsec SA
1289rekeyfuzz 100%
1290.TE
1291.PP
1292Randomization can be disabled by setting
1293.BR rekeyfuzz " to " 0% .
1294.SS Formula
1295The following formula is used to calculate the rekey time of IPsec SAs:
1296.PP
1297.EX
1298 rekeytime = lifetime - (margintime + random(0, margintime * rekeyfuzz))
1299.EE
1300.PP
1301It applies equally to IKE SAs and byte and packet limits for IPsec SAs.
1302.SS Example
1303Let's consider the default configuration:
1304.PP
1305.EX
1306 lifetime = 1h
1307 margintime = 9m
1308 rekeyfuzz = 100%
1309.EE
1310.PP
1311From the formula above follows that the rekey time lies between:
1312.PP
1313.EX
1314 rekeytime_min = 1h - (9m + 9m) = 42m
1315 rekeytime_max = 1h - (9m + 0m) = 51m
1316.EE
1317.PP
1318Thus, the daemon will attempt to rekey the IPsec SA at a random time
1319between 42 and 51 minutes after establishing the SA. Or, in other words,
1320between 9 and 18 minutes before the SA expires.
1321.SS Notes
1322.IP \[bu]
1323Since the rekeying of an SA needs some time, the margin values must not be
1324too low.
1325.IP \[bu]
1326The value
1327.B margin... + margin... * rekeyfuzz
1328must not exceed the original limit. For example, specifying
1329.B margintime = 30m
1330in the default configuration is a bad idea as there is a chance that the rekey
1331time equals zero and, thus, rekeying gets disabled.
fea5e716
MW
1332.SH FILES
1333.nf
1334/etc/ipsec.conf
7900ab1b
AS
1335/etc/ipsec.d/aacerts
1336/etc/ipsec.d/acerts
fea5e716
MW
1337/etc/ipsec.d/cacerts
1338/etc/ipsec.d/certs
1339/etc/ipsec.d/crls
fea5e716
MW
1340
1341.SH SEE ALSO
75e3d90d 1342strongswan.conf(5), ipsec.secrets(5), ipsec(8)
fea5e716 1343.SH HISTORY
f115838b
TB
1344Originally written for the FreeS/WAN project by Henry Spencer.
1345Updated and extended for the strongSwan project <http://www.strongswan.org> by
1346Tobias Brunner, Andreas Steffen and Martin Willi.