---
name: "racoon.conf"
section: "5"
platform: "linux"
package: "racoon"
version: "1:0.8.2+20140711-8+deb9u1"
release: "Debian 9 (Stretch)"
platforms: ["linux", "macos"]
url: "https://new.carta.tech/racoon.conf"
---

# racoon.conf(5)

configuration file for racoon

## NAME

**racoon.conf** – configuration file for racoon

## DESCRIPTION

**racoon.conf** is the configuration file for the [racoon(8)](/racoon/8.md) ISAKMP daemon. [racoon(8)](/racoon/8.md) 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. Each directive is composed by a tag and statements, enclosed by ‘{’ and ‘}’. Lines beginning with ‘#’ are comments.

### Meta Syntax

Keywords and special characters that the parser expects exactly are displayed using **this** font. Parameters are specified with *this* font. Square brackets( ‘\[’ and ‘\]’) are used to show optional keywords and parameters. Note that you have to pay attention when this manual is describing *port* numbers. The *port* number is always enclosed by ‘\[’ and ‘\]’. In this case, the port number is not an optional keyword. If it is possible to omit the *port* number, the expression becomes \[\[*port*\]\]. The vertical bar (‘\|’) is used to indicate a choice between optional parameters. Parentheses( ‘(’ and ‘)’) are used to group keywords and parameters when necessary. Major parameters are listed below.

- *number*

  means a hexadecimal or a decimal number. The former must be prefixed with ‘0x’.

- *string*

  - *path*

  - *file*

  means any string enclosed in ‘"’ (double quotes).

- *address*

  means IPv6 and/or IPv4 address.

- *port*

  means a TCP/UDP port number. The port number is always enclosed by ‘\[’ and ‘\]’.

- *timeunit*

  is one of following: **sec**, **secs**, **second**, **seconds**, **min**, **mins**, **minute**, **minutes**, **hour**, **hours**.

### Privilege separation

- **privsep** **{** *statements* **}**

  Specifies privilege separation parameters. When enabled, these enable [racoon(8)](/racoon/8.md) to operate with an unprivileged instance doing most of the work, while a privileged instance takes care of performing the following operations as root: reading PSK and private keys, launching hook scripts, and validating passwords against system databases or against PAM. Please note that using privilege separation makes changes to the *listen* and *paths* sections ignored upon configuration reloads. A [racoon(8)](/racoon/8.md) restart is required if you want such changes to be taken into account.

  - **user** *user*;

    The user to which the unprivileged instance of [racoon(8)](/racoon/8.md), should switch. This can be a quoted user name or a numeric UID.

  - **group** *group*;

    The group the unprivileged instance of [racoon(8)](/racoon/8.md), should switch. This can be a quoted group name or a numeric GID.

  - **chroot** *path*;

    A directory to which the unprivileged instance of [racoon(8)](/racoon/8.md) should [chroot(2)](/chroot/2.md). This directory should hold a tree where the following files must be reachable:

    - */dev/random*

      - */dev/urandom*

      - The certificates

      - The file containing the Xauth banner

      The PSK file, the private keys, and the hook scripts are accessed through the privileged instance of [racoon(8)](/racoon/8.md) and do not need to be reachable in the [chroot(2)](/chroot/2.md)'ed tree.

### Path Specification

This section specifies various paths used by racoon. When running in privilege separation mode, **certificate** and **script** paths are mandatory. A [racoon(8)](/racoon/8.md) restart is required if you want path changes to be taken into account.

- **path** **include** *path*;

  Specifies a path to include a file. See File Inclusion.

- **path** **pre\_shared\_key** *file*;

  Specifies a file containing pre-shared key(s) for various ID(s). See Pre-shared key File.

- **path** **certificate** *path*;

  [racoon(8)](/racoon/8.md) will search this directory if a certificate or certificate request is received. If you run with privilege separation, [racoon(8)](/racoon/8.md) will refuse to use a certificate stored outside of this directory.

- **path** **backupsa** *file*;

  Specifies a file to which SA information negotiated by racoon should be stored. [racoon(8)](/racoon/8.md) will install SA(s) from the file when started with the **-B** flag. The file is growing because [racoon(8)](/racoon/8.md) simply adds SAs to it. You should maintain the file manually.

- **path** **script** *path*;

  [racoon(8)](/racoon/8.md) will search this directory for scripts hooks. If you run with privilege separation, [racoon(8)](/racoon/8.md) will refuse to execute a script stored outside of this directory.

- **path** **pidfile** *file*;

  Specifies file where to store PID of process. If path starts with */* it is treated as an absolute path. Otherwise, it is treated as a relative path to the VARRUN directory specified at compilation time. Default is *racoon.pid*.

### File Inclusion

- **include** *file*

  Specifies other configuration files to be included.

### Timer Specification

- **timer** **{** *statements* **}**

  This section specifies various timer values used by racoon.

  - **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.

  - **natt\_keepalive** *number* *timeunit*;

    The interval between sending NAT-Traversal keep-alive packets. The default time is 20 seconds. Set to 0s to disable keep-alive packets.

### Listening Port Specification

- **listen** **{** *statements* **}**

  If no *listen* directive is specified, [racoon(8)](/racoon/8.md) will listen on all available interface addresses. The following is the list of valid statements:

  - **isakmp** *address* \[\[*port*\]\];

    If this is specified, [racoon(8)](/racoon/8.md) will only listen on the defined *address*. The default port is 500, which is specified by IANA. You can provide more than one address definition.

  - **isakmp\_natt** *address* \[*port*\];

    Same as **isakmp** but also sets the socket options to accept UDP-encapsulated ESP traffic for NAT-Traversal. If you plan to use NAT-T, you should provide at least one address with port 4500, which is specified by IANA. There is no default.

  - **strict\_address**;

    Requires that all addresses for ISAKMP be bound. This statement will be ignored if you do not specify address definitions.

    When running in privilege separation mode, you need to restart [racoon(8)](/racoon/8.md) to have changes to the *listen* section taken into account.

    The *listen* section can also be used to specify the admin socket mode and ownership if racoon was built with support for admin port.

    - **adminsock** *path* \[*owner group mode*\];

      The *path*, *owner*, and *group* values specify the socket path, owner, and group. They must be quoted. The defaults are */var/racoon/racoon.sock*, UID 0, and GID 0. *mode* is the access mode in octal. The default is 0600.

    - **adminsock** **disabled**;

      This directive tells racoon to not listen on the admin socket.

### Miscellaneous Global Parameters

- **gss\_id\_enc** *enctype*;

  Older versions of [racoon(8)](/racoon/8.md) used ISO-Latin-1 as the encoding of the GSS-API identifier attribute. For interoperability with Microsoft Windows' GSS-API authentication scheme, the default encoding has been changed to UTF-16LE. The **gss\_id\_enc** parameter allows [racoon(8)](/racoon/8.md) to be configured to use the old encoding for compatibility with existing [racoon(8)](/racoon/8.md) installations. The following are valid values for *enctype*:

  - **utf-16le**

    Use UTF-16LE to encode the GSS-API identifier attribute. This is the default encoding. This encoding is compatible with Microsoft Windows.

  - **latin1**

    Use ISO-Latin-1 to encode the GSS-API identifier attribute. This is the encoding used by older versions of [racoon(8)](/racoon/8.md).

- **pfkey\_buffer** *kBytes*

  Specifies the socket send/receive buffer size in kilobytes. Numerous kernel PF\_KEY implementations have problems with dumping SAD/SDP with large amount of entries (this happens when 100s to 1000s of tunnels are configured).

  The default value of 0 leaves everything at the OS-specific default value. If the default buffer size is greater than what is specified here racoon will not decrease it.

  This problem is known to be fixed in Linux 2.6.25 and later.

### Remote Nodes Specifications

- **remote** *name* \[**inherit** *parent\_name*\] **({** *statements* **}** \| **;)**

  Specifies the IKE phase 1 parameters for each remote node.

  If connection is initiated using racoonctl, a unique match using the remote IP must be found or the remote block name has to be given. For received acquires (kernel notices traffic requiring a new SA) the remote IP and remoteid from matching sainfo block are used to decide the remoteblock. If no uniquely matching remoteblock is found using these criteria, no connection attempt is done.

  When acting as responder, racoon picks the first proposal that has one or more acceptable remote configurations. When determining if a remote specification is matching the following information is checked:

  - The remote IP is checked against **remote\_address**.

  - ISAKMP exchange type is checked against **exchange\_mode**.

  - ISAKMP SA attributes must match a **proposal** block.

  - The remote identity is matched against **peers\_identifier** if **verify\_identifier** is on.

  - If a certificate request was received, it must match the issuer of **certificate\_type x509** certificate. If certificate request without issuer name was sent, the **match\_empty\_cr** parameter specifies whether or not remote block matches.

    Similarly, NAT-T is enabled if any of the initial remote configuration candidates allow NAT-T.

    Sections with **inherit** *parent* statements (where *parent* is either *address* or a keyword **anonymous**) that have all values predefined to those of a given *parent*. In these sections it is enough to redefine only the changed parameters.

    The following are valid statements.

    - **remote\_address** *address*;

      Defines the IP address of the peer.

    - **exchange\_mode** (**main** \| **aggressive** \| **base**);

      Defines the exchange mode for phase 1 when racoon is the initiator. It also means the acceptable exchange mode when racoon is the 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**;

      Means to use IPsec DOI as specified in RFC 2407. You can omit this statement.

    - **situation** **identity\_only**;

      Means to use SIT\_IDENTITY\_ONLY as specified in RFC 2407. You can omit this statement.

    - **my\_identifier** \[*qualifier*\] *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*. The *qualifier* is currently only used for **keyid**, and can be either **file** or **tag**. The possible values are :

      - **my\_identifier** **address** \[*address*\];

        The type is the IP address. This is the default type if you do not 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**\] *file*;

        The type is a KEY\_ID, read from the file.

      - **my\_identifier** **keyid** **tag** *string*;

        The type is a KEY\_ID, specified in the quoted string.

      - **my\_identifier** **asn1dn** \[*string*\];

        The type is an ASN.1 distinguished name. If *string* is omitted, [racoon(8)](/racoon/8.md) will get the DN from the Subject field in the certificate.

    - **xauth\_login** \[*string*\];

      Specifies the login to use in client-side Hybrid authentication. It is available only if [racoon(8)](/racoon/8.md) has been built with this option. The associated password is looked up in the pre-shared key files, using the login **string** as the key id.

    - **peers\_identifier** *idtype* *...*;

      Specifies the peer's identifier to be received. If it is not defined then [racoon(8)](/racoon/8.md) 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 **my\_identifier** except that the individual component values of an **asn1dn** identifier may specified as **\*** to match any value (e.g. "C=XX, O=MyOrg, OU=\*, CN=Mine"). The format of the specification should correspond to RFC 2253; in particular, commas and certain other characters - **,=+#;** - may be included in a name by preceding them with a backslash "\\", and arbitrary characters may be inserted in a name with the "\\nn" escape, where nn is the hex representation of the ascii value of the desired character. Alternative acceptable peer identifiers may be specified by repeating the **peers\_identifier** statement.

    - **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** is not the same as the peer's identifier in the ID payload, the negotiation will fail. The default is off.

    - **certificate\_type** *certspec*;

      Specifies a certificate specification. *certspec* is one of followings:

      - **x509** *certfile* *privkeyfile*;

        *certfile* means a file name of a certificate. *privkeyfile* means a file name of a secret key.

        - **plain\_rsa** *privkeyfile*;

          *privkeyfile* means a file name of a private key generated by [plainrsa-gen(8)](/plainrsa-gen/8.md). Required for RSA authentication.

    - **ca\_type** *cacertspec*;

      Specifies a root certificate authority specification. *cacertspec* is one of followings:

      - **x509** *cacertfile*;

        *cacertfile* means a file name of the root certificate authority. Default is */etc/openssl/cert.pem*

    - **mode\_cfg** **(on** \| **off)**;

      Gather network information through ISAKMP mode configuration. Default is off.

    - **weak\_phase1\_check** **(on** \| **off)**;

      Tells racoon to act on unencrypted deletion messages during phase 1. This is a small security risk, so the default is off, meaning that racoon will keep on trying to establish a connection even if the user credentials are wrong, for instance.

    - **peers\_certfile** (**dnssec** \| *certfile* \| **plain\_rsa** *pubkeyfile*);

      If **dnssec** is defined, [racoon(8)](/racoon/8.md) will ignore the CERT payload from the peer, and try to get the peer's certificate from DNS instead. If *certfile* is defined, [racoon(8)](/racoon/8.md) will ignore the CERT payload from the peer, and will use this certificate as the peer's certificate. If **plain\_rsa** is defined, [racoon(8)](/racoon/8.md) will expect *pubkeyfile* to be the peer's public key that was generated by [plainrsa-gen(8)](/plainrsa-gen/8.md).

    - **script** *script* **phase1\_up**

      - **script** *script* **phase1\_down**

      - **script** *script* **phase1\_dead**

      Shell scripts that get executed when a phase 1 SA goes up or down, or when it is detected as dead by DPD. All scripts get either **phase1\_up** , **phase1\_down** or **phase1\_dead** as first argument, and the following variables are set in their environment:

      - LOCAL\_ADDR

        The local address of the phase 1 SA.

      - LOCAL\_PORT

        The local port used for IKE for the phase 1 SA.

      - REMOTE\_ADDR

        The remote address of the phase 1 SA.

      - REMOTE\_PORT

        The remote port used for IKE for the phase 1 SA.

      - REMOTE\_ID

        The remote identity received in IKE for the phase 1 SA.

        The following variables are only set if **mode\_cfg** was enabled:

        - INTERNAL\_ADDR4

          An IPv4 internal address obtained by ISAKMP mode config.

        - INTERNAL\_NETMASK4

          An IPv4 internal netmask obtained by ISAKMP mode config.

        - INTERNAL\_CIDR4

          An IPv4 internal netmask obtained by ISAKMP mode config, in CIDR notation.

        - INTERNAL\_DNS4

          The first internal DNS server IPv4 address obtained by ISAKMP mode config.

        - INTERNAL\_DNS4\_LIST

          A list of internal DNS servers IPv4 address obtained by ISAKMP mode config, separated by spaces.

        - INTERNAL\_WINS4

          The first internal WINS server IPv4 address obtained by ISAKMP mode config.

        - INTERNAL\_WINS4\_LIST

          A list of internal WINS servers IPv4 address obtained by ISAKMP mode config, separated by spaces.

        - SPLIT\_INCLUDE

          The space separated list of IPv4 addresses and masks (address slash mask) that define the networks to be encrypted (as opposed to the default where all the traffic should be encrypted) ; obtained by ISAKMP mode config ; SPLIT\_INCLUDE and SPLIT\_LOCAL are mutually exclusive.

        - SPLIT\_LOCAL

          The space separated list of IPv4 addresses and masks (address slash mask) that define the networks to be considered local, and thus excluded from the tunnels ; obtained by ISAKMP mode config.

        - SPLIT\_INCLUDE\_CIDR

          Same as SPLIT\_INCLUDE, with netmasks in CIDR notation.

        - SPLIT\_LOCAL\_CIDR

          Same as SPLIT\_LOCAL, with netmasks in CIDR notation.

        - DEFAULT\_DOMAIN

          The DNS default domain name obtained by ISAKMP mode config.

    - **send\_cert** **(on** \| **off)**;

      If you do not want to send a certificate, set this to off. The default is on.

    - **send\_cr** **(on** \| **off)**;

      If you do not want to send a certificate request, set this to off. The default is on.

    - **match\_empty\_cr** **(on** \| **off)**;

      Specifies whether this remote block is a valid match when a non-specific certificate request is received. The default is on.

    - **verify\_cert** **(on** \| **off)**;

      By default, the identifier sent by the remote host (as specified in its **my\_identifier** statement) is compared with the credentials in the certificate used to authenticate the remote host as follows:

      - Type **asn1dn**:

        The entire certificate subject name is compared with the identifier, e.g. "C=XX, O=YY, ...".

      - Type **address,** **fqdn,** **or** **user\_fqdn**:

        The certificate's subjectAltName is compared with the identifier.

        If the two do not match the negotiation will fail. If you do not want to verify the identifier using the peer's certificate, set this to off.

    - **lifetime** **time** *number* *timeunit*;

      Define a lifetime of a certain time which will be proposed in the phase 1 negotiations. Any proposal will be accepted, and the attribute(s) will not be proposed to the peer if you do not specify it (them). They can be individually specified in each proposal.

    - **ike\_frag** **(on** \| **off** \| **force)**;

      Enable receiver-side IKE fragmentation if [racoon(8)](/racoon/8.md) has been built with this feature. If set to on, racoon will advertise itself as being capable of receiving packets split by IKE fragmentation. This extension is there to work around broken firewalls that do not work with fragmented UDP packets. IKE fragmentation is always enabled on the sender-side, and it is used if the peer advertises itself as IKE fragmentation capable. By selecting force, IKE Fragmentation will be used when racoon is acting as the initiator even before the remote peer has advertised itself as IKE fragmentation capable.

    - **esp\_frag** *fraglen*;

      This option is only relevant if you use NAT traversal in tunnel mode. Its purpose is to work around broken DSL routers that reject UDP fragments, by fragmenting the IP packets before ESP encapsulation. The result is ESP over UDP of fragmented packets instead of fragmented ESP over UDP packets (i.e., IP:UDP:ESP:frag(IP) instead of frag(IP:UDP:ESP:IP)). *fraglen* is the maximum size of the fragments. 552 should work anywhere, but the higher *fraglen* is, the better the performance.

      Note that because PMTU discovery is broken on many sites, you will have to use MSS clamping if you want TCP to work correctly.

    - **initial\_contact** **(on** \| **off)**;

      Enable this to send an INITIAL-CONTACT message. The default value is **on**. This message is useful only when the responder implementation chooses an old SA when there are multiple SAs with different established time and the initiator reboots. If racoon did not send the message, the responder would use an old SA even when a new SA was established. For systems that use a KAME derived IPSEC stack, the [sysctl(8)](/sysctl/8.md) variable net.key.preferred\_oldsa can be used to control this preference. When the value is zero, the stack always uses a new SA.

    - **passive** **(on** \| **off)**;

      If you do not want to initiate the negotiation, set this to on. The default value is **off**. It is useful for a server.

    - **proposal\_check** *level*;

      Specifies the action of lifetime length, key length, and PFS of the phase 2 selection on the responder side, and the action of lifetime check in phase 1. The default level is **strict**. If the *level* is:

      - **obey**

        The responder will obey the initiator anytime.

      - **strict**

        If the responder's lifetime length is longer than the initiator's or the responder's key length is shorter than the initiator's, the responder will use the initiator's value. Otherwise, the proposal will be rejected. If PFS is not required by the responder, the responder will obey the proposal. If PFS is required by both sides and the responder's group is not equal to the initiator's, then the responder will reject the proposal.

      - **claim**

        If the responder's lifetime length is longer than the initiator's or the responder's key length is shorter than the initiator's, the responder will use the initiator's value. If the responder's lifetime length is shorter than the initiator's, the responder uses its own length AND sends a RESPONDER-LIFETIME notify message to an initiator in the case of lifetime (phase 2 only). For PFS, this directive behaves the same as **strict**.

      - **exact**

        If the initiator's lifetime or key length is not equal to the responder's, the responder will reject the proposal. If PFS is required by both sides and the responder's group is not equal to the initiator's, then the responder will reject the proposal.

    - **support\_proxy** **(on** \| **off)**;

      If this value is set to on, then both values of ID payloads in the phase 2 exchange are always used as the addresses of end-point of IPsec-SAs. The default is off.

    - **generate\_policy** **(on** \| **off** \| **require** \| **unique)**;

      This directive is for the responder. Therefore you should set **passive** to on in order that [racoon(8)](/racoon/8.md) only becomes a responder. If the responder does not have any policy in SPD during phase 2 negotiation, and the directive is set to on, then [racoon(8)](/racoon/8.md) 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 clients whose IP address is allocated dynamically. Note that an inappropriate policy might be installed into the responder's SPD by the initiator, so other communications might fail if such policies are installed due to a policy mismatch between the initiator and the responder. **on** and **require** values mean the same thing (generate a require policy). **unique** tells racoon to set up unique policies, with a monotoning increasing reqid number (between 1 and IPSEC\_MANUAL\_REQID\_MAX). This directive is ignored in the initiator case. The default value is **off**.

    - **nat\_traversal** **(on** \| **off** \| **force)**;

      This directive enables use of the NAT-Traversal IPsec extension (NAT-T). NAT-T allows one or both peers to reside behind a NAT gateway (i.e., doing address- or port-translation). If a NAT gateway is detected during the phase 1 handshake, racoon will attempt to negotiate the use of NAT-T with the remote peer. If the negotiation succeeds, all ESP and AH packets for the given connection will be encapsulated into UDP datagrams (port 4500, by default). Possible values are:

      - **on**

        NAT-T is used when a NAT gateway is detected between the peers.

      - **off**

        NAT-T is not proposed/accepted. This is the default.

      - **force**

        NAT-T is used regardless of whether a NAT gateway is detected between the peers or not.

        Please note that NAT-T support is a compile-time option. Although it is enabled in the source distribution by default, it may not be available in your particular build. In that case you will get a warning when using any NAT-T related config options.

    - **dpd\_delay** *delay*;

      This option activates the DPD and sets the time (in seconds) allowed between 2 proof of liveliness requests. The default value is **0**, which disables DPD monitoring, but still negotiates DPD support.

    - **dpd\_retry** *delay*;

      If **dpd\_delay** is set, this sets the delay (in seconds) to wait for a proof of liveliness before considering it as failed and send another request. The default value is **5**.

    - **dpd\_maxfail** *number*;

      If **dpd\_delay** is set, this sets the maximum number of liveliness proofs to request (without reply) before considering the peer is dead. The default value is **5**.

    - **rekey** **(on** \| **off** \| **force)**;

      Enable automatic renegotiation of expired phase1 when there are non-dying phase2 SAs. Possible values are:

      - **force**

        Rekeying is done unconditionally.

      - **on**

        Rekeying is done only if DPD monitoring is active. This is the default.

      - **off**

        No automatic rekeying. Do note that turning off automatic rekeying will result in inaccurate DPD monitoring.

    - **nonce\_size** *number*;

      define the byte size of nonce value. Racoon can send any value although RFC2409 specifies that the value MUST be between 8 and 256 bytes. The default size is 16 bytes.

    - **ph1id** *number*;

      An optional number to identify the remote proposal and to link it only with sainfos who have the same number. Defaults to 0.

    - **proposal** **{** *sub-substatements* **}**

      - **encryption\_algorithm** *algorithm*;

        Specifies the encryption algorithm used for the phase 1 negotiation. This directive must be defined. *algorithm* is one of following: **des,** **3des,** **blowfish,** **cast128,** **aes,** **camellia** for Oakley. For other transforms, this statement should not be used.

      - **hash\_algorithm** *algorithm*;

        Defines the hash algorithm used for the phase 1 negotiation. This directive must be defined. *algorithm* is one of following: **md5,** **sha1,** **sha256,** **sha384,** **sha512** for Oakley.

      - **authentication\_method** *type*;

        Defines the authentication method used for the phase 1 negotiation. This directive must be defined. *type* is one of: **pre\_shared\_key**, **rsasig** (for plain RSA authentication), **gssapi\_krb**, **hybrid\_rsa\_server**, **hybrid\_rsa\_client**, **xauth\_rsa\_server**, **xauth\_rsa\_client**, **xauth\_psk\_server** or **xauth\_psk\_client**.

      - **dh\_group** *group*;

        Defines the group used for the Diffie-Hellman exponentiations. This directive must be defined. *group* is one of following: **modp768**, **modp1024**, **modp1536**, **modp2048**, **modp3072**, **modp4096**, **modp6144**, **modp8192**. Or you can define 1, 2, 5, 14, 15, 16, 17, or 18 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*;

        Defines the lifetime of the phase 1 SA proposal. Refer to the description of the **lifetime** directive defined in the **remote** directive.

      - **gss\_id** *string*;

        Defines the GSS-API endpoint name, to be included as an attribute in the SA, if the **gssapi\_krb** authentication method is used. If this is not defined, the default value of ‘host/hostname’ is used, where hostname is the value returned by the [hostname(1)](/hostname/1.md) command.

- **remote** (*address* \| **anonymous**) \[\[*port*\]\] \[**inherit** *parent*\] **{** *statements* **}**

  Deprecated format of specifying a remote block. This will be removed in future. It is a remnant from time when remote block was decided solely based on the peers IP address.

  This is equivalent to:

  ```
  remote "address" [inherit "parent-address"] {
  	remote_address address;
  }
  ```

### Sainfo Specifications

- **sainfo** (*local\_id* \| **anonymous**) (*remote\_id* \| **clientaddr** \| **anonymous**) \[**from** *idtype* \[*string*\]\] \[**group** *string*\] **{** *statements* **}**

  Defines the parameters of the IKE phase 2 (IPsec-SA establishment).

  The *local\_id* and *remote\_id* strings are constructed like:

  **address** *address* \[**/** *prefix*\] \[\[ *port*\]\] *ul\_proto*

  or

  **subnet** *address* \[**/** *prefix*\] \[\[ *port*\]\] *ul\_proto*

  An id string should be expressed to match the exact value of an ID payload. This is not like a filter rule. For example, if you define 3ffe:501:4819::/48 as *local\_id*. 3ffe:501:4819:1000:/64 will not match. In the case of a longest prefix (selecting a single host), *address* instructs to send ID type of ADDRESS while *subnet* instructs to send ID type of SUBNET. Otherwise, these instructions are identical.

  The **anonymous** keyword can be used to match any id. The **clientaddr** keyword can be used to match a remote id that is equal to either the peer ip address or the mode\_cfg ip address (if assigned). This can be useful to restrict policy generation when racoon is acting as a client gateway for peers with dynamic ip addresses.

  The **from** keyword allows an sainfo to only match for peers that use a specific phase1 id value during authentication. The **group** keyword allows an XAuth group membership check to be performed for this sainfo section. When the mode\_cfg auth source is set to **system** or **ldap**, the XAuth user is verified to be a member of the specified group before allowing a matching SA to be negotiated.

  - **pfs\_group** *group*;

    define the group of Diffie-Hellman exponentiations. If you do not require PFS then you can omit this directive. Any proposal will be accepted if you do not specify one. *group* is one of following: **modp768**, **modp1024**, **modp1536**, **modp2048**, **modp3072**, **modp4096**, **modp6144**, **modp8192**. Or you can define 1, 2, 5, 14, 15, 16, 17, or 18 as the DH group number.

  - **lifetime** **time** *number* *timeunit*;

    define how long an IPsec-SA will be used, in timeunits. Any proposal will be accepted, and no attribute(s) will be proposed to the peer if you do not specify it(them). See the **proposal\_check** directive.

  - **remoteid** *number*;

    Sainfos will only be used if their remoteid matches the ph1id of the remote section used for phase 1. Defaults to 0, which is also the default for ph1id.

    [racoon(8)](/racoon/8.md) does not have a list of security protocols to be negotiated. The list of security protocols are passed by SPD in the kernel. Therefore you have to define all of the potential algorithms in the phase 2 proposals even if there are algorithms which will not be used. These algorithms are define 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”. [racoon(8)](/racoon/8.md) 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(8)](/racoon/8.md) 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 that the kernel may not support the algorithm you have specified.

    - **encryption\_algorithm** *algorithms*;

      **des**, **3des**, **des\_iv64**, **des\_iv32**, **rc5**, **rc4**, **idea**, **3idea**, **cast128**, **blowfish**, **null\_enc**, **twofish**, **rijndael**, **aes**, **camellia** (used with ESP)

    - **authentication\_algorithm** *algorithms*;

      **des**, **3des**, **des\_iv64**, **des\_iv32**, **hmac\_md5**, **hmac\_sha1**, **hmac\_sha256,** **hmac\_sha384,** **hmac\_sha512,** **non\_auth** (used with ESP authentication and AH)

    - **compression\_algorithm** *algorithms*;

      **deflate** (used with IPComp)

### Logging level

- **log** *level*;

  Defines the logging level. *level* is one of following: **error**, **warning**, **notify**, **info**, **debug** or **debug2**. The default is **info**. If you set the logging level too high on slower machines, IKE negotiation can fail due to timing constraint changes.

### Specifies the way to pad

- **padding** **{** *statements* **}**

  specifies the padding format. The following are valid statements:

  - **randomize** **(on** \| **off)**;

    Enables the use of a randomized value for padding. The default is on.

  - **randomize\_length** **(on** \| **off)**;

    The pad length will be random. The default is off.

  - **maximum\_length** *number*;

    Defines a maximum padding length. If **randomize\_length** is off, this is ignored. The default is 20 bytes.

  - **exclusive\_tail** **(on** \| **off)**;

    Means to put the number of pad bytes minus one into the last part of the padding. The default is on.

  - **strict\_check** **(on** \| **off)**;

    Means to constrain the peer to set the number of pad bytes. The default is off.

### ISAKMP mode configuration settings

- **mode\_cfg** **{** *statements* **}**

  Defines the information to return for remote hosts' ISAKMP mode config requests. Also defines the authentication source for remote peers authenticating through Xauth.

  The following are valid statements:

  - **auth\_source** **(system** \| **radius** \| **pam** \| **ldap)**;

    Specifies the source for authentication of users through Xauth. *system* means to use the Unix user database. This is the default. *radius* means to use a RADIUS server. It works only if [racoon(8)](/racoon/8.md) was built with libradius support. Radius configuration is handled by statements in the **radiuscfg** section. *pam* means to use PAM. It works only if [racoon(8)](/racoon/8.md) was built with libpam support. *ldap* means to use LDAP. It works only if [racoon(8)](/racoon/8.md) was built with libldap support. LDAP configuration is handled by statements in the **ldapcfg** section.

  - **auth\_groups** *group1*, *...*;

    Specifies the group memberships for Xauth in quoted group name strings. When defined, the authenticating user must be a member of at least one group for Xauth to succeed.

  - **group\_source** **(system** \| **ldap)**;

    Specifies the source for group validation of users through Xauth. *system* means to use the Unix user database. This is the default. *ldap* means to use LDAP. It works only if [racoon(8)](/racoon/8.md) was built with libldap support and requires LDAP authentication. LDAP configuration is handled by statements in the **ldapcfg** section.

  - **conf\_source** **(local** \| **radius** \| **ldap)**;

    Specifies the source for IP addresses and netmask allocated through ISAKMP mode config. *local* means to use the local IP pool defined by the **network4** and **pool\_size** statements. This is the default. *radius* means to use a RADIUS server. It works only if [racoon(8)](/racoon/8.md) was built with libradius support and requires RADIUS authentication. RADIUS configuration is handled by statements in the **radiuscfg** section. *ldap* means to use an LDAP server. It works only if [racoon(8)](/racoon/8.md) was built with libldap support and requires LDAP authentication. LDAP configuration is handled by statements in the **ldapcfg** section.

  - **accounting** **(none** \| **system** \| **radius** \| **pam)**;

    Enables or disables accounting for Xauth logins and logouts. The default is *none* which disable accounting. Specifying *system* enables system accounting through [utmp(5)](/utmp/5.md). Specifying *radius* enables RADIUS accounting. It works only if [racoon(8)](/racoon/8.md) was built with libradius support and requires RADIUS authentication. RADIUS configuration is handled by statements in the **radiuscfg** section. Specifying *pam* enables PAM accounting. It works only if [racoon(8)](/racoon/8.md) was build with libpam support and requires PAM authentication.

  - **pool\_size** *size*

    Specify the size of the IP address pool, either local or allocated through RADIUS. **conf\_source** selects the local pool or the RADIUS configuration, but in both configurations, you cannot have more than *size* users connected at the same time. The default is 255.

  - **network4** *address*;

    - **netmask4** *address*;

    The local IP pool base address and network mask from which dynamically allocated IPv4 addresses should be taken. This is used if **conf\_source** is set to *local* or if the RADIUS server returned *255.255.255.254*. Default is *0.0.0.0/0.0.0.0*.

  - **dns4** *addresses*;

    A list of IPv4 addresses for DNS servers, separated by commas, or on multiple **dns4** lines.

  - **wins4** *addresses*;

    A list of IPv4 address for WINS servers. The keyword

  - nbns4

    can also be used as an alias for

  - wins4.

    - **split\_network** **(include** \| **local\_lan)** *network/mask,* *...*

    The network configuration to send, in CIDR notation (e.g. 192.168.1.0/24). If **include** is specified, the tunnel should be only used to encrypt the indicated destinations ; otherwise, if **local\_lan** is used, everything will pass through the tunnel but those destinations.

  - **default\_domain** *domain*;

    The default DNS domain to send.

  - **split\_dns** *domain*, *...*

    The split dns configuration to send, in quoted domain name strings. This list can be used to describe a list of domain names for which a peer should query a modecfg assigned dns server. DNS queries for all other domains would be handled locally. (Cisco VPN client only).

  - **banner** *path*;

    The path of a file displayed on the client at connection time. Default is */etc/motd*.

  - **auth\_throttle** *delay*;

    On each failed Xauth authentication attempt, refuse new attempts for a set *delay* of seconds. This is to avoid dictionary attacks on Xauth passwords. Default is one second. Set to zero to disable authentication delay.

  - **pfs\_group** *group*;

    Sets the PFS group used in the client proposal (Cisco VPN client only). Default is 0.

  - **save\_passwd** **(on** \| **off)**;

    Allow the client to save the Xauth password (Cisco VPN client only). Default is off.

### Ldap configuration settings

- **ldapcfg** **{** *statements* **}**

  Defines the parameters that will be used to communicate with an ldap server for **xauth** authentication.

  The following are valid statements:

  - **version** **(2** \| **3)**;

    The ldap protocol version used to communicate with the server. The default is **3**.

  - **host** *(hostname* \| *address)*;

    The host name or ip address of the ldap server. The default is **localhost**.

  - **port** *number*;

    The port that the ldap server is configured to listen on. The default is **389**.

  - **base** *distinguished* *name*;

    The ldap search base. This option has no default value.

  - **subtree** **(on** \| **off)**;

    Use the subtree ldap search scope. Otherwise, use the one level search scope. The default is **off**.

  - **bind\_dn** *distinguished* *name*;

    The user dn used to optionally bind as before performing ldap search operations. If this option is not specified, anonymous binds are used.

  - **bind\_pw** *string*;

    The password used when binding as **bind\_dn**.

  - **attr\_user** *attribute* *name*;

    The attribute used to specify a users name in an ldap directory. For example, if a user dn is "cn=jdoe,dc=my,dc=net" then the attribute would be "cn". The default value is **cn**.

  - **attr\_addr** *attribute* *name*;

    - **attr\_mask** *attribute* *name*;

    The attributes used to specify a users network address and subnet mask in an ldap directory. These values are forwarded during mode\_cfg negotiation when the conf\_source is set to ldap. The default values are **racoon-address** and **racoon-netmask**.

  - **attr\_group** *attribute* *name*;

    The attribute used to specify a group name in an ldap directory. For example, if a group dn is "cn=users,dc=my,dc=net" then the attribute would be "cn". The default value is **cn**.

  - **attr\_member** *attribute* *name*;

    The attribute used to specify group membership in an ldap directory. The default value is **member**.

### Radius configuration settings

- **radiuscfg** **{** *statements* **}**

  Defines the parameters that will be used to communicate with radius servers for **xauth** authentication. If radius is selected as the xauth authentication or accounting source and no servers are defined in this section, settings from the system [radius.conf(5)](/radius.conf/5.md) configuration file will be used instead.

  The following are valid statements:

  - **auth** *(hostname* \| *address)* *\[port\]* *sharedsecret*;

    The host name or ip address, optional port value and shared secret value of a radius authentication server. Up to 5 radius authentication servers may be specified using multiple lines.

  - **acct** *(hostname* \| *address)* *\[port\]* *sharedsecret*;

    The host name or ip address, optional port value and shared secret value of a radius accounting server. Up to 5 radius accounting servers may be specified using multiple lines.

  - **timeout** *seconds*;

    The timeout for receiving replies from radius servers. The default is **3**.

  - **retries** *count*;

    The maximum number of repeated requests to make before giving up on a radius server. The default is **3**.

### 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 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

The pre-shared key file defines pairs of identifiers and corresponding shared secret keys which are used in the pre-shared key authentication method in phase 1. The pair in each line is separated by some number of blanks and/or tab characters like in the [hosts(5)](/hosts/5.md) file. Key can include blanks because everything after the first blanks is interpreted as the secret key. Lines starting with ‘#’ are ignored. Keys which start with ‘0x’ are interpreted as hexadecimal strings. Note that the file must be owned by the user ID running [racoon(8)](/racoon/8.md) (usually the privileged user), and must not be accessible by others.

## EXAMPLES

The following 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, twofish, rijndael ;
	authentication_algorithm hmac_sha1, hmac_md5 ;
	compression_algorithm deflate ;
}
```

If you are configuring plain RSA authentication, the remote directive should look like the following:

```
path certificate "/usr/local/v6/etc" ;
remote anonymous
{
        exchange_mode main,base ;
        lifetime time 12 hour ;
        certificate_type plain_rsa "/usr/local/v6/etc/myrsakey.priv";
        peers_certfile plain_rsa "/usr/local/v6/etc/yourrsakey.pub";
        proposal {
                        encryption_algorithm aes ;
                        hash_algorithm sha1 ;
                        authentication_method rsasig ;
                        dh_group 2 ;
        }
}
```

The following is a sample for the pre-shared key file.

```
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
```

## SEE ALSO

[racoon(8)](/racoon/8.md), [racoonctl(8)](/racoonctl/8.md), [setkey(8)](/setkey/8.md)

## HISTORY

The **racoon.conf** configuration file first appeared in the “YIPS” Yokogawa IPsec implementation.

## BUGS

Some statements may not be handled by [racoon(8)](/racoon/8.md) yet.

Diffie-Hellman computation can take a very long time, and may cause unwanted timeouts, specifically when a large D-H group is used.

## SECURITY CONSIDERATIONS

The use of IKE phase 1 aggressive mode is not recommended, as described in http://www.kb.cert.org/vuls/id/886601.
