ipsec.4 (161581) | ipsec.4 (162404) |
---|---|
1.\" $KAME: ipsec.4,v 1.17 2001/06/27 15:25:10 itojun Exp $ 2.\" 3.\" Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. 4.\" All rights reserved. 5.\" 6.\" Redistribution and use in source and binary forms, with or without 7.\" modification, are permitted provided that the following conditions 8.\" are met: --- 13 unchanged lines hidden (view full) --- 22.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28.\" SUCH DAMAGE. 29.\" | 1.\" $KAME: ipsec.4,v 1.17 2001/06/27 15:25:10 itojun Exp $ 2.\" 3.\" Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. 4.\" All rights reserved. 5.\" 6.\" Redistribution and use in source and binary forms, with or without 7.\" modification, are permitted provided that the following conditions 8.\" are met: --- 13 unchanged lines hidden (view full) --- 22.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28.\" SUCH DAMAGE. 29.\" |
30.\" $FreeBSD: head/share/man/man4/ipsec.4 161581 2006-08-24 17:07:19Z danger $ | 30.\" $FreeBSD: head/share/man/man4/ipsec.4 162404 2006-09-18 15:24:20Z ru $ |
31.\" 32.Dd August 24, 2006 33.Dt IPSEC 4 34.Os 35.Sh NAME 36.Nm ipsec 37.Nd IP security protocol 38.Sh SYNOPSIS | 31.\" 32.Dd August 24, 2006 33.Dt IPSEC 4 34.Os 35.Sh NAME 36.Nm ipsec 37.Nd IP security protocol 38.Sh SYNOPSIS |
39.In sys/types.h 40.In netinet/in.h 41.In netinet6/ipsec.h | |
42.Cd "options IPSEC" 43.Cd "options IPSEC_DEBUG" 44.Cd "options IPSEC_ESP" 45.Cd "options IPSEC_FILTERGIF" | 39.Cd "options IPSEC" 40.Cd "options IPSEC_DEBUG" 41.Cd "options IPSEC_ESP" 42.Cd "options IPSEC_FILTERGIF" |
43.Pp 44.In sys/types.h 45.In netinet/in.h 46.In netinet6/ipsec.h |
|
46.Sh DESCRIPTION 47.Nm 48is a security protocol implemented within the Internet Protocol layer 49of the TCP/IP stack. 50.Nm 51is defined for both IPv4 and IPv6 52.Xr ( inet 4 53and 54.Xr inet6 4 ) . 55.Nm | 47.Sh DESCRIPTION 48.Nm 49is a security protocol implemented within the Internet Protocol layer 50of the TCP/IP stack. 51.Nm 52is defined for both IPv4 and IPv6 53.Xr ( inet 4 54and 55.Xr inet6 4 ) . 56.Nm |
56contains two protocols, | 57contains two protocols, |
57ESP, the encapsulated security payload protocol and 58AH, the authentication header protocol. 59ESP prevents unauthorized parties from reading the payload of an IP packet 60by encrypting it using 61secret key cryptography algorithms. 62AH both authenticates guarantees the integrity of an IP packet 63by attaching a cryptographic checksum computed using one-way hash functions. 64.Nm 65has operates in one of two modes: transport mode or tunnel mode. 66Transport mode is used to protect peer-to-peer communication between end nodes. 67Tunnel mode encapsulates IP packets within other IP packets 68and is designed for security gateways such as VPN endpoints. 69.\" 70.Ss Kernel interface 71.Nm 72is controlled by a key management and policy engine, | 58ESP, the encapsulated security payload protocol and 59AH, the authentication header protocol. 60ESP prevents unauthorized parties from reading the payload of an IP packet 61by encrypting it using 62secret key cryptography algorithms. 63AH both authenticates guarantees the integrity of an IP packet 64by attaching a cryptographic checksum computed using one-way hash functions. 65.Nm 66has operates in one of two modes: transport mode or tunnel mode. 67Transport mode is used to protect peer-to-peer communication between end nodes. 68Tunnel mode encapsulates IP packets within other IP packets 69and is designed for security gateways such as VPN endpoints. 70.\" 71.Ss Kernel interface 72.Nm 73is controlled by a key management and policy engine, |
73that reside in the operating system kernel. Key management | 74that reside in the operating system kernel. 75Key management |
74is the process of associating keys with security associations, also | 76is the process of associating keys with security associations, also |
75know as SAs. Policy management dictates when new security | 77know as SAs. 78Policy management dictates when new security |
76associations created or destroyed. 77.Pp 78The key management engine can be accessed from userland by using 79.Dv PF_KEY 80sockets. 81The 82.Dv PF_KEY 83socket API is defined in RFC2367. --- 4 unchanged lines hidden (view full) --- 88.Xr setsockopt 2 89operations, and 90.Xr sysctl 3 91interface. 92The kernel implements 93an extended version of the 94.Dv PF_KEY 95interface, and allows the programmer to define IPsec policies | 79associations created or destroyed. 80.Pp 81The key management engine can be accessed from userland by using 82.Dv PF_KEY 83sockets. 84The 85.Dv PF_KEY 86socket API is defined in RFC2367. --- 4 unchanged lines hidden (view full) --- 91.Xr setsockopt 2 92operations, and 93.Xr sysctl 3 94interface. 95The kernel implements 96an extended version of the 97.Dv PF_KEY 98interface, and allows the programmer to define IPsec policies |
96which are similar to the per-packet filters. The | 99which are similar to the per-packet filters. 100The |
97.Xr setsockopt 2 98interface is used to define per-socket behavior, and 99.Xr sysctl 3 100interface is used to define host-wide default behavior. 101.Pp 102The kernel code does not implement a dynamic encryption key exchange protocol 103such as IKE 104(Internet Key Exchange). 105Key exchange protocols are beyond what is necessary in the kernel and 106should be implemented as daemon processes which call the 107.Nm APIs. 108.\" 109.Ss Policy management | 101.Xr setsockopt 2 102interface is used to define per-socket behavior, and 103.Xr sysctl 3 104interface is used to define host-wide default behavior. 105.Pp 106The kernel code does not implement a dynamic encryption key exchange protocol 107such as IKE 108(Internet Key Exchange). 109Key exchange protocols are beyond what is necessary in the kernel and 110should be implemented as daemon processes which call the 111.Nm APIs. 112.\" 113.Ss Policy management |
110IPsec policies can be managed in one of two ways, either by | 114IPsec policies can be managed in one of two ways, either by |
111configuring per-socket policies using the | 115configuring per-socket policies using the |
112.Xr setsockopt 2 | 116.Xr setsockopt 2 |
113system calls, or by configuring kernel level packet filter-based 114policies using the 115.Dv PF_KEY 116interface, via the | 117system calls, or by configuring kernel level packet filter-based 118policies using the 119.Dv PF_KEY 120interface, via the |
117.Xr setkey 8 | 121.Xr setkey 8 |
118command. 119In either case, IPsec policies must be specified using the syntax described in 120.Xr ipsec_set_policy 3 . 121Please refer to the 122.Xr setkey 8 123man page for instructions on its use. 124.Pp 125When setting policies using the 126.Xr setkey 8 127command the 128.Dq Li default 129option you can have the system use its default policy, explained 130below, for processing packets. 131The following sysctl variables are available for configuring the | 122command. 123In either case, IPsec policies must be specified using the syntax described in 124.Xr ipsec_set_policy 3 . 125Please refer to the 126.Xr setkey 8 127man page for instructions on its use. 128.Pp 129When setting policies using the 130.Xr setkey 8 131command the 132.Dq Li default 133option you can have the system use its default policy, explained 134below, for processing packets. 135The following sysctl variables are available for configuring the |
132system's IPsec behavior. The variables can have one of two values. | 136system's IPsec behavior. 137The variables can have one of two values. |
133A 134.Li 1 135means 136.Dq Li use , 137which means that if there is a security association then use it but if | 138A 139.Li 1 140means 141.Dq Li use , 142which means that if there is a security association then use it but if |
138there is not then the packets are not processed by IPsec. The value | 143there is not then the packets are not processed by IPsec. 144The value |
139.Li 2 140is synonymous with 141.Dq Li require , 142which requires that a security association must exist for the packets | 145.Li 2 146is synonymous with 147.Dq Li require , 148which requires that a security association must exist for the packets |
143to move, and not be dropped. These terms are defined in | 149to move, and not be dropped. 150These terms are defined in |
144.Xr ipsec_set_policy 8 . 145.Bl -column net.inet6.ipsec6.esp_trans_deflev integerxxx 146.It Sy "Name Type Changeable" 147.It "net.inet.ipsec.esp_trans_deflev integer yes" 148.It "net.inet.ipsec.esp_net_deflev integer yes" 149.It "net.inet.ipsec.ah_trans_deflev integer yes" 150.It "net.inet.ipsec.ah_net_deflev integer yes" 151.It "net.inet6.ipsec6.esp_trans_deflev integer yes" 152.It "net.inet6.ipsec6.esp_net_deflev integer yes" 153.It "net.inet6.ipsec6.ah_trans_deflev integer yes" 154.It "net.inet6.ipsec6.ah_net_deflev integer yes" 155.El 156.Pp 157If the kernel does not find a matching, system wide, policy then the | 151.Xr ipsec_set_policy 8 . 152.Bl -column net.inet6.ipsec6.esp_trans_deflev integerxxx 153.It Sy "Name Type Changeable" 154.It "net.inet.ipsec.esp_trans_deflev integer yes" 155.It "net.inet.ipsec.esp_net_deflev integer yes" 156.It "net.inet.ipsec.ah_trans_deflev integer yes" 157.It "net.inet.ipsec.ah_net_deflev integer yes" 158.It "net.inet6.ipsec6.esp_trans_deflev integer yes" 159.It "net.inet6.ipsec6.esp_net_deflev integer yes" 160.It "net.inet6.ipsec6.ah_trans_deflev integer yes" 161.It "net.inet6.ipsec6.ah_net_deflev integer yes" 162.El 163.Pp 164If the kernel does not find a matching, system wide, policy then the |
158default value is applied. The system wide default policy is specified | 165default value is applied. 166The system wide default policy is specified |
159by the following 160.Xr sysctl 8 161variables. 162.Li 0 163means 164.Dq Li discard 165which asks the kernel to drop the packet. 166.Li 1 --- 67 unchanged lines hidden (view full) --- 234.Sh PROTOCOLS 235The 236.Nm 237protocol acts as a plug-in to the 238.Xr inet 4 239and 240.Xr inet6 4 241protocols and therefore supports most of the protocols defined upon | 167by the following 168.Xr sysctl 8 169variables. 170.Li 0 171means 172.Dq Li discard 173which asks the kernel to drop the packet. 174.Li 1 --- 67 unchanged lines hidden (view full) --- 242.Sh PROTOCOLS 243The 244.Nm 245protocol acts as a plug-in to the 246.Xr inet 4 247and 248.Xr inet6 4 249protocols and therefore supports most of the protocols defined upon |
242those IP-layer protocols. The | 250those IP-layer protocols. 251The |
243.Xr icmp 4 244and | 252.Xr icmp 4 253and |
245.Xr icmp6 4 | 254.Xr icmp6 4 |
246protocols may behave differently with | 255protocols may behave differently with |
247.Nm | 256.Nm |
248because 249.Nm 250can prevent 251.Xr icmp 4 252or 253.Xr icmp6 4 254routines from looking into the IP payload. 255.\" --- 64 unchanged lines hidden (view full) --- 320.Pp 321When a large database of security associations or policies is present 322in the kernel the 323.Dv SADB_DUMP 324and 325.Dv SADB_SPDDUMP 326operations on 327.Dv PF_KEY | 257because 258.Nm 259can prevent 260.Xr icmp 4 261or 262.Xr icmp6 4 263routines from looking into the IP payload. 264.\" --- 64 unchanged lines hidden (view full) --- 329.Pp 330When a large database of security associations or policies is present 331in the kernel the 332.Dv SADB_DUMP 333and 334.Dv SADB_SPDDUMP 335operations on 336.Dv PF_KEY |
328sockets may fail due to lack of space. Increasing the socket buffer | 337sockets may fail due to lack of space. 338Increasing the socket buffer |
329size may alleviate this problem. | 339size may alleviate this problem. |