IKECTL(8)
π ikectl β bestie's guide to the IKEv2 daemon π
okay so. ikectl(8) is the little control remote for your system manager's manual era, and it's literally the bestie of the iked(8) daemon. it also hands you commands to keep a simple X.509 certificate authority (CA) alive and thriving for your IKEv2 peers. no cap, it's giving admin main character energy. π
β¨ SYNOPSIS β¨
ikectl [-q] [-s socket] command [arg ...]
πΈ DESCRIPTION πΈ
ikectl controls the iked(8) daemon, and on top of that it gives you commands to maintain a whole simple X.509 certificate authority (CA) for IKEv2 peers. two jobs, one icon. π
okay so the options are as follows:
-qβ don't ask for confirmation of any default options. she's confident, she's not checking in with you first. π-ssocket β use socket instead of the default/var/run/iked.sockto communicate withiked(8).
π IKED CONTROL COMMANDS π
these are the commands you get for controlling iked(8), and they are lowkey iconic:
activeβ setiked(8)to active mode.passiveβ setiked(8)to passive mode. in passive mode no packets are sent to peers and no connections are initiated byiked(8). she's just vibing. π¦coupleβ load the negotiated security associations (SAs) and flows into the kernel.decoupleβ unload the negotiated SAs and flows from the kernel. > heads up bestie: this mode is only useful for testing and debugging. it is not the everyday slay. πloadfilename β reload the configuration from the specified file.log briefβ disable verbose logging.log verboseβ enable verbose logging.monitorβ monitor internal messages of theiked(8)subsystems.reloadβ reload the configuration from the default configuration file.reset allβ reset the running state.reset caβ reset the X.509 CA and certificate state.reset policyβ flush the configured policies.reset saβ flush the running SAs.reset userβ flush the local user database.reset idikeid β delete all IKE SAs with matching ID.show saβ show internal state of active IKE SAs, Child SAs and IPsec flows.
π PKI AND CERTIFICATE AUTHORITY COMMANDS π
so here's the situation: to use public key based authentication with IKEv2, a public key infrastructure (PKI) has to be set up to create and sign the peer certificates. and ikectl includes commands to simplify maintenance of the PKI and to set up a simple certificate authority (CA) for iked(8) and its peers. it's giving "i made it easy for you". π«Ά
the following commands are available to control the CA:
canamecreate[passwordpassword] β create a new certificate authority with the specified name. the command will prompt for a CA password unless it is specified with the optional password argument. the password will be saved in a protected fileikeca.passwdin the CA directory and used for subsequent commands. πcanamedeleteβ delete the certificate authority with the specified name.canameexport[peerpeer] [passwordpassword] β export the certificate authority with the specified name into the current directory for transport to other systems. this command will create a compressed tarball calledca.tgzin the local directory and optionallyca.zipif theziptool is installed. the optional peer argument can be used to specify the address or FQDN of the local gateway which will be written into a text filepeer.txtand included in the archives. π¦canameinstall[path] β install the certificate and Certificate Revocation List (CRL) for CA name as the currently active CA or into the specified path.canamecertificatehostcreate[server|client|ocsp] β create a private key and certificate for host and sign then with the key of certificate authority with the specified name.- the certificate will be valid for client and server authentication by default by setting both flags as the extended key usage in the certificate; this can be restricted using the optional server or client argument. if the ocsp argument is specified the extended key usage will be set for OCSP signing.
canamecertificatehostdeleteβ deletes the private key and certificates associated with host.canamecertificatehostexport[peerpeer] [passwordpassword] β export key files for host of the certificate authority with the specified name into the current directory for transport to other systems. this command will create a compressed tarball host.tgzin the local directory and optionally host.zipif theziptool is installed. the optional peer argument can be used to specify the address or FQDN of the local gateway which will be written into a text filepeer.txtand included in the archives.canamecertificatehostinstall[path] β install the private and public key for host into the active configuration or specified path.canamecertificatehostrevokeβ revoke the certificate specified by host and generate a new Certificate Revocation List (CRL).show canamecertificates[host] β display a listing of certificates associated with CA name or display certificate details if host is specified.canamekeyhostcreateβ create a private key for host if one does not already exist.canamekeyhostinstall[path] β install the private and public keys for host into the active configuration or specified path.canamekeyhostdeleteβ delete the private key for host.canamekeyhostimportfile β source the private key for host from the named file.
π FILES π
/etc/iked/β active configuration./etc/ssl/β directory to store the CA files./usr/share/iked/β if this optional directory exists,ikectlwill include the contents with theca exportcommands./var/run/iked.sockβ default Unix-domain socket used for communication withiked(8).
β EXAMPLES β
first, create a new certificate authority:
# ikectl ca vpn create
now create the certificates for the VPN peers. the specified hostname, either IP address or FQDN, will be saved in the signed certificate and has to match the IKEv2 identity, or srcid, of the peers:
# ikectl ca vpn certificate 10.1.2.3 create
# ikectl ca vpn certificate 10.2.3.4 create
# ikectl ca vpn certificate 10.3.4.5 create
it is possible that the host that was used to create the CA is also one of the VPN peers. in this case you can install the peer and CA certificates locally:
# ikectl ca vpn install
# ikectl ca vpn certificate 10.1.2.3 install
now export the individual host key, the certificate and the CA certificate to each other peer. first run the export command to create tarballs that include the required files:
# ikectl ca vpn certificate 10.2.3.4 export
# ikectl ca vpn certificate 10.3.4.5 export
these commands will produce two tarballs 10.2.3.4.tgz and 10.3.4.5.tgz. copy these tarballs over to the appropriate peers and extract them to the /etc/iked/ directory:
10.2.3.4# tar -C /etc/iked -xzpf 10.2.3.4.tgz
10.3.4.5# tar -C /etc/iked -xzpf 10.3.4.5.tgz
ikectl will also create zip archives 10.2.3.4.zip and 10.3.4.5.zip in addition to the tarballs if the zip tool is found in /usr/local/bin/zip. these archives can be exported to peers running Windows and will include the certificates in a format that is supported by the OS. the zip tool can be installed from the OpenBSD packages or ports collection before running the export commands, see packages(7) for more information. for example:
# pkg_add zip
π SEE ALSO π
π§ HISTORY π§
the ikectl program first appeared in OpenBSD 4.8. a true elder, still slaying. π
π AUTHORS π
the ikectl program was written by Reyk Floeter <reyk@openbsd.org> and Jonathan Gray <jsg@openbsd.org>. legends, honestly. π«Ά
π CAVEATS π
for ease of use, the ca commands maintain all peers' private keys on the CA machine. in contrast to a "real" CA, it does not support signing of public keys that have been imported from peers that do not want to expose their private keys to the CA. > so yeah bestie, know what you're signing up for before you hand over your keys. π₯
okay that's the whole page!! this one's from the Debian crew, dated April 25, 2020, and it lives in the IKECTL(8) era of the manual. go forth and certificate-ify. πΈβ¨π
π¦ where this page comes from
- debian bookworm: openiked 7.2-1 Β· ISC
- debian trixie: openiked 7.4-1 Β· ISC
- fedora 43: openiked 7.4-3.fc43 Β· ISC
- fedora 44: openiked 7.4-4.fc44 Β· ISC
- ubuntu jammy: openiked 7.0-1build1 Β· ISC
- ubuntu noble: openiked 7.3-1build3 Β· ISC
- ubuntu questing: openiked 7.4-1
- ubuntu resolute: openiked 7.4-1build1 Β· ISC
- ubuntu stonking: openiked 7.4-1build2 Β· ISC
- Copyright (c) 2007-2013 Reyk Floeter <reyk@openbsd.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms