xref: /netbsd-src/crypto/dist/ipsec-tools/src/racoon/racoon.conf.5 (revision 18dd566a909c3449f45784796f4e0e7a1c9224d3)
1.\"	$NetBSD: racoon.conf.5,v 1.70 2021/12/05 07:11:56 msaitoh Exp $
2.\"
3.\"	Id: racoon.conf.5,v 1.54 2006/08/22 18:17:17 manubsd Exp
4.\"
5.\" Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
6.\" All rights reserved.
7.\"
8.\" Redistribution and use in source and binary forms, with or without
9.\" modification, are permitted provided that the following conditions
10.\" are met:
11.\" 1. Redistributions of source code must retain the above copyright
12.\"    notice, this list of conditions and the following disclaimer.
13.\" 2. Redistributions in binary form must reproduce the above copyright
14.\"    notice, this list of conditions and the following disclaimer in the
15.\"    documentation and/or other materials provided with the distribution.
16.\" 3. Neither the name of the project nor the names of its contributors
17.\"    may be used to endorse or promote products derived from this software
18.\"    without specific prior written permission.
19.\"
20.\" THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
31.\"
32.Dd December 5, 2021
33.Dt RACOON.CONF 5
34.Os
35.\"
36.Sh NAME
37.Nm racoon.conf
38.Nd configuration file for racoon
39.\"
40.\" .Sh SYNOPSIS
41.\"
42.Sh DESCRIPTION
43.Nm
44is the configuration file for the
45.Xr racoon 8
46ISAKMP daemon.
47.Xr racoon 8
48negotiates security associations for itself (ISAKMP SA, or phase 1 SA)
49and for kernel IPsec (IPsec SA, or phase 2 SA).
50The file consists of a sequence of directives and statements.
51Each directive is composed by a tag and statements, enclosed by
52.Ql {
53and
54.Ql } .
55Lines beginning with
56.Ql #
57are comments.
58.\"
59.Ss Meta Syntax
60Keywords and special characters that the parser expects exactly are
61displayed using
62.Ic this
63font.
64Parameters are specified with
65.Ar this
66font.
67Square brackets
68.Po
69.Ql \&[
70and
71.Ql \&]
72.Pc
73are used to show optional keywords and parameters.
74Note that
75you have to pay attention when this manual is describing
76.Ar port
77numbers.
78The
79.Ar port
80number is always enclosed by
81.Ql \&[
82and
83.Ql \&] .
84In this case, the port number is not an optional keyword.
85If it is possible to omit the
86.Ar port
87number,
88the expression becomes
89.Bq Bq Ar port .
90The vertical bar
91.Pq Ql \&|
92is used to indicate
93a choice between optional parameters.
94Parentheses
95.Po
96.Ql \&(
97and
98.Ql \&)
99.Pc
100are used to group keywords and parameters when necessary.
101Major parameters are listed below.
102.Pp
103.Bl -tag -width addressx -compact
104.It Ar number
105means a hexadecimal or a decimal number.
106The former must be prefixed with
107.Ql Li 0x .
108.It Ar string
109.It Ar path
110.It Ar file
111means any string enclosed in
112.Ql \&"
113.Pq double quotes .
114.It Ar address
115means IPv6 and/or IPv4 address.
116.It Ar port
117means a TCP/UDP port number.
118The port number is always enclosed by
119.Ql \&[
120and
121.Ql \&] .
122.It Ar timeunit
123is one of following:
124.Ic sec , secs , second , seconds ,
125.Ic min , mins , minute , minutes ,
126.Ic hour , hours .
127.El
128.\"
129.Ss Privilege separation
130.Bl -tag -width Ds -compact
131.It Ic privsep { Ar statements Ic }
132Specifies privilege separation parameters.
133When enabled, these enable
134.Xr racoon 8
135to operate with an unprivileged instance doing most of the work, while
136a privileged instance takes care of performing the following operations
137as root: reading PSK and private keys, launching hook scripts, and
138validating passwords against system databases or against PAM.
139Please note that using privilege separation makes changes to the
140.Ar listen
141and
142.Ar paths
143sections ignored upon configuration reloads.
144A
145.Xr racoon 8
146restart is required if you want such changes to be taken into account.
147.Pp
148.Bl -tag -width Ds -compact
149.It Ic user Ar user ;
150The user to which the unprivileged instance of
151.Xr racoon 8 ,
152should switch.
153This can be a quoted user name or a numeric UID.
154.It Ic group Ar group ;
155The group the unprivileged instance of
156.Xr racoon 8 ,
157should switch.
158This can be a quoted group name or a numeric GID.
159.It Ic chroot Ar path ;
160A directory to which the unprivileged instance of
161.Xr racoon 8
162should
163.Xr chroot 2 .
164This directory should hold a tree where the following files must be
165reachable:
166.Bl -tag -width Ds -compact
167.It Pa /dev/random
168.It Pa /dev/urandom
169.It The certificates
170.It The file containing the Xauth banner
171.El
172.Pp
173The PSK file, the private keys, and the hook scripts are accessed through the
174privileged instance of
175.Xr racoon 8
176and do not need to be reachable in the
177.Xr chroot 2 Ap ed
178tree.
179.El
180.El
181.Ss Path Specification
182This section specifies various paths used by racoon.
183When running in privilege separation mode,
184.Ic certificate
185and
186.Ic script
187paths are mandatory.
188A
189.Xr racoon 8
190restart is required if you want path changes to be taken into account.
191.Bl -tag -width Ds -compact
192.It Ic path include Ar path ;
193Specifies a path to include a file.
194See
195.Sx File Inclusion .
196.It Ic path pre_shared_key Ar file ;
197Specifies a file containing pre-shared key(s) for various ID(s).
198See
199.Sx Pre-shared key File .
200.It Ic path certificate Ar path ;
201.Xr racoon 8
202will search this directory if a certificate or certificate request is received.
203If you run with privilege separation,
204.Xr racoon 8
205will refuse to use a certificate stored outside of this directory.
206.It Ic path backupsa Ar file ;
207Specifies a file to which SA information negotiated by
208racoon should be stored.
209.Xr racoon 8
210will install SA(s) from the file when started with the
211.Fl B
212flag.
213The file is growing because
214.Xr racoon 8
215simply adds SAs to it.
216You should maintain the file manually.
217.It Ic path script Ar path ;
218.Xr racoon 8
219will search this directory for scripts hooks.
220If you run with privilege separation,
221.Xr racoon 8
222will refuse to execute a script stored outside of this directory.
223.It Ic path pidfile Ar file ;
224Specifies file where to store PID of process.
225If path starts with
226.Pa /
227it is treated as an absolute path.
228Otherwise, it is treated as a relative
229path to the VARRUN directory specified at compilation time.
230Default is
231.Pa racoon.pid .
232.El
233.\"
234.Ss File Inclusion
235.Bl -tag -width Ds -compact
236.It Ic include Ar file
237Specifies other configuration files to be included.
238.El
239.\"
240.Ss Timer Specification
241.Bl -tag -width Ds -compact
242.It Ic timer { Ar statements Ic }
243This section specifies various timer values used by racoon.
244.Pp
245.Bl -tag -width Ds -compact
246.It Ic counter Ar number ;
247The maximum number of retries to send.
248The default is 5.
249.It Ic interval Ar number Ar timeunit ;
250The interval to resend, in seconds.
251The default time is 10 seconds.
252.It Ic persend Ar number ;
253The number of packets per send.
254The default is 1.
255.It Ic phase1 Ar number Ar timeunit ;
256The maximum time it should take to complete phase 1.
257The default time is 15 seconds.
258.It Ic phase2 Ar number Ar timeunit ;
259The maximum time it should take to complete phase 2.
260The default time is 10 seconds.
261.It Ic natt_keepalive Ar number Ar timeunit ;
262The interval between sending NAT-Traversal keep-alive packets.
263The default time is 20 seconds.
264Set to 0s to disable keep-alive packets.
265.El
266.El
267.\"
268.Ss Listening Port Specification
269.Bl -tag -width Ds -compact
270.It Ic listen { Ar statements Ic }
271If no
272.Ar listen
273directive is specified,
274.Xr racoon 8
275will listen on all available interface addresses.
276The following is the list of valid statements:
277.Pp
278.Bl -tag -width Ds -compact
279.\" How do I express bold brackets; `[' and `]' .
280.\" Answer: For bold brackets, do "Ic \&[ foo \&]".
281.\" Is the "Bq Ic [ Ar port ] ;" buggy ?
282.It Ic isakmp Ar address Bq Bq Ar port ;
283If this is specified,
284.Xr racoon 8
285will only listen on the defined
286.Ar address .
287The default port is 500, which is specified by IANA.
288You can provide more than one address definition.
289.It Ic isakmp_natt Ar address Bq Ar port ;
290Same as
291.Ic isakmp
292but also sets the socket options to accept UDP-encapsulated ESP traffic for
293NAT-Traversal.
294If you plan to use NAT-T, you should provide at least one address
295with port 4500, which is specified by IANA.
296There is no default.
297.It Ic strict_address ;
298Requires that all addresses for ISAKMP be bound.
299This statement will be ignored if you do not specify address definitions.
300.El
301When running in privilege separation mode, you need to restart
302.Xr racoon 8
303to have changes to the
304.Ar listen
305section taken into account.
306.Pp
307The
308.Ar listen
309section can also be used to specify the admin socket mode and ownership
310if racoon was built with support for admin port.
311.Bl -tag -width Ds -compact
312.It Ic adminsock Ar path Op Ar owner\ group\ mode ;
313The
314.Ar path ,
315.Ar owner ,
316and
317.Ar group
318values specify the socket path, owner, and group.
319They must be quoted.
320The defaults are
321.Pa /var/racoon/racoon.sock ,
322UID 0, and GID 0.
323.Ar mode
324is the access mode in octal.
325The default is 0600.
326.It Ic adminsock disabled ;
327This directive tells racoon to not listen on the admin socket.
328.El
329.El
330.\"
331.Ss Miscellaneous Global Parameters
332.Bl -tag -width Ds -compact
333.It Ic gss_id_enc Ar enctype ;
334Older versions of
335.Xr racoon 8
336used ISO-Latin-1 as the encoding of the GSS-API identifier attribute.
337For interoperability with Microsoft Windows' GSS-API authentication
338scheme, the default encoding has been changed to UTF-16LE.
339The
340.Ic gss_id_enc
341parameter allows
342.Xr racoon 8
343to be configured to use the old encoding for compatibility with existing
344.Xr racoon 8
345installations.
346The following are valid values for
347.Ar enctype :
348.Pp
349.Bl -tag -width Ds -compact
350.It Ic utf-16le
351Use UTF-16LE to encode the GSS-API identifier attribute.
352This is the default encoding.
353This encoding is compatible with Microsoft Windows.
354.It Ic latin1
355Use ISO-Latin-1 to encode the GSS-API identifier attribute.
356This is the encoding used by older versions of
357.Xr racoon 8 .
358.El
359.El
360.\"
361.Pp
362.Bl -tag -width Ds -compact
363.It Ic pfkey_buffer Ar kBytes
364Specifies the socket send/receive buffer size in kilobytes.
365Numerous kernel PF_KEY implementations have problems with dumping
366SAD/SDP with large amount of entries (this happens when 100s to
3671000s of tunnels are configured).
368.Pp
369The default value of 0 leaves everything at the OS-specific default value.
370If the default buffer size is greater than what is specified here racoon
371will not decrease it.
372.Pp
373This problem is known to be fixed in Linux 2.6.25 and later.
374.El
375.\"
376.Ss Remote Nodes Specifications
377.Bl -tag -width Ds -compact
378.It Ic remote Ar name Bo Ic inherit Ar parent_name Bc Ic { Ar statements Ic }
379.It Ic remote Ar name Ic inherit Ar parent_name ;
380Specifies the IKE phase 1 parameters for each remote node.
381.Pp
382If connection is initiated using racoonctl, a unique match using the
383remote IP must be found or the remote block name has to be given.
384For received acquires (kernel notices traffic requiring a new SA) the
385remote IP and remoteid from matching sainfo block are used to decide
386the remoteblock.
387If no uniquely matching remoteblock is found using
388these criteria, no connection attempt is done.
389.Pp
390When acting as responder, racoon picks the first proposal that has one
391or more acceptable remote configurations.
392When determining if a remote
393specification is matching the following information is checked:
394.Bl -bullet -width Ds -compact
395.It
396The remote IP is checked against
397.Ic remote_address .
398.It
399ISAKMP exchange type is checked against
400.Ic exchange_mode .
401.It
402ISAKMP SA attributes must match a
403.Ic proposal
404block.
405.It
406The remote identity is matched against
407.Ic peers_identifier
408if
409.Ic verify_identifier
410is on.
411.It
412If a certificate request was received, it must match the issuer of
413.Ic "certificate_type x509"
414certificate.
415If certificate request without issuer name was sent, the
416.Ic match_empty_cr
417parameter specifies whether or not remote block matches.
418.El
419.Pp
420Similarly, NAT-T is enabled if any of the initial remote configuration
421candidates allow NAT-T.
422.Pp
423Sections with
424.Ic inherit Ar parent
425statements (where
426.Ar parent
427is either
428.Ar address
429or a keyword
430.Ic anonymous )
431that have all values predefined to those of a given
432.Ar parent .
433In these sections it is enough to redefine only the changed parameters.
434.Pp
435The following are valid statements.
436.Pp
437.Bl -tag -width Ds -compact
438.\"
439.It Ic remote_address Ar address ;
440Defines the IP address of the peer.
441.\"
442.It Ic exchange_mode ( main | aggressive | base ) ;
443Defines the exchange mode for phase 1 when racoon is the initiator.
444It also means the acceptable exchange mode when racoon is the responder.
445More than one mode can be specified by separating them with a comma.
446All of the modes are acceptable.
447The first exchange mode is what racoon uses when it is the initiator.
448.\"
449.It Ic doi Ic ipsec_doi ;
450Means to use IPsec DOI as specified in RFC 2407.
451You can omit this statement.
452.\"
453.It Ic situation Ic identity_only ;
454Means to use SIT_IDENTITY_ONLY as specified in RFC 2407.
455You can omit this statement.
456.\"
457.It Ic my_identifier Bo Ar qualifier Bc Ar idtype ... ;
458Specifies the identifier sent to the remote host
459and the type to use in the phase 1 negotiation.
460.Ic address, fqdn , user_fqdn , keyid ,
461and
462.Ic asn1dn
463can be used as an
464.Ar idtype .
465The
466.Ar qualifier
467is currently only used for
468.Ic keyid ,
469and can be either
470.Ic file
471or
472.Ic tag .
473The possible values are :
474.Bl -tag -width Ds -compact
475.It Ic my_identifier Ic address Bq Ar address ;
476The type is the IP address.
477This is the default type if you do not specify an identifier to use.
478.It Ic my_identifier Ic user_fqdn Ar string ;
479The type is a USER_FQDN (user fully-qualified domain name).
480.It Ic my_identifier Ic fqdn Ar string ;
481The type is a FQDN (fully-qualified domain name).
482.It Ic my_identifier Ic keyid Bo Ic file Bc Ar file ;
483The type is a KEY_ID, read from the file.
484.It Ic my_identifier Ic keyid Ic tag Ar string ;
485The type is a KEY_ID, specified in the quoted string.
486.It Ic my_identifier Ic asn1dn Bq Ar string ;
487The type is an ASN.1 distinguished name.
488If
489.Ar string
490is omitted,
491.Xr racoon 8
492will get the DN from the Subject field in the certificate.
493.El
494.\"
495.It Ic xauth_login Bq Ar string ;
496Specifies the login to use in client-side Hybrid authentication.
497It is available only if
498.Xr racoon 8
499has been built with this option.
500The associated password is looked up in the pre-shared key files,
501using the login
502.Ic string
503as the key id.
504.\"
505.It Ic peers_identifier Ar idtype ... ;
506Specifies the peer's identifier to be received.
507If it is not defined then
508.Xr racoon 8
509will not verify the peer's identifier in ID payload transmitted from the peer.
510If it is defined, the behavior of the verification depends on the flag of
511.Ic verify_identifier .
512The usage of
513.Ar idtype
514is the same as
515.Ic my_identifier
516except that the individual component values of an
517.Ic asn1dn
518identifier may specified as
519.Ic *
520to match any value (e.g. "C=XX, O=MyOrg, OU=*, CN=Mine").
521The format of the
522specification should correspond to RFC 2253; in particular, commas and certain
523other characters -
524.Ic ,=+\*[Lt]\*[Gt]#;
525- may be included in a name by preceding them with a backslash "\e", and
526arbitrary characters may be inserted in a name with the "\enn" escape, where
527nn is the hex representation of the ascii value of the desired character.
528Alternative acceptable peer identifiers may be specified by repeating the
529.Ic peers_identifier
530statement.
531.\"
532.It Ic verify_identifier (on | off) ;
533If you want to verify the peer's identifier,
534set this to on.
535In this case, if the value defined by
536.Ic peers_identifier
537is not the same as the peer's identifier in the ID payload,
538the negotiation will fail.
539The default is off.
540.\"
541.It Ic certificate_type Ar certspec ;
542Specifies a certificate specification.
543.Ar certspec
544is one of followings:
545.Bl -tag -width Ds -compact
546.It Ic x509 Ar certfile Ar privkeyfile ;
547.Ar certfile
548means a file name of a certificate.
549.Ar privkeyfile
550means a file name of a secret key.
551.El
552.Bl -tag -width Ds -compact
553.It Ic plain_rsa Ar privkeyfile ;
554.Ar privkeyfile
555means a file name of a private key generated by
556.Xr plainrsa-gen 8 .
557Required
558for RSA authentication.
559.El
560.It Ic ca_type Ar cacertspec ;
561Specifies a root certificate authority specification.
562.Ar cacertspec
563is one of followings:
564.Bl -tag -width Ds -compact
565.It Ic x509 Ar cacertfile ;
566.Ar cacertfile
567means a file name of the root certificate authority.
568Default is
569.Pa /etc/openssl/cert.pem
570.El
571.\"
572.It Ic mode_cfg (on | off) ;
573Gather network information through ISAKMP mode configuration.
574Default is off.
575.\"
576.It Ic weak_phase1_check (on | off) ;
577Tells racoon to act on unencrypted deletion messages during phase 1.
578This is a small security risk, so the default is off, meaning that
579racoon will keep on trying to establish a connection even if the
580user credentials are wrong, for instance.
581.\"
582.It Ic peers_certfile ( dnssec | Ar certfile | Ic plain_rsa Ar pubkeyfile ) ;
583If
584.Ic dnssec
585is defined,
586.Xr racoon 8
587will ignore the CERT payload from the peer,
588and try to get the peer's certificate from DNS instead.
589If
590.Ar certfile
591is defined,
592.Xr racoon 8
593will ignore the CERT payload from the peer,
594and will use this certificate as the peer's certificate.
595If
596.Ic plain_rsa
597is defined,
598.Xr racoon 8
599will expect
600.Ar pubkeyfile
601to be the peer's public key that was generated by
602.Xr plainrsa-gen 8 .
603.\"
604.It Ic script Ar script Ic phase1_up
605.It Ic script Ar script Ic phase1_down
606.It Ic script Ar script Ic phase1_dead
607Shell scripts that get executed when a phase 1 SA goes up or down, or
608when it is detected as dead by DPD.
609All scripts get either
610.Ic phase1_up
611,
612.Ic phase1_down
613or
614.Ic phase1_dead
615as first argument, and the following
616variables are set in their environment:
617.Bl -tag -width Ds -compact
618.It Ev LOCAL_ADDR
619The local address of the phase 1 SA.
620.It Ev LOCAL_PORT
621The local port used for IKE for the phase 1 SA.
622.It Ev REMOTE_ADDR
623The remote address of the phase 1 SA.
624.It Ev REMOTE_PORT
625The remote port used for IKE for the phase 1 SA.
626.It Ev REMOTE_ID
627The remote identity received in IKE for the phase 1 SA.
628.El
629The following variables are only set if
630.Ic mode_cfg
631was enabled:
632.Bl -tag -width Ds -compact
633.It INTERNAL_ADDR4
634An IPv4 internal address obtained by ISAKMP mode config.
635.It INTERNAL_NETMASK4
636An IPv4 internal netmask obtained by ISAKMP mode config.
637.It INTERNAL_CIDR4
638An IPv4 internal netmask obtained by ISAKMP mode config, in CIDR notation.
639.It INTERNAL_DNS4
640The first internal DNS server IPv4 address obtained by ISAKMP mode config.
641.It INTERNAL_DNS4_LIST
642A list of internal DNS servers IPv4 address obtained by ISAKMP mode config,
643separated by spaces.
644.It INTERNAL_WINS4
645The first internal WINS server IPv4 address obtained by ISAKMP mode config.
646.It INTERNAL_WINS4_LIST
647A list of internal WINS servers IPv4 address obtained by ISAKMP mode config,
648separated by spaces.
649.It SPLIT_INCLUDE
650The space separated list of IPv4 addresses and masks (address slash mask)
651that define the networks to be encrypted (as opposed to the default where
652all the traffic should be encrypted) ; obtained by ISAKMP mode config ;
653SPLIT_INCLUDE and SPLIT_LOCAL are mutually exclusive.
654.It SPLIT_LOCAL
655The space separated list of IPv4 addresses and masks (address slash mask)
656that define the networks to be considered local, and thus excluded from the
657tunnels ; obtained by ISAKMP mode config.
658.It SPLIT_INCLUDE_CIDR
659Same as SPLIT_INCLUDE, with netmasks in CIDR notation.
660.It SPLIT_LOCAL_CIDR
661Same as SPLIT_LOCAL, with netmasks in CIDR notation.
662.It DEFAULT_DOMAIN
663The DNS default domain name obtained by ISAKMP mode config.
664.El
665.\"
666.\"
667.It Ic send_cert (on | off) ;
668If you do not want to send a certificate, set this to off.
669The default is on.
670.\"
671.It Ic send_cr (on | off) ;
672If you do not want to send a certificate request, set this to off.
673The default is on.
674.\"
675.It Ic match_empty_cr (on | off) ;
676Specifies whether this remote block is a valid match when a non-specific
677certificate request is received.
678The default is on.
679.\"
680.It Ic verify_cert (on | off) ;
681By default, the identifier sent by the remote host (as specified in its
682.Ic my_identifier
683statement) is compared with the credentials in the certificate
684used to authenticate the remote host as follows:
685.Bl -tag -width Ds -compact
686.It Type Ic asn1dn :
687The entire certificate subject name is compared with the identifier,
688e.g. "C=XX, O=YY, ...".
689.It Type Ic address, fqdn, or user_fqdn :
690The certificate's subjectAltName is compared with the identifier.
691.El
692If the two do not match the negotiation will fail.
693If you do not want to verify the identifier using the peer's certificate,
694set this to off.
695.\"
696.It Ic lifetime time Ar number Ar timeunit ;
697Define a lifetime of a certain time
698which will be proposed in the phase 1 negotiations.
699Any proposal will be accepted, and the attribute(s) will not be proposed to
700the peer if you do not specify it (them).
701They can be individually specified in each proposal.
702.\"
703.It Ic ike_frag (on | off | force) ;
704Enable receiver-side IKE fragmentation if
705.Xr racoon 8
706has been built with this feature.
707If set to on, racoon will advertise
708itself as being capable of receiving packets split by IKE fragmentation.
709This extension is there to work around broken firewalls that do not
710work with fragmented UDP packets.
711IKE fragmentation is always enabled on the sender-side, and it is
712used if the peer advertises itself as IKE fragmentation capable.
713By selecting force, IKE Fragmentation will
714be used when racoon is acting as the initiator even before the remote
715peer has advertised itself as IKE fragmentation capable.
716.\"
717.It Ic esp_frag Ar fraglen ;
718This option is only relevant if you use NAT traversal in tunnel mode.
719Its purpose is to work around broken DSL routers that reject UDP
720fragments, by fragmenting the IP packets before ESP encapsulation.
721The result is ESP over UDP of fragmented packets instead of fragmented
722ESP over UDP packets (i.e., IP:UDP:ESP:frag(IP) instead of
723frag(IP:UDP:ESP:IP)).
724.Ar fraglen
725is the maximum size of the fragments.
726552 should work anywhere,
727but the higher
728.Ar fraglen
729is, the better the performance.
730.Pp
731Note that because PMTU discovery is broken on many sites, you will
732have to use MSS clamping if you want TCP to work correctly.
733.\"
734.It Ic initial_contact (on | off) ;
735Enable this to send an INITIAL-CONTACT message.
736The default value is
737.Ic on .
738This message is useful only when the responder implementation chooses an
739old SA when there are multiple SAs with different established time and the
740initiator reboots.
741If racoon did not send the message,
742the responder would use an old SA even when a new SA was established.
743For systems that use a KAME derived IPSEC stack, the
744.Xr sysctl 8
745variable net.key.preferred_oldsa can be used to control this preference.
746When the value is zero, the stack always uses a new SA.
747.\"
748.It Ic passive (on | off) ;
749If you do not want to initiate the negotiation, set this to on.
750The default value is
751.Ic off .
752It is useful for a server.
753.\"
754.It Ic proposal_check Ar level ;
755Specifies the action of lifetime length, key length, and PFS of the phase 2
756selection on the responder side, and the action of lifetime check in
757phase 1.
758The default level is
759.Ic strict .
760If the
761.Ar level
762is:
763.Bl -tag -width Ds -compact
764.It Ic obey
765The responder will obey the initiator anytime.
766.It Ic strict
767If the responder's lifetime length is longer than the initiator's or
768the responder's key length is shorter than the initiator's,
769the responder will use the initiator's value.
770Otherwise, the proposal will be rejected.
771If PFS is not required by the responder, the responder will obey the proposal.
772If PFS is required by both sides and the responder's group is not equal to
773the initiator's, then the responder will reject the proposal.
774.It Ic claim
775If the responder's lifetime length is longer than the initiator's or
776the responder's key length is shorter than the initiator's,
777the responder will use the initiator's value.
778If the responder's lifetime length is shorter than the initiator's,
779the responder uses its own length AND sends a RESPONDER-LIFETIME notify
780message to an initiator in the case of lifetime (phase 2 only).
781For PFS, this directive behaves the same as
782.Ic strict .
783.It Ic exact
784If the initiator's lifetime or key length is not equal to the responder's,
785the responder will reject the proposal.
786If PFS is required by both sides and the responder's group is not equal to
787the initiator's, then the responder will reject the proposal.
788.El
789.\"
790.It Ic support_proxy (on | off) ;
791If this value is set to on, then both values of ID payloads in the
792phase 2 exchange are always used as the addresses of end-point of
793IPsec-SAs.
794The default is off.
795.\"
796.It Ic generate_policy (on | off | require | unique) ;
797This directive is for the responder.
798Therefore you should set
799.Ic passive
800to on in order that
801.Xr racoon 8
802only becomes a responder.
803If the responder does not have any policy in SPD during phase 2
804negotiation, and the directive is set to on, then
805.Xr racoon 8
806will choose the first proposal in the
807SA payload from the initiator, and generate policy entries from the proposal.
808It is useful to negotiate with clients whose IP address is allocated
809dynamically.
810Note that an inappropriate policy might be installed into the responder's SPD
811by the initiator,
812so other communications might fail if such policies are installed
813due to a policy mismatch between the initiator and the responder.
814.Ic on
815and
816.Ic require
817values mean the same thing (generate a require policy).
818.Ic unique
819tells racoon to set up unique policies, with a monotoning increasing
820reqid number (between 1 and IPSEC_MANUAL_REQID_MAX).
821This directive is ignored in the initiator case.
822The default value is
823.Ic off .
824.\"
825.\"
826.It Ic nat_traversal (on | off | force) ;
827This directive enables use of the NAT-Traversal IPsec extension
828(NAT-T).
829NAT-T allows one or both peers to reside behind a NAT gateway (i.e.,
830doing address- or port-translation).
831If a NAT gateway is detected during the phase 1 handshake, racoon will
832attempt to negotiate the use of NAT-T with the remote peer.
833If the negotiation succeeds, all ESP and AH packets for the given connection
834will be encapsulated into UDP datagrams (port 4500, by default).
835Possible values are:
836.Bl -tag -width Ds -compact
837.It Ic on
838NAT-T is used when a NAT gateway is detected between the peers.
839.It Ic off
840NAT-T is not proposed/accepted.
841This is the default.
842.It Ic force
843NAT-T is used regardless of whether a NAT gateway is detected between the
844peers or not.
845.El
846Please note that NAT-T support is a compile-time option.
847Although it is enabled in the source distribution by default, it
848may not be available in your particular build.
849In that case you will get a
850warning when using any NAT-T related config options.
851.\"
852.It Ic dpd_delay Ar delay ;
853This option activates the DPD and sets the time (in seconds) allowed
854between 2 proof of liveliness requests.
855The default value is
856.Ic 0 ,
857which disables DPD monitoring, but still negotiates DPD support.
858.\"
859.It Ic dpd_retry Ar delay ;
860If
861.Ic dpd_delay
862is set, this sets the delay (in seconds) to wait for a proof of
863liveliness before considering it as failed and send another request.
864The default value is
865.Ic 5 .
866.\"
867.It Ic dpd_maxfail Ar number ;
868If
869.Ic dpd_delay
870is set, this sets the maximum number of liveliness proofs to request
871(without reply) before considering the peer is dead.
872The default value is
873.Ic 5 .
874.\"
875.It Ic rekey (on | off | force) ;
876Enable automatic renegotiation of expired phase1 when there are non-dying
877phase2 SAs.
878Possible values are:
879.Bl -tag -width Ds -compact
880.It Ic force
881Rekeying is done unconditionally.
882.It Ic on
883Rekeying is done only if DPD monitoring is active.
884This is the default.
885.It Ic off
886No automatic rekeying.
887Do note that turning off automatic rekeying will
888result in inaccurate DPD monitoring.
889.El
890.\"
891.It Ic nonce_size Ar number ;
892define the byte size of nonce value.
893Racoon can send any value although
894RFC2409 specifies that the value MUST be between 8 and 256 bytes.
895The default size is 16 bytes.
896.\"
897.It Ic ph1id Ar number ;
898An optional number to identify the remote proposal and to link it
899only with sainfos who have the same number.
900Defaults to 0.
901.\"
902.It Ic proposal { Ar sub-substatements Ic }
903.Bl -tag -width Ds -compact
904.\"
905.It Ic encryption_algorithm Ar algorithm ;
906Specifies the encryption algorithm used for the phase 1 negotiation.
907This directive must be defined.
908.Ar algorithm
909is one of following:
910.Ic des, 3des, blowfish, cast128, aes, camellia
911.\".Ic rc5 , idea
912for Oakley.
913For other transforms, this statement should not be used.
914.\"
915.It Ic hash_algorithm Ar algorithm ;
916Defines the hash algorithm used for the phase 1 negotiation.
917This directive must be defined.
918.Ar algorithm
919is one of following:
920.Ic md5, sha1, sha256, sha384, sha512
921for Oakley.
922.\"
923.It Ic authentication_method Ar type ;
924Defines the authentication method used for the phase 1 negotiation.
925This directive must be defined.
926.Ar type
927is one of:
928.Ic pre_shared_key , rsasig
929(for plain RSA authentication),
930.Ic gssapi_krb , hybrid_rsa_server ,
931.Ic hybrid_rsa_client , xauth_rsa_server , xauth_rsa_client , xauth_psk_server
932or
933.Ic xauth_psk_client .
934.\"
935.It Ic dh_group Ar group ;
936Defines the group used for the Diffie-Hellman exponentiations.
937This directive must be defined.
938.Ar group
939is one of following:
940.Ic modp768 , modp1024 , modp1536 ,
941.Ic modp2048 , modp3072 , modp4096 ,
942.Ic modp6144 , modp8192 .
943Or you can define 1, 2, 5, 14, 15, 16, 17, or 18 as the DH group number.
944When you want to use aggressive mode,
945you must define the same DH group in each proposal.
946.It Ic lifetime time Ar number Ar timeunit ;
947Defines the lifetime of the phase 1 SA proposal.
948Refer to the description of the
949.Ic lifetime
950directive defined in the
951.Ic remote
952directive.
953.It Ic gss_id Ar string ;
954Defines the GSS-API endpoint name, to be included as an attribute in the SA,
955if the
956.Ic gssapi_krb
957authentication method is used.
958If this is not defined, the default value of
959.Ql host/hostname
960is used, where hostname is the value returned by the
961.Xr hostname 1
962command.
963.El
964.El
965.Pp
966.It Ic remote Po Ar address | Ic anonymous Pc Bo Bo Ar port Bc Bc \
967Bo Ic inherit Ar parent Bc Ic { Ar statements Ic }
968Deprecated format of specifying a remote block.
969This will be removed in future.
970It is a remnant from time when remote block was decided
971solely based on the peers IP address.
972.Pp
973This is equivalent to:
974.Bd -literal -offset
975remote "address" [inherit "parent-address"] {
976	remote_address address;
977}
978.Ed
979.El
980.\"
981.Ss Sainfo Specifications
982.Bl -tag -width Ds -compact
983.It Ic sainfo Po Ar local_id | Ic anonymous Pc \
984Po Ar remote_id | Ic clientaddr | Ic anonymous Pc \
985Bo Ic from Ar idtype Bo Ar string Bc Bc Bo Ic group Ar string Bc \
986Ic { Ar statements Ic }
987Defines the parameters of the IKE phase 2 (IPsec-SA establishment).
988.Pp
989The
990.Ar local_id
991and
992.Ar remote_id
993strings are constructed like:
994.Pp
995.Ic address Ar address
996.Bq Ic / Ar prefix
997.Bq Ic [ Ar port ]
998.Ar ul_proto
999.Pp
1000or
1001.Pp
1002.Ic subnet Ar address
1003.Bq Ic / Ar prefix
1004.Bq Ic [ Ar port ]
1005.Ar ul_proto
1006.Pp
1007An id string should be expressed to match the exact value of an ID payload.
1008This is not like a filter rule.
1009For example, if you define 3ffe:501:4819::/48 as
1010.Ar local_id .
10113ffe:501:4819:1000:/64 will not match.
1012In the case of a longest prefix (selecting a single host),
1013.Ar address
1014instructs to send ID type of ADDRESS while
1015.Ar subnet
1016instructs to send ID type of SUBNET.
1017Otherwise, these instructions are identical.
1018.Pp
1019The
1020.Ic anonymous
1021keyword can be used to match any id.
1022The
1023.Ic clientaddr
1024keyword can be used to match a remote id that is equal to either the peer
1025ip address or the mode_cfg ip address (if assigned).
1026This can be useful
1027to restrict policy generation when racoon is acting as a client gateway
1028for peers with dynamic ip addresses.
1029.Pp
1030The
1031.Ic from
1032keyword allows an sainfo to only match for peers that use a specific phase1
1033id value during authentication.
1034The
1035.Ic group
1036keyword allows an XAuth group membership check to be performed
1037for this sainfo section.
1038When the mode_cfg auth source is set to
1039.Ic system
1040or
1041.Ic ldap ,
1042the XAuth user is verified to be a member of the specified group
1043before allowing a matching SA to be negotiated.
1044.Pp
1045.Bl -tag -width Ds -compact
1046.\"
1047.It Ic pfs_group Ar group ;
1048define the group of Diffie-Hellman exponentiations.
1049If you do not require PFS then you can omit this directive.
1050Any proposal will be accepted if you do not specify one.
1051.Ar group
1052is one of following:
1053.Ic modp768 , modp1024 , modp1536 ,
1054.Ic modp2048 , modp3072 , modp4096 ,
1055.Ic modp6144 , modp8192 .
1056Or you can define 1, 2, 5, 14, 15, 16, 17, or 18 as the DH group number.
1057.\"
1058.It Ic lifetime time Ar number Ar timeunit ;
1059define how long an IPsec-SA will be used, in timeunits.
1060Any proposal will be accepted, and no attribute(s) will be proposed to
1061the peer if you do not specify it(them).
1062See the
1063.Ic proposal_check
1064directive.
1065.\"
1066.It Ic remoteid Ar number ;
1067Sainfos will only be used if their remoteid matches the ph1id of the
1068remote section used for phase 1.
1069Defaults to 0, which is also the default for ph1id.
1070.El
1071.\"
1072.Pp
1073.Xr racoon 8
1074does not have a list of security protocols to be negotiated.
1075The list of security protocols are passed by SPD in the kernel.
1076Therefore you have to define all of the potential algorithms
1077in the phase 2 proposals even if there are algorithms which will not be used.
1078These algorithms are define by using the following three directives,
1079with a single comma as the separator.
1080For algorithms that can take variable-length keys, algorithm names
1081can be followed by a key length, like
1082.Dq Li blowfish 448 .
1083.Xr racoon 8
1084will compute the actual phase 2 proposals by computing
1085the permutation of the specified algorithms,
1086and then combining them with the security protocol specified by the SPD.
1087For example, if
1088.Ic des , 3des , hmac_md5 ,
1089and
1090.Ic hmac_sha1
1091are specified as algorithms, we have four combinations for use with ESP,
1092and two for AH.
1093Then, based on the SPD settings,
1094.Xr racoon 8
1095will construct the actual proposals.
1096If the SPD entry asks for ESP only, there will be 4 proposals.
1097If it asks for both AH and ESP, there will be 8 proposals.
1098Note that the kernel may not support the algorithm you have specified.
1099.\"
1100.Bl -tag -width Ds -compact
1101.It Ic encryption_algorithm Ar algorithms ;
1102.Ic des , 3des , des_iv64 , des_iv32 ,
1103.Ic rc5 , rc4 , idea , 3idea ,
1104.Ic cast128 , blowfish , null_enc ,
1105.Ic twofish , rijndael , aes , camellia , aes_gcm_16
1106.Pq used with ESP
1107.\"
1108.It Ic authentication_algorithm Ar algorithms ;
1109.Ic hmac_md5 , hmac_sha1 , hmac_sha256, hmac_sha384, hmac_sha512, non_auth
1110.Pq used with ESP authentication and AH
1111.\"
1112.It Ic compression_algorithm Ar algorithms ;
1113.Ic deflate
1114.Pq used with IPComp
1115.El
1116.El
1117.\"
1118.Ss Logging level
1119.Bl -tag -width Ds -compact
1120.It Ic log Ar level ;
1121Defines the logging level.
1122.Ar level
1123is one of following:
1124.Ic error , warning , notify , info , debug
1125or
1126.Ic debug2 .
1127The default is
1128.Ic info .
1129If you set the logging level too high on slower machines,
1130IKE negotiation can fail due to timing constraint changes.
1131.El
1132.\"
1133.Ss Specifies the way to pad
1134.Bl -tag -width Ds -compact
1135.It Ic padding { Ar statements Ic }
1136specifies the padding format.
1137The following are valid statements:
1138.Bl -tag -width Ds -compact
1139.It Ic randomize (on | off) ;
1140Enables the use of a randomized value for padding.
1141The default is on.
1142.It Ic randomize_length (on | off) ;
1143The pad length will be random.
1144The default is off.
1145.It Ic maximum_length Ar number ;
1146Defines a maximum padding length.
1147If
1148.Ic randomize_length
1149is off, this is ignored.
1150The default is 20 bytes.
1151.It Ic exclusive_tail (on | off) ;
1152Means to put the number of pad bytes minus one into the last part
1153of the padding.
1154The default is on.
1155.It Ic strict_check (on | off) ;
1156Means to constrain the peer to set the number of pad bytes.
1157The default is off.
1158.El
1159.El
1160.Ss ISAKMP mode configuration settings
1161.Bl -tag -width Ds -compact
1162.It Ic mode_cfg { Ar statements Ic }
1163Defines the information to return for remote hosts' ISAKMP mode config
1164requests.
1165Also defines the authentication source for remote peers
1166authenticating through Xauth.
1167.Pp
1168The following are valid statements:
1169.Bl -tag -width Ds -compact
1170.It Ic auth_source (system | radius | pam | ldap) ;
1171Specifies the source for authentication of users through Xauth.
1172.Ar system
1173means to use the Unix user database.
1174This is the default.
1175.Ar radius
1176means to use a RADIUS server.
1177It works only if
1178.Xr racoon 8
1179was built with libradius support.
1180Radius configuration is handled by statements in the
1181.Ic radiuscfg
1182section.
1183.Ar pam
1184means to use PAM.
1185It works only if
1186.Xr racoon 8
1187was built with libpam support.
1188.Ar ldap
1189means to use LDAP.
1190It works only if
1191.Xr racoon 8
1192was built with libldap support.
1193LDAP configuration is handled by statements in the
1194.Ic ldapcfg
1195section.
1196.It Ic auth_groups Ar "group1", ... ;
1197Specifies the group memberships for Xauth in quoted group name strings.
1198When defined, the authenticating user must be a member of at least one
1199group for Xauth to succeed.
1200.It Ic group_source (system | ldap) ;
1201Specifies the source for group validation of users through Xauth.
1202.Ar system
1203means to use the Unix user database.
1204This is the default.
1205.Ar ldap
1206means to use LDAP.
1207It works only if
1208.Xr racoon 8
1209was built with libldap support and requires LDAP authentication.
1210LDAP configuration is handled by statements in the
1211.Ic ldapcfg
1212section.
1213.It Ic conf_source (local | radius | ldap) ;
1214Specifies the source for IP addresses and netmask allocated through ISAKMP
1215mode config.
1216.Ar local
1217means to use the local IP pool defined by the
1218.Ic network4
1219and
1220.Ic pool_size
1221statements.
1222This is the default.
1223.Ar radius
1224means to use a RADIUS server.
1225It works only if
1226.Xr racoon 8
1227was built with libradius support and requires RADIUS authentication.
1228RADIUS configuration is handled by statements in the
1229.Ic radiuscfg
1230section.
1231.Ar ldap
1232means to use an LDAP server.
1233It works only if
1234.Xr racoon 8
1235was built with libldap support and requires LDAP authentication.
1236LDAP configuration is handled by
1237statements in the
1238.Ic ldapcfg
1239section.
1240.It Ic accounting (none | system | radius | pam) ;
1241Enables or disables accounting for Xauth logins and logouts.
1242The default is
1243.Ar none
1244which disable accounting.
1245Specifying
1246.Ar system
1247enables system accounting through
1248.Xr utmp 5 .
1249Specifying
1250.Ar radius
1251enables RADIUS accounting.
1252It works only if
1253.Xr racoon 8
1254was built with libradius support and requires RADIUS authentication.
1255RADIUS configuration is handled by statements in the
1256.Ic radiuscfg
1257section.
1258Specifying
1259.Ar pam
1260enables PAM accounting.
1261It works only if
1262.Xr racoon 8
1263was build with libpam support and requires PAM authentication.
1264.It Ic pool_size Ar size
1265Specify the size of the IP address pool, either local or allocated
1266through RADIUS.
1267.Ic conf_source
1268selects the local pool or the RADIUS configuration, but in both
1269configurations, you cannot have more than
1270.Ar size
1271users connected at the same time.
1272The default is 255.
1273.It Ic network4 Ar address ;
1274.It Ic netmask4 Ar address ;
1275The local IP pool base address and network mask from which dynamically
1276allocated IPv4 addresses should be taken.
1277This is used if
1278.Ic conf_source
1279is set to
1280.Ar local
1281or if the RADIUS server returned
1282.Ar 255.255.255.254 .
1283Default is
1284.Ar 0.0.0.0/0.0.0.0 .
1285.It Ic dns4 Ar addresses ;
1286A list of IPv4 addresses for DNS servers, separated by commas, or on multiple
1287.Ic dns4
1288lines.
1289.It Ic wins4 Ar addresses ;
1290A list of IPv4 address for WINS servers.
1291The keyword
1292.It nbns4
1293can also be used as an alias for
1294.It wins4 .
1295.It Ic split_network (include | local_lan) Ar network/mask, ...
1296The network configuration to send, in CIDR notation (e.g. 192.168.1.0/24).
1297If
1298.Ic include
1299is specified, the tunnel should be only used to encrypt the indicated
1300destinations ; otherwise, if
1301.Ic local_lan
1302is used, everything will pass through the tunnel but those destinations.
1303.It Ic default_domain Ar domain ;
1304The default DNS domain to send.
1305.It Ic split_dns Ar "domain", ...
1306The split dns configuration to send, in quoted domain name strings.
1307This list can be used to describe a list of domain names for which
1308a peer should query a modecfg assigned dns server.
1309DNS queries for all other domains would be handled locally.
1310(Cisco VPN client only).
1311.It Ic banner Ar path ;
1312The path of a file displayed on the client at connection time.
1313Default is
1314.Ar /etc/motd .
1315.It Ic auth_throttle Ar delay ;
1316On each failed Xauth authentication attempt, refuse new attempts for a set
1317.Ar delay
1318of seconds.
1319This is to avoid dictionary attacks on Xauth passwords.
1320Default is one second.
1321Set to zero to disable authentication delay.
1322.It Ic pfs_group Ar group ;
1323Sets the PFS group used in the client proposal (Cisco VPN client only).
1324Default is 0.
1325.It Ic save_passwd (on | off) ;
1326Allow the client to save the Xauth password (Cisco VPN client only).
1327Default is off.
1328.El
1329.El
1330.Ss Ldap configuration settings
1331.Bl -tag -width Ds -compact
1332.It Ic ldapcfg { Ar statements Ic }
1333Defines the parameters that will be used to communicate with an ldap
1334server for
1335.Ic xauth
1336authentication.
1337.Pp
1338The following are valid statements:
1339.Bl -tag -width Ds -compact
1340.It Ic version (2 | 3) ;
1341The ldap protocol version used to communicate with the server.
1342The default is
1343.Ic 3 .
1344.It Ic host Ar (hostname | address) ;
1345The host name or ip address of the ldap server.
1346The default is
1347.Ic localhost .
1348.It Ic port Ar number ;
1349The port that the ldap server is configured to listen on.
1350The default is
1351.Ic 389 .
1352.It Ic uri Ar (ldapuri) ;
1353URI(s) referring to the ldap server(s); a list of URI, separated by
1354whitespace or commas.
1355It takes precedence over
1356.Ic host/port .
1357.It Ic timeout Ar (number) ;
1358network timeout connecting to the ldap server(s).
1359The default is the default connect timeout from the underlying protocol.
1360.It Ic tls (on | off) ;
1361Use TLS with the ldap server.
1362The default is
1363.Ic off .
1364.It Ic base Ar distinguished name ;
1365The ldap search base.
1366This option has no default value.
1367.It Ic subtree (on | off) ;
1368Use the subtree ldap search scope.
1369Otherwise, use the one level search scope.
1370The default is
1371.Ic off .
1372.It Ic bind_dn Ar distinguished name ;
1373The user dn used to optionally bind as before performing ldap search operations.
1374If this option is not specified, anonymous binds are used.
1375.It Ic bind_pw Ar string ;
1376The password used when binding as
1377.Ic bind_dn .
1378.It Ic attr_user Ar attribute name ;
1379The attribute used to specify a users name in an ldap directory.
1380For example,
1381if a user dn is "cn=jdoe,dc=my,dc=net" then the attribute would be "cn".
1382The default value is
1383.Ic cn .
1384.It Ic attr_addr Ar attribute name ;
1385.It Ic attr_mask Ar attribute name ;
1386The attributes used to specify a users network address and subnet mask in an
1387ldap directory.
1388These values are forwarded during mode_cfg negotiation when
1389the conf_source is set to ldap.
1390The default values are
1391.Ic racoon-address
1392and
1393.Ic racoon-netmask .
1394.It Ic attr_group Ar attribute name ;
1395The attribute used to specify a group name in an ldap directory.
1396For example,
1397if a group dn is "cn=users,dc=my,dc=net" then the attribute would be "cn".
1398The default value is
1399.Ic cn .
1400.It Ic attr_member Ar attribute name ;
1401The attribute used to specify group membership in an ldap directory.
1402The default value is
1403.Ic member .
1404.It Ic debug Ar (number) ;
1405Set ldap debug level.
1406The default value is 0.
1407.El
1408.El
1409.Ss Radius configuration settings
1410.Bl -tag -width Ds -compact
1411.It Ic radiuscfg { Ar statements Ic }
1412Defines the parameters that will be used to communicate with radius
1413servers for
1414.Ic xauth
1415authentication.
1416If radius is selected as the xauth authentication or accounting
1417source and no servers are defined in this section, settings from
1418the system
1419.Xr radius.conf 5
1420configuration file will be used instead.
1421.Pp
1422The following are valid statements:
1423.Bl -tag -width Ds -compact
1424.It Ic auth Ar (hostname | address) [port] sharedsecret ;
1425The host name or ip address, optional port value and shared secret value
1426of a radius authentication server.
1427Up to 5 radius authentication servers
1428may be specified using multiple lines.
1429.It Ic acct Ar (hostname | address) [port] sharedsecret ;
1430The host name or ip address, optional port value and shared secret value
1431of a radius accounting server.
1432Up to 5 radius accounting servers may be
1433specified using multiple lines.
1434.It Ic timeout Ar seconds ;
1435The timeout for receiving replies from radius servers.
1436The default is
1437.Ic 3 .
1438.It Ic retries Ar count ;
1439The maximum number of repeated requests to make before giving up
1440on a radius server.
1441The default is
1442.Ic 3 .
1443.El
1444.El
1445.Ss Special directives
1446.Bl -tag -width Ds -compact
1447.It Ic complex_bundle (on | off) ;
1448defines the interpretation of proposal in the case of SA bundle.
1449Normally
1450.Dq IP AH ESP IP payload
1451is proposed as
1452.Dq AH tunnel and ESP tunnel .
1453The interpretation is more common to other IKE implementations, however,
1454it allows very limited set of combinations for proposals.
1455With the option enabled, it will be proposed as
1456.Dq AH transport and ESP tunnel .
1457The default value is
1458.Ic off .
1459.El
1460.\"
1461.Ss Pre-shared key File
1462The pre-shared key file defines pairs of identifiers and corresponding
1463shared secret keys which are used in the pre-shared key authentication
1464method in phase 1.
1465The pair in each line is separated by some number of blanks and/or tab
1466characters like in the
1467.Xr hosts 5
1468file.
1469Key can include blanks because everything after the first blanks
1470is interpreted as the secret key.
1471Lines starting with
1472.Ql #
1473are ignored.
1474Keys which start with
1475.Ql 0x
1476are interpreted as hexadecimal strings.
1477Note that the file must be owned by the user ID running
1478.Xr racoon 8
1479.Pq usually the privileged user ,
1480and must not be accessible by others.
1481.Pp
1482If configured with
1483.Dv ENABLE_WILDCARD_MATCH ,
1484this implementation allows a wildcard key
1485.Dq * .
1486This is allowed for the special case of a single user connecting to
1487a gateway using an iPhone.
1488On an iPhone, L2TP over IPSEC only supports
1489main mode with pre-shared keys (no certificates).
1490Unfortunately racoon
1491only supports pre-shared-key lookup by address when identity protection
1492is used, and since the iPhone does not have a specific IP address, we
1493don't know what key to put in the pre-shared key file.
1494.Pp
1495Sharing the connection with more than one user is strongly discouraged
1496because any user can pretend to be the server since they know the pre-shared
1497key.
1498This means that any user can steal the traffic of any other user, by
1499spoofing DNS which is not trivial but easy.
1500Even worse, the malicious user will be able to then steal any other
1501authentication data (CHAP/XAUTH etc.) that another user will supply
1502to the compromised server, because it assumes that phase 1 is secured
1503by the pre-shared key.
1504.Pp
1505In summary, never use wildcard keys if your gateway is hosting more than
1506one user.
1507.\"
1508.Sh EXAMPLES
1509The following shows how the remote directive should be configured.
1510.Bd -literal -offset
1511path pre_shared_key "/usr/local/v6/etc/psk.txt" ;
1512remote anonymous
1513{
1514	exchange_mode aggressive,main,base;
1515	lifetime time 24 hour;
1516	proposal {
1517		encryption_algorithm 3des;
1518		hash_algorithm sha1;
1519		authentication_method pre_shared_key;
1520		dh_group 2;
1521	}
1522}
1523
1524sainfo anonymous
1525{
1526	pfs_group 2;
1527	lifetime time 12 hour ;
1528	encryption_algorithm 3des, blowfish 448, twofish, rijndael ;
1529	authentication_algorithm hmac_sha1, hmac_md5 ;
1530	compression_algorithm deflate ;
1531}
1532.Ed
1533.Pp
1534If you are configuring plain RSA authentication, the remote directive
1535should look like the following:
1536.Bd -literal -offset
1537path certificate "/usr/local/v6/etc" ;
1538remote anonymous
1539{
1540        exchange_mode main,base ;
1541        lifetime time 12 hour ;
1542        certificate_type plain_rsa "/usr/local/v6/etc/myrsakey.priv";
1543        peers_certfile plain_rsa "/usr/local/v6/etc/yourrsakey.pub";
1544        proposal {
1545                        encryption_algorithm aes ;
1546                        hash_algorithm sha1 ;
1547                        authentication_method rsasig ;
1548                        dh_group 2 ;
1549        }
1550}
1551.Ed
1552.Pp
1553The following is a sample for the pre-shared key file.
1554.Bd -literal -offset
155510.160.94.3     mekmitasdigoat
1556172.16.1.133    0x12345678
1557194.100.55.1    whatcertificatereally
15583ffe:501:410:ffff:200:86ff:fe05:80fa    mekmitasdigoat
15593ffe:501:410:ffff:210:4bff:fea2:8baa    mekmitasdigoat
1560foo@kame.net    mekmitasdigoat
1561foo.kame.net    hoge
1562.Ed
1563.\"
1564.Sh SEE ALSO
1565.Xr racoon 8 ,
1566.Xr racoonctl 8 ,
1567.Xr setkey 8
1568.\"
1569.Sh HISTORY
1570The
1571.Nm
1572configuration file first appeared in the
1573.Dq YIPS
1574Yokogawa IPsec implementation.
1575.\"
1576.Sh BUGS
1577Some statements may not be handled by
1578.Xr racoon 8
1579yet.
1580.Pp
1581Diffie-Hellman computation can take a very long time, and may cause
1582unwanted timeouts, specifically when a large D-H group is used.
1583.\"
1584.Sh SECURITY CONSIDERATIONS
1585The use of IKE phase 1 aggressive mode is not recommended,
1586as described in
1587.Li http://www.kb.cert.org/vuls/id/886601 .
1588