ikectl — control the IKEv2 daemon
Contents
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.
Debian April 25, 2020 IKECTL(8)
Description
The ikectl program controls the iked(8) daemon and provides commands to maintain a simple X.509
certificate authority (CA) for IKEv2 peers.
The options are as follows:
-q Don't ask for confirmation of any default options.
-ssocket
Use socket instead of the default /var/run/iked.sock to communicate with iked(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
Files
/etc/iked/ Active configuration.
/etc/ssl/ Directory to store the CA files.
/usr/share/iked/ If this optional directory exists, ikectl will include the contents with the caexport commands.
/var/run/iked.sock Default Unix-domain socket used for communication with iked(8).
History
The ikectl program first appeared in OpenBSD 4.8.
Iked Control Commands
The following commands are available to control iked(8):
active Set iked(8) to active mode.
passive
Set iked(8) to passive mode. In passive mode no packets are sent to peers and no connections are
initiated by iked(8).
couple Load the negotiated security associations (SAs) and flows into the kernel.
decouple
Unload the negotiated SAs and flows from the kernel. This mode is only useful for testing and
debugging.
loadfilename
Reload the configuration from the specified file.
logbrief
Disable verbose logging.
logverbose
Enable verbose logging.
monitor
Monitor internal messages of the iked(8) subsystems.
reload Reload the configuration from the default configuration file.
resetall
Reset the running state.
resetca
Reset the X.509 CA and certificate state.
resetpolicy
Flush the configured policies.
resetsa
Flush the running SAs.
resetuser
Flush the local user database.
resetidikeid
Delete all IKE SAs with matching ID.
showsa
Show internal state of active IKE SAs, Child SAs and IPsec flows.
Name
ikectl — control the IKEv2 daemon
See Also
packages(7), iked(8), ssl(8)
Synopsis
ikectl [-q] [-ssocket] command [arg...]
