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