1 .TH IPSEC.CONF 5 "27 Jun 2007"
4 ipsec.conf \- IPsec configuration and connections
9 specifies most configuration and control information for the
10 strongSwan IPsec subsystem.
11 (The major exception is secrets for authentication;
13 .IR ipsec.secrets (5).)
14 Its contents are not security-sensitive.
16 The file is a text file, consisting of one or more
18 White space followed by
20 followed by anything to the end of the line
21 is a comment and is ignored,
22 as are empty lines which are not within a section.
26 and a file name, separated by white space,
27 is replaced by the contents of that file,
28 preceded and followed by empty lines.
29 If the file name is not a full pathname,
30 it is considered to be relative to the directory containing the
32 Such inclusions can be nested.
33 Only a single filename may be supplied, and it may not contain white space,
34 but it may include shell wildcards (see
41 The intention of the include facility is mostly to permit keeping
42 information on connections, or sets of connections,
43 separate from the main configuration file.
44 This permits such connection descriptions to be changed,
45 copied to the other security gateways involved, etc.,
46 without having to constantly extract them from the configuration
47 file and then insert them back into it.
50 parameter (described below) which permits splitting a single logical
51 section (e.g. a connection description) into several actual sections.
54 begins with a line of the form:
61 indicates what type of section follows, and
63 is an arbitrary name which distinguishes the section from others
65 (Names must start with a letter and may contain only
66 letters, digits, periods, underscores, and hyphens.)
67 All subsequent non-empty lines
68 which begin with white space are part of the section;
69 comments within a section must begin with white space too.
70 There may be only one section of a given type with a given name.
72 Lines within the section are generally of the form
74 \ \ \ \ \ \fIparameter\fB=\fIvalue\fR
76 (note the mandatory preceding white space).
77 There can be white space on either side of the
79 Parameter names follow the same syntax as section names,
80 and are specific to a section type.
81 Unless otherwise explicitly specified,
82 no parameter name may appear more than once in a section.
86 stands for the system default value (if any) of the parameter,
87 i.e. it is roughly equivalent to omitting the parameter line entirely.
90 may contain white space only if the entire
92 is enclosed in double quotes (\fB"\fR);
95 cannot itself contain a double quote,
96 nor may it be continued across more than one line.
98 Numeric values are specified to be either an ``integer''
99 (a sequence of digits) or a ``decimal number''
100 (sequence of digits optionally followed by `.' and another sequence of digits).
102 There is currently one parameter which is available in any type of
106 the value is a section name;
107 the parameters of that section are appended to this section,
108 as if they had been written as part of it.
109 The specified section must exist, must follow the current one,
110 and must have the same section type.
111 (Nesting is permitted,
112 and there may be more than one
115 although it is forbidden to append the same section more than once.)
119 specifies defaults for sections of the same type.
120 For each parameter in it,
121 any section of that type which does not have a parameter of the same name
122 gets a copy of the one from the
125 There may be multiple
127 sections of a given type,
128 but only one default may be supplied for any specific parameter name,
131 sections of a given type must precede all non-\c
133 sections of that type.
135 sections may not contain the
139 Currently there are three types of sections:
142 section specifies general configuration information for IPsec, a
144 section specifies an IPsec connection, while a
146 section specifies special properties of a certification authority.
151 .IR "connection specification" ,
152 defining a network connection to be made using IPsec.
153 The name given is arbitrary, and is used to identify the connection.
154 Here's a simple example:
162 leftsubnet=10.1.0.0/16
164 rightsubnet=10.1.0.0/16
170 A note on terminology: There are two kinds of communications going on:
171 transmission of user IP packets, and gateway-to-gateway negotiations for
172 keying, rekeying, and general control.
173 The path to control the connection is called 'ISAKMP SA' in IKEv1 and
174 'IKE SA' in the IKEv2 protocol. That what is being negotiated, the kernel
175 level data path, is called 'IPsec SA'.
176 strongSwan currently uses two separate keying daemons. Pluto handles
177 all IKEv1 connections, Charon is the new daemon supporting the IKEv2 protocol.
178 Charon does not support all keywords yet.
180 To avoid trivial editing of the configuration file to suit it to each system
181 involved in a connection,
182 connection specifications are written in terms of
187 rather than in terms of local and remote.
188 Which participant is considered
193 IPsec figures out which one it is being run on based on internal information.
194 This permits using identical connection specifications on both ends.
195 There are cases where there is no symmetry; a good convention is to
198 for the local side and
200 for the remote side (the first letters are a good mnemonic).
202 Many of the parameters relate to one participant or the other;
205 are listed here, but every parameter whose name begins with
210 whose description is the same but with
216 Parameters are optional unless marked '(required)'.
217 .SS "CONN PARAMETERS"
218 Unless otherwise noted, for a connection to work,
219 in general it is necessary for the two ends to agree exactly
220 on the values of these parameters.
223 AH authentication algorithm to be used
224 for the connection, e.g.
228 whether authentication should be done as part of
229 ESP encryption, or separately using the AH protocol;
230 acceptable values are
234 The IKEv2 daemon currently supports only ESP.
237 how the two security gateways should authenticate each other;
238 acceptable values are
244 for RSA digital signatures (the default),
248 if negotiation is never to be attempted or accepted (useful for shunt-only conns).
249 Digital signatures are superior in every way to shared secrets. In IKEv2, the
250 two ends must not agree on this parameter, it is relevant for the
251 outbound authentication method only.
252 IKEv1 additionally supports the values
256 that will enable eXtended AUTHentication (XAUTH) in addition to IKEv1 main mode
257 based on shared secrets or digital RSA signatures, respectively.
258 IKEv2 additionally supports the value
260 which indicates an initiator to request EAP authentication. The EAP method to
261 use is selected by the server (see
265 what operation, if any, should be done automatically at IPsec startup;
266 currently-accepted values are
275 loads a connection without starting it.
277 loads a connection and installs kernel traps. If traffic is detected between
281 , a connection is established.
283 loads a connection and brings it up immediatly.
285 ignores the connection. This is equal to delete a connection from the config
287 Relevant only locally, other end need not agree on it
288 (but in general, for an intended-to-be-permanent connection,
291 to ensure that any reboot causes immediate renegotiation).
294 whether IPComp compression of content is proposed on the connection
295 (link-level compression does not work on encrypted data,
296 so to be effective, compression must be done \fIbefore\fR encryption);
297 acceptable values are
301 (the default). A value of
303 causes IPsec to propose both compressed and uncompressed,
304 and prefer compressed.
307 prevents IPsec from proposing compression;
308 a proposal to compress will still be accepted.
309 IKEv2 does not support IP compression yet.
312 controls the use of the Dead Peer Detection protocol (DPD, RFC 3706) where
313 R_U_THERE notification messages (IKEv1) or empty INFORMATIONAL messages (IKEv2)
314 are periodically sent in order to check the
315 liveliness of the IPsec peer. The values
320 all activate DPD. If no activity is detected, all connections with a dead peer
321 are stopped and unrouted (
323 ), put in the hold state (
328 For IKEv1, the default is
330 which disables the active sending of R_U_THERE notifications.
331 Nevertheless pluto will always send the DPD Vendor ID during connection set up
332 in order to signal the readiness to act passively as a responder if the peer
333 wants to use DPD. For IKEv2,
335 does't make sense, since all messages are used to detect dead peers. If specified,
336 it has the same meaning as the default (
341 defines the period time interval with which R_U_THERE messages/INFORMATIONAL
342 exchanges are sent to the peer. These are only sent if no other traffic is
343 received. In IKEv2, a value of 0 sends no additional INFORMATIONAL
344 messages and uses only standard messages (such as those to rekey) to detect
348 defines the timeout interval, after which all connections to a peer are deleted
349 in case of inactivity. This only applies to IKEv1, in IKEv2 the default
350 retransmission timeout applies, as every exchange is used to detect dead peers.
353 defines the EAP type to propose as server if the client has
355 selected. Acceptable values are
362 Additionally, IANA assigned EAP method numbers are accepted, or a definition
367 ) can be used to specify vendor specific EAP types.
370 defines the identity the client uses to reply to a EAP Identity request.
371 If defined on the EAP server, the defined identity will be used as peer
372 identity during EAP authentication. The special value
374 uses the EAP Identity method to ask the client for a EAP identity. If not
375 defined, the IKEv2 identity will be used as EAP identity.
378 ESP encryption/authentication algorithm to be used
379 for the connection, e.g.
381 (encryption-integrity-[dh-group]). If dh-group is specified, CHILD_SA setup
382 and rekeying include a separate diffe hellman exchange (IKEv2 only).
385 Force UDP encapsulation for ESP packets even if no NAT situation is detected.
386 This may help to hurdle restrictive firewalls. To enforce the peer to
387 encapsulate packets, NAT detection payloads are faked (IKEv2 only).
390 IKE/ISAKMP SA encryption/authentication algorithm to be used, e.g.
391 .B aes128-sha1-modp2048
392 (encryption-integrity-dhgroup). In IKEv2, multiple algorithms and proposals
393 may be included, such as
394 .B aes128-aes256-sha1-modp1536-modp2048,3des-sha1-md5-modp1024.
397 how long the keying channel of a connection ('ISAKMP/IKE SA')
398 should last before being renegotiated.
401 method of key exchange;
402 which protocol should be used to initialize the connection. Connections marked with
404 are initiated with pluto, those marked with
406 with charon. An incoming request from the remote peer is handled by the correct
407 daemon, unaffected from the
409 setting. The default value
411 currently behaves exactly as
415 how many attempts (a whole number or \fB%forever\fP) should be made to
416 negotiate a connection, or a replacement for one, before giving up
419 The value \fB%forever\fP
420 means 'never give up'.
421 Relevant only locally, other end need not agree on it.
424 how long a particular instance of a connection
425 (a set of encryption/authentication keys for user packets) should last,
426 from successful negotiation to expiry;
427 acceptable values are an integer optionally followed by
430 or a decimal number followed by
436 in minutes, hours, or days respectively)
441 Normally, the connection is renegotiated (via the keying channel)
443 The two ends need not exactly agree on
445 although if they do not,
446 there will be some clutter of superseded connections on the end
447 which thinks the lifetime is longer.
451 the IP address of the left participant's public-network interface,
452 in any form accepted by
454 or one of several magic values.
458 will be filled in automatically with the local address
459 of the default-route interface (as determined at IPsec startup time).
469 signifies an address to be filled in (by automatic keying) during
470 negotiation. The prefix
472 in front of a fully-qualified domain name or an IP address will implicitly set
474 If the domain name cannot be resolved into an IP address at IPsec startup or update time
484 , making it behave as
486 although a concrete IP address has been assigned.
487 Recommended for dynamic IP addresses that can be resolved by DynDNS at IPsec startup or
489 Acceptable values are
496 the distinguished name of a certificate authority which is required to
497 lie in the trust path going from the left participant's certificate up
498 to the root certification authority.
501 the path to the left participant's X.509 certificate. The file can be coded either in
502 PEM or DER format. OpenPGP certificates are supported as well.
503 Both absolute paths or paths relative to \fI/etc/ipsec.d/certs\fP
504 are accepted. By default
508 to the distinguished name of the certificate's subject and
510 to the distinguished name of the certificate's issuer.
511 The left participant's ID can be overriden by specifying a
513 value which must be certified by the certificate, though.
516 whether the left participant is doing forwarding-firewalling
517 (including masquerading) using iptables for traffic from \fIleftsubnet\fR,
518 which should be turned off (for traffic to the other subnet)
519 once the connection is established;
520 acceptable values are
525 May not be used in the same connection description with
527 Implemented as a parameter to the default \fBipsec _updown\fR script.
529 Relevant only locally, other end need not agree on it.
531 If one or both security gateways are doing forwarding firewalling
532 (possibly including masquerading),
533 and this is specified using the firewall parameters,
534 tunnels established with IPsec are exempted from it
535 so that packets can flow unchanged through the tunnels.
536 (This means that all subnets connected in this manner must have
537 distinct, non-overlapping subnet address blocks.)
538 This is done by the default \fBipsec _updown\fR script (see
541 In situations calling for more control,
542 it may be preferable for the user to supply his own
545 which makes the appropriate adjustments for his system.
548 a comma separated list of group names. If the
550 parameter is present then the peer must be a member of at least one
551 of the groups defined by the parameter. Group membership must be certified
552 by a valid attribute certificate stored in \fI/etc/ipsec.d/acerts/\fP thas has been
553 issued to the peer by a trusted Authorization Authority stored in
554 \fI/etc/ipsec.d/aacerts/\fP. Attribute certificates are not supported in IKEv2 yet.
557 inserts a pair of INPUT and OUTPUT iptables rules using the default
558 \fBipsec _updown\fR script, thus allowing access to the host itself
559 in the case where the host's internal interface is part of the
560 negotiated client subnet.
561 Acceptable values are
570 should be identified for authentication;
573 Can be an IP address (in any
576 or a fully-qualified domain name preceded by
578 (which is used as a literal string and not resolved).
581 this parameter is not needed any more because the NETKEY IPsec stack does
582 not require explicit routing entries for the traffic to be tunneled.
585 restrict the traffic selector to a single protocol and/or port.
587 .B leftprotoport=tcp/http
589 .B leftprotoport=6/80
594 the left participant's
595 public key for RSA signature authentication,
596 in RFC 2537 format using
601 means the same as not specifying a value (useful to override a default).
605 means that the key is extracted from a certificate.
606 The identity used for the left participant
607 must be a specific host, not
609 or another magic value.
611 if two connection descriptions
612 specify different public keys for the same
614 confusion and madness will ensue.
628 The internal source IP to use in a tunnel, also known as virtual IP. If the
635 an address is requested from the peer. In IKEv2, a defined address is requested,
636 but the server may change it. If the server does not support it, the address
640 The internal source IP to use in a tunnel for the remote peer. If the
643 on the responder side, the initiator must propose a address which is then echoed
644 back. The IKEv2 daemon also supports address pools expressed as
645 \fInetwork\fB/\fInetmask\fR
646 or the use of an external IP address pool using %\fIpoolname\fR
647 , where \fIpoolname\fR is the name of the IP address pool used for the lookup.
650 private subnet behind the left participant, expressed as
651 \fInetwork\fB/\fInetmask\fR
652 (actually, any form acceptable to
654 if omitted, essentially assumed to be \fIleft\fB/32\fR,
655 signifying that the left end of the connection goes to the left participant
656 only. When using IKEv2, the configured subnet of the peers may differ, the
657 protocol narrows it to the greatest common subnet. Further, IKEv2 supports
658 multiple subnets separated by commas. IKEv1 only interprets the first subnet
659 of such a definition.
662 the peer can propose any subnet or single IP address that fits within the
664 .BR leftsubnetwithin.
665 Not relevant for IKEv2, as subnets are narrowed.
668 what ``updown'' script to run to adjust routing and/or firewalling
669 when the status of the connection
671 .BR "ipsec _updown" ).
672 May include positional parameters separated by white space
673 (although this requires enclosing the whole string in quotes);
674 including shell metacharacters is unwise.
678 Relevant only locally, other end need not agree on it. IKEv2 uses the updown
679 script to insert firewall rules only. Routing is not support and will be
680 implemented directly into Charon.
683 enables the IKEv2 MOBIKE protocol defined by RFC 4555. Accepted values are
689 the IKEv2 charon daemon will not actively propose MOBIKE as initiator and
690 ignore the MOBIKE_SUPPORTED notify as responder.
693 defines which mode is used to assign a virtual IP.
699 Currently relevant for IKEv1 only since IKEv2 always uses the configuration
700 payload in pull mode.
703 whether Perfect Forward Secrecy of keys is desired on the connection's
705 (with PFS, penetration of the key-exchange protocol
706 does not compromise keys negotiated earlier);
707 acceptable values are
712 IKEv2 always uses PFS for IKE_SA rekeying whereas for CHILD_SA rekeying
713 PFS is enforced by defining a Diffie-Hellman modp group in the
718 defines a Diffie-Hellman group for perfect forward secrecy in IKEv1 Quick Mode
719 differing from the DH group used for IKEv1 Main Mode (IKEv1 only).
722 whether rekeying of an IKE_SA should also reauthenticate the peer. In IKEv1,
723 reauthentication is always done. In IKEv2, a value of
725 rekeys without uninstalling the IPsec SAs, a value of
727 (the default) creates a new IKE_SA from scratch and tries to recreate
731 whether a connection should be renegotiated when it is about to expire;
732 acceptable values are
737 The two ends need not agree, but while a value of
739 prevents Pluto/Charon from requesting renegotiation,
740 it does not prevent responding to renegotiation requested from the other end,
743 will be largely ineffective unless both ends agree on it.
746 maximum percentage by which
748 should be randomly increased to randomize rekeying intervals
749 (important for hosts with many connections);
750 acceptable values are an integer,
751 which may exceed 100,
759 after this random increase,
764 will suppress time randomization.
765 Relevant only locally, other end need not agree on it.
768 how long before connection expiry or keying-channel expiry
770 negotiate a replacement
771 begin; acceptable values as for
775 Relevant only locally, other end need not agree on it.
778 the type of the connection; currently the accepted values
782 signifying a host-to-host, host-to-subnet, or subnet-to-subnet tunnel;
784 signifying host-to-host transport mode;
786 signifying that no IPsec processing should be done at all;
788 signifying that packets should be discarded; and
790 signifying that packets should be discarded and a diagnostic ICMP returned.
791 Charon currently supports only
798 specifies the role in the XAUTH protocol if activated by
801 .B authby=xauthrsasig.
808 .SS "CONN PARAMETERS: IKEv2 MEDIATION EXTENSION"
809 The following parameters are relevant to IKEv2 Mediation Extension
813 whether this connection is a mediation connection, ie. whether this
814 connection is used to mediate other connections. Mediation connections
815 create no child SA. Acceptable values are
821 the name of the connection to mediate this connection through. If given,
822 the connection will be mediated through the named mediation connection.
823 The mediation connection must set
827 ID as which the peer is known to the mediation server, ie. which the other
828 end of this connection uses as its
830 on its connection to the mediation server. This is the ID we request the
831 mediation server to mediate us with. If
835 of this connection will be used as peer ID.
838 This are optional sections that can be used to assign special
839 parameters to a Certification Authority (CA). These parameters are not
840 supported in IKEv2 yet.
843 currently can have either the value
850 defines a path to the CA certificate either relative to
851 \fI/etc/ipsec.d/cacerts\fP or as an absolute path.
854 defines a CRL distribution point (ldap, http, or file URI)
861 defines an alternative CRL distribution point (ldap, http, or file URI)
864 defines an ldap host. Currently used by IKEv1 only.
874 defines an alternative OCSP URI. Currently used by IKEv2 only.
876 defines the base URI for the Hash and URL feature supported by IKEv2.
877 Instead of exchanging complete certificates, IKEv2 allows to send an URI
878 that resolves to the DER encoded certificate. The certificate URIs are built
879 by appending the SHA1 hash of the DER encoded certificates to this base URI.
880 .SH "CONFIG SECTIONS"
883 section known to the IPsec software is the one named
885 which contains information used when the software is being started
901 Parameters are optional unless marked ``(required)''.
902 The currently-accepted
907 section affecting both daemons are:
910 certificate revocation lists (CRLs) fetched via http or ldap will be cached in
911 \fI/etc/ipsec.d/crls/\fR under a unique file name derived from the certification
912 authority's public key.
920 whether to start the IKEv2 Charon daemon or not.
928 in what directory should things started by \fBipsec starter\fR
929 (notably the Pluto and Charon daemons) be allowed to dump core?
930 The empty value (the default) means they are not
932 This feature is currently not yet supported by \fBipsec starter\fR.
935 whether to start the IKEv1 Pluto daemon or not.
943 defines if a fresh CRL must be available in order for the peer authentication based
944 on RSA signatures to succeed.
950 IKEv2 additionally recognizes
954 if at least one CRL URI is defined and to
959 whether a particular participant ID should be kept unique,
960 with any new (automatically keyed)
961 connection using an ID from a different IP address
962 deemed to replace all old ones using that ID;
963 acceptable values are
968 Participant IDs normally \fIare\fR unique,
969 so a new (automatically-keyed) connection using the same ID is
970 almost invariably intended to replace an old one.
971 The IKEv2 daemon also accepts the value
977 to reject new IKE_SA setups and keep the duplicate established earlier.
981 parameters are used by the IKEv1 Pluto daemon only:
984 interval in seconds. CRL fetching is enabled if the value is greater than zero.
985 Asynchronous, periodic checking for fresh CRLs is currently done by the
986 IKEv1 Pluto daemon only.
989 interval in seconds between NAT keep alive packets, the default being 20 seconds.
992 activates NAT traversal by accepting source ISAKMP ports different from udp/500 and
993 being able of floating to udp/4500 if a NAT situation is detected.
1001 no certificate request payloads will be sent.
1007 Used by IKEv1 only, NAT traversal always being active in IKEv2.
1010 non-standard argument string for PKCS#11 C_Initialize() function;
1011 required by NSS softoken.
1014 defines the path to a dynamically loadable PKCS #11 library.
1017 PKCS #11 login sessions will be kept during the whole lifetime of the keying
1018 daemon. Useful with pin-pad smart card readers.
1026 Pluto will act as a PKCS #11 proxy accessible via the whack interface.
1034 how much Pluto debugging output should be logged.
1038 means no debugging output (the default).
1042 Otherwise only the specified types of output
1043 (a quoted list, names without the
1046 separated by white space) are enabled;
1047 for details on available debugging types, see
1051 Pluto will not use syslog, but rather log to stderr, and redirect stderr
1052 to the argument file.
1055 shell command to run after starting Pluto
1056 (e.g., to remove a decrypted copy of the
1059 It's run in a very simple way;
1060 complexities like I/O redirection are best hidden within a script.
1061 Any output is redirected for logging,
1062 so running interactive commands is difficult unless they use
1064 or equivalent for their interaction.
1068 shell command to run before starting Pluto
1069 (e.g., to decrypt an encrypted copy of the
1072 It's run in a very simple way;
1073 complexities like I/O redirection are best hidden within a script.
1074 Any output is redirected for logging,
1075 so running interactive commands is difficult unless they use
1077 or equivalent for their interaction.
1081 defines private networks using a wildcard notation.
1085 parameters are used by the IKEv2 Charon daemon only:
1088 how much Charon debugging output should be logged.
1089 A comma separated list containing type level/pairs may
1091 .B dmn 3, ike 1, net -1.
1092 Acceptable values for types are
1093 .B dmn, mgr, ike, chd, job, cfg, knl, net, enc, lib
1094 and the level is one of
1095 .B -1, 0, 1, 2, 3, 4
1096 (for silent, audit, control, controlmore, raw, private).
1100 parameters only make sense if the KLIPS IPsec stack
1101 is used instead of the default NETKEY stack of the Linux 2.6 kernel:
1104 whether a tunnel's need to fragment a packet should be reported
1105 back with an ICMP message,
1106 in an attempt to make the sender lower his PMTU estimate;
1107 acceptable values are
1114 whether a tunnel packet's TOS field should be set to
1116 rather than copied from the user packet inside;
1117 acceptable values are
1124 virtual and physical interfaces for IPsec to use:
1126 \fIvirtual\fB=\fIphysical\fR pair, a (quoted!) list of pairs separated
1129 One of the pairs may be written as
1131 which means: find the interface \fId\fR that the default route points to,
1132 and then act as if the value was ``\fBipsec0=\fId\fR''.
1136 must be used to denote no interfaces.
1139 value that the MTU of the ipsec\fIn\fR interface(s) should be set to,
1140 overriding IPsec's (large) default.
1141 .SH CHOOSING A CONNECTION
1143 When choosing a connection to apply to an outbound packet caught with a
1145 the system prefers the one with the most specific eroute that
1146 includes the packet's source and destination IP addresses.
1147 Source subnets are examined before destination subnets.
1148 For initiating, only routed connections are considered. For responding,
1149 unrouted but added connections are considered.
1151 When choosing a connection to use to respond to a negotiation which
1152 doesn't match an ordinary conn, an opportunistic connection
1153 may be instantiated. Eventually, its instance will be /32 -> /32, but
1154 for earlier stages of the negotiation, there will not be enough
1155 information about the client subnets to complete the instantiation.
1159 /etc/ipsec.d/aacerts
1161 /etc/ipsec.d/cacerts
1166 ipsec(8), pluto(8), starter(8), ttoaddr(3), ttodata(3)
1168 Written for the FreeS/WAN project by Henry Spencer.
1169 Extended for the strongSwan project
1170 <http://www.strongswan.org>
1171 by Andreas Steffen. IKEv2-specific features by Martin Willi.
1174 If conns are to be added before DNS is available, \fBleft=\fP\fIFQDN\fP