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