]> git.ipfire.org Git - people/ms/strongswan.git/blame - src/starter/ipsec.conf.5
Updated and corrected the ipsec(8) manual page.
[people/ms/strongswan.git] / src / starter / ipsec.conf.5
CommitLineData
7900ab1b 1.TH IPSEC.CONF 5 "27 Jun 2007"
fea5e716
MW
2.SH NAME
3ipsec.conf \- IPsec configuration and connections
4.SH DESCRIPTION
5The optional
6.I ipsec.conf
7file
8specifies most configuration and control information for the
9strongSwan IPsec subsystem.
10(The major exception is secrets for authentication;
11see
12.IR ipsec.secrets (5).)
532f2347 13Its contents are not security-sensitive.
fea5e716
MW
14.PP
15The file is a text file, consisting of one or more
16.IR sections .
17White space followed by
18.B #
19followed by anything to the end of the line
20is a comment and is ignored,
21as are empty lines which are not within a section.
22.PP
23A line which contains
24.B include
25and a file name, separated by white space,
26is replaced by the contents of that file,
27preceded and followed by empty lines.
28If the file name is not a full pathname,
29it is considered to be relative to the directory containing the
30including file.
31Such inclusions can be nested.
32Only a single filename may be supplied, and it may not contain white space,
33but it may include shell wildcards (see
34.IR sh (1));
35for example:
36.PP
37.B include
38.B "ipsec.*.conf"
39.PP
40The intention of the include facility is mostly to permit keeping
41information on connections, or sets of connections,
42separate from the main configuration file.
43This permits such connection descriptions to be changed,
44copied to the other security gateways involved, etc.,
45without having to constantly extract them from the configuration
46file and then insert them back into it.
47Note also the
48.B also
49parameter (described below) which permits splitting a single logical
50section (e.g. a connection description) into several actual sections.
51.PP
fea5e716
MW
52A section
53begins with a line of the form:
54.PP
55.I type
56.I name
57.PP
58where
59.I type
60indicates what type of section follows, and
61.I name
62is an arbitrary name which distinguishes the section from others
63of the same type.
64(Names must start with a letter and may contain only
65letters, digits, periods, underscores, and hyphens.)
66All subsequent non-empty lines
67which begin with white space are part of the section;
68comments within a section must begin with white space too.
69There may be only one section of a given type with a given name.
70.PP
71Lines within the section are generally of the form
72.PP
73\ \ \ \ \ \fIparameter\fB=\fIvalue\fR
74.PP
75(note the mandatory preceding white space).
76There can be white space on either side of the
77.BR = .
78Parameter names follow the same syntax as section names,
79and are specific to a section type.
80Unless otherwise explicitly specified,
81no parameter name may appear more than once in a section.
82.PP
83An empty
84.I value
85stands for the system default value (if any) of the parameter,
86i.e. it is roughly equivalent to omitting the parameter line entirely.
87A
88.I value
89may contain white space only if the entire
90.I value
91is enclosed in double quotes (\fB"\fR);
92a
93.I value
94cannot itself contain a double quote,
95nor may it be continued across more than one line.
96.PP
97Numeric 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
101There is currently one parameter which is available in any type of
102section:
103.TP
104.B also
105the value is a section name;
106the parameters of that section are appended to this section,
107as if they had been written as part of it.
108The specified section must exist, must follow the current one,
109and must have the same section type.
110(Nesting is permitted,
111and there may be more than one
112.B also
113in a single section,
114although it is forbidden to append the same section more than once.)
fea5e716
MW
115.PP
116A section with name
117.B %default
118specifies defaults for sections of the same type.
119For each parameter in it,
120any section of that type which does not have a parameter of the same name
121gets a copy of the one from the
122.B %default
123section.
124There may be multiple
125.B %default
126sections of a given type,
127but only one default may be supplied for any specific parameter name,
128and all
129.B %default
130sections of a given type must precede all non-\c
131.B %default
132sections of that type.
133.B %default
134sections may not contain the
135.B also
136parameter.
137.PP
138Currently there are three types of sections:
139a
140.B config
141section specifies general configuration information for IPsec, a
142.B conn
143section specifies an IPsec connection, while a
144.B ca
7900ab1b 145section specifies special properties of a certification authority.
fea5e716
MW
146.SH "CONN SECTIONS"
147A
148.B conn
149section contains a
150.IR "connection specification" ,
151defining a network connection to be made using IPsec.
532f2347 152The name given is arbitrary, and is used to identify the connection.
fea5e716
MW
153Here's a simple example:
154.PP
155.ne 10
156.nf
157.ft B
158.ta 1c
159conn snt
7900ab1b
AS
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
fea5e716 164 keyingtries=%forever
7900ab1b 165 auto=add
fea5e716
MW
166.ft
167.fi
168.PP
532f2347 169A note on terminology: There are two kinds of communications going on:
fea5e716
MW
170transmission of user IP packets, and gateway-to-gateway negotiations for
171keying, rekeying, and general control.
532f2347 172The path to control the connection is called 'ISAKMP SA' in IKEv1 and
7900ab1b 173'IKE SA' in the IKEv2 protocol. That what is being negotiated, the kernel
532f2347
MW
174level data path, is called 'IPsec SA'.
175strongSwan currently uses two separate keying daemons. Pluto handles
176all IKEv1 connections, Charon is the new daemon supporting the IKEv2 protocol.
177Charon does not support all keywords yet.
fea5e716
MW
178.PP
179To avoid trivial editing of the configuration file to suit it to each system
180involved in a connection,
181connection specifications are written in terms of
182.I left
183and
184.I right
185participants,
186rather than in terms of local and remote.
187Which participant is considered
188.I left
189or
190.I right
191is arbitrary;
192IPsec figures out which one it is being run on based on internal information.
193This permits using identical connection specifications on both ends.
194There are cases where there is no symmetry; a good convention is to
195use
196.I left
197for the local side and
198.I right
199for the remote side (the first letters are a good mnemonic).
200.PP
201Many of the parameters relate to one participant or the other;
202only the ones for
203.I left
204are listed here, but every parameter whose name begins with
205.B left
206has a
207.B right
208counterpart,
209whose description is the same but with
210.B left
211and
212.B right
213reversed.
214.PP
532f2347
MW
215Parameters are optional unless marked '(required)'.
216.SS "CONN PARAMETERS"
217Unless otherwise noted, for a connection to work,
fea5e716
MW
218in general it is necessary for the two ends to agree exactly
219on the values of these parameters.
220.TP 14
c2bc2b27
AS
221.B ah
222AH authentication algorithm to be used
223for the connection, e.g.
224.B hmac-md5.
fea5e716
MW
225.TP
226.B auth
227whether authentication should be done as part of
228ESP encryption, or separately using the AH protocol;
229acceptable values are
230.B esp
231(the default) and
232.BR ah .
532f2347 233The IKEv2 daemon currently supports only ESP.
fea5e716
MW
234.TP
235.B authby
236how the two security gateways should authenticate each other;
237acceptable values are
238.B secret
7900ab1b
AS
239or
240.B psk
c7f76958
AS
241for pre-shared secrets,
242.B pubkey
243(the default) for public key signatures as well as the synonyms
fea5e716 244.B rsasig
c7f76958
AS
245for RSA digital signatures and
246.B ecdsasig
247for Elliptic Curve DSA signatures.
fea5e716 248.B never
c7f76958
AS
249can be used if negotiation is never to be attempted or accepted (useful for
250shunt-only conns).
8015c91c 251Digital signatures are superior in every way to shared secrets.
7900ab1b
AS
252IKEv1 additionally supports the values
253.B xauthpsk
254and
255.B xauthrsasig
256that will enable eXtended AUTHentication (XAUTH) in addition to IKEv1 main mode
257based on shared secrets or digital RSA signatures, respectively.
a44bb934 258This parameter is deprecated for IKEv2 connections, as two peers do not need
8015c91c 259to agree on an authentication method. Use the
a44bb934
MW
260.B leftauth
261parameter instead to define authentication methods in IKEv2.
fea5e716 262.TP
c2bc2b27
AS
263.B auto
264what operation, if any, should be done automatically at IPsec startup;
265currently-accepted values are
266.B add
267,
268.B route
269,
270.B start
7900ab1b 271and
c2bc2b27
AS
272.BR ignore .
273.B add
274loads a connection without starting it.
275.B route
276loads a connection and installs kernel traps. If traffic is detected between
277.B leftsubnet
278and
279.B rightsubnet
280, a connection is established.
281.B start
282loads a connection and brings it up immediatly.
283.B ignore
284ignores the connection. This is equal to delete a connection from the config
8015c91c 285file.
c2bc2b27
AS
286Relevant only locally, other end need not agree on it
287(but in general, for an intended-to-be-permanent connection,
288both ends should use
289.B auto=start
290to ensure that any reboot causes immediate renegotiation).
7900ab1b 291.TP
fea5e716
MW
292.B compress
293whether IPComp compression of content is proposed on the connection
294(link-level compression does not work on encrypted data,
295so to be effective, compression must be done \fIbefore\fR encryption);
296acceptable values are
297.B yes
298and
299.B no
532f2347 300(the default). A value of
fea5e716
MW
301.B yes
302causes IPsec to propose both compressed and uncompressed,
303and prefer compressed.
304A value of
305.B no
306prevents IPsec from proposing compression;
307a proposal to compress will still be accepted.
532f2347 308IKEv2 does not support IP compression yet.
fea5e716 309.TP
fea5e716
MW
310.B dpdaction
311controls the use of the Dead Peer Detection protocol (DPD, RFC 3706) where
a655f5c0
MW
312R_U_THERE notification messages (IKEv1) or empty INFORMATIONAL messages (IKEv2)
313are periodically sent in order to check the
314liveliness of the IPsec peer. The values
7900ab1b
AS
315.BR clear ,
316.BR hold ,
8015c91c 317and
7900ab1b
AS
318.B restart
319all activate DPD. If no activity is detected, all connections with a dead peer
fea5e716
MW
320are stopped and unrouted (
321.B clear
7900ab1b 322), put in the hold state (
fea5e716 323.B hold
7900ab1b
AS
324) or restarted (
325.B restart
326).
327For IKEv1, the default is
a655f5c0
MW
328.B none
329which disables the active sending of R_U_THERE notifications.
330Nevertheless pluto will always send the DPD Vendor ID during connection set up
331in order to signal the readiness to act passively as a responder if the peer
7900ab1b
AS
332wants to use DPD. For IKEv2,
333.B none
334does't make sense, since all messages are used to detect dead peers. If specified,
a655f5c0
MW
335it has the same meaning as the default (
336.B clear
fea5e716
MW
337).
338.TP
339.B dpddelay
a655f5c0
MW
340defines the period time interval with which R_U_THERE messages/INFORMATIONAL
341exchanges are sent to the peer. These are only sent if no other traffic is
342received. In IKEv2, a value of 0 sends no additional INFORMATIONAL
343messages and uses only standard messages (such as those to rekey) to detect
344dead peers.
fea5e716
MW
345.TP
346.B dpdtimeout
347defines the timeout interval, after which all connections to a peer are deleted
a655f5c0
MW
348in case of inactivity. This only applies to IKEv1, in IKEv2 the default
349retransmission timeout applies, as every exchange is used to detect dead peers.
fea5e716 350.TP
8015c91c
MW
351.B inactivity
352defines the timeout interval, after which a CHILD_SA is closed if it did
353not send or receive any traffic. Currently supported in IKEv2 connections only.
354.TP
eea626ed 355.B eap
a44bb934
MW
356defines the EAP type to propose as server if the client requests EAP
357authentication. This parameter is deprecated in the favour of
358.B leftauth.
4a6b84a9
MW
359
360To forward EAP authentication to a RADIUS server using the EAP-RADIUS plugin,
8015c91c 361set
4a6b84a9 362.B eap=radius
eea626ed 363.TP
82290106
MW
364.B eap_identity
365defines the identity the client uses to reply to a EAP Identity request.
366If defined on the EAP server, the defined identity will be used as peer
8015c91c 367identity during EAP authentication. The special value
82290106
MW
368.B %identity
369uses the EAP Identity method to ask the client for a EAP identity. If not
370defined, the IKEv2 identity will be used as EAP identity.
371.TP
c2bc2b27
AS
372.B esp
373ESP encryption/authentication algorithm to be used
374for the connection, e.g.
375.B 3des-md5
376(encryption-integrity-[dh-group]). If dh-group is specified, CHILD_SA setup
377and rekeying include a separate diffe hellman exchange (IKEv2 only).
378.TP
5df92bba 379.B forceencaps
9dae1bed 380Force UDP encapsulation for ESP packets even if no NAT situation is detected.
8015c91c 381This may help to hurdle restrictive firewalls. To enforce the peer to
9dae1bed
MW
382encapsulate packets, NAT detection payloads are faked (IKEv2 only).
383.TP
c2bc2b27
AS
384.B ike
385IKE/ISAKMP SA encryption/authentication algorithm to be used, e.g.
386.B aes128-sha1-modp2048
387(encryption-integrity-dhgroup). In IKEv2, multiple algorithms and proposals
388may be included, such as
389.B aes128-aes256-sha1-modp1536-modp2048,3des-sha1-md5-modp1024.
390.TP
fea5e716 391.B ikelifetime
532f2347 392how long the keying channel of a connection ('ISAKMP/IKE SA')
fea5e716
MW
393should last before being renegotiated.
394.TP
84bec926
AS
395.B installpolicy
396decides whether IPsec policies are installed in the kernel by the IKEv2
397charon daemon for a given connection. Allows peaceful co-existence e.g. with
398the Mobile IPv6 daemon mip6d who wants to control the kernel policies.
399Acceptable values are
400.B yes
401(the default) and
402.BR no .
403.TP
fea5e716
MW
404.B keyexchange
405method of key exchange;
3572b3b6 406which protocol should be used to initialize the connection. Connections marked with
fea5e716 407.B ikev1
3572b3b6 408are initiated with pluto, those marked with
fea5e716 409.B ikev2
8015c91c
MW
410with charon. An incoming request from the remote peer is handled by the correct
411daemon, unaffected from the
fea5e716 412.B keyexchange
3572b3b6 413setting. The default value
fea5e716
MW
414.B ike
415currently behaves exactly as
416.B ikev1.
417.TP
fea5e716
MW
418.B keyingtries
419how many attempts (a whole number or \fB%forever\fP) should be made to
420negotiate a connection, or a replacement for one, before giving up
421(default
422.BR %forever ).
423The value \fB%forever\fP
532f2347 424means 'never give up'.
fea5e716
MW
425Relevant only locally, other end need not agree on it.
426.TP
427.B keylife
deddfde9
TB
428synonym for
429.BR lifetime .
fea5e716 430.TP
c2bc2b27
AS
431.B left
432(required)
433the IP address of the left participant's public-network interface,
434in any form accepted by
435.IR ttoaddr (3)
436or one of several magic values.
437If it is
438.BR %defaultroute ,
439.B left
440will be filled in automatically with the local address
441of the default-route interface (as determined at IPsec startup time).
442(Either
443.B left
444or
445.B right
446may be
447.BR %defaultroute ,
448but not both.)
449The value
450.B %any
451signifies an address to be filled in (by automatic keying) during
452negotiation. The prefix
453.B %
454in front of a fully-qualified domain name or an IP address will implicitly set
455.B leftallowany=yes.
456If the domain name cannot be resolved into an IP address at IPsec startup or update time
457then
458.B left=%any
459and
460.B leftallowany=no
461will be assumed.
462.TP
463.B leftallowany
464a modifier for
465.B left
466, making it behave as
467.B %any
468although a concrete IP address has been assigned.
469Recommended for dynamic IP addresses that can be resolved by DynDNS at IPsec startup or
470update time.
471Acceptable values are
472.B yes
473and
474.B no
475(the default).
476.TP
a44bb934
MW
477.B leftauth
478Authentication method to use (local) or require (remote) in this connection.
8015c91c 479This parameter is supported in IKEv2 only. Acceptable values are
a44bb934 480.B pubkey
8015c91c 481for public key authentication (RSA/ECDSA),
a44bb934
MW
482.B psk
483for pre-shared key authentication and
484.B eap
485to (require the) use of the Extensible Authentication Protocol. In the case
8015c91c 486of
a44bb934
MW
487.B eap,
488an optional EAP method can be appended. Currently defined methods are
489.B eap-aka, eap-sim, eap-gtc, eap-md5
490and
491.B eap-mschapv2.
492Alternatively, IANA assigned EAP method numbers are accepted. Vendor specific
493EAP methods are defined in the form
494.B eap-type-vendor
495(e.g.
496.B eap-7-12345
497).
498.TP
499.B leftauth2
8015c91c 500Same as
a44bb934
MW
501.B leftauth,
502but defines an additional authentication exchange. IKEv2 supports multiple
503authentication rounds using "Multiple Authentication Exchanges" defined
504in RFC4739. This allows, for example, separated authentication
505of host and user (IKEv2 only).
506.TP
fea5e716
MW
507.B leftca
508the distinguished name of a certificate authority which is required to
509lie in the trust path going from the left participant's certificate up
8015c91c 510to the root certification authority.
fea5e716 511.TP
a44bb934
MW
512.B leftca2
513Same as
514.B leftca,
515but for the second authentication round (IKEv2 only).
516.TP
fea5e716
MW
517.B leftcert
518the path to the left participant's X.509 certificate. The file can be coded either in
519PEM or DER format. OpenPGP certificates are supported as well.
7900ab1b 520Both absolute paths or paths relative to \fI/etc/ipsec.d/certs\fP
fea5e716
MW
521are accepted. By default
522.B leftcert
8015c91c 523sets
fea5e716
MW
524.B leftid
525to the distinguished name of the certificate's subject and
526.B leftca
527to the distinguished name of the certificate's issuer.
528The left participant's ID can be overriden by specifying a
529.B leftid
530value which must be certified by the certificate, though.
531.TP
a44bb934
MW
532.B leftcert2
533Same as
534.B leftcert,
535but for the second authentication round (IKEv2 only).
536.TP
c2bc2b27
AS
537.B leftfirewall
538whether the left participant is doing forwarding-firewalling
539(including masquerading) using iptables for traffic from \fIleftsubnet\fR,
540which should be turned off (for traffic to the other subnet)
541once the connection is established;
542acceptable values are
543.B yes
544and
545.B no
546(the default).
547May not be used in the same connection description with
548.BR leftupdown .
549Implemented as a parameter to the default \fBipsec _updown\fR script.
550See notes below.
551Relevant only locally, other end need not agree on it.
552
553If one or both security gateways are doing forwarding firewalling
554(possibly including masquerading),
555and this is specified using the firewall parameters,
556tunnels established with IPsec are exempted from it
557so that packets can flow unchanged through the tunnels.
558(This means that all subnets connected in this manner must have
559distinct, non-overlapping subnet address blocks.)
560This is done by the default \fBipsec _updown\fR script (see
561.IR pluto (8)).
562
563In situations calling for more control,
564it may be preferable for the user to supply his own
565.I updown
566script,
567which makes the appropriate adjustments for his system.
568.TP
569.B leftgroups
570a comma separated list of group names. If the
571.B leftgroups
572parameter is present then the peer must be a member of at least one
573of the groups defined by the parameter. Group membership must be certified
574by a valid attribute certificate stored in \fI/etc/ipsec.d/acerts/\fP thas has been
575issued to the peer by a trusted Authorization Authority stored in
576\fI/etc/ipsec.d/aacerts/\fP. Attribute certificates are not supported in IKEv2 yet.
577.TP
578.B lefthostaccess
579inserts a pair of INPUT and OUTPUT iptables rules using the default
580\fBipsec _updown\fR script, thus allowing access to the host itself
581in the case where the host's internal interface is part of the
582negotiated client subnet.
583Acceptable values are
584.B yes
585and
586.B no
587(the default).
588.TP
589.B leftid
590how
591the left participant
592should be identified for authentication;
593defaults to
594.BR left .
595Can be an IP address (in any
596.IR ttoaddr (3)
597syntax)
598or a fully-qualified domain name preceded by
599.B @
600(which is used as a literal string and not resolved).
601.TP
a44bb934
MW
602.B leftid2
603identity to use for a second authentication for the left participant
604(IKEv2 only); defaults to
605.BR leftid .
606.TP
667b7372
MW
607.B leftikeport
608UDP port the left participant uses for IKE communication. Currently supported in
609IKEv2 connections only. If unspecified, port 500 is used with port floating to
6104500 if NAT is detected or MOBIKE enabled. Specifying a local IKE port
611different from the default additionally requires a socket implementation that
612listens to this port.
613.TP
c2bc2b27
AS
614.B leftnexthop
615this parameter is not needed any more because the NETKEY IPsec stack does
616not require explicit routing entries for the traffic to be tunneled.
617.TP
618.B leftprotoport
619restrict the traffic selector to a single protocol and/or port.
620Examples:
621.B leftprotoport=tcp/http
7900ab1b 622or
c2bc2b27 623.B leftprotoport=6/80
7900ab1b 624or
c2bc2b27 625.B leftprotoport=udp
7900ab1b
AS
626.TP
627.B leftrsasigkey
628the left participant's
629public key for RSA signature authentication,
630in RFC 2537 format using
631.IR ttodata (3)
632encoding.
633The magic value
634.B %none
635means the same as not specifying a value (useful to override a default).
636The value
637.B %cert
638(the default)
639means that the key is extracted from a certificate.
640The identity used for the left participant
641must be a specific host, not
642.B %any
643or another magic value.
644.B Caution:
645if two connection descriptions
646specify different public keys for the same
647.BR leftid ,
648confusion and madness will ensue.
649.TP
c2bc2b27
AS
650.B leftsendcert
651Accepted values are
652.B never
653or
654.BR no ,
655.B always
656or
657.BR yes ,
658and
659.BR ifasked .
fea5e716 660.TP
fea5e716 661.B leftsourceip
9b45443d
MW
662The internal source IP to use in a tunnel, also known as virtual IP. If the
663value is
7900ab1b
AS
664.BR %modeconfig ,
665.BR %modecfg ,
666.BR %config ,
9b45443d 667or
7900ab1b 668.B %cfg,
8e79d8d3
MW
669an address is requested from the peer. In IKEv2, a defined address is requested,
670but the server may change it. If the server does not support it, the address
8015c91c 671is enforced.
8e79d8d3 672.TP
532137e7 673.B rightsourceip
8e79d8d3
MW
674The internal source IP to use in a tunnel for the remote peer. If the
675value is
676.B %config
677on the responder side, the initiator must propose a address which is then echoed
b0103105
MW
678back. The IKEv2 daemon also supports address pools expressed as
679\fInetwork\fB/\fInetmask\fR
680or the use of an external IP address pool using %\fIpoolname\fR
681, where \fIpoolname\fR is the name of the IP address pool used for the lookup.
fea5e716 682.TP
c2bc2b27
AS
683.B leftsubnet
684private subnet behind the left participant, expressed as
685\fInetwork\fB/\fInetmask\fR
686(actually, any form acceptable to
687.IR ttosubnet (3));
688if omitted, essentially assumed to be \fIleft\fB/32\fR,
689signifying that the left end of the connection goes to the left participant
690only. When using IKEv2, the configured subnet of the peers may differ, the
34443902
MW
691protocol narrows it to the greatest common subnet. Further, IKEv2 supports
692multiple subnets separated by commas. IKEv1 only interprets the first subnet
693of such a definition.
c2bc2b27
AS
694.TP
695.B leftsubnetwithin
696the peer can propose any subnet or single IP address that fits within the
697range defined by
698.BR leftsubnetwithin.
699Not relevant for IKEv2, as subnets are narrowed.
700.TP
701.B leftupdown
702what ``updown'' script to run to adjust routing and/or firewalling
703when the status of the connection
704changes (default
705.BR "ipsec _updown" ).
706May include positional parameters separated by white space
707(although this requires enclosing the whole string in quotes);
708including shell metacharacters is unwise.
709See
710.IR pluto (8)
711for details.
712Relevant only locally, other end need not agree on it. IKEv2 uses the updown
713script to insert firewall rules only. Routing is not support and will be
714implemented directly into Charon.
715.TP
deddfde9
TB
716.B lifebytes
717the number of bytes transmitted over an IPsec SA before it expires (IKEv2
718only).
719.TP
720.B lifepackets
721the number of packets transmitted over an IPsec SA before it expires (IKEv2
722only).
723.TP
724.B lifetime
725how long a particular instance of a connection
726(a set of encryption/authentication keys for user packets) should last,
727from successful negotiation to expiry;
728acceptable values are an integer optionally followed by
729.BR s
730(a time in seconds)
731or a decimal number followed by
732.BR m ,
733.BR h ,
734or
735.B d
736(a time
737in minutes, hours, or days respectively)
738(default
739.BR 1h ,
740maximum
741.BR 24h ).
742Normally, the connection is renegotiated (via the keying channel)
743before it expires (see
744.BR margintime ).
745The two ends need not exactly agree on
746.BR lifetime ,
747although if they do not,
748there will be some clutter of superseded connections on the end
749which thinks the lifetime is longer.
750.TP
751.B marginbytes
752how many bytes before IPsec SA expiry (see
753.BR lifebytes )
754should attempts to negotiate a replacement begin (IKEv2 only).
755.TP
756.B marginpackets
757how many packets before IPsec SA expiry (see
758.BR lifepackets )
759should attempts to negotiate a replacement begin (IKEv2 only).
760.TP
761.B margintime
762how long before connection expiry or keying-channel expiry
763should attempts to
764negotiate a replacement
765begin; acceptable values as for
766.B lifetime
767(default
768.BR 9m ).
769Relevant only locally, other end need not agree on it.
770.TP
8c4339bd
AS
771.B mobike
772enables the IKEv2 MOBIKE protocol defined by RFC 4555. Accepted values are
773.B yes
774(the default) and
775.BR no .
776If set to
777.BR no ,
78279973
MW
778the IKEv2 charon daemon will not actively propose MOBIKE as initiator and
779ignore the MOBIKE_SUPPORTED notify as responder.
8c4339bd 780.TP
7900ab1b
AS
781.B modeconfig
782defines which mode is used to assign a virtual IP.
783Accepted values are
784.B push
785and
786.B pull
787(the default).
788Currently relevant for IKEv1 only since IKEv2 always uses the configuration
789payload in pull mode.
790.TP
fea5e716
MW
791.B pfs
792whether Perfect Forward Secrecy of keys is desired on the connection's
793keying channel
794(with PFS, penetration of the key-exchange protocol
795does not compromise keys negotiated earlier);
796acceptable values are
797.B yes
798(the default)
799and
7900ab1b
AS
800.BR no.
801IKEv2 always uses PFS for IKE_SA rekeying whereas for CHILD_SA rekeying
802PFS is enforced by defining a Diffie-Hellman modp group in the
803.B esp
804parameter.
0ef961b8 805.TP
8015c91c 806.B pfsgroup
0ef961b8
AS
807defines a Diffie-Hellman group for perfect forward secrecy in IKEv1 Quick Mode
808differing from the DH group used for IKEv1 Main Mode (IKEv1 only).
fea5e716 809.TP
c2bc2b27
AS
810.B reauth
811whether rekeying of an IKE_SA should also reauthenticate the peer. In IKEv1,
812reauthentication is always done. In IKEv2, a value of
813.B no
814rekeys without uninstalling the IPsec SAs, a value of
815.B yes
816(the default) creates a new IKE_SA from scratch and tries to recreate
817all IPsec SAs.
818.TP
fea5e716
MW
819.B rekey
820whether a connection should be renegotiated when it is about to expire;
821acceptable values are
822.B yes
823(the default)
824and
825.BR no .
7900ab1b 826The two ends need not agree, but while a value of
fea5e716 827.B no
6fe03b0a 828prevents Pluto/Charon from requesting renegotiation,
fea5e716
MW
829it does not prevent responding to renegotiation requested from the other end,
830so
831.B no
832will be largely ineffective unless both ends agree on it.
833.TP
834.B rekeyfuzz
835maximum percentage by which
deddfde9
TB
836.BR marginbytes ,
837.B marginpackets
838and
839.B margintime
fea5e716
MW
840should be randomly increased to randomize rekeying intervals
841(important for hosts with many connections);
842acceptable values are an integer,
843which may exceed 100,
844followed by a `%'
deddfde9 845(defaults to
fea5e716
MW
846.BR 100% ).
847The value of
deddfde9 848.BR marginTYPE ,
fea5e716
MW
849after this random increase,
850must not exceed
deddfde9
TB
851.B lifeTYPE
852(where TYPE is one of
853.IR bytes ,
854.I packets
855or
856.IR time ).
fea5e716
MW
857The value
858.B 0%
deddfde9 859will suppress randomization.
fea5e716
MW
860Relevant only locally, other end need not agree on it.
861.TP
862.B rekeymargin
deddfde9
TB
863synonym for
864.BR margintime .
532f2347 865.TP
c2bc2b27
AS
866.B type
867the type of the connection; currently the accepted values
868are
869.B tunnel
870(the default)
871signifying a host-to-host, host-to-subnet, or subnet-to-subnet tunnel;
872.BR transport ,
873signifying host-to-host transport mode;
84bec926
AS
874.BR transport_proxy ,
875signifying the special Mobile IPv6 transport proxy mode;
c2bc2b27
AS
876.BR passthrough ,
877signifying that no IPsec processing should be done at all;
878.BR drop ,
879signifying that packets should be discarded; and
880.BR reject ,
881signifying that packets should be discarded and a diagnostic ICMP returned.
84bec926
AS
882Charon currently supports
883.BR tunnel ,
884.BR transport ,
c2bc2b27 885and
84bec926
AS
886.BR tunnel_proxy
887connection types, only .
fea5e716 888.TP
c2bc2b27
AS
889.B xauth
890specifies the role in the XAUTH protocol if activated by
891.B authby=xauthpsk
892or
893.B authby=xauthrsasig.
894Accepted values are
895.B server
896and
897.B client
898(the default).
d5cc1758 899
e74bc8e5 900.SS "CONN PARAMETERS: IKEv2 MEDIATION EXTENSION"
8015c91c 901The following parameters are relevant to IKEv2 Mediation Extension
e74bc8e5 902operation only.
d5cc1758 903.TP 14
e74bc8e5
TB
904.B mediation
905whether this connection is a mediation connection, ie. whether this
d5cc1758
TB
906connection is used to mediate other connections. Mediation connections
907create no child SA. Acceptable values are
908.B no
909(the default) and
910.BR yes .
911.TP
e74bc8e5 912.B mediated_by
d5cc1758
TB
913the name of the connection to mediate this connection through. If given,
914the connection will be mediated through the named mediation connection.
915The mediation connection must set
e74bc8e5 916.BR mediation=yes .
d5cc1758 917.TP
e74bc8e5 918.B me_peerid
d5cc1758
TB
919ID as which the peer is known to the mediation server, ie. which the other
920end of this connection uses as its
921.B leftid
922on its connection to the mediation server. This is the ID we request the
923mediation server to mediate us with. If
e74bc8e5 924.B me_peerid
d5cc1758
TB
925is not given, the
926.B rightid
927of this connection will be used as peer ID.
928
fea5e716
MW
929.SH "CA SECTIONS"
930This are optional sections that can be used to assign special
8015c91c 931parameters to a Certification Authority (CA). These parameters are not
532f2347 932supported in IKEv2 yet.
fea5e716
MW
933.TP 10
934.B auto
935currently can have either the value
936.B ignore
937or
938.B add
8015c91c 939.
fea5e716
MW
940.TP
941.B cacert
8015c91c 942defines a path to the CA certificate either relative to
fea5e716
MW
943\fI/etc/ipsec.d/cacerts\fP or as an absolute path.
944.TP
945.B crluri
946defines a CRL distribution point (ldap, http, or file URI)
947.TP
7900ab1b
AS
948.B crluri1
949synonym for
950.B crluri.
951.TP
fea5e716
MW
952.B crluri2
953defines an alternative CRL distribution point (ldap, http, or file URI)
954.TP
955.B ldaphost
7900ab1b 956defines an ldap host. Currently used by IKEv1 only.
fea5e716
MW
957.TP
958.B ocspuri
959defines an OCSP URI.
7900ab1b
AS
960.TP
961.B ocspuri1
962synonym for
963.B ocspuri.
964.TP
965.B ocspuri2
966defines an alternative OCSP URI. Currently used by IKEv2 only.
6439267a
TB
967.B certuribase
968defines the base URI for the Hash and URL feature supported by IKEv2.
969Instead of exchanging complete certificates, IKEv2 allows to send an URI
970that resolves to the DER encoded certificate. The certificate URIs are built
971by appending the SHA1 hash of the DER encoded certificates to this base URI.
fea5e716
MW
972.SH "CONFIG SECTIONS"
973At present, the only
974.B config
975section known to the IPsec software is the one named
976.BR setup ,
977which contains information used when the software is being started
978(see
7900ab1b 979.IR starter (8)).
fea5e716
MW
980Here's an example:
981.PP
982.ne 8
983.nf
984.ft B
985.ta 1c
986config setup
fea5e716 987 plutodebug=all
7900ab1b
AS
988 crlcheckinterval=10m
989 strictcrlpolicy=yes
fea5e716
MW
990.ft
991.fi
992.PP
993Parameters are optional unless marked ``(required)''.
994The currently-accepted
995.I parameter
996names in a
997.B config
998.B setup
b360e393 999section affecting both daemons are:
fea5e716 1000.TP 14
e0e7ef07
AS
1001.B cachecrls
1002certificate revocation lists (CRLs) fetched via http or ldap will be cached in
1003\fI/etc/ipsec.d/crls/\fR under a unique file name derived from the certification
1004authority's public key.
1005Accepted values are
1006.B yes
1007and
1008.B no
1009(the default).
7900ab1b
AS
1010.TP
1011.B charonstart
e0e7ef07 1012whether to start the IKEv2 Charon daemon or not.
7900ab1b 1013Accepted values are
fea5e716 1014.B yes
7900ab1b
AS
1015or
1016.BR no .
8015c91c 1017The default is
e4838d02
MW
1018.B yes
1019if starter was compiled with IKEv2 support.
7900ab1b 1020.TP
e0e7ef07
AS
1021.B dumpdir
1022in what directory should things started by \fBipsec starter\fR
1023(notably the Pluto and Charon daemons) be allowed to dump core?
1024The empty value (the default) means they are not
1025allowed to.
1026This feature is currently not yet supported by \fBipsec starter\fR.
7900ab1b
AS
1027.TP
1028.B plutostart
e0e7ef07 1029whether to start the IKEv1 Pluto daemon or not.
7900ab1b
AS
1030Accepted values are
1031.B yes
7900ab1b 1032or
fea5e716 1033.BR no .
8015c91c 1034The default is
e4838d02
MW
1035.B yes
1036if starter was compiled with IKEv1 support.
fea5e716 1037.TP
e0e7ef07
AS
1038.B strictcrlpolicy
1039defines if a fresh CRL must be available in order for the peer authentication based
1040on RSA signatures to succeed.
1041Accepted values are
1042.B yes
1043and
1044.B no
1045(the default).
1046IKEv2 additionally recognizes
1047.B ifuri
1048which reverts to
1049.B yes
1050if at least one CRL URI is defined and to
1051.B no
1052if no URI is known.
b360e393
MW
1053.TP
1054.B uniqueids
1055whether a particular participant ID should be kept unique,
1056with any new (automatically keyed)
1057connection using an ID from a different IP address
1058deemed to replace all old ones using that ID;
1059acceptable values are
1060.B yes
1061(the default)
1062and
1063.BR no .
1064Participant IDs normally \fIare\fR unique,
1065so a new (automatically-keyed) connection using the same ID is
1066almost invariably intended to replace an old one.
1067The IKEv2 daemon also accepts the value
1068.B replace
1069wich is identical to
1070.B yes
1071and the value
1072.B keep
1073to reject new IKE_SA setups and keep the duplicate established earlier.
e0e7ef07
AS
1074.PP
1075The following
1076.B config section
1077parameters are used by the IKEv1 Pluto daemon only:
1078.TP
b360e393
MW
1079.B crlcheckinterval
1080interval in seconds. CRL fetching is enabled if the value is greater than zero.
1081Asynchronous, periodic checking for fresh CRLs is currently done by the
1082IKEv1 Pluto daemon only.
1083.TP
e0e7ef07
AS
1084.B keep_alive
1085interval in seconds between NAT keep alive packets, the default being 20 seconds.
1086.TP
1087.B nat_traversal
1088activates NAT traversal by accepting source ISAKMP ports different from udp/500 and
1089being able of floating to udp/4500 if a NAT situation is detected.
1090Accepted values are
1091.B yes
1092and
1093.B no
1094(the default).
a46173df 1095Used by IKEv1 only, NAT traversal always being active in IKEv2.
8c4339bd 1096.TP
e0e7ef07
AS
1097.B nocrsend
1098no certificate request payloads will be sent.
1099Accepted values are
1100.B yes
1101and
1102.B no
1103(the default).
e0e7ef07 1104.TP
dd0ee786
AS
1105.B pkcs11initargs
1106non-standard argument string for PKCS#11 C_Initialize() function;
1107required by NSS softoken.
1108.TP
e0e7ef07
AS
1109.B pkcs11module
1110defines the path to a dynamically loadable PKCS #11 library.
1111.TP
1112.B pkcs11keepstate
1113PKCS #11 login sessions will be kept during the whole lifetime of the keying
1114daemon. Useful with pin-pad smart card readers.
1115Accepted values are
1116.B yes
1117and
1118.B no
1119(the default).
1120.TP
1121.B pkcs11proxy
1122Pluto will act as a PKCS #11 proxy accessible via the whack interface.
1123Accepted values are
1124.B yes
1125and
1126.B no
1127(the default).
1128.TP
fea5e716
MW
1129.B plutodebug
1130how much Pluto debugging output should be logged.
1131An empty value,
1132or the magic value
1133.BR none ,
1134means no debugging output (the default).
1135The magic value
1136.B all
1137means full output.
1138Otherwise only the specified types of output
1139(a quoted list, names without the
1140.B \-\-debug\-
1141prefix,
1142separated by white space) are enabled;
1143for details on available debugging types, see
7900ab1b 1144.IR pluto (8).
fea5e716 1145.TP
0fc1fc0e
AS
1146.B plutostderrlog
1147Pluto will not use syslog, but rather log to stderr, and redirect stderr
1148to the argument file.
1149.TP
e0e7ef07
AS
1150.B postpluto
1151shell command to run after starting Pluto
1152(e.g., to remove a decrypted copy of the
fea5e716
MW
1153.I ipsec.secrets
1154file).
1155It's run in a very simple way;
1156complexities like I/O redirection are best hidden within a script.
1157Any output is redirected for logging,
1158so running interactive commands is difficult unless they use
1159.I /dev/tty
1160or equivalent for their interaction.
1161Default is none.
1162.TP
e0e7ef07
AS
1163.B prepluto
1164shell command to run before starting Pluto
1165(e.g., to decrypt an encrypted copy of the
fea5e716
MW
1166.I ipsec.secrets
1167file).
1168It's run in a very simple way;
1169complexities like I/O redirection are best hidden within a script.
1170Any output is redirected for logging,
1171so running interactive commands is difficult unless they use
1172.I /dev/tty
1173or equivalent for their interaction.
1174Default is none.
1175.TP
e0e7ef07
AS
1176.B virtual_private
1177defines private networks using a wildcard notation.
e0e7ef07
AS
1178.PP
1179The following
1180.B config section
1181parameters are used by the IKEv2 Charon daemon only:
fea5e716 1182.TP
e0e7ef07
AS
1183.B charondebug
1184how much Charon debugging output should be logged.
1185A comma separated list containing type level/pairs may
1186be specified, e.g:
1187.B dmn 3, ike 1, net -1.
1188Acceptable values for types are
1189.B dmn, mgr, ike, chd, job, cfg, knl, net, enc, lib
1190and the level is one of
1191.B -1, 0, 1, 2, 3, 4
1192(for silent, audit, control, controlmore, raw, private).
1193.PP
1194The following
1195.B config section
1196parameters only make sense if the KLIPS IPsec stack
1197is used instead of the default NETKEY stack of the Linux 2.6 kernel:
fea5e716 1198.TP
e0e7ef07
AS
1199.B fragicmp
1200whether a tunnel's need to fragment a packet should be reported
1201back with an ICMP message,
1202in an attempt to make the sender lower his PMTU estimate;
1203acceptable values are
7900ab1b 1204.B yes
e0e7ef07 1205(the default)
7900ab1b 1206and
e0e7ef07 1207.BR no .
7900ab1b 1208.TP
e0e7ef07
AS
1209.B hidetos
1210whether a tunnel packet's TOS field should be set to
1211.B 0
1212rather than copied from the user packet inside;
1213acceptable values are
7900ab1b 1214.B yes
e0e7ef07 1215(the default)
7900ab1b 1216and
e0e7ef07 1217.BR no
fea5e716 1218.TP
e0e7ef07
AS
1219.B interfaces
1220virtual and physical interfaces for IPsec to use:
1221a single
1222\fIvirtual\fB=\fIphysical\fR pair, a (quoted!) list of pairs separated
1223by white space, or
1224.BR %none .
1225One of the pairs may be written as
1226.BR %defaultroute ,
1227which means: find the interface \fId\fR that the default route points to,
1228and then act as if the value was ``\fBipsec0=\fId\fR''.
1229.B %defaultroute
1230is the default;
1231.B %none
1232must be used to denote no interfaces.
7900ab1b 1233.TP
e0e7ef07
AS
1234.B overridemtu
1235value that the MTU of the ipsec\fIn\fR interface(s) should be set to,
1236overriding IPsec's (large) default.
fea5e716
MW
1237.SH CHOOSING A CONNECTION
1238.PP
8015c91c 1239When choosing a connection to apply to an outbound packet caught with a
fea5e716
MW
1240.BR %trap,
1241the system prefers the one with the most specific eroute that
1242includes the packet's source and destination IP addresses.
1243Source subnets are examined before destination subnets.
1244For initiating, only routed connections are considered. For responding,
1245unrouted but added connections are considered.
1246.PP
1247When choosing a connection to use to respond to a negotiation which
1248doesn't match an ordinary conn, an opportunistic connection
1249may be instantiated. Eventually, its instance will be /32 -> /32, but
1250for earlier stages of the negotiation, there will not be enough
1251information about the client subnets to complete the instantiation.
1252.SH FILES
1253.nf
1254/etc/ipsec.conf
7900ab1b
AS
1255/etc/ipsec.d/aacerts
1256/etc/ipsec.d/acerts
fea5e716
MW
1257/etc/ipsec.d/cacerts
1258/etc/ipsec.d/certs
1259/etc/ipsec.d/crls
fea5e716
MW
1260
1261.SH SEE ALSO
7900ab1b 1262ipsec(8), pluto(8), starter(8), ttoaddr(3), ttodata(3)
fea5e716 1263.SH HISTORY
e0e7ef07
AS
1264Written for the FreeS/WAN project by Henry Spencer.
1265Extended for the strongSwan project
fea5e716 1266<http://www.strongswan.org>
7900ab1b 1267by Andreas Steffen. IKEv2-specific features by Martin Willi.
fea5e716
MW
1268.SH BUGS
1269.PP
7900ab1b 1270If conns are to be added before DNS is available, \fBleft=\fP\fIFQDN\fP
fea5e716 1271will fail.