1 .\" $KAME: racoon.conf.5,v 1.96 2002/02/21 14:30:21 sakane Exp $
3 .\" Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
4 .\" All rights reserved.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
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.
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
36 .Nd configuration file for racoon
42 is the configuration file for the
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 are enclosed by
58 Keywords and special characters that the parser expects exactly are
62 Parameters are specified with
71 are used to show optional keywords and parameters.
73 you have to pay attention when this manual is describing
78 number is always enclosed by
82 In this case, the port number is not an optional keyword.
83 If it is possible to omit
86 the expression becomes
91 a choice between optional parameters.
98 are used to group keywords and parameters when necessary.
99 Major parameters are listed below.
101 .Bl -tag -width addressx -compact
103 means a hexadecimal or a decimal number.
104 The former must be prefixed with
109 means any string enclosed in
113 means IPv6 and/or IPv4 address.
115 means a TCP/UDP port number.
116 The port number is always enclosed by
122 .Ic sec , secs , second , seconds ,
123 .Ic min , mins , minute , minutes ,
127 .Ss Path Specification
128 .Bl -tag -width Ds -compact
129 .It Ic path include Ar path ;
130 specifies a path to include a file.
133 .It Ic path pre_shared_key Ar file ;
134 specifies a file containing pre-shared key(s) for various ID(s).
136 .Sx Pre-shared key File .
137 .It Ic path certificate Ar path ;
139 will search this directory if a certificate or certificate request is received.
140 .It Ic path backupsa Ar file ;
141 specifies a file to be stored a SA information which is negotiated by racoon.
143 will install SA(s) from the file with a boot option
145 The file is increasing because
147 simply add a SA to the file at the moment.
148 You should maintain the file manually.
152 .Bl -tag -width Ds -compact
153 .It Ic include Ar file
154 other configuration files can be included.
157 .Ss Identifier Specification
159 It must be defined at each
163 .Ss Timer Specification
164 .Bl -tag -width Ds -compact
165 .It Ic timer { Ar statements Ic }
166 specifies various timer values.
168 .Bl -tag -width Ds -compact
169 .It Ic counter Ar number ;
170 the maximum number of retries to send.
172 .It Ic interval Ar number Ar timeunit ;
173 the interval to resend, in seconds.
174 The default time is 10 seconds.
175 .It Ic persend Ar number ;
176 the number of packets per send.
178 .It Ic phase1 Ar number Ar timeunit ;
179 the maximum time it should take to complete phase 1.
180 The default time is 15 seconds.
181 .It Ic phase2 Ar number Ar timeunit ;
182 the maximum time it should take to complete phase 2.
183 The default time is 10 seconds.
187 .Ss Listening Port Specification
188 .Bl -tag -width Ds -compact
189 .It Ic listen { Ar statements Ic }
192 directive is specified,
194 will listen on all of the available interface addresses.
195 The following is the list of valid statements:
197 .Bl -tag -width Ds -compact
198 .\" How do I express bold brackets; `[' and `]' .
199 .\" Is the "Bq Ic [ Ar port ] ;" buggy ?
200 .It Ic isakmp Ar address Bq Bq Ar port ;
201 If this is specified,
205 The default port is 500, which is specified by IANA.
206 You can provide more than one address definition.
207 .It Ic strict_address ;
208 require that all addresses for ISAKMP must be bound.
209 This statement will be ignored if you do not specify any addresses.
213 .Ss Remote Nodes Specifications
214 .Bl -tag -width Ds -compact
216 .Ic remote ( Ar address \*(Ba Ic anonymous )
218 .Ic { Ar statements Ic }
220 specifies the parameters for IKE phase 1 for each remote node.
221 The default port is 500.
224 is specified, the statements apply to all peers which do not match
229 The following are valid statements.
231 .Bl -tag -width Ds -compact
233 .It Ic exchange_mode ( main \*(Ba aggressive \*(Ba base ) ;
234 defines the exchange mode for phase 1 when racoon is the initiator.
235 Also it means the acceptable exchange mode when racoon is responder.
236 More than one mode can be specified by separating them with a comma.
237 All of the modes are acceptable.
238 The first exchange mode is what racoon uses when it is the initiator.
240 .It Ic doi Ic ipsec_doi ;
241 means to use IPSEC-DOI as specified RFC 2407.
242 You can omit this statement.
244 .It Ic situation Ic identity_only ;
245 means to use SIT_IDENTITY_ONLY as specified RFC 2407.
246 You can omit this statement.
248 .It Ic identifier Ar idtype ;
253 .It Ic my_identifier Ar idtype ... ;
254 specifies the identifier sent to the remote host
255 and the type to use in the phase 1 negotiation.
256 .Ic address, fqdn , user_fqdn , keyid and asn1dn
260 .Bl -tag -width Ds -compact
261 .It Ic my_identifier Ic address Bq Ar address ;
262 the type is the IP address.
263 This is the default type if you do not specify an identifier to use.
264 .It Ic my_identifier Ic user_fqdn Ar string ;
265 the type is a USER_FQDN (user fully-qualified domain name).
266 .It Ic my_identifier Ic fqdn Ar string ;
267 the type is a FQDN (fully-qualified domain name).
268 .It Ic my_identifier Ic keyid Ar file ;
269 the type is a KEY_ID.
270 .It Ic my_identifier Ic asn1dn Bq Ar string ;
271 the type is an ASN.1 distinguished name.
276 will get DN from Subject field in the certificate.
279 .It Ic peers_identifier Ar idtype ... ;
280 specifies the peer's identifier to be received.
281 If it is not defined then
283 will not verify the peer's identifier in ID payload transmitted from the peer.
284 If it is defined, the behavior of the verification depends on the flag of
285 .Ic verify_identifier .
291 .It Ic verify_identifier (on \(ba off) ;
292 If you want to verify the peer's identifier,
294 In this case, if the value defined by
296 is not same to the peer's identifier in the ID payload,
297 the negotiation will failed.
300 .It Ic certificate_type Ar certspec ;
301 specifies a certificate specification.
303 is one of followings:
304 .Bl -tag -width Ds -compact
305 .It Ic x509 Ar certfile Ar privkeyfile;
307 means a file name of certificate.
309 means a file name of secret key.
312 .It Ic peers_certfile ( dnssec \*(Ba Ar certfile ) ;
317 will ignore the CERT payload from the peer,
318 and try to get the peer's certificate from DNS instead.
323 will ignore the CERT payload from the peer,
324 and will use this certificate as the peer's certificate.
326 .It Ic send_cert (on \(ba off) ;
327 If you do not want to send a certificate for some reason, set this to off.
330 .It Ic send_cr (on \(ba off) ;
331 If you do not want to send a certificate request for some reason, set this to off.
334 .It Ic verify_cert (on \(ba off) ;
335 If you do not want to verify the peer's certificate for some reason,
339 .It Ic lifetime time Ar number Ar timeunit ;
340 define a lifetime of a certain time
341 which will be proposed in the phase 1 negotiations.
342 Any proposal will be accepted, and the attribute(s) will be not proposed to
343 the peer if you do not specify it(them).
344 They can be individually specified in each proposal.
346 .It Ic initial_contact (on \(ba off) ;
347 enable this to send an INITIAL-CONTACT message.
350 This message is useful only when
351 the implementation of the responder choices an old SA when there are multiple
352 SAs which are different established time, and the initiator reboots.
353 If racoon did not use the message,
354 the responder would use an old SA even when an new SA was established.
355 The KAME stack has the switch in the system wide value,
356 net.key.preferred_oldsa.
357 when the value is zero, the stack always use an new SA.
359 .It Ic passive (on \(ba off) ;
360 If you do not want to initiate the negotiation, set this to on.
363 It is useful for a server.
365 .It Ic proposal_check Ar level ;
366 specifies the action of lifetime length and PFS of the phase 2
367 selection on the responder side.
373 .Bl -tag -width Ds -compact
375 the responder will obey the initiator anytime.
377 If the responder's length is longer than the initiator's one, the
378 responder uses the initiator's one.
379 Otherwise it rejects the proposal.
380 If PFS is not required by the responder, the responder will obey the proposal.
381 If PFS is required by both sides and if the responder's group is not equal to
382 the initiator's one, then the responder will reject the proposal.
384 If the responder's length is longer than the initiator's one, the
385 responder will use the initiator's one.
386 If the responder's length is
387 shorter than the initiator's one, the responder uses its own length
388 AND sends a RESPONDER-LIFETIME notify message to an initiator in the
390 About PFS, this directive is same as
393 If the initiator's length is not equal to the responder's one, the
394 responder will reject the proposal.
395 If PFS is required by both sides and if the responder's group is not equal to
396 the initiator's one, then the responder will reject the proposal.
399 .It Ic support_mip6 (on \(ba off) ;
400 If this value is set on then both values of ID payloads in phase 2 exchange
401 are always used as the addresses of end-point of IPsec-SAs.
404 .It Ic generate_policy (on \(ba off) ;
405 This directive is for the responder.
406 Therefore you should set
410 only becomes a responder.
411 If the responder does not have any policy in SPD during phase 2 negotiation,
412 and the directive is set on, then
414 will choice the first proposal in the
415 SA payload from the initiator, and generate policy entries from the proposal.
416 It is useful to negotiate with the client which is allocated IP address
418 Note that inappropriate policy might be installed by the initiator
419 because the responder just installs policies as the initiator proposes.
420 So that other communication might fail if such policies installed.
421 This directive is ignored in the initiator case.
425 .It Ic nonce_size Ar number ;
426 define the byte size of nonce value.
427 Racoon can send any value although
428 RFC2409 specifies that the value MUST be between 8 and 256 bytes.
429 The default size is 16 bytes.
432 .Ic proposal { Ar sub-substatements Ic }
434 .Bl -tag -width Ds -compact
436 .It Ic encryption_algorithm Ar algorithm ;
437 specify the encryption algorithm used for the phase 1 negotiation.
438 This directive must be defined.
441 .Ic des , 3des , blowfish , cast128
444 For other transforms, this statement should not be used.
446 .It Ic hash_algorithm Ar algorithm;
447 define the hash algorithm used for the phase 1 negotiation.
448 This directive must be defined.
454 .It Ic authentication_method Ar type ;
455 defines the authentication method used for the phase 1 negotiation.
456 This directive must be defined.
459 .Ic pre_shared_key, rsasig , gssapi_krb .
461 .It Ic dh_group Ar group ;
462 define the group used for the Diffie-Hellman exponentiations.
463 This directive must be defined.
466 .Ic modp768 , modp1024 , modp1536 .
467 Or you can define 1, 2, or 5 as the DH group number.
468 When you want to use aggressive mode,
469 you must define same DH group in each proposal.
470 .It Ic lifetime time Ar number Ar timeunit ;
471 define lifetime of the phase 1 SA proposal.
472 Refer to the description of
474 directive immediately defined in
477 .It Ic gssapi_id Ar string ;
478 define the GSS-API endpoint name, to be included as an attribute in the SA,
481 authentication method is used. If this is not defined, the default value of
483 is used, where hostname is the FQDN of the interface being used.
488 .Ss Policy Specifications
489 The policy directive is obsolete, policies are now in the SPD.
491 will obey the policy configured into the kernel by
493 and will construct phase 2 proposals by combining
497 and policies in the kernel.
499 .Ss Sainfo Specifications
500 .Bl -tag -width Ds -compact
502 .Ic sainfo ( Ar source_id destination_id \*(Ba Ic anonymous )
503 .Ic { Ar statements Ic }
505 defines the parameters of the IKE phase 2 (IPsec-SA establishment).
509 are constructed like:
511 .Ic address Ar address
520 It means exactly the content of ID payload.
521 This is not like a filter rule.
522 For example, if you define 3ffe:501:4819::/48 as
524 3ffe:501:4819:1000:/64 will not match.
526 .Bl -tag -width Ds -compact
528 .It Ic pfs_group Ar group ;
529 define the group of Diffie-Hellman exponentiations.
530 If you do not require PFS then you can omit this directive.
531 Any proposal will be accepted if you do not specify one.
534 .Ic modp768 , modp1024 , modp1536 .
535 Or you can define 1, 2, or 5 as the DH group number.
537 .It Ic lifetime time Ar number Ar timeunit ;
538 define the lifetime of amount of time
539 which are to be used IPsec-SA.
540 Any proposal will be accepted, and no attribute(s) will be proposed to
541 the peer if you do not specify it(them).
546 .It Ic my_identifier Ar idtype ... ;
548 It does not make sense to specify a identifier in the phase 2.
553 does not have the list of security protocols to be negotiated.
554 The list of security protocols are passed by SPD in the kernel.
555 Therefore you have to define all of the potential algorithms
556 in the phase 2 proposals even if there is a algorithm which will not be used.
557 These algorithms are define by using the following three directives,
558 and they are lined with single comma as the separator.
559 For algorithms that can take variable-length keys, algorithm names
560 can be followed by a key length, like
561 .Dq Li blowfish 448 .
563 will compute the actual phase 2 proposals by computing
564 the permutation of the specified algorithms,
565 and then combining them with the security protocol specified by the SPD.
567 .Ic des, 3des, hmac_md5,
570 are specified as algorithms, we have four combinations for use with ESP,
572 Then, based on the SPD settings,
574 will construct the actual proposals.
575 If the SPD entry asks for ESP only, there will be 4 proposals.
576 If it asks for both AH and ESP, there will be 8 proposals.
577 Note that the kernel may not support the algorithm you have specified.
579 .Bl -tag -width Ds -compact
580 .It Ic encryption_algorithm Ar algorithms ;
581 .Ic des , 3des , des_iv64 , des_iv32 ,
582 .Ic rc5 , rc4 , idea , 3idea ,
583 .Ic cast128 , blowfish , null_enc ,
584 .Ic twofish , rijndael
587 .It Ic authentication_algorithm Ar algorithms ;
588 .Ic des , 3des , des_iv64 , des_iv32 ,
589 .Ic hmac_md5 , hmac_sha1 , non_auth
590 .Pq used with ESP authentication and AH
592 .It Ic compression_algorithm Ar algorithms ;
599 .Bl -tag -width Ds -compact
600 .It Ic log Ar level ;
601 define logging level.
609 If you put too high logging level on slower machines,
610 IKE negotiation can fail due to timing constraint changes.
613 .Ss Specifying the way to pad
614 .Bl -tag -width Ds -compact
615 .It Ic padding { Ar statements Ic }
616 specified padding format.
617 The following are valid statements:
618 .Bl -tag -width Ds -compact
619 .It Ic randomize (on \(ba off) ;
620 enable using a randomized value for padding.
622 .It Ic randomize_length (on \(ba off) ;
623 the pad length is random.
625 .It Ic maximum_length Ar number ;
626 define a maximum padding length.
628 .Ic randomize_length is off, this is ignored.
629 The default is 20 bytes.
630 .It Ic exclusive_tail (on \(ba off) ;
631 means to put the number of pad bytes minus one into last part of the padding.
633 .It Ic strict_check (on \(ba off) ;
634 means to be constrained the peer to set the number of pad bytes.
638 .Ss Special directives
639 .Bl -tag -width Ds -compact
640 .It Ic complex_bundle (on \(ba off) ;
641 defines the interpretation of proposal in the case of SA bundle.
643 .Dq IP AH ESP IP payload
645 .Dq AH tunnel and ESP tunnel .
646 The interpretation is more common to other IKE implementations, however,
647 it allows very limited set of combinations for proposals.
648 With the option enabled, it will be proposed as
649 .Dq AH transport and ESP tunnel .
654 .Ss Pre-shared key File
655 Pre-shared key file defines a pair of the identifier and the shared secret key
656 which are used at Pre-shared key authentication method in phase 1.
657 The pair in each lines are separated by some number of blanks and/or tab
660 Key can be included any blanks because all of the words after 2nd column
661 are interpreted as a secret key.
665 Keys which start with
667 are hexa-decimal strings.
668 Note that the file must be owned by the user ID running
670 .Pq usually the privileged user ,
671 and must not be accessible by others.
674 The following shows how the remote directive should be configured.
676 path pre_shared_key "/usr/local/v6/etc/psk.txt" ;
679 exchange_mode aggressive,main,base;
680 lifetime time 24 hour;
682 encryption_algorithm 3des;
684 authentication_method pre_shared_key;
692 lifetime time 12 hour ;
693 encryption_algorithm 3des, blowfish 448, twofish, rijndael ;
694 authentication_algorithm hmac_sha1, hmac_md5 ;
695 compression_algorithm deflate ;
699 The following is a sample of the file defined pre-shared key.
701 10.160.94.3 mekmitasdigoat
702 172.16.1.133 0x12345678
703 194.100.55.1 whatcertificatereally
704 3ffe:501:410:ffff:200:86ff:fe05:80fa mekmitasdigoat
705 3ffe:501:410:ffff:210:4bff:fea2:8baa mekmitasdigoat
706 foo@kame.net mekmitasdigoat
718 configuration file first appeared in
720 Yokogawa IPsec implementation.
723 Some statements may not be handled by