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