/etc/racoon/racoon.conf

Configuration file for racoon

Name:

/etc/racoon/racoon.conf

Description:

This file is the configuration file for the racoon ISAKMP daemon. This daemon negotiates security associations for itself (ISAKMP SA, or phase 1 SA) and for kernel IPsec (IPsec SA, or phase 2 SA). The file consists of a sequence of directives and statements. Statements are enclosed by braces ({}). Lines beginning with # are comments.

The major parameters are listed below.

number
A hexadecimal (prefixed with 0x) or decimal number.
string, path, file
Any string enclosed in double quotes (e.g., "string").
address
IPv6 and/or IPv4 address.
port
A TCP/UDP port number.
timeunit
One of the following:
  • sec
  • secs
  • second
  • seconds
  • min
  • mins
  • minute
  • minutes
  • hour
  • hours

Path Specification

The following path specfications are allowed:

path include path
Specifies a path to include a file, see File Inclusion, below.
path pre_shared_key file
Specifies a file containing pre-shared key(s) for various ID(s); see Pre-shared key File, below.
path certificate path
The racoon daemon will search this directory if a certificate or certificate request is received.
path backupsa file
Specifies a file to store SA information that is negotiated by racoon. If you specify the -B option when you start racoon, the daemon will install SA(s) from this file.
Note: Make sure you remove redundant data from this file to keep it to a reasonable size because racoon simply adds SAs (you have to do this manually).

File Inclusion

include file
Other configuration files can be included.

Identifier Specification

This is obsolete; it must be defined at each remote directive.

Timer Specification

timer {statements...}
Specifies various timer values. You can use statements such as:
counter number
The maximum number of retries to send. The default is 5.
interval number timeunit
The interval to resend, in seconds. The default time is 10 seconds.
persend number
The number of packets per send. The default is 1.
phase1 number timeunit
The maximum time it should take to complete phase 1. The default time is 15 seconds.
phase2 number timeunit
The maximum time it should take to complete phase 2. The default time is 10 seconds.

Listening Port Specification

listen { statements }
If you don't specify this directive, racoon will listen on all of the available interface addresses. Here are the valid statements:
isakmp address [port]
Tells racoon to listen only on address. The default port is 500 (specified by IANA). You can provide more than one address definition.
strict_address
Require that all addresses for ISAKMP must be bound. This statement is ignored if you don't specify any addresses.

Remote Nodes Specifications

remote (address | anonymous) [port] { statements }
Specifies the parameters for IKE phase 1 for each remote node. The default port is 500. If anonymous is specified, the statements apply to all peers that don't match any other remote directive.

These are the valid statements:

exchange_mode (main | aggressive | base) Ic0
Defines the exchange mode for phase 1 when racoon is the initiator. Also it means the acceptable exchange mode when racoon is responder. More than one mode can be specified by separating them with a comma. All of the modes are acceptable. The first exchange mode is what racoon uses when it is the initiator.
doi ipsec_doi
Use IPSEC-DOI as specified in RFC 2407. You can omit this statement.
situation identity_only
Use SIT_IDENTITY_ONLY as specified in RFC 2407. You can omit this statement.
identifier idtype
This statement is obsolete. Instead, use my_identifier.
my_identifier idtype ...
Specifies the identifier sent to the remote host and the type to use in the phase 1 negotiation. address, fqdn, user_fqdn, keyid and asn1dn can be used as an idtype. They are used like this:
my_identifier address [address]
The type is the IP address. This is the default type if you don't specify an identifier to use.
my_identifier user_fqdn string
The type is a USER_FQDN (user fully-qualified domain name).
my_identifier fqdn string
The type is a FQDN (fully-qualified domain name).
my_identifier keyid file
The type is a KEY_ID.
my_identifier asn1dn [string]
The type is an ASN.1 distinguished name. If string is omitted, racoon will get DN from the Subject field in the certificate.
peers_identifier idtype ...
This statement specifies the peer's identifier to be received. If it is not defined then racoon will not verify the peer's identifier in ID payload transmitted from the peer. If it is defined, the behavior of the verification depends on the flag of verify_identifier. The usage of idtype is the same as in my_identifier.
verify_identifier (on | off)
If you want to verify the peer's identifier, set this to on. In this case, if the value defined by peers_identifier isn't the same as the peer's identifier in the ID payload, the negotiation will fail. The default is off.
certificate_type certspec
This specifies a certificate specification. The certspec variable is constructed like this:
x509 certfile privkeyfile
Where certfile is the file name of the certificate and privkeyfile is the file name of the secret key.
peers_certfile (dnssec | certfile)
If dnssec is defined, racoon will ignore the CERT payload from the peer, and try to get the peer's certificate from DNS instead. If certfile is defined, racoon will ignore the CERT payload from the peer, and will use this certificate as the peer's certificate.
send_cert (on | off)
If you don't want to send a certificate for some reason, set this to off. The default is on.
send_cr (on | off)
If you don't want to send a certificate request for some reason, set this to off. The default is on.
verify_cert (on | off)
If you don't want to verify the peer's certificate for some reason, set this to off. The default is on.
lifetime time number timeunit
Define a lifetime which will be proposed in the phase 1 negotiations. Any proposal will be accepted, and attributes will be not proposed to the peer unless you specify them. They can be individually specified in each proposal.
initial_contact (on | off)
Enable this to send an INITIAL-CONTACT message. The default value is on.
passive (on | off)
If you don't want to initiate the negotiation, set this to on. The default value is off. This is useful for a server.
proposal_check level
Specifies the action of lifetime length and PFS of the phase 2 selection on the responder side. The default level is strict. Here are the acceptable values for level:
obey
The responder will obey the initiator anytime.
strict
If the responder's length is longer than the initiator's one, the responder uses the initiator's one; otherwise, it rejects the proposal. If PFS isn't required by the responder, the responder will obey the proposal. If PFS is required by both sides, and if the responder's group isn't equal to the initiator's one, the responder will reject the proposal.
claim
If the responder's length is longer than the initiator's one, the responder will use the initiator's one. If the responder's length is shorter than the initiator's one, the responder uses its own length AND sends a RESPONDER-LIFETIME notify message to an initiator in the case of lifetime. About PFS, this directive is same as strict.
exact
If the initiator's length isn't equal to the responder's one, the responder will reject the proposal. If PFS is required by both sides and if the responder's group isn't equal to the initiator's one, the responder will reject the proposal.
support_mip6 (on | off)
If this value is set on, both values of ID payloads in phase 2 exchange are always used as the addresses of end-point of IPsec-SAs. The default is off.
generate_policy (on | off)
This directive is for the responder. Therefore you should set passive on in order that racoon only becomes a responder. If the responder doesn't have any policy in SPD during phase 2 negotiation, and the directive is set on, then racoon will choose the first proposal in the SA payload from the initiator, and generate policy entries from the proposal. It is useful to negotiate with the client which is allocated IP address dynamically.

Note that inappropriate policy might be installed by the initiator because the responder just installs policies as the initiator proposes. So that other communication might fail if such policies installed. This directive is ignored in the initiator case. The default value is off.

nonce_size number
Define the byte size of nonce value. The racoon daemon can send any value, although RFC2409 specifies that the value MUST be between 8 and 256 bytes. The default size is 16 bytes.
proposal { sub-substatements }
The substatements are as follows:
encryption_algorithm algorithm;
Specify the encryption algorithm used for the phase 1 negotiation. This directive must be defined. The algorithm variable for oakley is one of following:
  • des
  • 3des
  • blowfish
  • cast128

This statement shouldn't be used for other transforms.

hash_algorithm algorithm
Define the hash algorithm used for the phase 1 negotiation. This directive must be defined. The algorithm variable for oakley is md5 or sha1.
authentication_method type
Defines the authentication method used for the phase 1 negotiation. This directive must be defined. The type variable is one of:
  • pre_shared_key
  • rsasig
  • gssapi_krb
dh_group group
Define the group used for the Diffie-Hellman exponentiations. This directive must be defined. The group variable is one of following:
  • modp768
  • modp1024
  • modp1536

Or you can define 1, 2, or 5 as the DH group number. When you want to use aggressive mode, you must define the same DH group in each proposal.

lifetime time number timeunit
Define the lifetime of the phase 1 SA proposal. Refer to the description of lifetime directive immediately defined in the remote directive.
gssapi_id string
Define the GSS-API endpoint name, to be included as an attribute in the SA, if the gssapi_krb authentication method is used. If this isn't defined, the default value of “ike/hostname is used, where hostname is the FQDN of the interface being used.

Policy Specifications

The policy directive is obsolete, policies are now in the SPD. The racoon daemon will obey the policy configured into the kernel by setkey, and will construct phase 2 proposals by combining sainfo specifications in /etc/racoon/racoon.conf, and policies in the kernel.

Sainfo Specifications

sainfo (source_id destination_id | anonymous) { statements }
Defines the parameters of the IKE phase 2 (IPSec-SA establishment). The source_id and destination_id variables are constructed like this:
address address [/ prefix] [ port ] ul_proto or idtype string
Means exactly the content of ID payload. This isn't like a filter rule. For example, if you define 3ffe:501:4819::/48 as source_id, 3ffe:501:4819:1000:/64 will not match.
pfs_group group
Define the group of Diffie-Hellman exponentiations. If you don't require PFS, you can omit this directive. Any proposal will be accepted if you don't specify one. The group variable is one of following:
  • modp768
  • modp1024
  • modp1536

Or you can define 1, 2, or 5 as the DH group number.

lifetime time number timeunit
Define the amount of time to be used for IPsec-SA. Any proposal will be accepted, and no unspecifed attributes will be proposed to the peer. For more informantion, see the proposal_check directive.
identifier idtype
This is obsolete, use my_identifier directives instead.
my_identifier idtype ...
Specifies the ID type to use for the phase 2 negotiation. The default is address described in the my_identifier directive in remote. This is always for the initiator, not the responder; as the responder, the racoon daemon can handle only the IP address type.

The racoon daemon doesn't have the list of security protocols to be negotiated. This list is passed by SPD in the kernel. Therefore, you have to define all of the potential algorithms in the phase 2 proposals, even if there is a algorithm which will not be used. These algorithms are defined by using the following three directives with a single comma as the separator.

For algorithms that can take variable-length keys, algorithm names can be followed by a key length, like blowfish 448. The racoon daemon will compute the actual phase 2 proposals by computing the permutation of the specified algorithms, and then combining them with the security protocol specified by the SPD. For example, if des, 3des, hmac_md5, and hmac_sha1 are specified as algorithms, we have four combinations for use with ESP, and two for AH. Then, based on the SPD settings, racoon will construct the actual proposals. If the SPD entry asks for ESP only, there will be 4 proposals. If it asks for both AH and ESP, there will be 8 proposals.

Note: The kernel may not support the algorithm you have specified.
encryption_algorithm algorithms
Where algorithms may be:
  • des
  • 3des
  • des_iv64
  • des_iv32
  • cast128
  • blowfish
  • null_enc
  • rijndael (used with ESP)
authentication_algorithm algorithms
Where algorithms may be:
  • des
  • 3des
  • des_iv64
  • des_iv32
  • hmac_md5
  • hmac_sha1
  • non_auth(used with ESP authentication and AH)
compression_algorithm algorithms
Where algorithms may be:
  • deflate (used with IPComp)

Logging level

log level
Define logging level. The level variable is one of the following:
  • notify (default)
  • debug
  • debug2

If you put too high a logging level on slower machines, IKE negotiation can fail due to timing constraint changes.

Specifying the way to pad

padding { statements }
The specified padding format. The following are valid statements:
randomize (on | off)
Enable using a randomized value for padding. The default is on.
randomize_length (on | off)
The pad length is random. The default is off.
maximum_length number
Define a maximum padding length. If randomize_length is off, this is ignored. The default is 20 bytes.
exclusive_tail (on | off)
This puts the number of pad bytes minus one into the last part of the padding. The default is on.
strict_check (on | off)
This constrains the peer to set the number of pad bytes. The default is off.

Special directives

complex_bundle (on | off)
Defines the interpretation of proposal in the case of SA bundle. Normally “IP AH ESP IP payload” is proposed as “AH tunnel and ESP tunnel”. The interpretation is more common to other IKE implementations, however, it allows a very limited set of combinations for proposals. With the option enabled, it will be proposed as “AH transport and ESP tunnel”. The default value is off.

Pre-shared key File

Pre-shared key file defines a pair of the identifier and the shared secret key which are used at Pre-shared key authentication method in phase 1. The pair in each lines are separated by some number of blanks and/or tab characters (as in /etc/hosts). The key can include blanks because all of the words after the 2nd column are interpreted as a secret key.

Lines starting with # are ignored. Keys that start with 0x are hexadecimal strings.

Note: The file must be owned by the user ID running racoon (usually the privileged user), and must not be accessible by others.

Examples:

The following example shows how the remote directive should be configured:

 path pre_shared_key "/usr/local/v6/etc/psk.txt" ;
 remote anonymous
 {
 exchange_mode aggressive,main,base;
 lifetime time 24 hour;
 proposal {
 encryption_algorithm 3des;
 hash_algorithm sha1;
 authentication_method pre_shared_key;
 dh_group 2;
 }
 }

 sainfo anonymous
 {
 pfs_group 2;
 lifetime time 12 hour ;
 encryption_algorithm 3des, blowfish 448, rijndael ;
 authentication_algorithm hmac_sha1, hmac_md5 ;
 compression_algorithm deflate ;
 }

The following is a sample of the file defined pre-shared key:

 10.160.94.3 mekmitasdigoat
 172.16.1.133 0x12345678
 194.100.55.1 whatcertificatereally
 3ffe:501:410:ffff:200:86ff:fe05:80fa mekmitasdigoat
 3ffe:501:410:ffff:210:4bff:fea2:8baa mekmitasdigoat
 foo@kame.net mekmitasdigoat
 foo.kame.net hoge

Caveats:

The racoon daemon may not yet be able to handle some of the statements described in this document.