Re: Ipsec - PF_KEY and set_policy



At Thu, 26 Jul 2007 08:13:02 +0800,
blue wrote:

As far as I know, setkey is used for IPsec SP and SA configuration.
ipsec_set_policy() could transfer a string to "policy request", which is
defined in RFC 2367 PF_KEY. Internally, setkey() will call
ipsec_set_policy() to construct the message then send it down to the
kernel. However, ipsec_set_policy() is used only for SP, not SA.

And expanding on this just a bit, there is a difference between a
policy (SP) and an association (SA) which is important to understand.
A policy describes something more general, such as "Between network A
and network B use an IPSEC ESP tunnel for all traffic." while an
association is an active communication channel like, "Between address
A and address B we have a tunnel using ESP with key X." There are two
databases in the kernel for this, a Security Policy Database which is
manipulated using the ipsec_set_policy() routing, and a Security
Association Database which is manipulated using direct calls to PF Key
sockets.

See RFC 2401 for a good intro to these concepts.

Best,
George
_______________________________________________
freebsd-net@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "freebsd-net-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Re: Ipsec - PF_KEY and set_policy
    ... ipsec_set_policycould transfer a string to "policy request", which is defined in RFC 2367 PF_KEY. ... setkey() will call ipsec_set_policyto construct the message then send it down to the kernel. ... I was just trying to understand PF_KEY interface for ipsec settings. ...
    (freebsd-net)
  • Problem with Racoon/IPSec/Setkey - Routing to/from multiple networks
    ... here using setkey and racoon. ... Setkey adds all of the below lines fine, ... spdadd $$any -P out ipsec ...
    (freebsd-net)
  • IPSEC broken (FAST_IPSEC works)?
    ... Both have the same IPSEC config ... (kernel, setkey, racoon, gif). ... transfer data over the VPN (no ping, no telnet to a port on a host on ... tcpdump on the gif interface shows nothing. ...
    (freebsd-current)
  • Re: Proxy ID and RFC
    ... The phrase "proxy ID" isn't explicitly used in the various IPsec ... which do not match the proxy information on which a tunnel was created ... The language changed considerably by the time RFC 2408 and 2409 was ...
    (comp.dcom.vpn)
  • Re: vpn1/fw1 NG to ipsec/racoon troubles, help please ...
    ... As soon as I changed the setkey parameters to a non tunnel device ... spdadd 10.22.200.0/24 10.21.0.0/16 any -P out ipsec ... phase 1 I agg: ...
    (FreeBSD-Security)