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. In IKEv2, a defined address is requested,
604 but the server may change it. If the server does not support it, the address
608 The internal source IP to use in a tunnel for the remote peer. If the
611 on the responder side, the initiator must propose a address which is then echoed
615 Not relevant for IKEv2, as subnets are narrowed.
618 whether Perfect Forward Secrecy of keys is desired on the connection's
620 (with PFS, penetration of the key-exchange protocol
621 does not compromise keys negotiated earlier);
622 acceptable values are
627 . IKEv2 always uses PFS for IKE_SA rekeying. PFS for rekeying IPsec SAs is
628 currently not supported.
631 whether a connection should be renegotiated when it is about to expire;
632 acceptable values are
637 The two ends need not agree,
640 prevents Pluto/Charon from requesting renegotiation,
641 it does not prevent responding to renegotiation requested from the other end,
644 will be largely ineffective unless both ends agree on it.
647 whether rekeying of an IKE_SA should also reauthenticate the peer. In IKEv1,
648 reauthentication is always done. In IKEv2, a value of
650 rekeys without uninstalling the IPsec SAs, a value of
652 (the default) creates a new IKE_SA from scratch and tries to recreate
656 maximum percentage by which
658 should be randomly increased to randomize rekeying intervals
659 (important for hosts with many connections);
660 acceptable values are an integer,
661 which may exceed 100,
669 after this random increase,
674 will suppress time randomization.
675 Relevant only locally, other end need not agree on it.
678 how long before connection expiry or keying-channel expiry
680 negotiate a replacement
681 begin; acceptable values as for
685 Relevant only locally, other end need not agree on it.
688 IKE/ISAKMP SA encryption/authentication algorithm to be used, e.g.
689 .B aes128-sha1-modp2048
690 (encryption-integrity-dhgroup). In IKEv2, multiple algorithms and proposals
691 may be included, such as
692 .B aes128-aes256-sha1-modp1536-modp2048,3des-sha1-md5-modp1024.
695 ESP encryption/authentication algorithm to be used
696 for the connection, e.g.
698 (encryption-integrity-[dh-group]). If dh-group is specified, CHILD_SA setup
699 and rekeying include a separate diffe hellman exchange (IKEv2 only).
702 AH authentication algorithm to be used
703 for the connection, e.g.
706 This are optional sections that can be used to assign special
707 parameters to a Certification Authority (CA). These parameters are not
708 supported in IKEv2 yet.
711 currently can have either the value
718 defines a path to the CA certificate either relative to
719 \fI/etc/ipsec.d/cacerts\fP or as an absolute path.
722 defines a CRL distribution point (ldap, http, or file URI)
725 defines an alternative CRL distribution point (ldap, http, or file URI)
728 defines an ldap host.
732 .SH "CONFIG SECTIONS"
735 section known to the IPsec software is the one named
737 which contains information used when the software is being started
739 .IR ipsec_setup (8)).
747 interfaces="ipsec0=eth1 ipsec1=ppp0"
754 Parameters are optional unless marked ``(required)''.
755 The currently-accepted
763 the identity to be used for
766 is used in the implicit policy group conns and can be used as
767 an identity in explicit conns.
770 is set to the IP address in \fB%defaultroute\fP (if that is supported by a TXT record in its reverse domain), or otherwise
771 the system's hostname (if that is supported by a TXT record in its forward domain), or otherwise it is undefined.
772 An explicit value generally starts with ``\fB@\fP''.
775 virtual and physical interfaces for IPsec to use:
777 \fIvirtual\fB=\fIphysical\fR pair, a (quoted!) list of pairs separated
780 One of the pairs may be written as
782 which means: find the interface \fId\fR that the default route points to,
783 and then act as if the value was ``\fBipsec0=\fId\fR''.
787 must be used to denote no interfaces.
790 is used (implicitly or explicitly)
791 information about the default route and its interface is noted for
800 should turn IP forwarding on
801 (if it's not already on) as IPsec is started,
802 and turn it off again (if it was off) as IPsec is stopped;
803 acceptable values are
807 For this to have full effect, forwarding must be
808 disabled before the hardware interfaces are brought
810 .B "net.ipv4.ip_forward\ =\ 0"
812 .IR /etc/sysctl.conf ),
813 because IPsec doesn't get control early enough to do that.
818 should adjust the reverse path filtering mechanism for the
819 physical devices to be used.
820 Values are \fB%unchanged\fP (to leave it alone)
821 or \fB0\fP, \fB1\fP, \fB2\fP (values to set it to).
822 \fI/proc/sys/net/ipv4/conf/PHYS/rp_filter\fP
823 is badly documented; it must be \fB0\fP in many cases
824 for ipsec to function.
825 The default value for the parameter is \fB0\fP.
830 ``facility'' name and priority to use for
831 startup/shutdown log messages,
836 how much Pluto debugging output should be logged.
840 means no debugging output (the default).
844 Otherwise only the specified types of output
845 (a quoted list, names without the
848 separated by white space) are enabled;
849 for details on available debugging types, see
853 how much Charon debugging output should be logged.
854 A comma separated list containing type level/pairs may
856 .B dmn 3, ike 1, net -1.
857 Acceptable values for types are
858 .B dmn, mgr, ike, chd, job, cfg, knl, net, enc, lib
859 and the level is one of
861 (for silent, audit, control, controlmore, raw, private)
864 additional options to pass to pluto upon startup. See
868 do not use syslog, but rather log to stderr, and direct stderr to the
872 in what directory should things started by
874 (notably the Pluto daemon) be allowed to
876 The empty value (the default) means they are not
880 whether to start Pluto or not;
886 (useful only in special circumstances).
889 should Pluto wait for each
890 negotiation attempt that is part of startup to
891 finish before proceeding with the next?
899 shell command to run before starting Pluto
900 (e.g., to decrypt an encrypted copy of the
903 It's run in a very simple way;
904 complexities like I/O redirection are best hidden within a script.
905 Any output is redirected for logging,
906 so running interactive commands is difficult unless they use
908 or equivalent for their interaction.
912 shell command to run after starting Pluto
913 (e.g., to remove a decrypted copy of the
916 It's run in a very simple way;
917 complexities like I/O redirection are best hidden within a script.
918 Any output is redirected for logging,
919 so running interactive commands is difficult unless they use
921 or equivalent for their interaction.
925 whether a tunnel's need to fragment a packet should be reported
926 back with an ICMP message,
927 in an attempt to make the sender lower his PMTU estimate;
928 acceptable values are
935 whether a tunnel packet's TOS field should be set to
937 rather than copied from the user packet inside;
938 acceptable values are
945 whether a particular participant ID should be kept unique,
946 with any new (automatically keyed)
947 connection using an ID from a different IP address
948 deemed to replace all old ones using that ID;
949 acceptable values are
954 Participant IDs normally \fIare\fR unique,
955 so a new (automatically-keyed) connection using the same ID is
956 almost invariably intended to replace an old one.
959 value that the MTU of the ipsec\fIn\fR interface(s) should be set to,
960 overriding IPsec's (large) default.
961 This parameter is needed only in special situations.
973 .SH CHOOSING A CONNECTION
975 When choosing a connection to apply to an outbound packet caught with a
977 the system prefers the one with the most specific eroute that
978 includes the packet's source and destination IP addresses.
979 Source subnets are examined before destination subnets.
980 For initiating, only routed connections are considered. For responding,
981 unrouted but added connections are considered.
983 When choosing a connection to use to respond to a negotiation which
984 doesn't match an ordinary conn, an opportunistic connection
985 may be instantiated. Eventually, its instance will be /32 -> /32, but
986 for earlier stages of the negotiation, there will not be enough
987 information about the client subnets to complete the instantiation.
998 ipsec(8), ipsec_ttoaddr(8), ipsec_auto(8), ipsec_manual(8), ipsec_rsasigkey(8)
1000 Written for the FreeS/WAN project
1001 <http://www.freeswan.org>
1002 by Henry Spencer. Extended for the strongSwan project
1003 <http://www.strongswan.org>
1004 by Andreas Steffen. Updated to respect IKEv2 specific configuration
1016 strongSwan blocks outbound packets using eroutes, but assumes inbound
1017 blocking is handled by the firewall. strongSwan offers firewall hooks
1018 via an ``updown'' script. However, the default
1020 provides no help in controlling a modern firewall.
1022 Including attributes of the keying channel
1023 (authentication methods,
1026 as an attribute of a connection,
1027 rather than of a participant pair, is dubious and incurs limitations.
1030 is not nearly as generous about the syntax of subnets,
1031 addresses, etc. as the usual strongSwan user interfaces.
1032 Four-component dotted-decimal must be used for all addresses.
1035 smart enough to translate bit-count netmasks to dotted-decimal form.
1037 It would be good to have a line-continuation syntax,
1038 especially for the very long lines involved in
1041 The ability to specify different identities,
1043 and public keys for different automatic-keyed connections
1044 between the same participants is misleading;
1045 this doesn't work dependably because the identity of the participants
1046 is not known early enough.
1047 This is especially awkward for the ``Road Warrior'' case,
1048 where the remote IP address is specified as
1050 and that is considered to be the ``participant'' for such connections.
1052 In principle it might be necessary to control MTU on an
1053 interface-by-interface basis,
1054 rather than with the single global override that
1058 A number of features which \fIcould\fR be implemented in
1059 both manual and automatic keying
1060 actually are not yet implemented for manual keying.
1061 This is unlikely to be fixed any time soon.
1063 If conns are to be added before DNS is available,
1064 \fBleft=\fP\fIFQDN\fP,
1065 \fBleftnextop=\fP\fIFQDN\fP,
1067 .B leftrsasigkey=%dnsonload
1070 does not actually use the public key for our side of a conn but it
1071 isn't generally known at a add-time which side is ours (Road Warrior
1072 and Opportunistic conns are currently exceptions).
1074 The \fBmyid\fP option does not affect explicit \fB ipsec auto \-\-add\fP or \fBipsec auto \-\-replace\fP commands for implicit conns.