]> git.saurik.com Git - apple/ipsec.git/blob - ipsec-tools/racoon/racoon.conf.5
ipsec-34.0.3.tar.gz
[apple/ipsec.git] / ipsec-tools / racoon / racoon.conf.5
1 .\" $Id: racoon.conf.5,v 1.27.2.12 2005/11/25 16:06:32 manubsd Exp $
2 .\"
3 .\" Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
4 .\" All rights reserved.
5 .\"
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
8 .\" are met:
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice, this list of conditions and the following disclaimer in the
13 .\" documentation and/or other materials provided with the distribution.
14 .\" 3. Neither the name of the project nor the names of its contributors
15 .\" may be used to endorse or promote products derived from this software
16 .\" without specific prior written permission.
17 .\"
18 .\" THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
19 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
22 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 .\" SUCH DAMAGE.
29 .\"
30 .Dd November 23, 2004
31 .Dt RACOON.CONF 5
32 .Os
33 .\"
34 .Sh NAME
35 .Nm racoon.conf
36 .Nd configuration file for racoon
37 .\"
38 .\" .Sh SYNOPSIS
39 .\"
40 .Sh DESCRIPTION
41 .Nm
42 is the configuration file for the
43 .Xr racoon 8
44 ISAKMP daemon.
45 .Xr racoon 8
46 negotiates security associations for itself (ISAKMP SA, or phase 1 SA)
47 and for kernel IPsec (IPsec SA, or phase 2 SA).
48 The file consists of a sequence of directives and statements.
49 Each directive is composed by a tag and statements, enclosed by
50 .Ql {
51 and
52 .Ql } .
53 Lines beginning with
54 .Ql #
55 are comments.
56 .\"
57 .Ss Meta Syntax
58 Keywords and special characters that the parser expects exactly are
59 displayed using
60 .Ic this
61 font.
62 Parameters are specified with
63 .Ar this
64 font.
65 Square brackets
66 .Po
67 .Ql \&[
68 and
69 .Ql \&]
70 .Pc
71 are used to show optional keywords and parameters.
72 Note that
73 you have to pay attention when this manual is describing
74 .Ar port
75 numbers.
76 The
77 .Ar port
78 number is always enclosed by
79 .Ql \&[
80 and
81 .Ql \&] .
82 In this case, the port number is not an optional keyword.
83 If it is possible to omit the
84 .Ar port
85 number,
86 the expression becomes
87 .Bq Bq Ar port .
88 The vertical bar
89 .Pq Ql \&|
90 is used to indicate
91 a choice between optional parameters.
92 Parentheses
93 .Po
94 .Ql \&(
95 and
96 .Ql \&)
97 .Pc
98 are used to group keywords and parameters when necessary.
99 Major parameters are listed below.
100 .Pp
101 .Bl -tag -width addressx -compact
102 .It Ar number
103 means a hexadecimal or a decimal number.
104 The former must be prefixed with
105 .Ql Li 0x .
106 .It Ar string
107 .It Ar path
108 .It Ar file
109 means any string enclosed in
110 .Ql \&"
111 .Pq double quotes .
112 .It Ar address
113 means IPv6 and/or IPv4 address.
114 .It Ar port
115 means a TCP/UDP port number.
116 The port number is always enclosed by
117 .Ql \&[
118 and
119 .Ql \&] .
120 .It Ar timeunit
121 is one of following:
122 .Ic sec , secs , second , seconds ,
123 .Ic min , mins , minute , minutes ,
124 .Ic hour , hours .
125 .El
126 .\"
127 .Ss Privilege separation
128 .Bl -tag -width Ds -compact
129 .It Ic privsep { Ar statements Ic }
130 specifies privilege separation parameters.
131 When enabled, these enable
132 .Xr racoon 8
133 to operate with an unprivileged instance doing most of the work, while
134 a privileged instance takes care of performing the following operations
135 as root: reading PSK and private keys, launching hook scripts, and
136 validating passwords against system databases or against PAM.
137 .Pp
138 .Bl -tag -width Ds -compact
139 .It Ic user Ar user ;
140 The user to which the unprivileged instance of
141 .Xr racoon 8 ,
142 should switch.
143 This can be a quoted user name or a numeric UID.
144 .It Ic group Ar group ;
145 The group to which the unprivileged instance of
146 .Xr racoon 8 ,
147 should switch.
148 This can be a quoted group name or a numeric GID.
149 .It Ic chroot Ar path ;
150 A directory to which the unprivileged instance of
151 .Xr racoon 8
152 should
153 .Xr chroot 2 .
154 This directory should hold a tree where the following files must be
155 reachable:
156 .Bl -tag -width Ds -compact
157 .It Pa /dev/random
158 .It Pa /dev/urandom
159 .It the certificates
160 .It the file containing the Xauth banner
161 .El
162 .Pp
163 The PSK file, the private keys, and the hook scripts are accessed through the
164 privileged instance of
165 .Xr racoon 8
166 and do not need to be reachable in the
167 .Xr chroot 2 Ap ed
168 tree.
169 .El
170 .El
171 .Ss Path Specification
172 This section specify various paths used by racoon.
173 When running in privilege separation mode,
174 .Ic certificate
175 and
176 .Ic script
177 paths are mandatory.
178 .Bl -tag -width Ds -compact
179 .It Ic path include Ar path ;
180 specifies a path to include a file.
181 See
182 .Sx File Inclusion .
183 .It Ic path pre_shared_key Ar file ;
184 specifies a file containing pre-shared key(s) for various ID(s).
185 See
186 .Sx Pre-shared key File .
187 .It Ic path certificate Ar path ;
188 .Xr racoon 8
189 will search this directory if a certificate or certificate request is received.
190 If you run with privilege separation,
191 .Xr racoon 8
192 will refuse to use a certificate stored outside of this directory.
193 .It Ic path backupsa Ar file ;
194 specifies a file to which SA information which is negotiated by
195 racoon should be stored.
196 .Xr racoon 8
197 will install SA(s) from the file when started with the
198 .Fl B
199 flag.
200 The file is growing because
201 .Xr racoon 8
202 simply adds SAs to it.
203 You should maintain the file manually.
204 .It Ic path script Ar path ;
205 .Xr racoon 8
206 will search this directory for scripts hooks.
207 If you run with privilege separation,
208 .Xr racoon 8
209 will refuse to execute a script stored outside of this directory.
210 .It Ic path pidfile Ar file ;
211 specifies file where to store PID of process.
212 If path starts with
213 .Pa /
214 it is treated as
215 an absolute path, otherwise relative to VARRUN directory specified at
216 compilation time.
217 Default is
218 .Pa racoon.pid .
219 .It Ic path logfile Ar file ;
220 specifies log file path.
221 .El
222 .\"
223 .Ss File Inclusion
224 .Bl -tag -width Ds -compact
225 .It Ic include Ar file
226 other configuration files can be included.
227 .El
228 .\"
229 .Ss Identifier Specification
230 is obsolete.
231 It must be defined at each
232 .Ic remote
233 directive.
234 .\"
235 .Ss Timer Specification
236 .Bl -tag -width Ds -compact
237 .It Ic timer { Ar statements Ic }
238 specifies various timer values.
239 .Pp
240 .Bl -tag -width Ds -compact
241 .It Ic counter Ar number ;
242 the maximum number of retries to send.
243 The default is 5.
244 .It Ic interval Ar number Ar timeunit ;
245 the interval to resend, in seconds.
246 The default time is 10 seconds.
247 .It Ic persend Ar number ;
248 the number of packets per send.
249 The default is 1.
250 .It Ic phase1 Ar number Ar timeunit ;
251 the maximum time it should take to complete phase 1.
252 The default time is 15 seconds.
253 .It Ic phase2 Ar number Ar timeunit ;
254 the maximum time it should take to complete phase 2.
255 The default time is 10 seconds.
256 .It Ic natt_keepalive Ar number Ar timeunit ;
257 interval between sending NAT-Traversal keep-alive packets.
258 The default time is 20 seconds.
259 Set to 0s to disable keep-alive packets.
260 .El
261 .El
262 .\"
263 .Ss Listening Port Specification
264 .Bl -tag -width Ds -compact
265 .It Ic listen { Ar statements Ic }
266 If no
267 .Ar listen
268 directive is specified,
269 .Xr racoon 8
270 will listen on all available interface addresses.
271 The following is the list of valid statements:
272 .Pp
273 .Bl -tag -width Ds -compact
274 .\" How do I express bold brackets; `[' and `]' .
275 .\" Answer: For bold brackets, do "Ic \&[ foo \&]".
276 .\" Is the "Bq Ic [ Ar port ] ;" buggy ?
277 .It Ic isakmp Ar address Bq Bq Ar port ;
278 If this is specified,
279 .Xr racoon 8
280 will only listen on
281 .Ar address .
282 The default port is 500, which is specified by IANA.
283 You can provide more than one address definition.
284 .It Ic isakmp_natt Ar address Bq Ar port ;
285 Same as
286 .Ic isakmp
287 but also sets the socket options to accept UDP-encapsulated ESP traffic for
288 NAT-Traversal.
289 If you plan to use NAT-T, you should provide at least one address
290 with port 4500, which is specified by IANA.
291 There is no default.
292 .It Ic strict_address ;
293 require that all addresses for ISAKMP must be bound.
294 This statement will be ignored if you do not specify any address.
295 .El
296 The
297 .Ar listen
298 section can also be used to specify the admin socket mode and ownership,
299 if racoon was built with support for admin port.
300 .Bl -tag -width Ds -compact
301 .It Ic adminsock Ar path Op Ar owner\ group\ mode ;
302 .Ar path ,
303 .Ar owner ,
304 and
305 .Ar group
306 are the socket path, owner, and group; they must be quoted.
307 Defaults are
308 .Pa /var/racoon/racoon.sock ,
309 UID 0, and GID 0.
310 .Ar mode
311 is the access mode in octal, default is 0600.
312 .It Ic adminsock disabled ;
313 This directive tells racoon to not listen on the admin socket.
314 .El
315 .El
316 .\"
317 .Ss Miscellaneous Global Parameters
318 .Bl -tag -width Ds -compact
319 .It Ic gss_id_enc Ar enctype ;
320 Older versions of
321 .Xr racoon 8
322 used ISO-Latin-1 as the encoding of the GSS-API identifier attribute.
323 For interoperability with Microsoft Windows' GSS-API authentication
324 scheme, the default encoding has been changed to UTF-16LE.
325 The
326 .Ic gss_id_enc
327 parameter allows
328 .Xr racoon 8
329 to be configured to use the old encoding for compatibility with existing
330 .Xr racoon 8
331 installations.
332 The following are valid values for
333 .Ar enctype :
334 .Pp
335 .Bl -tag -width Ds -compact
336 .It Ic utf-16le
337 Use UTF-16LE to encode the GSS-API identifier attribute.
338 This is the default encoding.
339 This encoding is compatible with Microsoft Windows.
340 .It Ic latin1
341 Use ISO-Latin-1 to encode the GSS-API identifier attribute.
342 This is the encoding used by older versions of
343 .Xr racoon 8 .
344 .El
345 .El
346 .\"
347 .Ss Remote Nodes Specifications
348 .Bl -tag -width Ds -compact
349 .It Xo
350 .Ic remote ( Ar address | Ic anonymous )
351 .Bq Bq Ar port
352 .Bq Ic inherit Ar parent
353 .Ic { Ar statements Ic }
354 .Xc
355 specifies the parameters for IKE phase 1 for each remote node.
356 The default port is 500.
357 If
358 .Ic anonymous
359 is specified, the statements apply to all peers which do not match
360 any other
361 .Ic remote
362 directive.
363 .Pp
364 Sections with
365 .Ic inherit Ar parent
366 statements (where
367 .Ar parent
368 is either
369 .Ar address
370 or a keyword
371 .Ic anonymous )
372 have all values predefined to those of a given
373 .Ar parent .
374 In these sections it is enough to redefine only the changed parameters.
375 .Pp
376 The following are valid statements.
377 .Pp
378 .Bl -tag -width Ds -compact
379 .\"
380 .It Ic exchange_mode ( main | aggressive | base ) ;
381 defines the exchange mode for phase 1 when racoon is the initiator.
382 It also means the acceptable exchange mode when racoon is responder.
383 More than one mode can be specified by separating them with a comma.
384 All of the modes are acceptable.
385 The first exchange mode is what racoon uses when it is the initiator.
386 .\"
387 .It Ic doi Ic ipsec_doi ;
388 means to use IPsec DOI as specified in RFC 2407.
389 You can omit this statement.
390 .\"
391 .It Ic situation Ic identity_only ;
392 means to use SIT_IDENTITY_ONLY as specified in RFC 2407.
393 You can omit this statement.
394 .\"
395 .It Ic identifier Ar idtype ;
396 is obsolete.
397 Instead, use
398 .Ic my_identifier .
399 .\"
400 .It Ic my_identifier Ar idtype ... ;
401 specifies the identifier sent to the remote host
402 and the type to use in the phase 1 negotiation.
403 .Ic address, fqdn , user_fqdn , keyid ,
404 and
405 .Ic asn1dn
406 can be used as an
407 .Ar idtype .
408 Use them in the following way:
409 .Bl -tag -width Ds -compact
410 .It Ic my_identifier Ic address Bq Ar address ;
411 the type is the IP address.
412 This is the default type if you do not specify an identifier to use.
413 .It Ic my_identifier Ic user_fqdn Ar string ;
414 the type is a USER_FQDN (user fully-qualified domain name).
415 .It Ic my_identifier Ic fqdn Ar string ;
416 the type is a FQDN (fully-qualified domain name).
417 .It Ic my_identifier Ic keyid Ar file ;
418 the type is a KEY_ID.
419 .It Ic my_identifier Ic asn1dn Bq Ar string ;
420 the type is an ASN.1 distinguished name.
421 If
422 .Ar string
423 is omitted,
424 .Xr racoon 8
425 will get the DN from the Subject field in the certificate.
426 .El
427 .\"
428 .It Ic xauth_login Bq Ar string ;
429 specifies the login to use in client-side Hybrid authentication.
430 It is available only if
431 .Xr racoon 8
432 has been built with this option.
433 The associated password is looked up in the pre-shared key files,
434 using the login
435 .Ic string
436 as the key id.
437 .\"
438 .It Ic peers_identifier Ar idtype ... ;
439 specifies the peer's identifier to be received.
440 If it is not defined then
441 .Xr racoon 8
442 will not verify the peer's identifier in ID payload transmitted from the peer.
443 If it is defined, the behavior of the verification depends on the flag of
444 .Ic verify_identifier .
445 The usage of
446 .Ar idtype
447 is the same as
448 .Ic my_identifier
449 except that the individual component values of an
450 .Ic asn1dn
451 identifier may specified as
452 .Ic *
453 to match any value (e.g. "C=XX, O=MyOrg, OU=*, CN=Mine").
454 Alternative acceptable peer identifiers may be specified by repeating the
455 .Ic peers_identifier
456 statement.
457 .\"
458 .It Ic verify_identifier (on \(ba off) ;
459 If you want to verify the peer's identifier,
460 set this to on.
461 In this case, if the value defined by
462 .Ic peers_identifier
463 is not the same as the peer's identifier in the ID payload,
464 the negotiation will failed.
465 The default is off.
466 .\"
467 .It Ic certificate_type Ar certspec ;
468 specifies a certificate specification.
469 .Ar certspec
470 is one of followings:
471 .Bl -tag -width Ds -compact
472 .It Ic x509 Ar certfile Ar privkeyfile ;
473 .Ar certfile
474 means a file name of a certificate.
475 .Ar privkeyfile
476 means a file name of a secret key.
477 .El
478 .It Ic ca_type Ar cacertspec ;
479 specifies a root certificate authority specification.
480 .Ar cacertspec
481 is one of followings:
482 .Bl -tag -width Ds -compact
483 .It Ic x509 Ar cacertfile ;
484 .Ar cacertfile
485 means a file name of the root certificate authority.
486 Default is
487 .Pa /etc/openssl/cert.pem
488 .El
489 .\"
490 .It Ic mode_cfg (on \(ba off) ;
491 Gather network information through ISAKMP mode configuration.
492 Default is off.
493 .\"
494 .It Ic peers_certfile ( dnssec | Ar certfile ) ;
495 If
496 .Ic dnssec
497 is defined,
498 .Xr racoon 8
499 will ignore the CERT payload from the peer,
500 and try to get the peer's certificate from DNS instead.
501 If
502 .Ar certfile
503 is defined,
504 .Xr racoon 8
505 will ignore the CERT payload from the peer,
506 and will use this certificate as the peer's certificate.
507 .\"
508 .It Ic script Ar script Ic phase1_up
509 .It Ic script Ar script Ic phase1_down
510 Shell scripts that get executed when a phase 1 SA goes up or down.
511 Both scripts get either
512 .Ic phase1_up
513 or
514 .Ic phase1_down
515 as first argument, and the following
516 variables are set in their environment:
517 .Bl -tag -width Ds -compact
518 .It Ev LOCAL_ADDR
519 The local address of the phase 1 SA.
520 .It Ev LOCAL_PORT
521 The local port used for IKE for the phase 1 SA.
522 .It Ev REMOTE_ADDR
523 The remote address of the phase 1 SA.
524 .It Ev REMOTE_PORT
525 The remote port used for IKE for the phase 1 SA.
526 .El
527 The following variables are only set if
528 .Ic mode_cfg
529 was enabled:
530 .Bl -tag -width Ds -compact
531 .It INTERNAL_ADDR4
532 An IPv4 internal address obtained by ISAKMP mode config.
533 .It INTERNAL_NETMASK4
534 An IPv4 internal netmask obtained by ISAKMP mode config.
535 .It INTERNAL_DNS4
536 Internal DNS server IPv4 address obtained by ISAKMP mode config.
537 .It INTERNAL_NBNS4
538 Internal WINS server IPv4 address obtained by ISAKMP mode config.
539 .El
540 .\"
541 .\"
542 .It Ic send_cert (on \(ba off) ;
543 If you do not want to send a certificate for some reason, set this to off.
544 The default is on.
545 .\"
546 .It Ic send_cr (on \(ba off) ;
547 If you do not want to send a certificate request for some reason, set this to off.
548 The default is on.
549 .\"
550 .It Ic verify_cert (on \(ba off) ;
551 If you do not want to verify the peer's certificate for some reason,
552 set this to off.
553 The default is on.
554 .\"
555 .It Ic lifetime time Ar number Ar timeunit ;
556 Define a lifetime of a certain time
557 which will be proposed in the phase 1 negotiations.
558 Any proposal will be accepted, and the attribute(s) will be not proposed to
559 the peer if you do not specify it (them).
560 They can be individually specified in each proposal.
561 .\"
562 .It Ic ike_frag (on \(ba off) ;
563 Enable receiver-side IKE fragmentation, if
564 .Xr racoon 8
565 has been built with this feature.
566 This extension is there to work around
567 broken firewalls that do not work with fragmented UDP packets.
568 IKE fragmentation is always enabled on the sender-side, and
569 it is used if the peer advertises itself as IKE fragmentation capable.
570 .\"
571 .It Ic esp_frag Ar fraglen ;
572 This option is only relevant if you use NAT traversal in tunnel mode.
573 Its purpose is to work around broken DSL routers that reject UDP
574 fragments, by fragmenting the IP packets before ESP encapsulation.
575 The result is ESP over UDP of fragmented packets instead of fragmented
576 ESP over UDP packets (i.e., IP:UDP:ESP:frag(IP) instead of
577 frag(IP:UDP:ESP:IP)).
578 .Ar fraglen
579 is the maximum size of the fragments.
580 552 should work anywhere,
581 but the higher
582 .Ar fraglen
583 is, the better is the performance.
584 .Pp
585 Note that because PMTU discovery is broken on many sites, you will
586 have to use MSS clamping if you want TCP to work correctly.
587 .\"
588 .It Ic initial_contact (on \(ba off) ;
589 enable this to send an INITIAL-CONTACT message.
590 The default value is
591 .Ic on .
592 This message is useful only when
593 the implementation of the responder chooses an old SA when there are multiple
594 SAs with different established time, and the initiator reboots.
595 If racoon did not send the message,
596 the responder would use an old SA even when a new SA was established.
597 The KAME stack has the switch in the system wide value
598 net.key.preferred_oldsa.
599 when the value is zero, the stack always uses a new SA.
600 .\"
601 .It Ic passive (on \(ba off) ;
602 If you do not want to initiate the negotiation, set this to on.
603 The default value is
604 .Ic off .
605 It is useful for a server.
606 .\"
607 .It Ic proposal_check Ar level ;
608 specifies the action of lifetime length and PFS of the phase 2
609 selection on the responder side, and the action of lifetime check in
610 phase 1.
611 The default level is
612 .Ic strict .
613 If the
614 .Ar level
615 is:
616 .Bl -tag -width Ds -compact
617 .It Ic obey
618 the responder will obey the initiator anytime.
619 .It Ic strict
620 If the responder's length is longer than the initiator's one, the
621 responder uses the initiator's one.
622 Otherwise it rejects the proposal.
623 If PFS is not required by the responder, the responder will obey the proposal.
624 If PFS is required by both sides and if the responder's group is not equal to
625 the initiator's one, then the responder will reject the proposal.
626 .It Ic claim
627 If the responder's length is longer than the initiator's one, the
628 responder will use the initiator's one.
629 If the responder's length is
630 shorter than the initiator's one, the responder uses its own length
631 AND sends a RESPONDER-LIFETIME notify message to an initiator in the
632 case of lifetime (phase 2 only).
633 For PFS, this directive behaves the same as
634 .Ic strict .
635 .It Ic exact
636 If the initiator's length is not equal to the responder's one, the
637 responder will reject the proposal.
638 If PFS is required by both sides and if the responder's group is not equal to
639 the initiator's one, then the responder will reject the proposal.
640 .El
641 .\"
642 .It Ic support_proxy (on \(ba off) ;
643 If this value is set to on, then both values of ID payloads in the
644 phase 2 exchange are always used as the addresses of end-point of
645 IPsec-SAs.
646 The default is off.
647 .\"
648 .It Ic generate_policy (on \(ba off) ;
649 This directive is for the responder.
650 Therefore you should set
651 .Ic passive
652 to on in order that
653 .Xr racoon 8
654 only becomes a responder.
655 If the responder does not have any policy in SPD during phase 2
656 negotiation, and the directive is set to on, then
657 .Xr racoon 8
658 will choose the first proposal in the
659 SA payload from the initiator, and generate policy entries from the proposal.
660 It is useful to negotiate with clients whose IP address is allocated
661 dynamically.
662 Note that an inappropriate policy might be installed into the responder's SPD
663 by the initiator,
664 so other communications might fail if such policies are installed
665 due to a policy mismatch between the initiator and the responder.
666 This directive is ignored in the initiator case.
667 The default value is
668 .Ic off .
669 .\"
670 .\"
671 .It Ic nat_traversal (on \(ba off \(ba force) ;
672 This directive enables use of the NAT-Traversal IPsec extension
673 (NAT-T).
674 NAT-T allows one or both peers to reside behind a NAT gateway (i.e.,
675 doing address- or port-translation).
676 Presence of NAT gateways along the path
677 is discovered during phase 1 handshake and if found, NAT-T is negotiated.
678 When NAT-T is in charge, all ESP and AH packets of a given connection
679 are encapsulated into UDP datagrams (port 4500, by default).
680 Possible values are:
681 .Bl -tag -width Ds -compact
682 .It Ic on
683 NAT-T is used when a NAT gateway is detected between the peers.
684 .It Ic off
685 NAT-T is not proposed/accepted.
686 This is the default.
687 .It Ic force
688 NAT-T is used regardless if a NAT is detected between the peers or not.
689 .El
690 Please note that NAT-T support is a compile-time option.
691 Although it is enabled in the source distribution by default, it
692 may not be available in your particular build.
693 In that case you will get a
694 warning when using any NAT-T related config options.
695 .\"
696 .It Ic dpd_delay Ar delay ;
697 This option activates the DPD and sets the time (in seconds) allowed
698 between 2 proof of liveness requests.
699 The default value is
700 .Ic 0 ,
701 which disables DPD monitoring, but still negotiates DPD support.
702 .\"
703 .It Ic dpd_retry Ar delay ;
704 If
705 .Ic dpd_delay
706 is set, this sets the delay (in seconds) to wait for a proof of
707 liveness before considering it as failed and send another request.
708 The default value is
709 .Ic 5 .
710 .\"
711 .It Ic dpd_maxfail Ar number ;
712 If
713 .Ic dpd_delay
714 is set, this sets the maximum number of proof of liveness to request
715 (without reply) before considering the peer is dead.
716 The default value is
717 .Ic 5 .
718 .\"
719 .It Ic nonce_size Ar number ;
720 define the byte size of nonce value.
721 Racoon can send any value although
722 RFC2409 specifies that the value MUST be between 8 and 256 bytes.
723 The default size is 16 bytes.
724 .\"
725 .It Xo
726 .Ic proposal { Ar sub-substatements Ic }
727 .Xc
728 .Bl -tag -width Ds -compact
729 .\"
730 .It Ic encryption_algorithm Ar algorithm ;
731 specify the encryption algorithm used for the phase 1 negotiation.
732 This directive must be defined.
733 .Ar algorithm
734 is one of following:
735 .Ic des , 3des , blowfish , cast128 , aes
736 .\".Ic rc5 , idea
737 for Oakley.
738 For other transforms, this statement should not be used.
739 .\"
740 .It Ic hash_algorithm Ar algorithm ;
741 define the hash algorithm used for the phase 1 negotiation.
742 This directive must be defined.
743 .Ar algorithm
744 is one of following:
745 .Ic md5, sha1, sha256, sha384, sha512
746 for Oakley.
747 .\"
748 .It Ic authentication_method Ar type ;
749 defines the authentication method used for the phase 1 negotiation.
750 This directive must be defined.
751 .Ar type
752 is one of:
753 .Ic pre_shared_key , rsasig , gssapi_krb , hybrid_rsa_server ,
754 or
755 .Ic hybrid_rsa_client .
756 .\"
757 .It Ic dh_group Ar group ;
758 define the group used for the Diffie-Hellman exponentiations.
759 This directive must be defined.
760 .Ar group
761 is one of following:
762 .Ic modp768 , modp1024 , modp1536 ,
763 .Ic modp2048 , modp3072 , modp4096 ,
764 .Ic modp6144 , modp8192 .
765 Or you can define 1, 2, 5, 14, 15, 16, 17, or 18 as the DH group number.
766 When you want to use aggressive mode,
767 you must define the same DH group in each proposal.
768 .It Ic lifetime time Ar number Ar timeunit ;
769 define lifetime of the phase 1 SA proposal.
770 Refer to the description of the
771 .Ic lifetime
772 directive defined in the
773 .Ic remote
774 directive.
775 .It Ic gss_id Ar string ;
776 define the GSS-API endpoint name, to be included as an attribute in the SA,
777 if the
778 .Ic gssapi_krb
779 authentication method is used.
780 If this is not defined, the default value of
781 .Ql host/hostname
782 is used, where hostname is the value returned by the
783 .Xr hostname 1
784 command.
785 .El
786 .El
787 .El
788 .\"
789 .Ss Policy Specifications
790 The policy directive is obsolete, policies are now in the SPD.
791 .Xr racoon 8
792 will obey the policy configured into the kernel by
793 .Xr setkey 8 ,
794 and will construct phase 2 proposals by combining
795 .Ic sainfo
796 specifications in
797 .Nm ,
798 and policies in the kernel.
799 .\"
800 .Ss Sainfo Specifications
801 .Bl -tag -width Ds -compact
802 .It Xo
803 .Ic sainfo ( Ar source_id destination_id | Ic anonymous ) [ from Ar idtype [ Ar string ] ]
804 .Ic { Ar statements Ic }
805 .Xc
806 defines the parameters of the IKE phase 2 (IPsec-SA establishment).
807 .Ar source_id
808 and
809 .Ar destination_id
810 are constructed like:
811 .Pp
812 .Ic address Ar address
813 .Bq Ic / Ar prefix
814 .Bq Ic [ Ar port ]
815 .Ar ul_proto
816 .Pp
817 or
818 .Pp
819 .Ic subnet Ar address
820 .Bq Ic / Ar prefix
821 .Bq Ic [ Ar port ]
822 .Ar ul_proto
823 .Pp
824 or
825 .Pp
826 .Ar idtype Ar string
827 .Pp
828 It means exactly the content of ID payload.
829 This is not like a filter rule.
830 For example, if you define 3ffe:501:4819::/48 as
831 .Ar source_id .
832 3ffe:501:4819:1000:/64 will not match.
833 .Pp
834 In case of longest prefix (selecting single host)
835 .Ar address
836 instructs to send ID type of ADDRESS, while
837 .Ar subnet
838 instructs to send ID type of SUBNET.
839 Otherwise these instructions are identical.
840 .Pp
841 .Bl -tag -width Ds -compact
842 .\"
843 .It Ic pfs_group Ar group ;
844 define the group of Diffie-Hellman exponentiations.
845 If you do not require PFS then you can omit this directive.
846 Any proposal will be accepted if you do not specify one.
847 .Ar group
848 is one of following:
849 .Ic modp768 , modp1024 , modp1536 ,
850 .Ic modp2048 , modp3072 , modp4096 ,
851 .Ic modp6144 , modp8192 .
852 Or you can define 1, 2, 5, 14, 15, 16, 17, or 18 as the DH group number.
853 .\"
854 .It Ic lifetime time Ar number Ar timeunit ;
855 define how long an IPsec-SA will be used, in timeunits.
856 Any proposal will be accepted, and no attribute(s) will be proposed to
857 the peer if you do not specify it(them).
858 See the
859 .Ic proposal_check
860 directive.
861 .\"
862 .It Ic my_identifier Ar idtype ... ;
863 is obsolete.
864 It does not make sense to specify an identifier in the phase 2.
865 .El
866 .\"
867 .Pp
868 .Xr racoon 8
869 does not have a list of security protocols to be negotiated.
870 The list of security protocols are passed by SPD in the kernel.
871 Therefore you have to define all of the potential algorithms
872 in the phase 2 proposals even if there are algorithms which will not be used.
873 These algorithms are define by using the following three directives,
874 with a single comma as the separator.
875 For algorithms that can take variable-length keys, algorithm names
876 can be followed by a key length, like
877 .Dq Li blowfish 448 .
878 .Xr racoon 8
879 will compute the actual phase 2 proposals by computing
880 the permutation of the specified algorithms,
881 and then combining them with the security protocol specified by the SPD.
882 For example, if
883 .Ic des , 3des , hmac_md5 ,
884 and
885 .Ic hmac_sha1
886 are specified as algorithms, we have four combinations for use with ESP,
887 and two for AH.
888 Then, based on the SPD settings,
889 .Xr racoon 8
890 will construct the actual proposals.
891 If the SPD entry asks for ESP only, there will be 4 proposals.
892 If it asks for both AH and ESP, there will be 8 proposals.
893 Note that the kernel may not support the algorithm you have specified.
894 .\"
895 .Bl -tag -width Ds -compact
896 .It Ic encryption_algorithm Ar algorithms ;
897 .Ic des , 3des , des_iv64 , des_iv32 ,
898 .Ic rc5 , rc4 , idea , 3idea ,
899 .Ic cast128 , blowfish , null_enc ,
900 .Ic twofish , rijndael , aes
901 .Pq used with ESP
902 .\"
903 .It Ic authentication_algorithm Ar algorithms ;
904 .Ic des , 3des , des_iv64 , des_iv32 ,
905 .Ic hmac_md5 , hmac_sha1 , hmac_sha256, hmac_sha384, hmac_sha512, non_auth
906 .Pq used with ESP authentication and AH
907 .\"
908 .It Ic compression_algorithm Ar algorithms ;
909 .Ic deflate
910 .Pq used with IPComp
911 .El
912 .El
913 .\"
914 .Ss Logging level
915 .Bl -tag -width Ds -compact
916 .It Ic log Ar level ;
917 define logging level.
918 .Ar level
919 is one of following:
920 .Ic notify , debug ,
921 and
922 .Ic debug2 .
923 The default is
924 .Ic notify .
925 If you set the logging level too high on slower machines,
926 IKE negotiation can fail due to timing constraint changes.
927 .El
928 .\"
929 .Ss Specifying the way to pad
930 .Bl -tag -width Ds -compact
931 .It Ic padding { Ar statements Ic }
932 specified padding format.
933 The following are valid statements:
934 .Bl -tag -width Ds -compact
935 .It Ic randomize (on \(ba off) ;
936 enable using a randomized value for padding.
937 The default is on.
938 .It Ic randomize_length (on \(ba off) ;
939 the pad length is random.
940 The default is off.
941 .It Ic maximum_length Ar number ;
942 define a maximum padding length.
943 If
944 .Ic randomize_length
945 is off, this is ignored.
946 The default is 20 bytes.
947 .It Ic exclusive_tail (on \(ba off) ;
948 means to put the number of pad bytes minus one into the last part
949 of the padding.
950 The default is on.
951 .It Ic strict_check (on \(ba off) ;
952 means to constrain the peer to set the number of pad bytes.
953 The default is off.
954 .El
955 .El
956 .Ss ISAKMP mode configuration settings
957 .Bl -tag -width Ds -compact
958 .It Ic mode_cfg { Ar statements Ic }
959 Defines the information to return for remote hosts' ISAKMP mode config
960 requests.
961 Also defines the authentication source for remote peers
962 authenticating through hybrid auth.
963 .Pp
964 The following are valid statements:
965 .Bl -tag -width Ds -compact
966 .It Ic auth_source (system \(ba radius \(ba pam) ;
967 Specify the source for authentication of users through hybrid auth.
968 .Ar system
969 means to use the Unix user database.
970 This is the default.
971 .Ar radius
972 means to use a RADIUS server.
973 It works only if
974 .Xr racoon 8
975 was built with libradius support, and the configuration is done in
976 .Xr radius.conf 5 .
977 .Ar pam
978 means to use PAM.
979 It works only if
980 .Xr racoon 8
981 was built with libpam support.
982 .It Ic conf_source (local \(ba radius) ;
983 Specify the source for IP addresses and netmask allocated through ISAKMP
984 mode config.
985 .Ar local
986 means to use the local IP pool defined by the
987 .Ic network4
988 and
989 .Ic pool_size
990 keywords.
991 This is the default.
992 .Ar radius
993 means to use a RADIUS server.
994 It works only if
995 .Xr racoon 8
996 was built with libradius support, and the configuration is done in
997 .Xr radius.conf 5 .
998 RADIUS configuration requires RADIUS authentication.
999 .It Ic accounting (none \(ba radius \(ba pam) ;
1000 Enable or disable accounting for Xauth logins and logouts.
1001 Default is
1002 .Ar none ,
1003 which disable accounting.
1004 .Ar radius
1005 enable RADIUS accounting.
1006 It works only if
1007 .Xr racoon 8
1008 was built with libradius support, and the configuration is done in
1009 .Xr radius.conf 5 .
1010 RADIUS accounting require RADIUS authentication.
1011 .Ar pam
1012 enable PAM accounting.
1013 It works only if
1014 .Xr racoon 8
1015 was built with libpam support.
1016 PAM accounting requires PAM authentication.
1017 .It Ic pool_size Ar size
1018 Specify the size of the IP address pool, either local or allocated
1019 through RADIUS.
1020 .Ic conf_source
1021 selects the local pool or the RADIUS configuration, but in both
1022 configurations, you cannot have more than
1023 .Ar size
1024 users connected at the same time.
1025 The default is 255.
1026 .It Ic network4 Ar address ;
1027 .It Ic netmask4 Ar address ;
1028 The local IP pool base address and network mask from which dynamically
1029 allocated IPv4 addresses should be taken.
1030 This is used if
1031 .Ic conf_source
1032 is set to
1033 .Ar local
1034 or if the RADIUS server returned
1035 .Ar 255.255.255.254 .
1036 Default is
1037 .Ar 0.0.0.0/0.0.0.0 .
1038 .It Ic dns4 Ar address ;
1039 The IPv4 address for a DNS server.
1040 .It Ic nbns4 Ar address ;
1041 The IPv4 address for a WINS server.
1042 .It Ic banner Ar path ;
1043 The path of a file displayed on the client at connection time.
1044 Default is
1045 .Ar /etc/motd .
1046 .It Ic auth_throttle Ar delay ;
1047 On each failed Xauth authentication attempt, refuse new attempts for
1048 .Ar delay
1049 more seconds.
1050 This is to avoid dictionary attacks on Xauth passwords.
1051 Default is one second.
1052 Set to zero to disable authentication delay.
1053 .It Ic pfs_group Ar group ;
1054 Sets the PFS group used in the client proposal (Cisco VPN client only).
1055 Default is 0.
1056 .It Ic save_passwd (on | off) ;
1057 Allow the client to save the Xauth password (Cisco VPN client only).
1058 Default is off.
1059 .El
1060 .El
1061 .Ss Special directives
1062 .Bl -tag -width Ds -compact
1063 .It Ic complex_bundle (on \(ba off) ;
1064 defines the interpretation of proposal in the case of SA bundle.
1065 Normally
1066 .Dq IP AH ESP IP payload
1067 is proposed as
1068 .Dq AH tunnel and ESP tunnel .
1069 The interpretation is more common to other IKE implementations, however,
1070 it allows very limited set of combinations for proposals.
1071 With the option enabled, it will be proposed as
1072 .Dq AH transport and ESP tunnel .
1073 The default value is
1074 .Ic off .
1075 .El
1076 .\"
1077 .Ss Pre-shared key File
1078 The pre-shared key file defines pairs of identifiers and corresponding
1079 shared secret keys which are used in the pre-shared key authentication
1080 method in phase 1.
1081 The pair in each line is separated by some number of blanks and/or tab
1082 characters like in the
1083 .Xr hosts 5
1084 file.
1085 Key can include blanks because everything after the first blanks
1086 is interpreted as the secret key.
1087 Lines starting with
1088 .Ql #
1089 are ignored.
1090 Keys which start with
1091 .Ql 0x
1092 are interpreted as hexadecimal strings.
1093 Note that the file must be owned by the user ID running
1094 .Xr racoon 8
1095 .Pq usually the privileged user ,
1096 and must not be accessible by others.
1097 .\"
1098 .Sh EXAMPLES
1099 The following shows how the remote directive should be configured.
1100 .Bd -literal -offset
1101 path pre_shared_key "/usr/local/v6/etc/psk.txt" ;
1102 remote anonymous
1103 {
1104 exchange_mode aggressive,main,base;
1105 lifetime time 24 hour;
1106 proposal {
1107 encryption_algorithm 3des;
1108 hash_algorithm sha1;
1109 authentication_method pre_shared_key;
1110 dh_group 2;
1111 }
1112 }
1113
1114 sainfo anonymous
1115 {
1116 pfs_group 2;
1117 lifetime time 12 hour ;
1118 encryption_algorithm 3des, blowfish 448, twofish, rijndael ;
1119 authentication_algorithm hmac_sha1, hmac_md5 ;
1120 compression_algorithm deflate ;
1121 }
1122 .Ed
1123 .Pp
1124 The following is a sample for the pre-shared key file.
1125 .Bd -literal -offset
1126 10.160.94.3 mekmitasdigoat
1127 172.16.1.133 0x12345678
1128 194.100.55.1 whatcertificatereally
1129 3ffe:501:410:ffff:200:86ff:fe05:80fa mekmitasdigoat
1130 3ffe:501:410:ffff:210:4bff:fea2:8baa mekmitasdigoat
1131 foo@kame.net mekmitasdigoat
1132 foo.kame.net hoge
1133 .Ed
1134 .\"
1135 .Sh SEE ALSO
1136 .Xr racoon 8 ,
1137 .Xr racoonctl 8 ,
1138 .Xr setkey 8
1139 .\"
1140 .Sh HISTORY
1141 The
1142 .Nm
1143 configuration file first appeared in the
1144 .Dq YIPS
1145 Yokogawa IPsec implementation.
1146 .\"
1147 .Sh BUGS
1148 Some statements may not be handled by
1149 .Xr racoon 8
1150 yet.
1151 .Pp
1152 Diffie-Hellman computation can take a very long time, and may cause
1153 unwanted timeouts, specifically when a large D-H group is used.
1154 .\"
1155 .Sh SECURITY CONSIDERATIONS
1156 The use of IKE phase 1 aggressive mode is not recommended,
1157 as described in
1158 .Li http://www.kb.cert.org/vuls/id/886601 .