1.\" $OpenBSD: iked.8,v 1.28 2020/11/20 13:03:00 jmc Exp $ 2.\" 3.\" Copyright (c) 2010 - 2014 Reyk Floeter <reyk@openbsd.org> 4.\" 5.\" Permission to use, copy, modify, and distribute this software for any 6.\" purpose with or without fee is hereby granted, provided that the above 7.\" copyright notice and this permission notice appear in all copies. 8.\" 9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16.\" 17.Dd $Mdocdate: November 20 2020 $ 18.Dt IKED 8 19.Os 20.Sh NAME 21.Nm iked 22.Nd Internet Key Exchange version 2 (IKEv2) daemon 23.Sh SYNOPSIS 24.Nm iked 25.Op Fl dnSTtv 26.Op Fl D Ar macro Ns = Ns Ar value 27.Op Fl f Ar file 28.Op Fl p Ar udpencap_port 29.Op Fl s Ar socket 30.Sh DESCRIPTION 31.Nm 32is an Internet Key Exchange (IKEv2) daemon which performs mutual 33authentication and which establishes and maintains IPsec flows and 34security associations (SAs) between the two peers. 35.Pp 36The IKEv2 protocol is defined in RFC 7296, 37which combines and updates the previous standards: 38ISAKMP/Oakley (RFC 2408), 39IKE (RFC 2409), 40and the Internet DOI (RFC 2407). 41.Nm 42only supports the IKEv2 protocol; 43support for 44ISAKMP/Oakley and IKEv1 45is provided by 46.Xr isakmpd 8 . 47.Pp 48.Nm 49supports mutual authentication using RSA or ECDSA public keys and X.509 50certificates. 51See the 52.Sx PUBLIC KEY AUTHENTICATION 53section below and PKI AND CERTIFICATE AUTHORITY COMMANDS in 54.Xr ikectl 8 55for more information about creating and maintaining the public key 56infrastructure. 57.Pp 58The options are as follows: 59.Bl -tag -width Ds 60.It Fl D Ar macro Ns = Ns Ar value 61Define 62.Ar macro 63to be set to 64.Ar value 65on the command line. 66Overrides the definition of 67.Ar macro 68in the configuration file. 69.It Fl d 70Do not daemonize and log to 71.Em stderr . 72.It Fl f Ar file 73Use 74.Ar file 75as the configuration file, instead of the default 76.Pa /etc/iked.conf . 77.It Fl n 78Configtest mode. 79Only check the configuration file for validity. 80.It Fl p Ar udpencap_port 81Specify the listen port for encapsulated UDP that 82the daemon will bind to as well as the UDP encapsulation port set 83in resulting IPsec SAs. 84In order to receive UDP encapsulated IPsec packets on ports other 85than 4500, the 86.Em net.inet.esp.udpencap_port 87.Xr sysctl 2 88variable has to be set accordingly. 89Implies -t. 90.It Fl S 91Start 92.Nm 93in passive mode. 94See the 95.Ic set passive 96option in 97.Xr iked.conf 5 98for more information. 99.It Fl s Ar socket 100Use 101.Ar socket 102as the control socket, instead of the default 103.Pa /var/run/iked.sock . 104.It Fl T 105Disable NAT-Traversal and do not propose NAT-Traversal support to the peers. 106.It Fl t 107Enforce NAT-Traversal and only listen to NAT-Traversal messages. 108This option is only recommended for testing; the default is to 109negotiate NAT-Traversal with the peers. 110.It Fl v 111Produce more verbose output. 112.El 113.Sh PUBLIC KEY AUTHENTICATION 114It is possible to store trusted public keys to make them directly 115usable by 116.Nm , 117bypassing the need to use certificates. 118The keys should be saved in PEM format (see 119.Xr openssl 1 ) 120and named and stored as follows: 121.Pp 122.Bl -tag -width "for_ufqdn_identitiesXX" -offset 3n -compact 123.It For IPv4 identities: 124/etc/iked/pubkeys/ipv4/A.B.C.D 125.It For IPv6 identities: 126/etc/iked/pubkeys/ipv6/abcd:abcd::ab:bc 127.It For FQDN identities: 128/etc/iked/pubkeys/fqdn/foo.bar.org 129.It For UFQDN identities: 130/etc/iked/pubkeys/ufqdn/user@foo.bar.org 131.El 132.Pp 133Depending on the 134.Ic srcid 135and 136.Ic dstid 137specifications in 138.Xr iked.conf 5 , 139keys may be named after their IPv4 address, IPv6 address, 140fully qualified domain name (FQDN) or user fully qualified domain name (UFQDN). 141.Pp 142For example, 143.Nm 144can authenticate using the pre-generated keys if the local public key, 145by default 146.Pa /etc/iked/local.pub , 147is copied to the remote gateway as 148.Pa /etc/iked/pubkeys/ipv4/local.gateway.ip.address 149and the remote gateway's public key 150is copied to the local gateway as 151.Pa /etc/iked/pubkeys/ipv4/remote.gateway.ip.address . 152Of course, new keys may also be generated 153(the user is not required to use the pre-generated keys). 154In this example, 155.Ic srcid 156and 157.Ic dstid 158would also have to be set to the specified addresses 159in 160.Xr iked.conf 5 . 161.Sh FILES 162.Bl -tag -width "/etc/iked/private/XXX" -compact 163.It Pa /etc/iked.conf 164The default 165.Nm 166configuration file. 167.It Pa /etc/iked/ca/ 168The directory where CA certificates are kept. 169.It Pa /etc/iked/certs/ 170The directory where IKE certificates are kept, both the local 171certificate(s) and those of the peers, if a choice to have them kept 172permanently has been made. 173.It Pa /etc/iked/crls/ 174The directory where CRLs are kept. 175.It Pa /etc/iked/private/ 176The directory where local private keys used for public key authentication 177are kept. 178The file 179.Pa local.key 180is used to store the local private key. 181.It Pa /etc/iked/pubkeys/ 182The directory in which trusted public keys are kept. 183The keys must be named in the fashion described above. 184.It Pa /var/run/iked.sock 185The default 186.Nm 187control socket. 188.El 189.Sh SEE ALSO 190.Xr iked.conf 5 , 191.Xr ikectl 8 , 192.Xr isakmpd 8 193.Sh STANDARDS 194.Rs 195.%A C. Kaufman 196.%A P. Hoffman 197.%A Y. Nir 198.%A P. Eronen 199.%A T. Kivinen 200.%D October 2014 201.%R RFC 7296 202.%T Internet Key Exchange Protocol Version 2 (IKEv2) 203.Re 204.Sh HISTORY 205The 206.Nm 207program first appeared in 208.Ox 4.8 . 209.Sh AUTHORS 210The 211.Nm 212program was written by 213.An Reyk Floeter Aq Mt reyk@openbsd.org . 214