ISAKMPD(8)

πŸ“¦ in ubuntu jammy

πŸ’– ISAKMPD(8) πŸ’–

okay bestie, sit down, hydrate, because today we are reading the manual page for isakmpd β€” the ISAKMP/Oakley a.k.a. IKE key management daemon ✨ yes that is a lot of acronyms and yes it ate. the formal header calls it ISAKMPD(8) from the System Manager's Manual, but we're on a first-name basis here πŸ’…


🌸 NAME 🌸

isakmpd β€” ISAKMP/Oakley a.k.a. IKE key management daemon πŸ¦‹

πŸŽ€ SYNOPSIS πŸŽ€

isakmpd [-4] [-6] [-c config-file] [-a] [-d] [-D class=level] [-f fifo]
        [-i pid-file] [-n] [-p listen-port] [-P local-port] [-K] [-L]
        [-l packetlog-file] [-r seed] [-R report-file] [-v]

✨ DESCRIPTION ✨

okay so here's the whole vibe: the isakmpd daemon establishes security associations for encrypted and/or authenticated network traffic. and right now, and honestly probably forever, that means ipsec(4) traffic. periodt.

the way isakmpd goes about its work is genuinely so organized of it: it keeps an internal configuration, plus a policy database that describes what kinds of SAs to negotiate, and then it just... listens. for everything. the events that control isakmpd are:

  • negotiation initiations coming in from a remote party 🫢
  • user input, either via a FIFO or by signals
  • upcalls from the kernel via a PF_KEY socket
  • scheduled events triggered by timers running out ⏰

most uses of isakmpd are gonna be implementing so-called "virtual private networks", or VPNs if you're in a hurry. the vpn(8) manual page walks you through setting up isakmpd for a simple VPN. for other uses you're gonna need some more knowledge of IKE as a protocol β€” one source of info is the RFCs mentioned below, iykyk πŸ“š

on startup, isakmpd forks into two processes for privilege separation. the unprivileged child jails itself with chroot(8) to /var/empty. the privileged process talks to the child, reads configuration files and PKI information, and binds to privileged ports on the child's behalf. see the "CAVEATS" section below, bestie, it's important πŸ‘‘

the options are as follows:

πŸ’… OPTIONS πŸ’…

  • -4 | -6 β€” these control what address family (AF_INET and/or AF_INET6) isakmpd will use. the default is to use both IPv4 and IPv6. versatile queen πŸ’–
  • -a β€” if given, isakmpd does not set up flows automatically. this is useful when flows are configured with ipsecadm(4) or by other programs like bgpd(8). so isakmpd only takes care of the SA establishment. teamwork, no cap 🀝
  • -c config-file β€” if given, specifies an alternate configuration file instead of /etc/isakmpd/isakmpd.conf. because this file may contain sensitive information, it must be readable only by the user running the daemon. isakmpd will reread the configuration file when sent a SIGHUP signal. so dramatic of it πŸ’€
  • -d β€” makes the daemon run in the foreground, logging to stderr.
  • -D class=level β€” debugging class. you can specify this argument many times. it takes a parameter of the form class=level, where both class and level are numbers. class denotes a debugging class, and level is the level you want that debugging class to limit debug printouts at (i.e., all debug printouts above the level specified will not output anything). if class is set to A, then all debugging classes are set to the specified level.

valid values for class are as follows:

  • 0 β€” Misc
  • 1 β€” Transport
  • 2 β€” Message
  • 3 β€” Crypto
  • 4 β€” Timer
  • 5 β€” Sysdep
  • 6 β€” SA
  • 7 β€” Exchange
  • 8 β€” Negotiation
  • 9 β€” Policy
  • 10 β€” FIFO user interface
  • A β€” All

currently used values for level are 0 to 99. yes, ninety-nine whole levels of debugging 🫠

  • -f fifo β€” specifies the FIFO (a.k.a. named pipe) where the daemon listens for user requests. if the path given is a dash (-), isakmpd will listen to stdin instead.
  • -i pid-file β€” by default the PID of the daemon process will be written to /var/run/isakmpd.pid. this path can be overridden by specifying another one as the argument to the -i option.
  • -n β€” when given, the kernel will not take part in the negotiations. this is a non-destructive mode, so to speak, in that it won't alter any SAs in the IPsec stack. cute and harmless 🧚
  • -p listen-port β€” specifies the listen port the daemon will bind to.
  • -P local-port β€” on the other hand (yes, capital -P, look closely πŸ‘€), the port specified here will be what the daemon binds its local end to when acting as initiator.
  • -K β€” when given, isakmpd does not read the policy configuration file and no keynote(4) policy check is accomplished. this option can be used when policies for flows and SA establishment are arranged by other programs like ipsecadm(8) or bgpd(8).
  • -L β€” Enable IKE packet capture πŸ”₯. when given, isakmpd will capture to file an unencrypted copy of the negotiation packets it is sending and receiving. this file can later be read by tcpdump(8) and other utilities using pcap(3). (unencrypted!! noted 🫣)
  • -l packetlog-file β€” as option -L above, but capture to a specified file.
  • -r seed β€” if given, a deterministic random number sequence will be used internally. this is useful for setting up regression tests.
  • -R report-file β€” when you signal isakmpd a SIGUSR1, it will report its internal state to a report file, normally /var/run/isakmpd.report, but this can be changed by feeding the file name as an argument to the -R flag. she loves to gossip πŸ“
  • -v β€” Enables verbose logging. normally isakmpd is silent and outputs only messages when a warning or an error occurs. with verbose logging, isakmpd reports successful completion of phase 1 (Main and Aggressive) and phase 2 (Quick) exchanges (Information and Transaction exchanges do not generate any additional status information). so it's the strong silent type until you ask ✨

🌈 Setting up an IKE public key infrastructure (a.k.a. PKI) 🌈

in order to use public key based authentication, there has to be an infrastructure managing the key signing. either there's an already existing PKI that isakmpd should take part in, or you're gonna need to set one up. in the former case, what needs doing varies depending on the actual Certificate Authority used, so it's not covered here β€” other than mentioning that openssl(1) needs to be used to create a certificate signing request that the CA understands. the latter case, however, is described right here bestie 🫢

  1. Create your own CA as root.
# openssl genrsa -out /etc/ssl/private/ca.key 1024
# openssl req -new -key /etc/ssl/private/ca.key \
        -out /etc/ssl/private/ca.csr

you are then asked to enter information that will be incorporated into your certificate request. what you're about to enter is what is called a Distinguished Name (DN). there are quite a few fields but you can leave some blank. for some fields there will be a default value; if you enter ., the field will be left blank.

# openssl x509 -req -days 365 -in /etc/ssl/private/ca.csr \
        -signkey /etc/ssl/private/ca.key \
        -extfile /etc/ssl/x509v3.cnf -extensions x509v3_CA \
        -out /etc/ssl/ca.crt
  1. Create keys and certificates for your IKE peers.

this step, as well as the next one, needs to be done for every peer. furthermore the last step will need to be done once for each ID you want the peer to have. the 10.0.0.1 below symbolizes that ID β€” in this case an IPv4 ID β€” and should be changed for each invocation. you will be asked for a DN for each run. encoding the ID in the common name is recommended, as it should be unique.

# openssl genrsa -out /etc/isakmpd/private/local.key 1024
# openssl req -new -key /etc/isakmpd/private/local.key \
        -out /etc/isakmpd/private/10.0.0.1.csr

now take these certificate signing requests to your CA and process them like below. you have to add a subjectAltName extension field to the certificate in order to make it usable by isakmpd. there are two possible ways to add the extensions to the certificate. either you have to run certpatch(8) or you have to make use of an OpenSSL configuration file, for example /etc/ssl/x509v3.cnf. replace 10.0.0.1 with the IP-address which isakmpd will use as the certificate identity.

to use certpatch(8), do the following

# openssl x509 -req -days 365 -in 10.0.0.1.csr -CA /etc/ssl/ca.crt \
        -CAkey /etc/ssl/private/ca.key -CAcreateserial \
        -out 10.0.0.1.crt
# certpatch -i 10.0.0.1 -k /etc/ssl/private/ca.key \
        10.0.0.1.crt 10.0.0.1.crt

otherwise do

# setenv CERTIP 10.0.0.1
# openssl x509 -req -days 365 -in 10.0.0.1.csr -CA /etc/ssl/ca.crt \
        -CAkey /etc/ssl/private/ca.key -CAcreateserial \
        -extfile /etc/ssl/x509v3.cnf -extensions x509v3_IPAddr \
        -out 10.0.0.1.crt

for a FQDN certificate, do

# setenv CERTFQDN somehost.somedomain
# openssl x509 -req -days 365 -in somehost.somedomain.csr \
        -CA /etc/ssl/ca.crt -CAkey /etc/ssl/private/ca.key \
        -CAcreateserial \
        -extfile /etc/ssl/x509v3.cnf -extensions x509v3_FQDN \
        -out somehost.somedomain.crt

or with certpatch(8)

# certpatch -t fqdn -i somehost.somedomain \
        -k /etc/ssl/private/ca.key \
        somehost.somedomain.crt somehost.somedomain.crt

(this assumes the previous steps were used to create a request for somehost.somedomain instead of 10.0.0.1)

put the certificate (the file ending in .crt) in /etc/isakmpd/certs/ on your local system. also carry over the CA cert /etc/ssl/ca.crt and put it in /etc/isakmpd/ca/. almost there, bestie πŸŽ€

to revoke certificates, create a Certificate Revocation List (CRL) file and install it in the /etc/isakmpd/crls/ directory. see openssl(1) and the crl subcommand for more info.

it is also possible to store trusted public keys to make them directly usable by isakmpd. the keys should be saved in PEM format (see openssl(1)) and named and stored after this easy formula:

  • For IPv4 identities β€” /etc/isakmpd/pubkeys/ipv4/A.B.C.D
  • For IPv6 identities β€” /etc/isakmpd/pubkeys/ipv6/abcd:abcd::ab:bc
  • For FQDN identities β€” /etc/isakmpd/pubkeys/fqdn/foo.bar.org
  • For UFQDN identities β€” /etc/isakmpd/pubkeys/ufqdn/user@foo.bar.org

πŸ¦‹ The FIFO user interface πŸ¦‹

when isakmpd starts, it creates a FIFO (named pipe) where it listens for user requests. all commands start with a single letter, followed by command-specific options. available commands are:

  • c <name> β€” Start the named connection, if stopped or inactive.
  • C set [section]:tag=value
  • C set [section]:tag=value force
  • C add [section]:tag=value
  • C rm [section]:tag
  • C rms [section]

okay so this whole lil squad updates the running isakmpd config atomically β€” like, no half-done mess, it's giving clean ✨. set sets a configuration value, which is a little triplet of section, tag and value. But heads up bestie: set will fail if the config already has a section with that named tag β€” and if you want it to just do it anyway, that's what the force option is for πŸ’…. add appends a configuration value to the named configuration list tag. rm removes a tag inside a section. rms nukes an entire section. gone, deleted, no trace 🫢.

⚠️ NOTE: sending isakmpd a SIGHUP or an "R" through the FIFO will void any updates you did to the configuration. Like, all that work? poof. πŸ’€
  • C get [section]:tag β€” get the configuration value of the specified section and tag. The result gets stored in /var/run/isakmpd.result πŸ“.
  • d <cookies> <msgid> β€” delete the specified SA from the system. And listen: specify <msgid> as "-" to match a Phase 1 SA πŸ‘‘
  • D <class> <level>
  • D A <level>
  • D T β€” set debug class <class> to level <level>. If <class> is given as "A", then that level applies to all debug classes, everyone eating together 🍽️. "D T" toggles all debug classes to level zero, and another "D T" command will toggle them right back to the earlier levels. it's giving light switch πŸ”…
  • p on[=<path>]
  • p off β€” enable or disable cleartext IKE packet capture. When you're enabling it, you can optionally say which file isakmpd should capture the packets to πŸ“¦
  • Q β€” cleanly shutdown the daemon, exactly like when it gets sent a SIGTERM signal. bye bestie, graceful exit 😌
  • r β€” report isakmpd internal state to a file. See the -R option. Same as when sent a SIGUSR1 signal.
  • R β€” reinitialize isakmpd, as when sent a SIGHUP signal.
  • S β€” report information on all known SAs to the /var/run/isakmpd.result file πŸ“„
  • t <name> β€” tear down the named connection, if it's active.
  • T β€” tear down all active connections. everyone out πŸ”₯

✨ FILES ✨

  • /etc/isakmpd/ca/ β€” the directory where CA certificates can be found. πŸŽ€
  • /etc/isakmpd/certs/ β€” the directory where IKE certificates can be found, both the local certificate(s) and those of the peers, if a choice to have them kept permanently has been made.
  • /etc/isakmpd/crls/ β€” the directory where CRLs can be found.
  • /etc/isakmpd/isakmpd.conf β€” the configuration file. And because this file can contain sensitive info, it must not be readable by anyone but the user running isakmpd πŸ”’
  • /etc/isakmpd/isakmpd.policy β€” the keynote policy configuration file. Same mode requirements as isakmpd.conf.
  • /etc/isakmpd/private/local.key β€” a local private key for certificate based authentication. There has to be a certificate for this key in the certificate directory mentioned above. Same mode requirements as isakmpd.conf.
  • /etc/isakmpd/pubkeys/ β€” directory in which trusted public keys can be kept. The keys must be named in the fashion described above.
  • /var/run/isakmpd.pid β€” the PID of the current daemon.
  • /var/run/isakmpd.fifo β€” the FIFO used to manually control isakmpd.
  • /var/run/isakmpd.pcap β€” the default IKE packet capture file.
  • /var/run/isakmpd.report β€” the report file written when SIGUSR1 is received.
  • /var/run/isakmpd.result β€” the report file written when the β€˜S’ or β€˜C get’ command is issued in the command FIFO.
  • /usr/share/ipsec/isakmpd/ β€” a directory containing some sample isakmpd and keynote policy configuration files. little starter pack 🧚

🌈 SEE ALSO 🌈

openssl(1), getnameinfo(3), pcap(3), ipsec(4), isakmpd.conf(5), isakmpd.policy(5), ssl(8), tcpdump(8), vpn(8)


πŸ’œ HISTORY πŸ’œ

The ISAKMP/Oakley key management protocol is described in the RFCs RFC 2407, RFC 2408 and RFC 2409. This implementation was done 1998 by Niklas Hallqvist and Niels Provos, sponsored by Ericsson Radio Systems. legends fr fr πŸ‘‘


🫢 CAVEATS 🫢

When you're storing a trusted public key for an IPv6 identity, you must use the most efficient form of address representation, i.e "::" instead of ":0:0:0:", or the matching will fail 😭. isakmpd uses the output from getnameinfo(3) for the address-to-name translation.

The privileged process only allows binding to the default port 500 or unprivileged ports (>1024).

And no cap: it is not possible to change the interfaces isakmpd listens on without a restart. πŸ™ˆ


πŸ’€ BUGS πŸ’€

The -P flag does not do what we document, rather it does nothing. it's giving decorative flag ✨ (not in the fun way)


and that's the whole page bestie, tysm for reading πŸ’– this one came from the Debian crew, dated August 07, 2002, filed under ISAKMPD(8) β€” mwah, stay encrypted πŸŽ€πŸ’…

πŸ“¦ where this page comes from
  • ubuntu jammy: isakmpd 20041012-10build1
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms