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