1 .TH IPSEC.CONF 5 "20 Jan 2006"
2 .\" RCSID $Id: ipsec.conf.5,v 1.2 2006/01/22 15:33:46 as Exp $
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 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.0.1.0/24
163 leftnexthop=172.16.55.66
165 rightsubnet=10.0.2.0/24
166 rightnexthop=172.16.88.99
171 A note on terminology: There are two kinds of communications going on:
172 transmission of user IP packets, and gateway-to-gateway negotiations for
173 keying, rekeying, and general control.
174 The path to control the connection is called 'ISAKMP SA' in IKEv1 and
175 'IKE SA' in the IKEv2 protocol. That what is beeing negotiated, the kernel
176 level data path, is called 'IPsec SA'.
177 strongSwan currently uses two separate keying daemons. Pluto handles
178 all IKEv1 connections, Charon is the new daemon supporting the IKEv2 protocol.
179 Charon does not support all keywords yet.
181 To avoid trivial editing of the configuration file to suit it to each system
182 involved in a connection,
183 connection specifications are written in terms of
188 rather than in terms of local and remote.
189 Which participant is considered
194 IPsec figures out which one it is being run on based on internal information.
195 This permits using identical connection specifications on both ends.
196 There are cases where there is no symmetry; a good convention is to
199 for the local side and
201 for the remote side (the first letters are a good mnemonic).
203 Many of the parameters relate to one participant or the other;
206 are listed here, but every parameter whose name begins with
211 whose description is the same but with
217 Parameters are optional unless marked '(required)'.
218 .SS "CONN PARAMETERS"
219 Unless otherwise noted, for a connection to work,
220 in general it is necessary for the two ends to agree exactly
221 on the values of these parameters.
224 the type of the connection; currently the accepted values
228 signifying a host-to-host, host-to-subnet, or subnet-to-subnet tunnel;
230 signifying host-to-host transport mode;
232 signifying that no IPsec processing should be done at all;
234 signifying that packets should be discarded; and
236 signifying that packets should be discarded and a diagnostic ICMP returned.
237 Charon currently supports only
245 the IP address of the left participant's public-network interface,
246 in any form accepted by
247 .IR ipsec_ttoaddr (3)
248 or one of several magic values.
257 specification contains
260 will be filled in automatically with the local address
261 of the default-route interface (as determined at IPsec startup time);
262 this also overrides any value supplied for
273 signifies an address to be filled in (by automatic keying) during
277 private subnet behind the left participant, expressed as
278 \fInetwork\fB/\fInetmask\fR
279 (actually, any form acceptable to
280 .IR ipsec_ttosubnet (3));
281 if omitted, essentially assumed to be \fIleft\fB/32\fR,
282 signifying that the left end of the connection goes to the left participant
283 only. When using IKEv2, the configured subnet of the peers may differ, the
284 protocol narrows it to the greates common subnet.
287 next-hop gateway IP address for the left participant's connection
288 to the public network;
293 If the value is to be overridden by the
294 .B left=%defaultroute
296 an explicit value must
299 If that method is not being used,
305 .B interfaces=%defaultroute
310 the next-hop gateway address of the default-route interface
314 signifies a value to be filled in (by automatic keying)
315 with the peer's address.
316 Relevant only locally, other end need not agree on it. Currently not supported
320 what ``updown'' script to run to adjust routing and/or firewalling
321 when the status of the connection
323 .BR "ipsec _updown" ).
324 May include positional parameters separated by white space
325 (although this requires enclosing the whole string in quotes);
326 including shell metacharacters is unwise.
330 Relevant only locally, other end need not agree on it. IKEv2 uses the updown
331 script to insert firewall rules only. Routing is not support and will be
332 implemented directly into Charon.
335 whether the left participant is doing forwarding-firewalling
336 (including masquerading) for traffic from \fIleftsubnet\fR,
337 which should be turned off (for traffic to the other subnet)
338 once the connection is established;
339 acceptable values are
343 May not be used in the same connection description with
345 Implemented as a parameter to the default
349 Relevant only locally, other end need not agree on it.
351 If one or both security gateways are doing forwarding firewalling
352 (possibly including masquerading),
353 and this is specified using the firewall parameters,
354 tunnels established with IPsec are exempted from it
355 so that packets can flow unchanged through the tunnels.
356 (This means that all subnets connected in this manner must have
357 distinct, non-overlapping subnet address blocks.)
358 This is done by the default
361 .IR ipsec_pluto (8)).
363 In situations calling for more control,
364 it may be preferable for the user to supply his own
367 which makes the appropriate adjustments for his system.
370 what operation, if any, should be done automatically at IPsec startup;
371 currently-accepted values are
381 loads a connection without starting it.
383 loads a connection and installs kernel traps. If traffic is detected between
387 , a connection is established.
389 loads a connection and brings it up immediatly.
391 ignores the connection. This is equal to delete a connection from the config
393 Relevant only locally, other end need not agree on it
394 (but in general, for an intended-to-be-permanent connection,
397 to ensure that any reboot causes immediate renegotiation).
400 whether authentication should be done as part of
401 ESP encryption, or separately using the AH protocol;
402 acceptable values are
406 The IKEv2 daemon currently supports only ESP.
409 how the two security gateways should authenticate each other;
410 acceptable values are
414 for RSA digital signatures (the default),
418 if negotiation is never to be attempted or accepted (useful for shunt-only conns).
419 Digital signatures are superior in every way to shared secrets. In IKEv2, the
420 two ends must not agree on this parameter, it is relevant for the own
421 authentication method only. IKEv2 additionally supports the value
423 which indicates an initiator to request EAP authentication. The EAP method to
424 use is selected by the server (see
428 whether IPComp compression of content is proposed on the connection
429 (link-level compression does not work on encrypted data,
430 so to be effective, compression must be done \fIbefore\fR encryption);
431 acceptable values are
435 (the default). A value of
437 causes IPsec to propose both compressed and uncompressed,
438 and prefer compressed.
441 prevents IPsec from proposing compression;
442 a proposal to compress will still be accepted.
443 IKEv2 does not support IP compression yet.
446 controls the use of the Dead Peer Detection protocol (DPD, RFC 3706) where
447 R_U_THERE notification messages (IKEv1) or empty INFORMATIONAL messages (IKEv2)
448 are periodically sent in order to check the
449 liveliness of the IPsec peer. The values
453 both activate DPD. If no activity is detected, all connections with a dead peer
454 are stopped and unrouted (
456 ) or put in the hold state (
462 which disables the active sending of R_U_THERE notifications.
463 Nevertheless pluto will always send the DPD Vendor ID during connection set up
464 in order to signal the readiness to act passively as a responder if the peer
465 wants to use DPD. For
467 does't make sense, as all messages are used to detect dead peers. If specified,
468 it has the same meaning as the default (
473 defines the period time interval with which R_U_THERE messages/INFORMATIONAL
474 exchanges are sent to the peer. These are only sent if no other traffic is
475 received. In IKEv2, a value of 0 sends no additional INFORMATIONAL
476 messages and uses only standard messages (such as those to rekey) to detect
480 defines the timeout interval, after which all connections to a peer are deleted
481 in case of inactivity. This only applies to IKEv1, in IKEv2 the default
482 retransmission timeout applies, as every exchange is used to detect dead peers.
485 what to do with packets when negotiation fails.
493 have the obvious meanings. Has no effect in IKEv2 yet.
496 how long the keying channel of a connection ('ISAKMP/IKE SA')
497 should last before being renegotiated.
500 method of key exchange;
501 which protocol should be used to initialize the connection. Connections marked with
503 are initiated with pluto, those marked with
505 with charon. An incoming request from the remote peer is handled by the correct
506 daemon, unaffected from the
508 setting. The default value
510 currently behaves exactly as
514 how many attempts (a whole number or \fB%forever\fP) should be made to
515 negotiate a connection, or a replacement for one, before giving up
518 The value \fB%forever\fP
519 means 'never give up'.
520 Relevant only locally, other end need not agree on it.
523 how long a particular instance of a connection
524 (a set of encryption/authentication keys for user packets) should last,
525 from successful negotiation to expiry;
526 acceptable values are an integer optionally followed by
529 or a decimal number followed by
535 in minutes, hours, or days respectively)
540 Normally, the connection is renegotiated (via the keying channel)
542 The two ends need not exactly agree on
544 although if they do not,
545 there will be some clutter of superseded connections on the end
546 which thinks the lifetime is longer.
549 the distinguished name of a certificate authority which is required to
550 lie in the trust path going from the left participant's certificate up
551 to the root certification authority.
554 the path to the left participant's X.509 certificate. The file can be coded either in
555 PEM or DER format. OpenPGP certificates are supported as well.
556 Both absolute paths or paths relative to
557 .B /etc/ipsec.d/certs
558 are accepted. By default
562 to the distinguished name of the certificate's subject and
564 to the distinguished name of the certificate's issuer.
565 The left participant's ID can be overriden by specifying a
567 value which must be certified by the certificate, though.
570 a comma separated list of group names. If the
572 parameter is present then the peer must be a member of at least one
573 of the groups defined by the parameter. Group membership must be certified
574 by a valid attribute certificate stored in \fI/etc/ipsec.d/acerts\fP thas has been
575 issued to the peer by a trusted Authorization Authority stored in
576 \fI/etc/ipsec.d/aacerts\fP. Attribute certificates are not supported in IKEv2 yet.
581 should be identified for authentication;
584 Can be an IP address (in any
585 .IR ipsec_ttoaddr (3)
587 or a fully-qualified domain name preceded by
589 (which is used as a literal string and not resolved).
592 stands for the current setting of \fImyid\fP.
593 This is set in \fBconfig setup\fP or by \fIipsec_whack\fP(8)), or, if not set,
594 it is the IP address in \fB%defaultroute\fP (if that is supported by a TXT record in its reverse domain), or otherwise
595 it is the system's hostname (if that is supported by a TXT record in its forward domain), or otherwise it is undefined.
598 The internal source IP to use in a tunnel, also known as virtual IP. If the
603 an address is requested from the peer.
606 Not relevant for IKEv2, as subnets are narrowed.
609 whether Perfect Forward Secrecy of keys is desired on the connection's
611 (with PFS, penetration of the key-exchange protocol
612 does not compromise keys negotiated earlier);
613 acceptable values are
618 . IKEv2 always uses PFS for IKE_SA rekeying. PFS for rekeying IPsec SAs is
619 currently not supported.
622 whether a connection should be renegotiated when it is about to expire;
623 acceptable values are
628 The two ends need not agree,
631 prevents Pluto/Charon from requesting renegotiation,
632 it does not prevent responding to renegotiation requested from the other end,
635 will be largely ineffective unless both ends agree on it.
638 whether rekeying of an IKE_SA should also reauthenticate the peer. In IKEv1,
639 reauthentication is always done. In IKEv2, a value of
641 rekeys without uninstalling the IPsec SAs, a value of
643 (the default) creates a new IKE_SA from scratch and tries to recreate
647 maximum percentage by which
649 should be randomly increased to randomize rekeying intervals
650 (important for hosts with many connections);
651 acceptable values are an integer,
652 which may exceed 100,
660 after this random increase,
665 will suppress time randomization.
666 Relevant only locally, other end need not agree on it.
669 how long before connection expiry or keying-channel expiry
671 negotiate a replacement
672 begin; acceptable values as for
676 Relevant only locally, other end need not agree on it.
679 IKE/ISAKMP SA encryption/authentication algorithm to be used, e.g.
680 .B aes128-sha1-modp2048
681 (encryption-integrity-dhgroup). In IKEv2, multiple algorithms and proposals
682 may be included, such as
683 .B aes128-aes256-sha1-modp1536-modp2048,3des-sha1-md5-modp1024.
686 ESP encryption/authentication algorithm to be used
687 for the connection, e.g.
689 (encryption-integrity-[dh-group]). If dh-group is specified, CHILD_SA setup
690 and rekeying include a separate diffe hellman exchange (IKEv2 only).
693 AH authentication algorithm to be used
694 for the connection, e.g.
697 This are optional sections that can be used to assign special
698 parameters to a Certification Authority (CA). These parameters are not
699 supported in IKEv2 yet.
702 currently can have either the value
709 defines a path to the CA certificate either relative to
710 \fI/etc/ipsec.d/cacerts\fP or as an absolute path.
713 defines a CRL distribution point (ldap, http, or file URI)
716 defines an alternative CRL distribution point (ldap, http, or file URI)
719 defines an ldap host.
723 .SH "CONFIG SECTIONS"
726 section known to the IPsec software is the one named
728 which contains information used when the software is being started
730 .IR ipsec_setup (8)).
738 interfaces="ipsec0=eth1 ipsec1=ppp0"
745 Parameters are optional unless marked ``(required)''.
746 The currently-accepted
754 the identity to be used for
757 is used in the implicit policy group conns and can be used as
758 an identity in explicit conns.
761 is set to the IP address in \fB%defaultroute\fP (if that is supported by a TXT record in its reverse domain), or otherwise
762 the system's hostname (if that is supported by a TXT record in its forward domain), or otherwise it is undefined.
763 An explicit value generally starts with ``\fB@\fP''.
766 virtual and physical interfaces for IPsec to use:
768 \fIvirtual\fB=\fIphysical\fR pair, a (quoted!) list of pairs separated
771 One of the pairs may be written as
773 which means: find the interface \fId\fR that the default route points to,
774 and then act as if the value was ``\fBipsec0=\fId\fR''.
778 must be used to denote no interfaces.
781 is used (implicitly or explicitly)
782 information about the default route and its interface is noted for
791 should turn IP forwarding on
792 (if it's not already on) as IPsec is started,
793 and turn it off again (if it was off) as IPsec is stopped;
794 acceptable values are
798 For this to have full effect, forwarding must be
799 disabled before the hardware interfaces are brought
801 .B "net.ipv4.ip_forward\ =\ 0"
803 .IR /etc/sysctl.conf ),
804 because IPsec doesn't get control early enough to do that.
809 should adjust the reverse path filtering mechanism for the
810 physical devices to be used.
811 Values are \fB%unchanged\fP (to leave it alone)
812 or \fB0\fP, \fB1\fP, \fB2\fP (values to set it to).
813 \fI/proc/sys/net/ipv4/conf/PHYS/rp_filter\fP
814 is badly documented; it must be \fB0\fP in many cases
815 for ipsec to function.
816 The default value for the parameter is \fB0\fP.
821 ``facility'' name and priority to use for
822 startup/shutdown log messages,
827 how much Pluto debugging output should be logged.
831 means no debugging output (the default).
835 Otherwise only the specified types of output
836 (a quoted list, names without the
839 separated by white space) are enabled;
840 for details on available debugging types, see
844 how much Charon debugging output should be logged.
845 A comma separated list containing type level/pairs may
847 .B dmn 3, ike 1, net -1.
848 Acceptable values for types are
849 .B dmn, mgr, ike, chd, job, cfg, knl, net, enc, lib
850 and the level is one of
852 (for silent, audit, control, controlmore, raw, private)
855 additional options to pass to pluto upon startup. See
859 do not use syslog, but rather log to stderr, and direct stderr to the
863 in what directory should things started by
865 (notably the Pluto daemon) be allowed to
867 The empty value (the default) means they are not
871 whether to start Pluto or not;
877 (useful only in special circumstances).
880 should Pluto wait for each
881 negotiation attempt that is part of startup to
882 finish before proceeding with the next?
890 shell command to run before starting Pluto
891 (e.g., to decrypt an encrypted copy of the
894 It's run in a very simple way;
895 complexities like I/O redirection are best hidden within a script.
896 Any output is redirected for logging,
897 so running interactive commands is difficult unless they use
899 or equivalent for their interaction.
903 shell command to run after starting Pluto
904 (e.g., to remove a decrypted copy of the
907 It's run in a very simple way;
908 complexities like I/O redirection are best hidden within a script.
909 Any output is redirected for logging,
910 so running interactive commands is difficult unless they use
912 or equivalent for their interaction.
916 whether a tunnel's need to fragment a packet should be reported
917 back with an ICMP message,
918 in an attempt to make the sender lower his PMTU estimate;
919 acceptable values are
926 whether a tunnel packet's TOS field should be set to
928 rather than copied from the user packet inside;
929 acceptable values are
936 whether a particular participant ID should be kept unique,
937 with any new (automatically keyed)
938 connection using an ID from a different IP address
939 deemed to replace all old ones using that ID;
940 acceptable values are
945 Participant IDs normally \fIare\fR unique,
946 so a new (automatically-keyed) connection using the same ID is
947 almost invariably intended to replace an old one.
950 value that the MTU of the ipsec\fIn\fR interface(s) should be set to,
951 overriding IPsec's (large) default.
952 This parameter is needed only in special situations.
964 .SH CHOOSING A CONNECTION
966 When choosing a connection to apply to an outbound packet caught with a
968 the system prefers the one with the most specific eroute that
969 includes the packet's source and destination IP addresses.
970 Source subnets are examined before destination subnets.
971 For initiating, only routed connections are considered. For responding,
972 unrouted but added connections are considered.
974 When choosing a connection to use to respond to a negotiation which
975 doesn't match an ordinary conn, an opportunistic connection
976 may be instantiated. Eventually, its instance will be /32 -> /32, but
977 for earlier stages of the negotiation, there will not be enough
978 information about the client subnets to complete the instantiation.
989 ipsec(8), ipsec_ttoaddr(8), ipsec_auto(8), ipsec_manual(8), ipsec_rsasigkey(8)
991 Written for the FreeS/WAN project
992 <http://www.freeswan.org>
993 by Henry Spencer. Extended for the strongSwan project
994 <http://www.strongswan.org>
995 by Andreas Steffen. Updated to respect IKEv2 specific configuration
1007 strongSwan blocks outbound packets using eroutes, but assumes inbound
1008 blocking is handled by the firewall. strongSwan offers firewall hooks
1009 via an ``updown'' script. However, the default
1011 provides no help in controlling a modern firewall.
1013 Including attributes of the keying channel
1014 (authentication methods,
1017 as an attribute of a connection,
1018 rather than of a participant pair, is dubious and incurs limitations.
1021 is not nearly as generous about the syntax of subnets,
1022 addresses, etc. as the usual strongSwan user interfaces.
1023 Four-component dotted-decimal must be used for all addresses.
1026 smart enough to translate bit-count netmasks to dotted-decimal form.
1028 It would be good to have a line-continuation syntax,
1029 especially for the very long lines involved in
1032 The ability to specify different identities,
1034 and public keys for different automatic-keyed connections
1035 between the same participants is misleading;
1036 this doesn't work dependably because the identity of the participants
1037 is not known early enough.
1038 This is especially awkward for the ``Road Warrior'' case,
1039 where the remote IP address is specified as
1041 and that is considered to be the ``participant'' for such connections.
1043 In principle it might be necessary to control MTU on an
1044 interface-by-interface basis,
1045 rather than with the single global override that
1049 A number of features which \fIcould\fR be implemented in
1050 both manual and automatic keying
1051 actually are not yet implemented for manual keying.
1052 This is unlikely to be fixed any time soon.
1054 If conns are to be added before DNS is available,
1055 \fBleft=\fP\fIFQDN\fP,
1056 \fBleftnextop=\fP\fIFQDN\fP,
1058 .B leftrsasigkey=%dnsonload
1061 does not actually use the public key for our side of a conn but it
1062 isn't generally known at a add-time which side is ours (Road Warrior
1063 and Opportunistic conns are currently exceptions).
1065 The \fBmyid\fP option does not affect explicit \fB ipsec auto \-\-add\fP or \fBipsec auto \-\-replace\fP commands for implicit conns.