2001-06-27 19:41:20 +00:00
|
|
|
.\" $KAME: ipsec.4,v 1.17 2001/06/27 15:25:10 itojun Exp $
|
2000-07-17 02:22:18 +00:00
|
|
|
.\"
|
2000-01-06 12:40:54 +00:00
|
|
|
.\" Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
|
|
|
|
.\" All rights reserved.
|
2000-07-17 02:22:18 +00:00
|
|
|
.\"
|
2000-01-06 12:40:54 +00:00
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
|
|
.\" modification, are permitted provided that the following conditions
|
|
|
|
.\" are met:
|
|
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
|
|
.\" 3. Neither the name of the project nor the names of its contributors
|
|
|
|
.\" may be used to endorse or promote products derived from this software
|
|
|
|
.\" without specific prior written permission.
|
2000-07-17 02:22:18 +00:00
|
|
|
.\"
|
2000-01-06 12:40:54 +00:00
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
|
|
|
|
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
.\" SUCH DAMAGE.
|
|
|
|
.\"
|
2005-02-09 18:07:17 +00:00
|
|
|
.\" $FreeBSD$
|
|
|
|
.\"
|
2009-11-29 20:47:43 +00:00
|
|
|
.Dd November 29, 2009
|
2000-01-06 12:40:54 +00:00
|
|
|
.Dt IPSEC 4
|
2000-01-17 15:24:41 +00:00
|
|
|
.Os
|
2000-01-06 12:40:54 +00:00
|
|
|
.Sh NAME
|
2012-11-07 06:53:44 +00:00
|
|
|
.Nm ipsec
|
2007-08-02 08:04:48 +00:00
|
|
|
.Nd Internet Protocol Security protocol
|
2000-01-06 12:40:54 +00:00
|
|
|
.Sh SYNOPSIS
|
2006-08-24 17:07:19 +00:00
|
|
|
.Cd "options IPSEC"
|
2007-08-02 08:04:48 +00:00
|
|
|
.Cd "device crypto"
|
2006-09-18 15:24:20 +00:00
|
|
|
.Pp
|
|
|
|
.In sys/types.h
|
|
|
|
.In netinet/in.h
|
2007-08-02 08:04:48 +00:00
|
|
|
.In netipsec/ipsec.h
|
|
|
|
.In netipsec/ipsec6.h
|
2000-01-06 12:40:54 +00:00
|
|
|
.Sh DESCRIPTION
|
|
|
|
.Nm
|
2006-02-14 13:02:00 +00:00
|
|
|
is a security protocol implemented within the Internet Protocol layer
|
2007-08-02 08:04:48 +00:00
|
|
|
of the networking stack.
|
2000-01-06 12:40:54 +00:00
|
|
|
.Nm
|
|
|
|
is defined for both IPv4 and IPv6
|
2001-08-07 15:48:51 +00:00
|
|
|
.Xr ( inet 4
|
2000-01-06 12:40:54 +00:00
|
|
|
and
|
2001-08-07 15:48:51 +00:00
|
|
|
.Xr inet6 4 ) .
|
2000-01-06 12:40:54 +00:00
|
|
|
.Nm
|
2007-08-02 08:04:48 +00:00
|
|
|
is a set of protocols,
|
|
|
|
.Tn ESP
|
|
|
|
(for Encapsulating Security Payload)
|
|
|
|
.Tn AH
|
|
|
|
(for Authentication Header),
|
|
|
|
and
|
|
|
|
.Tn IPComp
|
|
|
|
(for IP Payload Compression Protocol)
|
|
|
|
that provide security services for IP datagrams.
|
|
|
|
AH both authenticates and guarantees the integrity of an IP packet
|
2006-02-14 13:02:00 +00:00
|
|
|
by attaching a cryptographic checksum computed using one-way hash functions.
|
2007-08-02 08:04:48 +00:00
|
|
|
ESP, in addition, prevents unauthorized parties from reading the payload of
|
|
|
|
an IP packet by also encrypting it.
|
|
|
|
IPComp tries to increase communication performance by compressing IP payload,
|
|
|
|
thus reducing the amount of data sent.
|
|
|
|
This will help nodes on slow links but with enough computing power.
|
2000-01-06 12:40:54 +00:00
|
|
|
.Nm
|
2007-08-02 08:04:48 +00:00
|
|
|
operates in one of two modes: transport mode or tunnel mode.
|
2006-02-14 13:02:00 +00:00
|
|
|
Transport mode is used to protect peer-to-peer communication between end nodes.
|
|
|
|
Tunnel mode encapsulates IP packets within other IP packets
|
|
|
|
and is designed for security gateways such as VPN endpoints.
|
2007-08-02 08:04:48 +00:00
|
|
|
.Pp
|
|
|
|
System configuration requires the
|
|
|
|
.Xr crypto 4
|
|
|
|
subsystem.
|
|
|
|
.Pp
|
|
|
|
The packets can be passed to a virtual
|
|
|
|
.Xr enc 4
|
|
|
|
interface,
|
|
|
|
to perform packet filtering before outbound encryption and after decapsulation
|
|
|
|
inbound.
|
|
|
|
.Pp
|
|
|
|
To properly filter on the inner packets of an
|
|
|
|
.Nm
|
2009-05-23 16:42:38 +00:00
|
|
|
tunnel with firewalls, you can change the values of the following sysctls
|
|
|
|
.Bl -column net.inet6.ipsec6.filtertunnel default enable
|
|
|
|
.It Sy "Name Default Enable"
|
2010-08-16 21:26:47 +00:00
|
|
|
.It "net.inet.ipsec.filtertunnel 0 1"
|
|
|
|
.It "net.inet6.ipsec6.filtertunnel 0 1"
|
2009-05-23 16:42:38 +00:00
|
|
|
.El
|
2000-01-06 12:40:54 +00:00
|
|
|
.\"
|
2000-03-12 16:37:25 +00:00
|
|
|
.Ss Kernel interface
|
2000-01-06 12:40:54 +00:00
|
|
|
.Nm
|
2006-02-14 13:02:00 +00:00
|
|
|
is controlled by a key management and policy engine,
|
2006-09-18 15:24:20 +00:00
|
|
|
that reside in the operating system kernel.
|
|
|
|
Key management
|
2006-02-14 13:02:00 +00:00
|
|
|
is the process of associating keys with security associations, also
|
2006-09-18 15:24:20 +00:00
|
|
|
know as SAs.
|
|
|
|
Policy management dictates when new security
|
2006-02-14 13:02:00 +00:00
|
|
|
associations created or destroyed.
|
2000-01-06 12:40:54 +00:00
|
|
|
.Pp
|
2006-02-14 13:02:00 +00:00
|
|
|
The key management engine can be accessed from userland by using
|
2000-01-06 12:40:54 +00:00
|
|
|
.Dv PF_KEY
|
|
|
|
sockets.
|
|
|
|
The
|
|
|
|
.Dv PF_KEY
|
|
|
|
socket API is defined in RFC2367.
|
|
|
|
.Pp
|
2006-02-14 13:02:00 +00:00
|
|
|
The policy engine is controlled by an extension to the
|
2000-01-06 12:40:54 +00:00
|
|
|
.Dv PF_KEY
|
|
|
|
API,
|
|
|
|
.Xr setsockopt 2
|
|
|
|
operations, and
|
|
|
|
.Xr sysctl 3
|
|
|
|
interface.
|
|
|
|
The kernel implements
|
2006-02-14 13:02:00 +00:00
|
|
|
an extended version of the
|
2000-01-06 12:40:54 +00:00
|
|
|
.Dv PF_KEY
|
2007-08-02 08:04:48 +00:00
|
|
|
interface and allows the programmer to define IPsec policies
|
2006-09-18 15:24:20 +00:00
|
|
|
which are similar to the per-packet filters.
|
|
|
|
The
|
2000-01-06 12:40:54 +00:00
|
|
|
.Xr setsockopt 2
|
|
|
|
interface is used to define per-socket behavior, and
|
|
|
|
.Xr sysctl 3
|
|
|
|
interface is used to define host-wide default behavior.
|
|
|
|
.Pp
|
2006-02-14 13:02:00 +00:00
|
|
|
The kernel code does not implement a dynamic encryption key exchange protocol
|
|
|
|
such as IKE
|
2001-08-07 15:48:51 +00:00
|
|
|
(Internet Key Exchange).
|
2006-02-14 13:02:00 +00:00
|
|
|
Key exchange protocols are beyond what is necessary in the kernel and
|
|
|
|
should be implemented as daemon processes which call the
|
|
|
|
.Nm APIs.
|
2000-01-06 12:40:54 +00:00
|
|
|
.\"
|
2000-03-12 16:37:25 +00:00
|
|
|
.Ss Policy management
|
2006-09-18 15:24:20 +00:00
|
|
|
IPsec policies can be managed in one of two ways, either by
|
2006-02-14 13:02:00 +00:00
|
|
|
configuring per-socket policies using the
|
2006-09-18 15:24:20 +00:00
|
|
|
.Xr setsockopt 2
|
2006-02-14 13:02:00 +00:00
|
|
|
system calls, or by configuring kernel level packet filter-based
|
|
|
|
policies using the
|
2000-01-06 12:40:54 +00:00
|
|
|
.Dv PF_KEY
|
2006-02-14 13:02:00 +00:00
|
|
|
interface, via the
|
2006-09-18 15:24:20 +00:00
|
|
|
.Xr setkey 8
|
2007-08-02 08:04:48 +00:00
|
|
|
you can define IPsec policies against packets using rules similar to packet
|
|
|
|
filtering rules.
|
|
|
|
Refer to
|
2000-01-06 12:40:54 +00:00
|
|
|
.Xr setkey 8
|
2007-08-02 08:04:48 +00:00
|
|
|
on how to use it.
|
2000-01-06 12:40:54 +00:00
|
|
|
.Pp
|
2006-02-14 13:02:00 +00:00
|
|
|
When setting policies using the
|
|
|
|
.Xr setkey 8
|
2007-08-02 08:04:48 +00:00
|
|
|
command, the
|
2000-01-06 12:40:54 +00:00
|
|
|
.Dq Li default
|
2007-08-02 08:04:48 +00:00
|
|
|
option instructs the system to use its default policy, as
|
|
|
|
explained below, for processing packets.
|
2006-02-14 13:20:09 +00:00
|
|
|
The following sysctl variables are available for configuring the
|
2006-09-18 15:24:20 +00:00
|
|
|
system's IPsec behavior.
|
|
|
|
The variables can have one of two values.
|
2006-02-14 13:20:09 +00:00
|
|
|
A
|
2000-01-06 12:40:54 +00:00
|
|
|
.Li 1
|
|
|
|
means
|
|
|
|
.Dq Li use ,
|
2006-02-14 13:20:09 +00:00
|
|
|
which means that if there is a security association then use it but if
|
2006-09-18 15:24:20 +00:00
|
|
|
there is not then the packets are not processed by IPsec.
|
|
|
|
The value
|
2000-01-06 12:40:54 +00:00
|
|
|
.Li 2
|
2006-02-14 13:20:09 +00:00
|
|
|
is synonymous with
|
|
|
|
.Dq Li require ,
|
|
|
|
which requires that a security association must exist for the packets
|
2006-09-18 15:24:20 +00:00
|
|
|
to move, and not be dropped.
|
|
|
|
These terms are defined in
|
2006-02-14 13:20:09 +00:00
|
|
|
.Xr ipsec_set_policy 8 .
|
2000-01-06 12:40:54 +00:00
|
|
|
.Bl -column net.inet6.ipsec6.esp_trans_deflev integerxxx
|
2000-12-29 09:18:45 +00:00
|
|
|
.It Sy "Name Type Changeable"
|
|
|
|
.It "net.inet.ipsec.esp_trans_deflev integer yes"
|
|
|
|
.It "net.inet.ipsec.esp_net_deflev integer yes"
|
|
|
|
.It "net.inet.ipsec.ah_trans_deflev integer yes"
|
|
|
|
.It "net.inet.ipsec.ah_net_deflev integer yes"
|
|
|
|
.It "net.inet6.ipsec6.esp_trans_deflev integer yes"
|
|
|
|
.It "net.inet6.ipsec6.esp_net_deflev integer yes"
|
|
|
|
.It "net.inet6.ipsec6.ah_trans_deflev integer yes"
|
|
|
|
.It "net.inet6.ipsec6.ah_net_deflev integer yes"
|
2000-01-06 12:40:54 +00:00
|
|
|
.El
|
|
|
|
.Pp
|
2006-02-14 13:20:09 +00:00
|
|
|
If the kernel does not find a matching, system wide, policy then the
|
2006-09-18 15:24:20 +00:00
|
|
|
default value is applied.
|
|
|
|
The system wide default policy is specified
|
2006-02-14 13:20:09 +00:00
|
|
|
by the following
|
2000-01-06 12:40:54 +00:00
|
|
|
.Xr sysctl 8
|
|
|
|
variables.
|
|
|
|
.Li 0
|
|
|
|
means
|
|
|
|
.Dq Li discard
|
|
|
|
which asks the kernel to drop the packet.
|
|
|
|
.Li 1
|
|
|
|
means
|
|
|
|
.Dq Li none .
|
|
|
|
.Bl -column net.inet6.ipsec6.def_policy integerxxx
|
2000-12-29 09:18:45 +00:00
|
|
|
.It Sy "Name Type Changeable"
|
|
|
|
.It "net.inet.ipsec.def_policy integer yes"
|
|
|
|
.It "net.inet6.ipsec6.def_policy integer yes"
|
2000-01-06 12:40:54 +00:00
|
|
|
.El
|
|
|
|
.\"
|
2000-07-17 02:22:18 +00:00
|
|
|
.Ss Miscellaneous sysctl variables
|
2007-08-02 08:04:48 +00:00
|
|
|
When the
|
|
|
|
.Nm
|
|
|
|
protocols are configured for use, all protocols are included in the system.
|
|
|
|
To selectively enable/disable protocols, use
|
|
|
|
.Xr sysctl 8 .
|
|
|
|
.Bl -column net.inet.ipcomp.ipcomp_enable
|
|
|
|
.It Sy "Name Default"
|
|
|
|
.It "net.inet.esp.esp_enable On"
|
|
|
|
.It "net.inet.ah.ah_enable On"
|
2009-11-29 20:47:43 +00:00
|
|
|
.It "net.inet.ipcomp.ipcomp_enable On"
|
2007-08-02 08:04:48 +00:00
|
|
|
.El
|
|
|
|
.Pp
|
|
|
|
In addition the following variables are accessible via
|
2000-07-17 02:22:18 +00:00
|
|
|
.Xr sysctl 8 ,
|
2006-02-14 13:20:09 +00:00
|
|
|
for tweaking the kernel's IPsec behavior:
|
2000-07-17 02:22:18 +00:00
|
|
|
.Bl -column net.inet6.ipsec6.inbonud_call_ike integerxxx
|
2000-12-29 09:18:45 +00:00
|
|
|
.It Sy "Name Type Changeable"
|
|
|
|
.It "net.inet.ipsec.ah_cleartos integer yes"
|
|
|
|
.It "net.inet.ipsec.ah_offsetmask integer yes"
|
|
|
|
.It "net.inet.ipsec.dfbit integer yes"
|
|
|
|
.It "net.inet.ipsec.ecn integer yes"
|
|
|
|
.It "net.inet.ipsec.debug integer yes"
|
|
|
|
.It "net.inet6.ipsec6.ecn integer yes"
|
|
|
|
.It "net.inet6.ipsec6.debug integer yes"
|
2000-07-17 02:22:18 +00:00
|
|
|
.El
|
|
|
|
.Pp
|
|
|
|
The variables are interpreted as follows:
|
2000-12-29 09:18:45 +00:00
|
|
|
.Bl -tag -width 6n
|
2000-07-17 02:22:18 +00:00
|
|
|
.It Li ipsec.ah_cleartos
|
2006-02-14 13:20:09 +00:00
|
|
|
If set to non-zero, the kernel clears the type-of-service field in the IPv4 header
|
2000-07-17 02:22:18 +00:00
|
|
|
during AH authentication data computation.
|
2006-02-14 13:20:09 +00:00
|
|
|
This variable is used to get current systems to inter-operate with devices that
|
2000-07-17 02:22:18 +00:00
|
|
|
implement RFC1826 AH.
|
|
|
|
It should be set to non-zero
|
2001-08-07 15:48:51 +00:00
|
|
|
(clear the type-of-service field)
|
2000-07-17 02:22:18 +00:00
|
|
|
for RFC2402 conformance.
|
|
|
|
.It Li ipsec.ah_offsetmask
|
2006-02-14 13:20:09 +00:00
|
|
|
During AH authentication data computation, the kernel will include a
|
2000-07-17 02:22:18 +00:00
|
|
|
16bit fragment offset field
|
2001-08-07 15:48:51 +00:00
|
|
|
(including flag bits)
|
2006-02-14 13:20:09 +00:00
|
|
|
in the IPv4 header, after computing logical AND with the variable.
|
|
|
|
The variable is used for inter-operating with devices that
|
2000-07-17 02:22:18 +00:00
|
|
|
implement RFC1826 AH.
|
|
|
|
It should be set to zero
|
2001-08-07 15:48:51 +00:00
|
|
|
(clear the fragment offset field during computation)
|
2000-07-17 02:22:18 +00:00
|
|
|
for RFC2402 conformance.
|
|
|
|
.It Li ipsec.dfbit
|
2006-02-14 13:20:09 +00:00
|
|
|
This variable configures the kernel behavior on IPv4 IPsec tunnel encapsulation.
|
|
|
|
If set to 0, the DF bit on the outer IPv4 header will be cleared while
|
|
|
|
1 means that the outer DF bit is set regardless from the inner DF bit and
|
|
|
|
2 indicates that the DF bit is copied from the inner header to the
|
|
|
|
outer one.
|
2001-06-11 12:39:29 +00:00
|
|
|
The variable is supplied to conform to RFC2401 chapter 6.1.
|
2000-07-17 02:22:18 +00:00
|
|
|
.It Li ipsec.ecn
|
|
|
|
If set to non-zero, IPv4 IPsec tunnel encapsulation/decapsulation behavior will
|
|
|
|
be friendly to ECN
|
2001-08-07 15:48:51 +00:00
|
|
|
(explicit congestion notification),
|
2000-07-17 02:22:18 +00:00
|
|
|
as documented in
|
|
|
|
.Li draft-ietf-ipsec-ecn-02.txt .
|
|
|
|
.Xr gif 4
|
|
|
|
talks more about the behavior.
|
|
|
|
.It Li ipsec.debug
|
|
|
|
If set to non-zero, debug messages will be generated via
|
|
|
|
.Xr syslog 3 .
|
|
|
|
.El
|
|
|
|
.Pp
|
2006-02-14 13:20:09 +00:00
|
|
|
Variables under the
|
2000-07-17 02:22:18 +00:00
|
|
|
.Li net.inet6.ipsec6
|
2006-02-14 13:20:09 +00:00
|
|
|
tree have similar meanings to those described above.
|
2000-07-17 02:22:18 +00:00
|
|
|
.\"
|
2000-01-06 12:40:54 +00:00
|
|
|
.Sh PROTOCOLS
|
|
|
|
The
|
|
|
|
.Nm
|
2006-02-14 13:20:09 +00:00
|
|
|
protocol acts as a plug-in to the
|
2000-01-06 12:40:54 +00:00
|
|
|
.Xr inet 4
|
|
|
|
and
|
|
|
|
.Xr inet6 4
|
2006-02-14 13:20:09 +00:00
|
|
|
protocols and therefore supports most of the protocols defined upon
|
2006-09-18 15:24:20 +00:00
|
|
|
those IP-layer protocols.
|
|
|
|
The
|
2000-01-06 12:40:54 +00:00
|
|
|
.Xr icmp 4
|
2006-02-14 13:20:09 +00:00
|
|
|
and
|
2006-09-18 15:24:20 +00:00
|
|
|
.Xr icmp6 4
|
2006-02-14 13:20:09 +00:00
|
|
|
protocols may behave differently with
|
2006-09-18 15:24:20 +00:00
|
|
|
.Nm
|
2006-02-14 13:20:09 +00:00
|
|
|
because
|
2000-01-06 12:40:54 +00:00
|
|
|
.Nm
|
|
|
|
can prevent
|
|
|
|
.Xr icmp 4
|
|
|
|
or
|
|
|
|
.Xr icmp6 4
|
2006-02-14 13:20:09 +00:00
|
|
|
routines from looking into the IP payload.
|
2000-01-06 12:40:54 +00:00
|
|
|
.\"
|
|
|
|
.Sh SEE ALSO
|
|
|
|
.Xr ioctl 2 ,
|
|
|
|
.Xr socket 2 ,
|
|
|
|
.Xr ipsec_set_policy 3 ,
|
2007-08-02 08:04:48 +00:00
|
|
|
.Xr crypto 4 ,
|
|
|
|
.Xr enc 4 ,
|
2000-01-06 12:40:54 +00:00
|
|
|
.Xr icmp6 4 ,
|
|
|
|
.Xr intro 4 ,
|
|
|
|
.Xr ip6 4 ,
|
|
|
|
.Xr setkey 8 ,
|
2000-03-21 02:46:28 +00:00
|
|
|
.Xr sysctl 8
|
2000-07-17 02:22:18 +00:00
|
|
|
.\".Xr racoon 8
|
2005-01-11 21:08:39 +00:00
|
|
|
.Rs
|
|
|
|
.%A "S. Kent"
|
|
|
|
.%A "R. Atkinson"
|
|
|
|
.%T "IP Authentication Header"
|
|
|
|
.%O "RFC 2404"
|
|
|
|
.Re
|
|
|
|
.Rs
|
|
|
|
.%A "S. Kent"
|
|
|
|
.%A "R. Atkinson"
|
|
|
|
.%T "IP Encapsulating Security Payload (ESP)"
|
|
|
|
.%O "RFC 2406"
|
|
|
|
.Re
|
2000-07-17 02:22:18 +00:00
|
|
|
.Sh STANDARDS
|
2000-01-06 12:40:54 +00:00
|
|
|
.Rs
|
2000-03-12 16:37:25 +00:00
|
|
|
.%A Daniel L. McDonald
|
|
|
|
.%A Craig Metz
|
|
|
|
.%A Bao G. Phan
|
|
|
|
.%T "PF_KEY Key Management API, Version 2"
|
|
|
|
.%R RFC
|
|
|
|
.%N 2367
|
2000-01-06 12:40:54 +00:00
|
|
|
.Re
|
2000-07-17 02:22:18 +00:00
|
|
|
.Pp
|
2000-01-06 12:40:54 +00:00
|
|
|
.Rs
|
|
|
|
.%A "D. L. McDonald"
|
|
|
|
.%T "A Simple IP Security API Extension to BSD Sockets"
|
2000-03-12 16:37:25 +00:00
|
|
|
.%R internet draft
|
2000-01-06 12:40:54 +00:00
|
|
|
.%N "draft-mcdonald-simple-ipsec-api-03.txt"
|
2000-03-12 16:37:25 +00:00
|
|
|
.%O work in progress material
|
2000-01-06 12:40:54 +00:00
|
|
|
.Re
|
2000-07-17 02:22:18 +00:00
|
|
|
.Sh HISTORY
|
2007-08-02 08:04:48 +00:00
|
|
|
The original
|
|
|
|
.Nm
|
|
|
|
implementation appeared in the WIDE/KAME IPv6/IPsec stack.
|
2000-01-06 12:40:54 +00:00
|
|
|
.Pp
|
2007-08-02 08:04:48 +00:00
|
|
|
For
|
|
|
|
.Fx 5.0
|
|
|
|
a fully locked IPsec implementation called fast_ipsec was brought in.
|
|
|
|
The protocols drew heavily on the
|
|
|
|
.Ox
|
|
|
|
implementation of the
|
|
|
|
.Tn IPsec
|
|
|
|
protocols.
|
|
|
|
The policy management code was derived from the
|
|
|
|
.Tn KAME
|
|
|
|
implementation found
|
|
|
|
in their
|
|
|
|
.Tn IPsec
|
|
|
|
protocols.
|
|
|
|
The fast_ipsec implementation lacked
|
|
|
|
.Xr ip6 4
|
|
|
|
support but made use of the
|
|
|
|
.Xr crypto 4
|
|
|
|
subsystem.
|
|
|
|
.Pp
|
|
|
|
For
|
|
|
|
.Fx 7.0
|
|
|
|
.Xr ip6 4
|
|
|
|
support was added to fast_ipsec.
|
|
|
|
After this the old KAME IPsec implementation was dropped and fast_ipsec
|
|
|
|
became what now is the only
|
|
|
|
.Nm
|
|
|
|
implementation in
|
|
|
|
.Fx .
|
|
|
|
.Sh BUGS
|
2006-02-14 13:20:09 +00:00
|
|
|
There is no single standard for the policy engine API,
|
2007-08-02 08:04:48 +00:00
|
|
|
so the policy engine API described herein is just for this implementation.
|
2000-07-17 02:22:18 +00:00
|
|
|
.Pp
|
2001-06-27 19:41:20 +00:00
|
|
|
AH and tunnel mode encapsulation may not work as you might expect.
|
|
|
|
If you configure inbound
|
2000-07-17 02:22:18 +00:00
|
|
|
.Dq require
|
2006-02-14 13:20:09 +00:00
|
|
|
policy with an AH tunnel or any IPsec encapsulating policy with AH
|
2001-08-07 15:48:51 +00:00
|
|
|
(like
|
|
|
|
.Dq Li esp/tunnel/A-B/use ah/transport/A-B/require ) ,
|
2001-06-27 19:41:20 +00:00
|
|
|
tunnelled packets will be rejected.
|
2006-02-14 13:20:09 +00:00
|
|
|
This is because the policy check is enforced on the inner packet on reception,
|
2001-06-27 19:41:20 +00:00
|
|
|
and AH authenticates encapsulating
|
2001-08-07 15:48:51 +00:00
|
|
|
(outer)
|
2000-07-17 02:22:18 +00:00
|
|
|
packet, not the encapsulated
|
2001-08-07 15:48:51 +00:00
|
|
|
(inner)
|
2001-06-27 19:41:20 +00:00
|
|
|
packet
|
2005-02-13 23:45:54 +00:00
|
|
|
(so for the receiving kernel there is no sign of authenticity).
|
2001-06-27 19:41:20 +00:00
|
|
|
The issue will be solved when we revamp our policy engine to keep all the
|
|
|
|
packet decapsulation history.
|
2000-07-17 02:22:18 +00:00
|
|
|
.Pp
|
2006-02-14 13:20:09 +00:00
|
|
|
When a large database of security associations or policies is present
|
|
|
|
in the kernel the
|
2000-07-17 02:22:18 +00:00
|
|
|
.Dv SADB_DUMP
|
|
|
|
and
|
|
|
|
.Dv SADB_SPDDUMP
|
2006-02-14 13:20:09 +00:00
|
|
|
operations on
|
2000-07-17 02:22:18 +00:00
|
|
|
.Dv PF_KEY
|
2006-09-18 15:24:20 +00:00
|
|
|
sockets may fail due to lack of space.
|
|
|
|
Increasing the socket buffer
|
2006-02-14 13:20:09 +00:00
|
|
|
size may alleviate this problem.
|
2007-08-02 08:04:48 +00:00
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Tn IPcomp
|
2009-11-29 21:03:54 +00:00
|
|
|
protocol may occasionally error because of
|
2009-11-29 20:47:43 +00:00
|
|
|
.Xr zlib 3
|
|
|
|
problems.
|
2007-08-02 08:04:48 +00:00
|
|
|
.Pp
|
|
|
|
This documentation needs more review.
|