NAME
DESCRIPTION
is the configuration file for the
racoon(8)
ISAKMP daemon.
racoon(8)
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.
Keywords and special characters that the parser expects exactly are
displayed using
c this
font.
Parameters are specified with
font.
Square brackets
and
are used to show optional keywords and parameters.
Note that
you have to pay attention when this manual is describing
numbers.
The
number is always enclosed by
and
In this case, the port number is not an optional keyword.
If it is possible to omit the
number,
the expression becomes
q Bq Ar 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
- string
- path
- file
means any string enclosed in
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:
c sec , secs , second , seconds ,
c min , mins , minute , minutes ,
c hour , hours .
- }
specifies privilege separation parameters.
When enabled, these enable
racoon(8)
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.
- ;
The user to which the unprivileged instance of
racoon(8)
should switch.
This can be a quoted user name or a numeric UID.
- ;
The group to which the unprivileged instance of
racoon(8)
should switch.
This can be a quoted group name or a numeric GID.
- ;
A directory to which the unprivileged instance of
racoon(8)
should
chroot(2)
This directory should hold a tree where the following files must be
reachable:
- /dev/random
- /dev/urandom
- certificates
- banner
The PSK file, the private keys, and the hook scripts are accessed through the
privileged instance of
racoon(8)
and do not need to be reachable in the
chroot(2)
tree.
This section specify various paths used by racoon.
When running in privilege separation mode,
c certificate
and
c script
paths are mandatory.
- ;
specifies a path to include a file.
See
- ;
specifies a file containing pre-shared key(s) for various ID(s).
See
- ;
racoon(8)
will search this directory if a certificate or certificate request is received.
If you run with privilege separation,
racoon(8)
will refuse to use a certificate stored outside of this directory.
- ;
specifies a file to which SA information which is negotiated by
racoon should be stored.
racoon(8)
will install SA(s) from the file when started with the
flag.
The file is growing because
racoon(8)
simply adds SAs to it.
You should maintain the file manually.
- ;
racoon(8)
will search this directory for scripts hooks.
If you run with privilege separation,
racoon(8)
will refuse to execute a script stored outside of this directory.
- ;
specifies file where to store PID of process.
If path starts with
it is treated as
an absolute path, otherwise relative to VARRUN directory specified at
compilation time.
Default is
- file
other configuration files can be included.
is obsolete.
It must be defined at each
c remote
directive.
- }
specifies various timer values.
- ;
the maximum number of retries to send.
The default is 5.
- ;
the interval to resend, in seconds.
The default time is 10 seconds.
- ;
the number of packets per send.
The default is 1.
- ;
the maximum time it should take to complete phase 1.
The default time is 15 seconds.
- ;
the maximum time it should take to complete phase 2.
The default time is 10 seconds.
- ;
interval between sending NAT-Traversal keep-alive packets.
The default time is 20 seconds.
Set to 0s to disable keep-alive packets.
- }
If no
directive is specified,
racoon(8)
will listen on all available interface addresses.
The following is the list of valid statements:
- ;
If this is specified,
racoon(8)
will only listen on
The default port is 500, which is specified by IANA.
You can provide more than one address definition.
- ;
Same as
c 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.
- ;
require that all addresses for ISAKMP must be bound.
This statement will be ignored if you do not specify any address.
The
section can also be used to specify the admin socket mode and ownership,
if racoon was built with support for admin port.
- ;
and
are the socket path, owner, and group; they must be quoted.
Defaults are
UID 0, and GID 0.
is the access mode in octal, default is 0600.
;
This directive tells racoon to not listen on the admin socket.
- ;
Older versions of
racoon(8)
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
c gss_id_enc
parameter allows
racoon(8)
to be configured to use the old encoding for compatibility with existing
racoon(8)
installations.
The following are valid values for
- 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)
- Xo
c remote ( Ar address | Ic anonymous )
q Bq Ar port
q Ic inherit Ar parent
c { Ar statements Ic }
specifies the parameters for IKE phase 1 for each remote node.
The default port is 500.
If
c anonymous
is specified, the statements apply to all peers which do not match
any other
c remote
directive.
Sections with
c inherit Ar parent
statements (where
is either
or a keyword
c anonymous )
have all values predefined to those of a given
In these sections it is enough to redefine only the changed parameters.
The following are valid statements.
- ;
defines the exchange mode for phase 1 when racoon is the initiator.
It also 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.
- ;
means to use IPsec DOI as specified in RFC 2407.
You can omit this statement.
- ;
means to use SIT_IDENTITY_ONLY as specified in RFC 2407.
You can omit this statement.
- ;
is obsolete.
Instead, use
c my_identifier .
- ;
specifies the identifier sent to the remote host
and the type to use in the phase 1 negotiation.
c address, fqdn , user_fqdn , keyid ,
and
c asn1dn
can be used as an
Use them in the following way:
- ;
the type is the IP address.
This is the default type if you do not specify an identifier to use.
- ;
the type is a USER_FQDN (user fully-qualified domain name).
- ;
the type is a FQDN (fully-qualified domain name).
- ;
the type is a KEY_ID.
- ;
the type is an ASN.1 distinguished name.
If
is omitted,
racoon(8)
will get the DN from the Subject field in the certificate.
- ;
specifies the login to use in client-side Hybrid authentication.
It is available only if
racoon(8)
has been built with this option.
The associated password is looked up in the pre-shared key files,
using the login
c string
as the key id.
- ;
specifies the peer's identifier to be received.
If it is not defined then
racoon(8)
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
c verify_identifier .
The usage of
is the same as
c my_identifier
except that the individual component values of an
c asn1dn
identifier may specified as
c *
to match any value (e.g. "C=XX, O=MyOrg, OU=*, CN=Mine").
Alternative acceptable peer identifiers may be specified by repeating the
c peers_identifier
statement.
- ;
If you want to verify the peer's identifier,
set this to on.
In this case, if the value defined by
c peers_identifier
is not the same as the peer's identifier in the ID payload,
the negotiation will failed.
The default is off.
- ;
specifies a certificate specification.
is one of followings:
- ;
means a file name of a certificate.
means a file name of a secret key.
- ;
specifies a root certificate authority specification.
is one of followings:
- ;
means a file name of the root certificate authority.
Default is
;
Gather network information through ISAKMP mode configuration.
Default is off.
;
If
c dnssec
is defined,
racoon(8)
will ignore the CERT payload from the peer,
and try to get the peer's certificate from DNS instead.
If
is defined,
racoon(8)
will ignore the CERT payload from the peer,
and will use this certificate as the peer's certificate.
phase1_up
phase1_down
Shell scripts that get executed when a phase 1 SA goes up or down.
Both scripts get either
c phase1_up
or
c phase1_down
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.
The following variables are only set if
c 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_DNS4
Internal DNS server IPv4 address obtained by ISAKMP mode config.
- INTERNAL_NBNS4
Internal WINS server IPv4 address obtained by ISAKMP mode config.
;
If you do not want to send a certificate for some reason, set this to off.
The default is on.
;
If you do not want to send a certificate request for some reason, set this to off.
The default is on.
;
If you do not want to verify the peer's certificate for some reason,
set this to off.
The default is on.
;
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 be not proposed to
the peer if you do not specify it (them).
They can be individually specified in each proposal.
;
Enable receiver-side IKE fragmentation, if
racoon(8)
has been built with this feature.
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.
;
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)).
is the maximum size of the fragments.
552 should work anywhere,
but the higher
is, the better is 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.
;
enable this to send an INITIAL-CONTACT message.
The default value is
c on .
This message is useful only when
the implementation of the responder 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.
The KAME stack has the switch in the system wide value
net.key.preferred_oldsa.
when the value is zero, the stack always uses a new SA.
;
If you do not want to initiate the negotiation, set this to on.
The default value is
c off .
It is useful for a server.
;
specifies the action of lifetime 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
c strict .
If the
is:
- 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 is not required by the responder, the responder will obey the proposal.
If PFS is required by both sides and if the responder's group is not equal to
the initiator's one, then 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 (phase 2 only).
For PFS, this directive behaves the same as
c strict .
- exact
If the initiator's length is not 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 is not equal to
the initiator's one, then the responder will reject the proposal.
;
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.
;
This directive is for the responder.
Therefore you should set
c passive
to on in order that
racoon(8)
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)
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.
This directive is ignored in the initiator case.
The default value is
c off .
;
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).
Presence of NAT gateways along the path
is discovered during phase 1 handshake and if found, NAT-T is negotiated.
When NAT-T is in charge, all ESP and AH packets of a given connection
are 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 if a NAT 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.
;
This option activates the DPD and sets the time (in seconds) allowed
between 2 proof of liveness requests.
The default value is
c 0 ,
which disables DPD monitoring, but still negotiates DPD support.
;
If
c dpd_delay
is set, this sets the delay (in seconds) to wait for a proof of
liveness before considering it as failed and send another request.
The default value is
c 5 .
;
If
c dpd_delay
is set, this sets the maximum number of proof of liveness to request
(without reply) before considering the peer is dead.
The default value is
c 5 .
;
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.
Xo
c proposal { Ar sub-substatements Ic }
- ;
specify the encryption algorithm used for the phase 1 negotiation.
This directive must be defined.
is one of following:
c des , 3des , blowfish , cast128 , aes
for Oakley.
For other transforms, this statement should not be used.
- ;
define the hash algorithm used for the phase 1 negotiation.
This directive must be defined.
is one of following:
c md5, sha1, sha256, sha384, sha512
for Oakley.
- ;
defines the authentication method used for the phase 1 negotiation.
This directive must be defined.
is one of:
c pre_shared_key , rsasig , gssapi_krb , hybrid_rsa_server ,
or
c hybrid_rsa_client .
- ;
define the group used for the Diffie-Hellman exponentiations.
This directive must be defined.
is one of following:
c modp768 , modp1024 , modp1536 ,
c modp2048 , modp3072 , modp4096 ,
c 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.
- ;
define lifetime of the phase 1 SA proposal.
Refer to the description of the
c lifetime
directive defined in the
c remote
directive.
- ;
define the GSS-API endpoint name, to be included as an attribute in the SA,
if the
c gssapi_krb
authentication method is used.
If this is not defined, the default value of
is used, where hostname is the value returned by the
hostname(1)
command.
The policy directive is obsolete, policies are now in the SPD.
racoon(8)
will obey the policy configured into the kernel by
setkey(8)
and will construct phase 2 proposals by combining
c sainfo
specifications in
and policies in the kernel.
- Xo
c sainfo ( Ar source_id destination_id | Ic anonymous ) [ from Ar idtype [ Ar string ] ]
c { Ar statements Ic }
defines the parameters of the IKE phase 2 (IPsec-SA establishment).
and
are constructed like:
c address Ar address
q Ic / Ar prefix
q Ic [ Ar port ]
or
c subnet Ar address
q Ic / Ar prefix
q Ic [ Ar port ]
or
It means exactly the content of ID payload.
This is not like a filter rule.
For example, if you define 3ffe:501:4819::/48 as
3ffe:501:4819:1000:/64 will not match.
In case of longest prefix (selecting single host)
instructs to send ID type of ADDRESS, while
instructs to send ID type of SUBNET.
Otherwise these instructions are identical.
- ;
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.
is one of following:
c modp768 , modp1024 , modp1536 ,
c modp2048 , modp3072 , modp4096 ,
c modp6144 , modp8192 .
Or you can define 1, 2, 5, 14, 15, 16, 17, or 18 as the DH group number.
- ;
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
c proposal_check
directive.
- ;
is obsolete.
It does not make sense to specify an identifier in the phase 2.
racoon(8)
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
racoon(8)
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
c des , 3des , hmac_md5 ,
and
c 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)
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.
- ;
c des , 3des , des_iv64 , des_iv32 ,
c rc5 , rc4 , idea , 3idea ,
c cast128 , blowfish , null_enc ,
c twofish , rijndael , aes
;
c des , 3des , des_iv64 , des_iv32 ,
c hmac_md5 , hmac_sha1 , hmac_sha256, hmac_sha384, hmac_sha512, non_auth
;
c deflate
- ;
define logging level.
is one of following:
c notify , debug ,
and
c debug2 .
The default is
c notify .
If you set the logging level too high on slower machines,
IKE negotiation can fail due to timing constraint changes.
- }
specified padding format.
The following are valid statements:
- ;
enable using a randomized value for padding.
The default is on.
- ;
the pad length is random.
The default is off.
- ;
define a maximum padding length.
If
c randomize_length
is off, this is ignored.
The default is 20 bytes.
- ;
means to put the number of pad bytes minus one into the last part
of the padding.
The default is on.
- ;
means to constrain the peer to set the number of pad bytes.
The default is off.
- }
Defines the information to return for remote hosts' ISAKMP mode config
requests.
Also defines the authentication source for remote peers
authenticating through hybrid auth.
The following are valid statements:
- ;
Specify the source for authentication of users through hybrid auth.
means to use the Unix user database.
This is the default.
means to use a RADIUS server.
It works only if
racoon(8)
was built with libradius support, and the configuration is done in
radius.conf(5)
means to use PAM.
It works only if
racoon(8)
was built with libpam support.
- ;
Specify the source for IP addresses and netmask allocated through ISAKMP
mode config.
means to use the local IP pool defined by the
c network4
and
c pool_size
keywords.
This is the default.
means to use a RADIUS server.
It works only if
racoon(8)
was built with libradius support, and the configuration is done in
radius.conf(5)
RADIUS configuration requires RADIUS authentication.
- ;
Enable or disable accounting for Xauth logins and logouts.
Default is
which disable accounting.
enable RADIUS accounting.
It works only if
racoon(8)
was built with libradius support, and the configuration is done in
radius.conf(5)
RADIUS accounting require RADIUS authentication.
enable PAM accounting.
It works only if
racoon(8)
was built with libpam support.
PAM accounting requires PAM authentication.
- size
Specify the size of the IP address pool, either local or allocated
through RADIUS.
c conf_source
selects the local pool or the RADIUS configuration, but in both
configurations, you cannot have more than
users connected at the same time.
The default is 255.
- ;
- ;
The local IP pool base address and network mask from which dynamically
allocated IPv4 addresses should be taken.
This is used if
c conf_source
is set to
or if the RADIUS server returned
Default is
- ;
The IPv4 address for a DNS server.
- ;
The IPv4 address for a WINS server.
- ;
The path of a file displayed on the client at connection time.
Default is
- ;
On each failed Xauth authentication attempt, refuse new attempts for
more seconds.
This is to avoid dictionary attacks on Xauth passwords.
Default is one second.
Set to zero to disable authentication delay.
- ;
Sets the PFS group used in the client proposal (Cisco VPN client only).
Default is 0.
- ;
Allow the client to save the Xauth password (Cisco VPN client only).
Default is off.
- ;
defines the interpretation of proposal in the case of SA bundle.
Normally
is proposed as
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
The default value is
c off .
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)
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
are interpreted as hexadecimal strings.
Note that the file must be owned by the user ID running
racoon(8)
and must not be accessible by others.
EXAMPLES
The following shows how the remote directive should be configured.
path pre_shared_key "/etc/racoon/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 ;
}
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
HISTORY
The
configuration file first appeared in the
Yokogawa IPsec implementation.
BUGS
Some statements may not be handled by
racoon(8)
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