Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

kame_ipsec(4) [netbsd man page]

KAME_IPSEC(4)						   BSD Kernel Interfaces Manual 					     KAME_IPSEC(4)

NAME
ipsec -- IP security protocol SYNOPSIS
#include <sys/types.h> #include <netinet/in.h> #include <netinet6/ipsec.h> options KAME_IPSEC options IPSEC_ESP options IPSEC_NAT_T options IPSEC_DEBUG DESCRIPTION
ipsec is the first implemtation of IPSEC in NetBSD. It is being replaced by fast_ipsec(4). The following kernel options are available: options IPSEC Includes support for the IPsec protocol. IPSEC will enable secret key management part, policy management part, AH and IPComp. Kernel binary will not be subject to export control in most of countries, even if compiled with IPSEC. For example, it should be okay to export it from the United States of America. INET6 and IPSEC are orthogonal so you can get IPv4-only kernel with IPsec support, IPv4/v6 dual support kernel without IPsec, and so forth. This option requires INET at this moment, but it should not. options IPSEC_DEBUG Enables debugging code in IPsec stack. This option assumes IPSEC. options IPSEC_ESP Includes support for IPsec ESP protocol. IPSEC_ESP will enable source code that is subject to export control in some countries (including the United States), and compiled kernel binary will be subject to certain restriction. This option assumes IPSEC. options IPSEC_NAT_T Includes support for IPsec Network Address Translator Traversal (NAT-T), as described in RFCs 3947 and 3948. This feature might be patent- encumbered in some countries. This option assumes IPSEC and IPSEC_ESP. SEE ALSO
ioctl(2), socket(2), ipsec_set_policy(3), fast_ipsec(4), icmp6(4), intro(4), ip6(4), ipsec(4), racoon(8), setkey(8), sysctl(8) STANDARDS
Daniel L. McDonald, Craig Metz, and Bao G. Phan, PF_KEY Key Management API, Version 2, RFC, 2367. HISTORY
The implementation described herein appeared in WIDE/KAME IPv6/IPsec stack. BUGS
The IPsec support is subject to change as the IPsec protocols develop. There is no single standard for policy engine API, so the policy engine API described herein is just for KAME implementation. AH and tunnel mode encapsulation may not work as you might expect. If you configure inbound ``require'' policy against AH tunnel or any IPsec encapsulating policy with AH (like ``esp/tunnel/A-B/use ah/transport/A-B/require''), tunneled packets will be rejected. This is because we enforce policy check on inner packet on reception, and AH authenticates encapsulating (outer) packet, not the encapsulated (inner) packet (so for the receiving kernel there's no sign of authenticity). The issue will be solved when we revamp our policy engine to keep all the packet decapsulation history. Under certain condition, truncated result may be raised from the kernel against SADB_DUMP and SADB_SPDDUMP operation on PF_KEY socket. This occurs if there are too many database entries in the kernel and socket buffer for the PF_KEY socket is insufficient. If you manipulate many IPsec key/policy database entries, increase the size of socket buffer or use sysctl(8) interface. BSD
January 16, 2012 BSD

Check Out this Related Man Page

IPSEC_SET_POLICY(3)					   BSD Library Functions Manual 				       IPSEC_SET_POLICY(3)

NAME
ipsec_set_policy, ipsec_get_policylen, ipsec_dump_policy -- manipulate IPsec policy specification structure from readable string LIBRARY
IPsec Policy Control Library (libipsec, -lipsec) SYNOPSIS
#include <netinet6/ipsec.h> char * ipsec_set_policy(char *policy, int len); int ipsec_get_policylen(char *buf); char * ipsec_dump_policy(char *buf, char *delim); DESCRIPTION
ipsec_set_policy() generates IPsec policy specification structure, namely struct sadb_x_policy and/or struct sadb_x_ipsecrequest from human- readable policy specification. Policy specification must be given as C string policy and length len of policy. ipsec_set_policy() will return the buffer of IPsec policy specification structure. You may want the length of the generated buffer such when calling setsockopt(2). ipsec_get_policylen() will return the length. ipsec_dump_policy() converts IPsec policy structure into readable form. Therefore, ipsec_dump_policy() can be regarded as inverse conversion of ipsec_set_policy(). buf points to a IPsec policy structure, struct sadb_x_policy. delim is a delimiter string, which is usually a blank character. If you set delim to NULL, single whitespace is assumed. ipsec_dump_policy() returns pointer to dynamically allocated string. It is caller's responsibility to reclaim the region, by using free(3). policy is formatted as either of the following: direction discard direction must be in or out. direction specifies which direction the policy needs to be applied. With discard policy, packets will be dropped if they match the policy. direction entrust entrust means to consult to SPD defined by setkey(8). direction bypass bypass means to be bypassed the IPsec processing. (packet will be transmitted in clear). This is for privileged socket. direction ipsec request ... ipsec means that the matching packets are subject to IPsec processing. ipsec can be followed by one or more request string, which is formatted as below: protocol / mode / src - dst [/level] protocol is either ah, esp or ipcomp. mode is either transport or tunnel. src and dst specifies IPsec endpoint. src always means ``sending node'' and dst always means ``receiving node''. There- fore, when direction is in, dst is this node and src is the other node (peer). If mode is transport, Both src and dst can be omited. level must be set to one of the following: default, use, require or unique. default means that the kernel should consult the system default policy defined by sysctl(8), such as net.inet.ipsec.esp_trans_deflev. See ipsec(4) regarding the system default. use means that a relevant SA can be used when available, since the kernel may perform IPsec operation against packets when possible. In this case, packets can be transmitted in clear (when SA is not available), or encrypted (when SA is available). require means that a relevant SA is required, since the kernel must perform IPsec operation against pack- ets. unique is the same as require, but adds the restriction that the SA for outbound traffic is used only for this pol- icy. You may need the identifier in order to relate the policy and the SA when you define the SA by manual keying. You can put the decimal number as the identifier after unique like unique: number. number must be between 1 and 32767 . If the request string is kept unambiguous, level and slash prior to level can be omitted. However, it is encouraged to spec- ify them explicitly to avoid unintended behaviors. If level is omitted, it will be interpreted as default. Note that there is a bit difference of specification from setkey(8). In specification by setkey(8), both entrust and bypass are not used. Refer to setkey(8) for detail. Here are several examples (long lines are wrapped for readability): in discard out ipsec esp/transport//require in ipsec ah/transport//require out ipsec esp/tunnel/10.1.1.2-10.1.1.1/use in ipsec ipcomp/transport//use esp/transport//use RETURN VALUES
ipsec_set_policy() returns a pointer to the allocated buffer of policy specification if successful; otherwise a NULL pointer is returned. ipsec_get_policylen() returns with positive value (meaning the buffer size) on success, and negative value on errors. ipsec_dump_policy() returns a pointer to dynamically allocated region on success, and NULL on errors. SEE ALSO
ipsec_strerror(3), ipsec(4), setkey(8) HISTORY
The functions first appeared in WIDE/KAME IPv6 protocol stack kit. IPv6 and IPsec support based on the KAME Project (http://www.kame.net/) stack was initially integrated into FreeBSD 4.0 BSD
May 5, 1998 BSD
Man Page