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