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 ESP encryption/authentication algorithm to be used
371 for the connection, e.g.
373 (encryption-integrity-[dh-group]). If dh-group is specified, CHILD_SA setup
374 and rekeying include a separate diffe hellman exchange (IKEv2 only).
377 Force UDP encapsulation for ESP packets even if no NAT situation is detected.
378 This may help to hurdle restrictive firewalls. To enforce the peer to
379 encapsulate packets, NAT detection payloads are faked (IKEv2 only).
382 IKE/ISAKMP SA encryption/authentication algorithm to be used, e.g.
383 .B aes128-sha1-modp2048
384 (encryption-integrity-dhgroup). In IKEv2, multiple algorithms and proposals
385 may be included, such as
386 .B aes128-aes256-sha1-modp1536-modp2048,3des-sha1-md5-modp1024.
389 how long the keying channel of a connection ('ISAKMP/IKE SA')
390 should last before being renegotiated.
393 method of key exchange;
394 which protocol should be used to initialize the connection. Connections marked with
396 are initiated with pluto, those marked with
398 with charon. An incoming request from the remote peer is handled by the correct
399 daemon, unaffected from the
401 setting. The default value
403 currently behaves exactly as
407 how many attempts (a whole number or \fB%forever\fP) should be made to
408 negotiate a connection, or a replacement for one, before giving up
411 The value \fB%forever\fP
412 means 'never give up'.
413 Relevant only locally, other end need not agree on it.
416 how long a particular instance of a connection
417 (a set of encryption/authentication keys for user packets) should last,
418 from successful negotiation to expiry;
419 acceptable values are an integer optionally followed by
422 or a decimal number followed by
428 in minutes, hours, or days respectively)
433 Normally, the connection is renegotiated (via the keying channel)
435 The two ends need not exactly agree on
437 although if they do not,
438 there will be some clutter of superseded connections on the end
439 which thinks the lifetime is longer.
443 the IP address of the left participant's public-network interface,
444 in any form accepted by
446 or one of several magic values.
450 will be filled in automatically with the local address
451 of the default-route interface (as determined at IPsec startup time).
461 signifies an address to be filled in (by automatic keying) during
462 negotiation. The prefix
464 in front of a fully-qualified domain name or an IP address will implicitly set
466 If the domain name cannot be resolved into an IP address at IPsec startup or update time
476 , making it behave as
478 although a concrete IP address has been assigned.
479 Recommended for dynamic IP addresses that can be resolved by DynDNS at IPsec startup or
481 Acceptable values are
488 the distinguished name of a certificate authority which is required to
489 lie in the trust path going from the left participant's certificate up
490 to the root certification authority.
493 the path to the left participant's X.509 certificate. The file can be coded either in
494 PEM or DER format. OpenPGP certificates are supported as well.
495 Both absolute paths or paths relative to \fI/etc/ipsec.d/certs\fP
496 are accepted. By default
500 to the distinguished name of the certificate's subject and
502 to the distinguished name of the certificate's issuer.
503 The left participant's ID can be overriden by specifying a
505 value which must be certified by the certificate, though.
508 whether the left participant is doing forwarding-firewalling
509 (including masquerading) using iptables for traffic from \fIleftsubnet\fR,
510 which should be turned off (for traffic to the other subnet)
511 once the connection is established;
512 acceptable values are
517 May not be used in the same connection description with
519 Implemented as a parameter to the default \fBipsec _updown\fR script.
521 Relevant only locally, other end need not agree on it.
523 If one or both security gateways are doing forwarding firewalling
524 (possibly including masquerading),
525 and this is specified using the firewall parameters,
526 tunnels established with IPsec are exempted from it
527 so that packets can flow unchanged through the tunnels.
528 (This means that all subnets connected in this manner must have
529 distinct, non-overlapping subnet address blocks.)
530 This is done by the default \fBipsec _updown\fR script (see
533 In situations calling for more control,
534 it may be preferable for the user to supply his own
537 which makes the appropriate adjustments for his system.
540 a comma separated list of group names. If the
542 parameter is present then the peer must be a member of at least one
543 of the groups defined by the parameter. Group membership must be certified
544 by a valid attribute certificate stored in \fI/etc/ipsec.d/acerts/\fP thas has been
545 issued to the peer by a trusted Authorization Authority stored in
546 \fI/etc/ipsec.d/aacerts/\fP. Attribute certificates are not supported in IKEv2 yet.
549 inserts a pair of INPUT and OUTPUT iptables rules using the default
550 \fBipsec _updown\fR script, thus allowing access to the host itself
551 in the case where the host's internal interface is part of the
552 negotiated client subnet.
553 Acceptable values are
562 should be identified for authentication;
565 Can be an IP address (in any
568 or a fully-qualified domain name preceded by
570 (which is used as a literal string and not resolved).
573 this parameter is not needed any more because the NETKEY IPsec stack does
574 not require explicit routing entries for the traffic to be tunneled.
577 restrict the traffic selector to a single protocol and/or port.
579 .B leftprotoport=tcp/http
581 .B leftprotoport=6/80
586 the left participant's
587 public key for RSA signature authentication,
588 in RFC 2537 format using
593 means the same as not specifying a value (useful to override a default).
597 means that the key is extracted from a certificate.
598 The identity used for the left participant
599 must be a specific host, not
601 or another magic value.
603 if two connection descriptions
604 specify different public keys for the same
606 confusion and madness will ensue.
620 The internal source IP to use in a tunnel, also known as virtual IP. If the
627 an address is requested from the peer. In IKEv2, a defined address is requested,
628 but the server may change it. If the server does not support it, the address
632 The internal source IP to use in a tunnel for the remote peer. If the
635 on the responder side, the initiator must propose a address which is then echoed
636 back. The IKEv2 daemon also supports address pools expressed as
637 \fInetwork\fB/\fInetmask\fR
638 or the use of an external IP address pool using %\fIpoolname\fR
639 , where \fIpoolname\fR is the name of the IP address pool used for the lookup.
642 private subnet behind the left participant, expressed as
643 \fInetwork\fB/\fInetmask\fR
644 (actually, any form acceptable to
646 if omitted, essentially assumed to be \fIleft\fB/32\fR,
647 signifying that the left end of the connection goes to the left participant
648 only. When using IKEv2, the configured subnet of the peers may differ, the
649 protocol narrows it to the greatest common subnet. Further, IKEv2 supports
650 multiple subnets separated by commas. IKEv1 only interprets the first subnet
651 of such a definition.
654 the peer can propose any subnet or single IP address that fits within the
656 .BR leftsubnetwithin.
657 Not relevant for IKEv2, as subnets are narrowed.
660 what ``updown'' script to run to adjust routing and/or firewalling
661 when the status of the connection
663 .BR "ipsec _updown" ).
664 May include positional parameters separated by white space
665 (although this requires enclosing the whole string in quotes);
666 including shell metacharacters is unwise.
670 Relevant only locally, other end need not agree on it. IKEv2 uses the updown
671 script to insert firewall rules only. Routing is not support and will be
672 implemented directly into Charon.
675 enables the IKEv2 MOBIKE protocol defined by RFC 4555. Accepted values are
681 the IKEv2 charon daemon will not actively propose MOBIKE but will still
682 accept and support the protocol as a responder.
685 defines which mode is used to assign a virtual IP.
691 Currently relevant for IKEv1 only since IKEv2 always uses the configuration
692 payload in pull mode.
695 whether Perfect Forward Secrecy of keys is desired on the connection's
697 (with PFS, penetration of the key-exchange protocol
698 does not compromise keys negotiated earlier);
699 acceptable values are
704 IKEv2 always uses PFS for IKE_SA rekeying whereas for CHILD_SA rekeying
705 PFS is enforced by defining a Diffie-Hellman modp group in the
710 whether rekeying of an IKE_SA should also reauthenticate the peer. In IKEv1,
711 reauthentication is always done. In IKEv2, a value of
713 rekeys without uninstalling the IPsec SAs, a value of
715 (the default) creates a new IKE_SA from scratch and tries to recreate
719 whether a connection should be renegotiated when it is about to expire;
720 acceptable values are
725 The two ends need not agree, but while a value of
727 prevents Pluto/Charon from requesting renegotiation,
728 it does not prevent responding to renegotiation requested from the other end,
731 will be largely ineffective unless both ends agree on it.
734 maximum percentage by which
736 should be randomly increased to randomize rekeying intervals
737 (important for hosts with many connections);
738 acceptable values are an integer,
739 which may exceed 100,
747 after this random increase,
752 will suppress time randomization.
753 Relevant only locally, other end need not agree on it.
756 how long before connection expiry or keying-channel expiry
758 negotiate a replacement
759 begin; acceptable values as for
763 Relevant only locally, other end need not agree on it.
766 the type of the connection; currently the accepted values
770 signifying a host-to-host, host-to-subnet, or subnet-to-subnet tunnel;
772 signifying host-to-host transport mode;
774 signifying that no IPsec processing should be done at all;
776 signifying that packets should be discarded; and
778 signifying that packets should be discarded and a diagnostic ICMP returned.
779 Charon currently supports only
786 specifies the role in the XAUTH protocol if activated by
789 .B authby=xauthrsasig.
796 .SS "CONN PARAMETERS: IKEv2 MEDIATION EXTENSION"
797 The following parameters are relevant to IKEv2 Mediation Extension
801 whether this connection is a mediation connection, ie. whether this
802 connection is used to mediate other connections. Mediation connections
803 create no child SA. Acceptable values are
809 the name of the connection to mediate this connection through. If given,
810 the connection will be mediated through the named mediation connection.
811 The mediation connection must set
815 ID as which the peer is known to the mediation server, ie. which the other
816 end of this connection uses as its
818 on its connection to the mediation server. This is the ID we request the
819 mediation server to mediate us with. If
823 of this connection will be used as peer ID.
826 This are optional sections that can be used to assign special
827 parameters to a Certification Authority (CA). These parameters are not
828 supported in IKEv2 yet.
831 currently can have either the value
838 defines a path to the CA certificate either relative to
839 \fI/etc/ipsec.d/cacerts\fP or as an absolute path.
842 defines a CRL distribution point (ldap, http, or file URI)
849 defines an alternative CRL distribution point (ldap, http, or file URI)
852 defines an ldap host. Currently used by IKEv1 only.
862 defines an alternative OCSP URI. Currently used by IKEv2 only.
864 defines the base URI for the Hash and URL feature supported by IKEv2.
865 Instead of exchanging complete certificates, IKEv2 allows to send an URI
866 that resolves to the DER encoded certificate. The certificate URIs are built
867 by appending the SHA1 hash of the DER encoded certificates to this base URI.
868 .SH "CONFIG SECTIONS"
871 section known to the IPsec software is the one named
873 which contains information used when the software is being started
889 Parameters are optional unless marked ``(required)''.
890 The currently-accepted
895 section affecting both daemons are:
898 certificate revocation lists (CRLs) fetched via http or ldap will be cached in
899 \fI/etc/ipsec.d/crls/\fR under a unique file name derived from the certification
900 authority's public key.
908 whether to start the IKEv2 Charon daemon or not.
916 in what directory should things started by \fBipsec starter\fR
917 (notably the Pluto and Charon daemons) be allowed to dump core?
918 The empty value (the default) means they are not
920 This feature is currently not yet supported by \fBipsec starter\fR.
923 whether to start the IKEv1 Pluto daemon or not.
931 defines if a fresh CRL must be available in order for the peer authentication based
932 on RSA signatures to succeed.
938 IKEv2 additionally recognizes
942 if at least one CRL URI is defined and to
947 whether a particular participant ID should be kept unique,
948 with any new (automatically keyed)
949 connection using an ID from a different IP address
950 deemed to replace all old ones using that ID;
951 acceptable values are
956 Participant IDs normally \fIare\fR unique,
957 so a new (automatically-keyed) connection using the same ID is
958 almost invariably intended to replace an old one.
959 The IKEv2 daemon also accepts the value
965 to reject new IKE_SA setups and keep the duplicate established earlier.
969 parameters are used by the IKEv1 Pluto daemon only:
972 interval in seconds. CRL fetching is enabled if the value is greater than zero.
973 Asynchronous, periodic checking for fresh CRLs is currently done by the
974 IKEv1 Pluto daemon only.
977 interval in seconds between NAT keep alive packets, the default being 20 seconds.
980 activates NAT traversal by accepting source ISAKMP ports different from udp/500 and
981 being able of floating to udp/4500 if a NAT situation is detected.
989 no certificate request payloads will be sent.
995 Used by IKEv1 only, NAT traversal always being active in IKEv2.
998 non-standard argument string for PKCS#11 C_Initialize() function;
999 required by NSS softoken.
1002 defines the path to a dynamically loadable PKCS #11 library.
1005 PKCS #11 login sessions will be kept during the whole lifetime of the keying
1006 daemon. Useful with pin-pad smart card readers.
1014 Pluto will act as a PKCS #11 proxy accessible via the whack interface.
1022 how much Pluto debugging output should be logged.
1026 means no debugging output (the default).
1030 Otherwise only the specified types of output
1031 (a quoted list, names without the
1034 separated by white space) are enabled;
1035 for details on available debugging types, see
1039 shell command to run after starting Pluto
1040 (e.g., to remove a decrypted copy of the
1043 It's run in a very simple way;
1044 complexities like I/O redirection are best hidden within a script.
1045 Any output is redirected for logging,
1046 so running interactive commands is difficult unless they use
1048 or equivalent for their interaction.
1052 shell command to run before starting Pluto
1053 (e.g., to decrypt an encrypted copy of the
1056 It's run in a very simple way;
1057 complexities like I/O redirection are best hidden within a script.
1058 Any output is redirected for logging,
1059 so running interactive commands is difficult unless they use
1061 or equivalent for their interaction.
1065 defines private networks using a wildcard notation.
1069 parameters are used by the IKEv2 Charon daemon only:
1072 how much Charon debugging output should be logged.
1073 A comma separated list containing type level/pairs may
1075 .B dmn 3, ike 1, net -1.
1076 Acceptable values for types are
1077 .B dmn, mgr, ike, chd, job, cfg, knl, net, enc, lib
1078 and the level is one of
1079 .B -1, 0, 1, 2, 3, 4
1080 (for silent, audit, control, controlmore, raw, private).
1084 parameters only make sense if the KLIPS IPsec stack
1085 is used instead of the default NETKEY stack of the Linux 2.6 kernel:
1088 whether a tunnel's need to fragment a packet should be reported
1089 back with an ICMP message,
1090 in an attempt to make the sender lower his PMTU estimate;
1091 acceptable values are
1098 whether a tunnel packet's TOS field should be set to
1100 rather than copied from the user packet inside;
1101 acceptable values are
1108 virtual and physical interfaces for IPsec to use:
1110 \fIvirtual\fB=\fIphysical\fR pair, a (quoted!) list of pairs separated
1113 One of the pairs may be written as
1115 which means: find the interface \fId\fR that the default route points to,
1116 and then act as if the value was ``\fBipsec0=\fId\fR''.
1120 must be used to denote no interfaces.
1123 value that the MTU of the ipsec\fIn\fR interface(s) should be set to,
1124 overriding IPsec's (large) default.
1125 .SH CHOOSING A CONNECTION
1127 When choosing a connection to apply to an outbound packet caught with a
1129 the system prefers the one with the most specific eroute that
1130 includes the packet's source and destination IP addresses.
1131 Source subnets are examined before destination subnets.
1132 For initiating, only routed connections are considered. For responding,
1133 unrouted but added connections are considered.
1135 When choosing a connection to use to respond to a negotiation which
1136 doesn't match an ordinary conn, an opportunistic connection
1137 may be instantiated. Eventually, its instance will be /32 -> /32, but
1138 for earlier stages of the negotiation, there will not be enough
1139 information about the client subnets to complete the instantiation.
1143 /etc/ipsec.d/aacerts
1145 /etc/ipsec.d/cacerts
1150 ipsec(8), pluto(8), starter(8), ttoaddr(3), ttodata(3)
1152 Written for the FreeS/WAN project by Henry Spencer.
1153 Extended for the strongSwan project
1154 <http://www.strongswan.org>
1155 by Andreas Steffen. IKEv2-specific features by Martin Willi.
1158 If conns are to be added before DNS is available, \fBleft=\fP\fIFQDN\fP