]> git.ipfire.org Git - thirdparty/strongswan.git/blob - man/ipsec.conf.5.in
Add uniqueids=never to ignore INITIAL_CONTACT notifies
[thirdparty/strongswan.git] / man / ipsec.conf.5.in
1 .TH IPSEC.CONF 5 "2012-06-26" "@IPSEC_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 also " = <name>"
237 includes conn section
238 .BR <name> .
239 .TP
240 .BR authby " = " pubkey " | rsasig | ecdsasig | psk | secret | never | xauthpsk | xauthrsasig"
241 how the two security gateways should authenticate each other;
242 acceptable values are
243 .B psk
244 or
245 .B secret
246 for pre-shared secrets,
247 .B pubkey
248 (the default) for public key signatures as well as the synonyms
249 .B rsasig
250 for RSA digital signatures and
251 .B ecdsasig
252 for Elliptic Curve DSA signatures.
253 .B never
254 can be used if negotiation is never to be attempted or accepted (useful for
255 shunt-only conns).
256 Digital signatures are superior in every way to shared secrets.
257 IKEv1 additionally supports the values
258 .B xauthpsk
259 and
260 .B xauthrsasig
261 that will enable eXtended AUTHentication (XAUTH) in addition to IKEv1 main mode
262 based on shared secrets or digital RSA signatures, respectively.
263 This parameter is deprecated, as two peers do not need to agree on an
264 authentication method in IKEv2. Use the
265 .B leftauth
266 parameter instead to define authentication methods.
267 .TP
268 .BR auto " = " ignore " | add | route | start"
269 what operation, if any, should be done automatically at IPsec startup;
270 currently-accepted values are
271 .BR add ,
272 .BR route ,
273 .B start
274 and
275 .B ignore
276 (the default).
277 .B add
278 loads a connection without starting it.
279 .B route
280 loads a connection and installs kernel traps. If traffic is detected between
281 .B leftsubnet
282 and
283 .B rightsubnet
284 , a connection is established.
285 .B start
286 loads a connection and brings it up immediately.
287 .B ignore
288 ignores the connection. This is equal to delete a connection from the config
289 file.
290 Relevant only locally, other end need not agree on it.
291 .TP
292 .BR closeaction " = " none " | clear | hold | restart"
293 defines the action to take if the remote peer unexpectedly closes a CHILD_SA
294 (see
295 .B dpdaction
296 for meaning of values).
297 A
298 .B closeaction should not be
299 used if the peer uses reauthentication or uniquids checking, as these events
300 might trigger the defined action when not desired. Currently not supported with
301 IKEv1.
302 .TP
303 .BR compress " = yes | " no
304 whether IPComp compression of content is proposed on the connection
305 (link-level compression does not work on encrypted data,
306 so to be effective, compression must be done \fIbefore\fR encryption);
307 acceptable values are
308 .B yes
309 and
310 .B no
311 (the default). A value of
312 .B yes
313 causes the daemon to propose both compressed and uncompressed,
314 and prefer compressed.
315 A value of
316 .B no
317 prevents the daemon from proposing or accepting compression.
318 .TP
319 .BR dpdaction " = " none " | clear | hold | restart"
320 controls the use of the Dead Peer Detection protocol (DPD, RFC 3706) where
321 R_U_THERE notification messages (IKEv1) or empty INFORMATIONAL messages (IKEv2)
322 are periodically sent in order to check the
323 liveliness of the IPsec peer. The values
324 .BR clear ,
325 .BR hold ,
326 and
327 .B restart
328 all activate DPD. If no activity is detected, all connections with a dead peer
329 are stopped and unrouted
330 .RB ( clear ),
331 put in the hold state
332 .RB ( hold )
333 or restarted
334 .RB ( restart ).
335 The default is
336 .B none
337 which disables the active sending of DPD messages.
338 .TP
339 .BR dpddelay " = " 30s " | <time>"
340 defines the period time interval with which R_U_THERE messages/INFORMATIONAL
341 exchanges are sent to the peer. These are only sent if no other traffic is
342 received. In IKEv2, a value of 0 sends no additional INFORMATIONAL
343 messages and uses only standard messages (such as those to rekey) to detect
344 dead peers.
345 .TP
346 .BR dpdtimeout " = " 150s " | <time>
347 defines the timeout interval, after which all connections to a peer are deleted
348 in case of inactivity. This only applies to IKEv1, in IKEv2 the default
349 retransmission timeout applies, as every exchange is used to detect dead peers.
350 .TP
351 .BR inactivity " = <time>"
352 defines the timeout interval, after which a CHILD_SA is closed if it did
353 not send or receive any traffic.
354 .TP
355 .BR eap_identity " = <id>"
356 defines the identity the client uses to reply to a EAP Identity request.
357 If defined on the EAP server, the defined identity will be used as peer
358 identity during EAP authentication. The special value
359 .B %identity
360 uses the EAP Identity method to ask the client for an EAP identity. If not
361 defined, the IKEv2 identity will be used as EAP identity.
362 .TP
363 .BR esp " = <cipher suites>"
364 comma-separated list of ESP encryption/authentication algorithms to be used
365 for the connection, e.g.
366 .BR aes128-sha256 .
367 The notation is
368 .BR encryption-integrity[-dhgroup][-esnmode] .
369 .br
370 Defaults to
371 .BR aes128-sha1,3des-sha1 .
372 The daemon adds its extensive default proposal to this default
373 or the configured value. To restrict it to the configured proposal an
374 exclamation mark
375 .RB ( ! )
376 can be added at the end.
377 .br
378 .BR Note :
379 As a responder the daemon accepts the first supported proposal received from
380 the peer. In order to restrict a responder to only accept specific cipher
381 suites, the strict flag
382 .RB ( ! ,
383 exclamation mark) can be used, e.g: aes256-sha512-modp4096!
384 .br
385 If
386 .B dh-group
387 is specified, CHILD_SA/Quick Mode setup and rekeying include a separate
388 Diffie-Hellman exchange. Valid values for
389 .B esnmode
390 (IKEv2 only) are
391 .B esn
392 and
393 .BR noesn .
394 Specifying both negotiates Extended Sequence Number support with the peer,
395 the default is
396 .B noesn.
397 .TP
398 .BR forceencaps " = yes | " no
399 force UDP encapsulation for ESP packets even if no NAT situation is detected.
400 This may help to surmount restrictive firewalls. In order to force the peer to
401 encapsulate packets, NAT detection payloads are faked.
402 .TP
403 .BR ike " = <cipher suites>"
404 comma-separated list of IKE/ISAKMP SA encryption/authentication algorithms
405 to be used, e.g.
406 .BR aes128-sha1-modp2048 .
407 The notation is
408 .BR encryption-integrity-dhgroup .
409 In IKEv2, multiple algorithms and proposals may be included, such as
410 aes128-aes256-sha1-modp1536-modp2048,3des-sha1-md5-modp1024.
411 .br
412 Defaults to
413 .B aes128-sha1-modp2048,3des-sha1-modp1536 .
414 The daemon adds its extensive default proposal to this
415 default or the configured value. To restrict it to the configured proposal an
416 exclamation mark
417 .RB ( ! )
418 can be added at the end.
419 .br
420 .BR Note :
421 As a responder the daemon accepts the first supported proposal received from
422 the peer. In order to restrict a responder to only accept specific cipher
423 suites, the strict flag
424 .BR ( ! ,
425 exclamation mark) can be used, e.g: aes256-sha512-modp4096!
426 .TP
427 .BR ikelifetime " = " 3h " | <time>"
428 how long the keying channel of a connection (ISAKMP or IKE SA)
429 should last before being renegotiated. Also see EXPIRY/REKEY below.
430 .TP
431 .BR installpolicy " = " yes " | no"
432 decides whether IPsec policies are installed in the kernel by the charon daemon
433 for a given connection. Allows peaceful cooperation e.g. with
434 the Mobile IPv6 daemon mip6d who wants to control the kernel policies.
435 Acceptable values are
436 .B yes
437 (the default) and
438 .BR no .
439 .TP
440 .BR keyexchange " = " ike " | ikev1 | ikev2"
441 method of key exchange;
442 which protocol should be used to initialize the connection. Connections marked with
443 .B ike
444 use IKEv2 when initiating, but accept any protocol version when responding.
445 .TP
446 .BR keyingtries " = " 3 " | <number> | %forever"
447 how many attempts (a whole number or \fB%forever\fP) should be made to
448 negotiate a connection, or a replacement for one, before giving up
449 (default
450 .BR 3 ).
451 The value \fB%forever\fP
452 means 'never give up'.
453 Relevant only locally, other end need not agree on it.
454 .TP
455 .B keylife
456 synonym for
457 .BR lifetime .
458 .TP
459 .BR left " = <ip address> | <fqdn> | " %any
460 (required)
461 the IP address of the left participant's public-network interface
462 or one of several magic values.
463 The value
464 .B %any
465 for the local endpoint signifies an address to be filled in (by automatic
466 keying) during negotiation. If the local peer initiates the connection setup
467 the routing table will be queried to determine the correct local IP address.
468 In case the local peer is responding to a connection setup then any IP address
469 that is assigned to a local interface will be accepted.
470
471 The prefix
472 .B %
473 in front of a fully-qualified domain name or an IP address will implicitly set
474 .BR leftallowany =yes.
475
476 If
477 .B %any
478 is used for the remote endpoint it literally means any IP address.
479
480 Please note that with the usage of wildcards multiple connection descriptions
481 might match a given incoming connection attempt. The most specific description
482 is used in that case.
483 .TP
484 .BR leftallowany " = yes | " no
485 a modifier for
486 .BR left ,
487 making it behave as
488 .B %any
489 although a concrete IP address or domain name has been assigned.
490 .TP
491 .BR leftauth " = <auth method>"
492 Authentication method to use locally (left) or require from the remote (right)
493 side.
494 Acceptable values are
495 .B pubkey
496 for public key authentication (RSA/ECDSA),
497 .B psk
498 for pre-shared key authentication,
499 .B eap
500 to (require the) use of the Extensible Authentication Protocol in IKEv2, and
501 .B xauth
502 for IKEv1 eXtended Authentication.
503 To require a trustchain public key strength for the remote side, specify the
504 key type followed by the minimum strength in bits (for example
505 .BR ecdsa-384
506 or
507 .BR rsa-2048-ecdsa-256 ).
508 To limit the acceptable set of hashing algorithms for trustchain validation,
509 append hash algorithms to
510 .BR pubkey
511 or a key strength definition (for example
512 .BR pubkey-sha1-sha256
513 or
514 .BR rsa-2048-ecdsa-256-sha256-sha384-sha512 ).
515 For
516 .B eap ,
517 an optional EAP method can be appended. Currently defined methods are
518 .BR eap-aka ,
519 .BR eap-gtc ,
520 .BR eap-md5 ,
521 .BR eap-mschapv2 ,
522 .BR eap-peap ,
523 .BR eap-sim ,
524 .BR eap-tls ,
525 .BR eap-ttls ,
526 .BR eap-dynamic ,
527 and
528 .BR eap-radius .
529 Alternatively, IANA assigned EAP method numbers are accepted. Vendor specific
530 EAP methods are defined in the form
531 .B eap-type-vendor
532 .RB "(e.g. " eap-7-12345 ).
533 For
534 .B xauth,
535 an XAuth authentication backend can be specified, such as
536 .B xauth-generic
537 or
538 .BR xauth-eap .
539 If XAuth is used in
540 .BR leftauth ,
541 Hybrid authentication is used. For traditional XAuth authentication, define
542 XAuth in
543 .BR lefauth2 .
544 .TP
545 .BR leftauth2 " = <auth method>"
546 Same as
547 .BR leftauth ,
548 but defines an additional authentication exchange. In IKEv1, only XAuth can be
549 used in the second authentication round. IKEv2 supports multiple complete
550 authentication rounds using "Multiple Authentication Exchanges" defined
551 in RFC4739. This allows, for example, separated authentication
552 of host and user.
553 .TP
554 .BR leftca " = <issuer dn> | %same"
555 the distinguished name of a certificate authority which is required to
556 lie in the trust path going from the left participant's certificate up
557 to the root certification authority.
558 .TP
559 .BR leftca2 " = <issuer dn> | %same"
560 Same as
561 .BR leftca ,
562 but for the second authentication round (IKEv2 only).
563 .TP
564 .BR leftcert " = <path>"
565 the path to the left participant's X.509 certificate. The file can be encoded
566 either in PEM or DER format. OpenPGP certificates are supported as well.
567 Both absolute paths or paths relative to \fI/etc/ipsec.d/certs\fP
568 are accepted. By default
569 .B leftcert
570 sets
571 .B leftid
572 to the distinguished name of the certificate's subject and
573 .B leftca
574 to the distinguished name of the certificate's issuer.
575 The left participant's ID can be overridden by specifying a
576 .B leftid
577 value which must be certified by the certificate, though.
578 .TP
579 .BR leftcert2 " = <path>"
580 Same as
581 .B leftcert,
582 but for the second authentication round (IKEv2 only).
583 .TP
584 .BR leftcertpolicy " = <OIDs>"
585 Comma separated list of certificate policy OIDs the peer's certificate must
586 have.
587 OIDs are specified using the numerical dotted representation.
588 .TP
589 .BR leftdns " = <servers>"
590 Comma separated list of DNS server addresses to exchange as configuration
591 attributes. On the initiator, a server is a fixed IPv4 / IPv6 address, or
592 .B %config4
593 /
594 .B %config6
595 to request attributes without an address. On the responder,
596 only fixed IPv4 /IPv6 addresses are allowed and define DNS servers assigned
597 to the client.
598 .TP
599 .BR leftfirewall " = yes | " no
600 whether the left participant is doing forwarding-firewalling
601 (including masquerading) using iptables for traffic from \fIleftsubnet\fR,
602 which should be turned off (for traffic to the other subnet)
603 once the connection is established;
604 acceptable values are
605 .B yes
606 and
607 .B no
608 (the default).
609 May not be used in the same connection description with
610 .BR leftupdown .
611 Implemented as a parameter to the default \fBipsec _updown\fR script.
612 See notes below.
613 Relevant only locally, other end need not agree on it.
614
615 If one or both security gateways are doing forwarding firewalling
616 (possibly including masquerading),
617 and this is specified using the firewall parameters,
618 tunnels established with IPsec are exempted from it
619 so that packets can flow unchanged through the tunnels.
620 (This means that all subnets connected in this manner must have
621 distinct, non-overlapping subnet address blocks.)
622 This is done by the default \fBipsec _updown\fR script.
623
624 In situations calling for more control,
625 it may be preferable for the user to supply his own
626 .I updown
627 script,
628 which makes the appropriate adjustments for his system.
629 .TP
630 .BR leftgroups " = <group list>"
631 a comma separated list of group names. If the
632 .B leftgroups
633 parameter is present then the peer must be a member of at least one
634 of the groups defined by the parameter.
635 .TP
636 .BR leftgroups2 " = <group list>"
637 Same as
638 .B leftgroups,
639 but for the second authentication round defined with
640 .B leftauth2.
641 .TP
642 .BR lefthostaccess " = yes | " no
643 inserts a pair of INPUT and OUTPUT iptables rules using the default
644 \fBipsec _updown\fR script, thus allowing access to the host itself
645 in the case where the host's internal interface is part of the
646 negotiated client subnet.
647 Acceptable values are
648 .B yes
649 and
650 .B no
651 (the default).
652 .TP
653 .BR leftid " = <id>"
654 how the left participant should be identified for authentication;
655 defaults to
656 .B left
657 or the subject of the certificate configured with
658 .BR leftcert .
659 Can be an IP address, a fully-qualified domain name, an email address, or
660 a keyid.
661 .TP
662 .BR leftid2 " = <id>"
663 identity to use for a second authentication for the left participant
664 (IKEv2 only); defaults to
665 .BR leftid .
666 .TP
667 .BR leftikeport " = <port>"
668 UDP port the left participant uses for IKE communication.
669 If unspecified, port 500 is used with the port floating
670 to 4500 if a NAT is detected or MOBIKE is enabled. Specifying a local IKE port
671 different from the default additionally requires a socket implementation that
672 listens to this port.
673 .TP
674 .BR leftprotoport " = <protocol>/<port>"
675 restrict the traffic selector to a single protocol and/or port.
676 Examples:
677 .B leftprotoport=tcp/http
678 or
679 .B leftprotoport=6/80
680 or
681 .B leftprotoport=udp
682 .TP
683 .BR leftrsasigkey " = " %cert " | <raw rsa public key> | <path to public key>"
684 the left participant's public key for RSA signature authentication, in RFC 2537
685 format using hex (0x prefix) or base64 (0s prefix) encoding. Also accepted is
686 the path to a file containing the public key in PEM or DER encoding.
687 The default value
688 .B %cert
689 means that the key is extracted from a certificate.
690 .TP
691 .BR leftsendcert " = never | no | " ifasked " | always | yes"
692 Accepted values are
693 .B never
694 or
695 .BR no ,
696 .B always
697 or
698 .BR yes ,
699 and
700 .BR ifasked " (the default),"
701 the latter meaning that the peer must send a certificate request payload in
702 order to get a certificate in return.
703 .TP
704 .BR leftsourceip " = %config4 | %config6 | <ip address>"
705 Comma separated list of internal source IPs to use in a tunnel, also known as
706 virtual IP. If the value is one of the synonyms
707 .BR %config ,
708 .BR %cfg ,
709 .BR %modeconfig ,
710 or
711 .BR %modecfg ,
712 an address (from the tunnel address family) is requested from the peer.
713 .TP
714 .BR rightsourceip " = %config | <network>/<netmask> | %poolname"
715 Comma separated list of internal source IPs to use in a tunnel for the remote
716 peer. If the value is
717 .B %config
718 on the responder side, the initiator must propose an address which is then
719 echoed back. Also supported are address pools expressed as
720 \fInetwork\fB/\fInetmask\fR
721 or the use of an external IP address pool using %\fIpoolname\fR,
722 where \fIpoolname\fR is the name of the IP address pool used for the lookup.
723 .TP
724 .BR leftsubnet " = <ip subnet>"
725 private subnet behind the left participant, expressed as
726 \fInetwork\fB/\fInetmask\fR;
727 if omitted, essentially assumed to be \fIleft\fB/32\fR,
728 signifying that the left end of the connection goes to the left participant
729 only. Configured subnets of the peers may differ, the protocol narrows it to
730 the greatest common subnet. In IKEv1, this may lead to problems with other
731 implementations, make sure to configure identical subnets in such
732 configurations. IKEv2 supports multiple subnets separated by commas, IKEv1 only
733 interprets the first subnet of such a definition.
734 .TP
735 .BR leftupdown " = <path>"
736 what ``updown'' script to run to adjust routing and/or firewalling
737 when the status of the connection
738 changes (default
739 .BR "ipsec _updown" ).
740 May include positional parameters separated by white space
741 (although this requires enclosing the whole string in quotes);
742 including shell metacharacters is unwise.
743 Relevant only locally, other end need not agree on it. Charon uses the updown
744 script to insert firewall rules only, since routing has been implemented
745 directly into the daemon.
746 .TP
747 .BR lifebytes " = <number>"
748 the number of bytes transmitted over an IPsec SA before it expires.
749 .TP
750 .BR lifepackets " = <number>"
751 the number of packets transmitted over an IPsec SA before it expires.
752 .TP
753 .BR lifetime " = " 1h " | <time>"
754 how long a particular instance of a connection
755 (a set of encryption/authentication keys for user packets) should last,
756 from successful negotiation to expiry;
757 acceptable values are an integer optionally followed by
758 .BR s
759 (a time in seconds)
760 or a decimal number followed by
761 .BR m ,
762 .BR h ,
763 or
764 .B d
765 (a time
766 in minutes, hours, or days respectively)
767 (default
768 .BR 1h ,
769 maximum
770 .BR 24h ).
771 Normally, the connection is renegotiated (via the keying channel)
772 before it expires (see
773 .BR margintime ).
774 The two ends need not exactly agree on
775 .BR lifetime ,
776 although if they do not,
777 there will be some clutter of superseded connections on the end
778 which thinks the lifetime is longer. Also see EXPIRY/REKEY below.
779 .TP
780 .BR marginbytes " = <number>"
781 how many bytes before IPsec SA expiry (see
782 .BR lifebytes )
783 should attempts to negotiate a replacement begin.
784 .TP
785 .BR marginpackets " = <number>"
786 how many packets before IPsec SA expiry (see
787 .BR lifepackets )
788 should attempts to negotiate a replacement begin.
789 .TP
790 .BR margintime " = " 9m " | <time>"
791 how long before connection expiry or keying-channel expiry
792 should attempts to
793 negotiate a replacement
794 begin; acceptable values as for
795 .B lifetime
796 (default
797 .BR 9m ).
798 Relevant only locally, other end need not agree on it. Also see EXPIRY/REKEY
799 below.
800 .TP
801 .BR mark " = <value>[/<mask>]"
802 sets an XFRM mark in the inbound and outbound
803 IPsec SAs and policies. If the mask is missing then a default
804 mask of
805 .B 0xffffffff
806 is assumed.
807 .TP
808 .BR mark_in " = <value>[/<mask>]"
809 sets an XFRM mark in the inbound IPsec SA and
810 policy. If the mask is missing then a default mask of
811 .B 0xffffffff
812 is assumed.
813 .TP
814 .BR mark_out " = <value>[/<mask>]"
815 sets an XFRM mark in the outbound IPsec SA and
816 policy. If the mask is missing then a default mask of
817 .B 0xffffffff
818 is assumed.
819 .TP
820 .BR mobike " = " yes " | no"
821 enables the IKEv2 MOBIKE protocol defined by RFC 4555. Accepted values are
822 .B yes
823 (the default) and
824 .BR no .
825 If set to
826 .BR no ,
827 the charon daemon will not actively propose MOBIKE as initiator and
828 ignore the MOBIKE_SUPPORTED notify as responder.
829 .TP
830 .BR modeconfig " = push | " pull
831 defines which mode is used to assign a virtual IP.
832 Accepted values are
833 .B push
834 and
835 .B pull
836 (the default).
837 Push mode is currently not supported in charon, hence this parameter has no
838 effect.
839 .TP
840 .BR reauth " = " yes " | no"
841 whether rekeying of an IKE_SA should also reauthenticate the peer. In IKEv1,
842 reauthentication is always done. In IKEv2, a value of
843 .B no
844 rekeys without uninstalling the IPsec SAs, a value of
845 .B yes
846 (the default) creates a new IKE_SA from scratch and tries to recreate
847 all IPsec SAs.
848 .TP
849 .BR rekey " = " yes " | no"
850 whether a connection should be renegotiated when it is about to expire;
851 acceptable values are
852 .B yes
853 (the default)
854 and
855 .BR no .
856 The two ends need not agree, but while a value of
857 .B no
858 prevents charon from requesting renegotiation,
859 it does not prevent responding to renegotiation requested from the other end,
860 so
861 .B no
862 will be largely ineffective unless both ends agree on it. Also see
863 .BR reauth .
864 .TP
865 .BR rekeyfuzz " = " 100% " | <percentage>"
866 maximum percentage by which
867 .BR marginbytes ,
868 .B marginpackets
869 and
870 .B margintime
871 should be randomly increased to randomize rekeying intervals
872 (important for hosts with many connections);
873 acceptable values are an integer,
874 which may exceed 100,
875 followed by a `%'
876 (defaults to
877 .BR 100% ).
878 The value of
879 .BR marginTYPE ,
880 after this random increase,
881 must not exceed
882 .B lifeTYPE
883 (where TYPE is one of
884 .IR bytes ,
885 .I packets
886 or
887 .IR time ).
888 The value
889 .B 0%
890 will suppress randomization.
891 Relevant only locally, other end need not agree on it. Also see EXPIRY/REKEY
892 below.
893 .TP
894 .B rekeymargin
895 synonym for
896 .BR margintime .
897 .TP
898 .BR reqid " = <number>"
899 sets the reqid for a given connection to a pre-configured fixed value.
900 .TP
901 .BR tfc " = <value>"
902 number of bytes to pad ESP payload data to. Traffic Flow Confidentiality
903 is currently supported in IKEv2 and applies to outgoing packets only. The
904 special value
905 .BR %mtu
906 fills up ESP packets with padding to have the size of the MTU.
907 .TP
908 .BR type " = " tunnel " | transport | transport_proxy | passthrough | drop"
909 the type of the connection; currently the accepted values
910 are
911 .B tunnel
912 (the default)
913 signifying a host-to-host, host-to-subnet, or subnet-to-subnet tunnel;
914 .BR transport ,
915 signifying host-to-host transport mode;
916 .BR transport_proxy ,
917 signifying the special Mobile IPv6 transport proxy mode;
918 .BR passthrough ,
919 signifying that no IPsec processing should be done at all;
920 .BR drop ,
921 signifying that packets should be discarded.
922 .TP
923 .BR xauth " = " client " | server"
924 specifies the role in the XAuth protocol if activated by
925 .B authby=xauthpsk
926 or
927 .B authby=xauthrsasig.
928 Accepted values are
929 .B server
930 and
931 .B client
932 (the default).
933 .TP
934 .BR xauth_identity " = <id>"
935 defines the identity/username the client uses to reply to an XAuth request.
936 If not defined, the IKEv1 identity will be used as XAuth identity.
937
938 .SS "CONN PARAMETERS: IKEv2 MEDIATION EXTENSION"
939 The following parameters are relevant to IKEv2 Mediation Extension
940 operation only.
941 .TP
942 .BR mediation " = yes | " no
943 whether this connection is a mediation connection, ie. whether this
944 connection is used to mediate other connections. Mediation connections
945 create no child SA. Acceptable values are
946 .B no
947 (the default) and
948 .BR yes .
949 .TP
950 .BR mediated_by " = <name>"
951 the name of the connection to mediate this connection through. If given,
952 the connection will be mediated through the named mediation connection.
953 The mediation connection must set
954 .BR mediation=yes .
955 .TP
956 .BR me_peerid " = <id>"
957 ID as which the peer is known to the mediation server, ie. which the other
958 end of this connection uses as its
959 .B leftid
960 on its connection to the mediation server. This is the ID we request the
961 mediation server to mediate us with. If
962 .B me_peerid
963 is not given, the
964 .B rightid
965 of this connection will be used as peer ID.
966
967 .SH "CA SECTIONS"
968 These are optional sections that can be used to assign special
969 parameters to a Certification Authority (CA). Because the daemons
970 automatically import CA certificates from \fI/etc/ipsec.d/cacerts\fP,
971 there is no need to explicitly add them with a CA section, unless you
972 want to assign special parameters (like a CRL) to a CA.
973 .TP
974 .BR also " = <name>"
975 includes ca section
976 .BR <name> .
977 .TP
978 .BR auto " = " ignore " | add"
979 currently can have either the value
980 .B ignore
981 (the default) or
982 .BR add .
983 .TP
984 .BR cacert " = <path>"
985 defines a path to the CA certificate either relative to
986 \fI/etc/ipsec.d/cacerts\fP or as an absolute path.
987 .TP
988 .BR crluri " = <uri>"
989 defines a CRL distribution point (ldap, http, or file URI)
990 .TP
991 .B crluri1
992 synonym for
993 .B crluri.
994 .TP
995 .BR crluri2 " = <uri>"
996 defines an alternative CRL distribution point (ldap, http, or file URI)
997 .TP
998 .TP
999 .BR ocspuri " = <uri>"
1000 defines an OCSP URI.
1001 .TP
1002 .B ocspuri1
1003 synonym for
1004 .B ocspuri.
1005 .TP
1006 .BR ocspuri2 " = <uri>"
1007 defines an alternative OCSP URI.
1008 .TP
1009 .BR certuribase " = <uri>"
1010 defines the base URI for the Hash and URL feature supported by IKEv2.
1011 Instead of exchanging complete certificates, IKEv2 allows to send an URI
1012 that resolves to the DER encoded certificate. The certificate URIs are built
1013 by appending the SHA1 hash of the DER encoded certificates to this base URI.
1014 .SH "CONFIG SECTIONS"
1015 At present, the only
1016 .B config
1017 section known to the IPsec software is the one named
1018 .BR setup ,
1019 which contains information used when the software is being started.
1020 The currently-accepted
1021 .I parameter
1022 names in a
1023 .B config
1024 .B setup
1025 section are:
1026 .TP
1027 .BR strictcrlpolicy " = yes | ifuri | " no
1028 defines if a fresh CRL must be available in order for the peer authentication
1029 based on RSA signatures to succeed.
1030 IKEv2 additionally recognizes
1031 .B ifuri
1032 which reverts to
1033 .B yes
1034 if at least one CRL URI is defined and to
1035 .B no
1036 if no URI is known.
1037 .TP
1038 .BR uniqueids " = " yes " | no | never | replace | keep"
1039 whether a particular participant ID should be kept unique,
1040 with any new IKE_SA using an ID deemed to replace all old ones using that ID;
1041 acceptable values are
1042 .BR yes ,
1043 (the default)
1044 .B no
1045 and
1046 .BR never .
1047 Participant IDs normally \fIare\fR unique, so a new IKE_SA using the same ID is
1048 almost invariably intended to replace an old one. The difference between
1049 .B no
1050 and
1051 .B never
1052 is that the daemon will replace old IKE_SAs when receving an INITIAL_CONTACT
1053 notify when the option is
1054 .B no
1055 but will ignore these notifies if
1056 .B never
1057 is configured.
1058 The daemon also accepts the value
1059 .B replace
1060 which is identical to
1061 .B yes
1062 and the value
1063 .B keep
1064 to reject new IKE_SA setups and keep the duplicate established earlier.
1065 .TP
1066 .BR charondebug " = <debug list>"
1067 how much charon debugging output should be logged.
1068 A comma separated list containing type/level-pairs may
1069 be specified, e.g:
1070 .B dmn 3, ike 1, net -1.
1071 Acceptable values for types are
1072 .B dmn, mgr, ike, chd, job, cfg, knl, net, asn, enc, lib, esp, tls,
1073 .B tnc, imc, imv, pts
1074 and the level is one of
1075 .B -1, 0, 1, 2, 3, 4
1076 (for silent, audit, control, controlmore, raw, private). By default, the level
1077 is set to
1078 .B 1
1079 for all types. For more flexibility see LOGGER CONFIGURATION in
1080 .IR strongswan.conf (5).
1081
1082 .SH SA EXPIRY/REKEY
1083 The IKE SAs and IPsec SAs negotiated by the daemon can be configured to expire
1084 after a specific amount of time. For IPsec SAs this can also happen after a
1085 specified number of transmitted packets or transmitted bytes. The following
1086 settings can be used to configure this:
1087 .TS
1088 l r l r,- - - -,lB s lB s,a r a r.
1089 Setting Default Setting Default
1090 IKE SA IPsec SA
1091 ikelifetime 3h lifebytes -
1092 lifepackets -
1093 lifetime 1h
1094 .TE
1095 .SS Rekeying
1096 IKE SAs as well as IPsec SAs can be rekeyed before they expire. This can be
1097 configured using the following settings:
1098 .TS
1099 l r l r,- - - -,lB s lB s,a r a r.
1100 Setting Default Setting Default
1101 IKE and IPsec SA IPsec SA
1102 margintime 9m marginbytes -
1103 marginpackets -
1104 .TE
1105 .SS Randomization
1106 To avoid collisions the specified margins are increased randomly before
1107 subtracting them from the expiration limits (see formula below). This is
1108 controlled by the
1109 .B rekeyfuzz
1110 setting:
1111 .TS
1112 l r,- -,lB s,a r.
1113 Setting Default
1114 IKE and IPsec SA
1115 rekeyfuzz 100%
1116 .TE
1117 .PP
1118 Randomization can be disabled by setting
1119 .BR rekeyfuzz " to " 0% .
1120 .SS Formula
1121 The following formula is used to calculate the rekey time of IPsec SAs:
1122 .PP
1123 .EX
1124 rekeytime = lifetime - (margintime + random(0, margintime * rekeyfuzz))
1125 .EE
1126 .PP
1127 It applies equally to IKE SAs and byte and packet limits for IPsec SAs.
1128 .SS Example
1129 Let's consider the default configuration:
1130 .PP
1131 .EX
1132 lifetime = 1h
1133 margintime = 9m
1134 rekeyfuzz = 100%
1135 .EE
1136 .PP
1137 From the formula above follows that the rekey time lies between:
1138 .PP
1139 .EX
1140 rekeytime_min = 1h - (9m + 9m) = 42m
1141 rekeytime_max = 1h - (9m + 0m) = 51m
1142 .EE
1143 .PP
1144 Thus, the daemon will attempt to rekey the IPsec SA at a random time
1145 between 42 and 51 minutes after establishing the SA. Or, in other words,
1146 between 9 and 18 minutes before the SA expires.
1147 .SS Notes
1148 .IP \[bu]
1149 Since the rekeying of an SA needs some time, the margin values must not be
1150 too low.
1151 .IP \[bu]
1152 The value
1153 .B margin... + margin... * rekeyfuzz
1154 must not exceed the original limit. For example, specifying
1155 .B margintime = 30m
1156 in the default configuration is a bad idea as there is a chance that the rekey
1157 time equals zero and, thus, rekeying gets disabled.
1158 .SH FILES
1159 .nf
1160 /etc/ipsec.conf
1161 /etc/ipsec.d/aacerts
1162 /etc/ipsec.d/acerts
1163 /etc/ipsec.d/cacerts
1164 /etc/ipsec.d/certs
1165 /etc/ipsec.d/crls
1166
1167 .SH SEE ALSO
1168 strongswan.conf(5), ipsec.secrets(5), ipsec(8)
1169 .SH HISTORY
1170 Originally written for the FreeS/WAN project by Henry Spencer.
1171 Updated and extended for the strongSwan project <http://www.strongswan.org> by
1172 Tobias Brunner, Andreas Steffen and Martin Willi.