SWANCTL.CONF(5)

πŸ’… SWANCTL.CONF(5) β€” the swanctl config file, bestie edition

okay so this is swanctl.conf, and it's the config file for swanctl(8) β€” the lil tool that loads your configs and credentials into the strongSwan IKE daemon. basically the whole vibe of your VPN setup lives in here. πŸ¦‹


✨ DESCRIPTION ✨

swanctl.conf is the configuration file that the swanctl(8) tool reads to load configurations and credentials into the strongSwan IKE daemon. that's the whole job, and it does it slayfully.

for the basics β€” file syntax, number/time formats, how to reference sections, or how to split your config across multiple files by including other files β€” go read strongswan.conf(5). it's giving "required reading" but fr fr it's required. πŸ“š


πŸŽ€ SETTINGS πŸŽ€

these are the settings you can use to configure connections, credentials and pools. yes, all three. we contain multitudes. πŸ’–

🫢 connections

section defining IKE connection configurations.

the connections section defines IKE connection configurations, each one chilling in its own subsection. in the keyword descriptions below, the connection is named <conn>, but ngl you can pick any arbitrary-yet-unique connection name for each connection subsection. go off, name it after your cat. 🐱

🫢 connections.<conn>

section for an IKE connection named <conn>. that's it, that's the whole section. main character energy. πŸ‘‘

connections.<conn>.version [2]

IKE major version to use for the connection. 1 uses IKEv1 aka ISAKMP, 2 uses IKEv2 (that's the default). a connection using 0 accepts both IKEv1 and IKEv2 as responder, and initiates the connection actively with IKEv2. lowkey the flex option. πŸ’…

connections.<conn>.local_addrs [%any]

local address(es) to use for IKE communication, comma separated. takes single IPv4/IPv6 addresses, DNS names, CIDR subnets or IP address ranges.

as initiator, the first non-range/non-subnet gets used to initiate the connection from. as responder, the local destination address has to match at least one of the specified addresses, subnets or ranges. gotta match, no exceptions.

if FQDNs are assigned, they get resolved every time a configuration lookup is done. and if DNS resolution times out, the lookup is delayed for that amount of time. so like, plan accordingly. 😭

connections.<conn>.remote_addrs [%any]

remote address(es) to use for IKE communication, comma separated. takes single IPv4/IPv6 addresses, DNS names, CIDR subnets or IP address ranges.

as initiator, the first non-range/non-subnet is used to initiate the connection to. as responder, the initiator's source address must match at least one of the specified addresses, subnets or ranges.

if FQDNs are assigned they get resolved every time a configuration lookup is done, and if DNS resolution times out, the lookup is delayed for that time. same deal as above, no cap.

⚠️ to initiate a connection, at least one specific address or DNS name must be specified. no vague vibes allowed, you need a real one. πŸ’€

connections.<conn>.local_port [500]

local UDP port for IKE communication. by default the port of the socket backend is used, which is usually 500. if port 500 is used, automatic IKE port floating to port 4500 kicks in to work around NAT issues.

using a non-default local IKE port requires support from the socket backend in use (socket-dynamic). so like, check with your backend first. 🫢

connections.<conn>.remote_port [500]

remote UDP port for IKE communication. if the default of port 500 is used, automatic IKE port floating to port 4500 is used to work around NAT issues. iconic NAT-dodging behavior honestly.

connections.<conn>.proposals [default]

a proposal is a set of algorithms. for non-AEAD IKE proposals, that includes an encryption algorithm, an integrity algorithm, a pseudo-random function and a key exchange method. for AEAD proposals, instead of encryption and integrity algorithms, a combined mode algorithm is used. slay.

with peers that support multiple IKEv2 key exchanges (RFC 9370), up to seven additional key exchanges may be negotiated. you configure them by prefixing the algorithm keyword with keX_ (where X is a number between 1 and 7). seven! that's so many!

for IKEv2, multiple algorithms of the same kind can be specified in a single proposal, and one gets selected from them. for IKEv1, only one algorithm per kind is allowed per proposal β€” extra algorithms get implicitly stripped. so use multiple proposals to offer different algorithm combos with IKEv1. iykyk.

algorithm keywords get separated using dashes. multiple proposals may be separated by commas. the special value default forms a default proposal of supported algorithms considered safe, and is usually a good choice for interoperability. when in doubt, default ate. πŸ”₯

connections.<conn>.vips []

comma separated list of virtual IPs to request in IKEv2 configuration payloads or IKEv1 Mode Config. the wildcard addresses 0.0.0.0 and :: request an arbitrary address, and specific addresses may be defined. the responder may return a different address though, or none at all. rude but ok. πŸ™ˆ

connections.<conn>.aggressive [no]

enables Aggressive Mode instead of Main Mode with Identity Protection.

πŸ’€ Aggressive Mode is considered less secure, because the ID and HASH payloads are exchanged unprotected. this lets a passive attacker snoop peer identities and β€” even worse β€” start dictionary attacks on the Preshared Key. so like, highkey think twice.

connections.<conn>.pull [yes]

if the default of yes is used, Mode Config works in pull mode, where the initiator actively requests a virtual IP. with no, push mode is used, where the responder pushes down a virtual IP to the initiating peer.

push mode is currently supported for IKEv1, but not in IKEv2. it's used by a few implementations only, so pull mode is recommended. go with the crowd on this one. 🫢

connections.<conn>.dscp [000000]

Differentiated Services Field Codepoint to set on outgoing IKE packets for this connection. the value is a six digit binary encoded string specifying the Codepoint to set, as defined in RFC 2474. six digits, binary, that's the whole assignment. ✨

connections.<conn>.encap [no]

to enforce UDP encapsulation of ESP packets, the IKE daemon can fake the NAT detection payloads. this makes the peer believe that NAT takes place on the path, forcing it to encapsulate ESP packets in UDP. gaslight gatekeep girlboss.

usually this isn't required, but it can help work around connectivity issues with overly restrictive intermediary firewalls. so it's the "my firewall is doing too much" fix. πŸ”₯

connections.<conn>.mobike [yes]

enables MOBIKE on IKEv2 connections. MOBIKE is enabled by default on IKEv2 connections and allows mobility of clients and multi-homing on servers by migrating active IPsec tunnels. it's giving "your tunnel follows you around" energy.

usually keeping MOBIKE enabled is unproblematic, since it's not used if the peer doesn't indicate support for it. but because of the design of MOBIKE, IKEv2 always floats to port 4500 starting from the second exchange. some implementations don't like this behavior, hence it can be disabled. one lil quirk, that's all. πŸ™ˆ

connections.<conn>.dpd_delay [0s]

interval to check the liveness of a peer actively using IKEv2 INFORMATIONAL exchanges or IKEv1 R_U_THERE messages. active DPD checking is only enforced if no IKE or ESP/AH packet has been received for the configured DPD delay. so it's a "hey bestie are you still there" but only when it's been quiet. πŸ’–

connections.<conn>.dpd_timeout [0s]

Charon by default uses the normal retransmission mechanism and timeouts to check the liveness of a peer, since all messages are used for liveness checking. for compatibility reasons, with IKEv1 a custom interval may be specified; this option has no effect on connections using IKE2. so like, IKEv1 only, don't come for me. 🫢

connections.<conn>.fragmentation [yes]

use IKE fragmentation (proprietary IKEv1 extension or RFC 7383 IKEv2 fragmentation). acceptable values are yes (the default), accept, force and no.

  • yes β€” if the peer supports it, oversized IKE messages get sent in fragments. the classic.
  • accept β€” support for fragmentation is announced to the peer, but the daemon doesn't send its own messages in fragments. look, don't touch.
  • force β€” only supported for IKEv1 β€” the initial IKE message will already be fragmented if required. aggressive. love that.
  • no β€” disables announcing support for this feature.
✨ note that fragmented IKE messages sent by a peer are always accepted irrespective of the value of this option (even when set to no). so like, you can refuse to announce it but you can't refuse to receive it. the disrespect.

connections.<conn>.childless [allow]

use childless IKE_SA initiation (RFC 6023) for IKEv2, with the first CHILD_SA created with a separate CREATE_CHILD_SA exchange (e.g. to use an independent key exchange for all CHILD_SAs). acceptable values are allow (the default), prefer, force and never. okay so let me break this down, bestie:

  • allow β€” responders will accept childless IKE_SAs (as indicated via notify in the IKE_SA_INIT response), while initiators continue to create regular IKE_SAs with the first CHILD_SA created during IKE_AUTH, unless the IKE_SA is initiated explicitly without any children (which will fail if the responder does not support or has disabled this extension). whew.
  • prefer β€” same effect as allow on responders, but as initiator a childless IKE_SA is initiated if the responder supports it. best of both worlds honestly.
  • force β€” only childless initiation is accepted, in either role. all in, no backup plan.
  • never β€” disables support for childless IKE_SAs as responder. hard pass.

connections.<conn>.send_certreq [yes]

send certificate request payloads to offer trusted root CA certificates to the peer. certificate requests help the peer choose an appropriate certificate/private key for authentication, and they're enabled by default. so helpful, so thoughtful. πŸŽ€

disabling certificate requests can be useful if too many trusted root CA certificates are installed, since each certificate request increases the size of the initial IKE packets. big packets = big problems, sometimes. πŸ“¦

connections.<conn>.send_cert [ifasked]

send certificate payloads when using certificate authentication. with the default of ifasked, the daemon sends certificate payloads only if certificate requests have been received. never disables sending of certificate payloads altogether, while always causes certificate payloads to be sent unconditionally whenever certificate authentication is used. pick your fighter. πŸ’…

  • connections.<conn>.ocsp [reply] β€” sends OCSP status requests in certificate request payloads and/or sends OCSP status responses in certificate payloads when certificate authentication is in play. The values, bestie:
    • reply (the default) β€” the daemon sends OCSP status responses in certificate payloads if an OCSP status request has been received in a certificate request.
    • never β€” disables sending of OCSP status requests and responses altogether.
    • request β€” OCSP status requests in certificate request payloads get sent whenever certificate authentication is used.
    • both β€” combines reply and request. yes, both. iconic behavior.
  • connections.<conn>.ppk_id [] β€” the string that identifies the Postquantum Preshared Key (PPK) to be used.
  • connections.<conn>.ppk_required [no] β€” whether a Postquantum Preshared Key (PPK) is required for this connection. no cap.
  • connections.<conn>.keyingtries [1] β€” how many retransmission sequences to perform during the initial connect. instead of giving up initiation after the first retransmission sequence (which is what the default value of 1 does), you can start additional sequences according to the configured value. a value of 0 initiates a new sequence until the connection establishes or fails with a permanent error β€” it literally does not stop trying. 🫢
  • connections.<conn>.unique [no] β€” the connection uniqueness policy to enforce. to avoid multiple connections from the same user, a uniqueness policy can be enforced. the values:
    • never β€” does never enforce such a policy, even if a peer included INITIAL_CONTACT notification messages.
    • no β€” replaces existing connections for the same identity if a new one has the INITIAL_CONTACT notify.
    • keep β€” rejects new connection attempts if the same user already has an active connection.
    • replace β€” deletes any existing connection if a new one for the same user gets established.

To compare connections for uniqueness, the remote IKE identity is used. If EAP or XAuth authentication is involved, the EAP-Identity or XAuth username is used to enforce the uniqueness policy instead.

On initiators this setting specifies whether an INITIAL_CONTACT notify is sent during IKE_AUTH if no existing connection is found with the remote peer (determined by the identities of the first authentication round). Unless set to never the client will send a notify.

  • connections.<conn>.reauth_time [0s] β€” time to schedule IKE reauthentication. IKE reauthentication recreates the IKE/ISAKMP SA from scratch and re-evaluates the credentials. In asymmetric configurations (with EAP or configuration payloads) it might not be possible to actively reauthenticate as responder. The IKEv2 reauthentication lifetime negotiation can instruct the client to perform reauthentication.

Reauthentication is disabled by default. Enabling it can usually result in short connection interruptions, even when using make-before-break reauthentication, which is now the default. However, they are significantly shorter than when using the legacy break-before-make approach. 😭 worth knowing.

  • connections.<conn>.rekey_time [4h] β€” IKE rekeying refreshes key material using a Diffie-Hellman exchange, but it does not re-check associated credentials. It's supported in IKEv2 only β€” IKEv1 performs a reauthentication procedure instead.

With the default value IKE rekeying is scheduled every 4 hours, minus the configured rand_time. If a reauth_time is configured, rekey_time defaults to zero disabling rekeying; explicitly set both to enforce rekeying and reauthentication. ⭐

  • connections.<conn>.over_time [10% of rekey_time/reauth_time] β€” the hard IKE_SA lifetime if rekey/reauth does not complete, as time. To avoid having an IKE/ISAKMP kept alive if IKE reauthentication or rekeying fails perpetually, a maximum hard lifetime may be specified. If the IKE_SA fails to rekey or reauthenticate within the specified time, the IKE_SA gets closed. 🫑

In contrast to CHILD_SA rekeying, over_time is relative in time to the rekey_time and reauth_time values, as it applies to both.

The default is 10% of the longer of rekey_time and reauth_time.

  • connections.<conn>.rand_time [over_time] β€” the time range from which to choose a random value to subtract from rekey/reauth times. To avoid having both peers initiating the rekey/reauth procedure simultaneously, a random time gets subtracted from the rekey/reauth times. so considerate of them πŸ’…

The default is equal to the configured over_time.

  • connections.<conn>.pools [] β€” comma separated list of named IP pools to allocate virtual IP addresses and other configuration attributes from. Each name references a pool by name from either the pools section or an external pool.
  • connections.<conn>.if_id_in [0] β€” the XFRM interface ID set on inbound policies/SA, can be overridden by child config, see there for details.

The special value %unique allocates a unique interface ID per IKE_SA, which is inherited by all its CHILD_SAs (unless overridden there), beyond that the value %unique-dir assigns a different unique interface ID for each direction (in/out).

  • connections.<conn>.if_id_out [0] β€” the XFRM interface ID set on outbound policies/SA, can be overridden by child config, see there for details.

The special value %unique allocates a unique interface ID per IKE_SA, which is inherited by all its CHILD_SAs (unless overridden there), beyond that the value %unique-dir assigns a different unique interface ID for each direction (in/out).

  • connections.<conn>.mediation [no] β€” whether this connection is a mediation connection, that is, whether this connection is used to mediate other connections using the IKEv2 Mediation Extension. Mediation connections create no CHILD_SA. πŸ‘‘
  • connections.<conn>.mediated_by [] β€” the name of the connection to mediate this connection through. If given, the connection will be mediated through the named mediation connection. The mediation connection must have mediation enabled. (rules are rules.)
  • connections.<conn>.mediation_peer [] β€” the identity under which the peer is registered at the mediation server, that is, the IKE identity the other end of this connection uses as its local identity on its connection to the mediation server. This is the identity we request the mediation server to mediate us with. Only relevant on connections that set mediated_by. If it is not given, the remote IKE identity of the first authentication round of this connection will be used.
  • connections.<conn>.local<suffix> β€” section for a local authentication round. A local authentication round defines the rules how authentication is performed for the local peer. Multiple rounds may be defined to use IKEv2 RFC 4739 Multiple Authentication or IKEv1 XAuth.

Each round is defined in a section having local as prefix, and an optional unique suffix. To define a single authentication round, the suffix may be omitted. πŸŽ€

  • connections.<conn>.local<suffix>.round [0] β€” optional numeric identifier by which authentication rounds are sorted. If not specified rounds are ordered by their position in the config file/VICI message.
  • connections.<conn>.local<suffix>.certs [] β€” comma separated list of certificate candidates to use for authentication. The certificates may use a relative path from the swanctl x509 directory or an absolute path.

The certificate used for authentication is selected based on the received certificate request payloads. If no appropriate CA can be located, the first certificate is used. πŸ¦‹

  • connections.<conn>.local<suffix>.cert<suffix> [] β€” section for a certificate candidate to use for authentication. Certificates in certs are transmitted as binary blobs, these sections offer more flexibility.
  • connections.<conn>.local<suffix>.cert<suffix>.file [] β€” absolute path to the certificate to load. Passed as-is to the daemon, so it must be readable by it.

Configure either this or handle, but not both, in one section. ✨

  • connections.<conn>.local<suffix>.cert<suffix>.handle [] β€” hex-encoded CKA_ID of the certificate on a token.

Configure either this or file, but not both, in one section.

  • connections.<conn>.local<suffix>.cert<suffix>.slot [] β€” optional slot number of the token that stores the certificate.
  • connections.<conn>.local<suffix>.cert<suffix>.module [] β€” optional PKCS#11 module name.
  • connections.<conn>.local<suffix>.pubkeys [] β€” comma separated list of raw public key candidates to use for authentication. The public keys may use a relative path from the swanctl pubkey directory or an absolute path.

Even though multiple local public keys could be defined in principle, only the first public key in the list is used for authentication. lowkey brutal but okay πŸ’€

  • connections.<conn>.local<suffix>.auth [pubkey] β€” authentication to perform locally. The methods:
    • pubkey β€” uses public key authentication using a private key associated to a usable certificate.
    • psk β€” uses pre-shared key authentication.
    • xauth β€” the IKEv1 specific method, used for XAuth or Hybrid authentication.
    • eap β€” the IKEv2 specific keyword, defines EAP authentication.

For xauth, a specific backend name may be appended, separated by a dash. The appropriate xauth backend is selected to perform the XAuth exchange. For traditional XAuth, the xauth method is usually defined in the second authentication round following an initial pubkey (or psk) round. Using xauth in the first round performs Hybrid Mode client authentication.

For eap, a specific EAP method name may be appended, separated by a dash. An EAP module implementing the appropriate method is selected to perform the EAP conversation. 🌈

Okay so back to it β€” this bit is still the tail end of the auth keyword tea, and it's giving cryptography ✨

If both peers support RFC 7427 ("Signature Authentication in IKEv2"), you can literally pick which specific hash algorithms get used during IKEv2 authentication. The way you do it: write ike: and then a trust chain signature scheme constraint right after it (peep the description of the remote section's auth keyword for the full lore on those).

So for example: ike:pubkey-sha384-sha256 means a public key signature scheme with either SHA-384 or SHA-256 gets used for authentication β€” in that order, and depending on which hash algorithms the peer actually supports πŸ’…

If you don't configure any specific hash algorithms, the default is to prefer an algorithm that matches or exceeds the strength of the signature key. And if you configure no constraints with the ike: prefix at all, then any signature scheme constraint (y'know, the ones without ike:) will also apply to IKEv2 authentication β€” unless that's disabled in strongswan.conf(5). πŸ™ˆ

Wanna use RSASSA-PSS signatures? Use rsa/pss instead of pubkey or rsa, like ike:rsa/pss-sha256. But heads up bestie: if pubkey or rsa constraints are configured, RSASSA-PSS signatures will only be used if it's enabled in strongswan.conf(5). No sneaky pss action otherwise 🫢


<h2>local auth-adjacent identities πŸ’–</h2>

  • connections.<conn>.local<suffix>.id [] β€” the IKE identity to use for this authentication round. When you're doing certificate auth, this identity must be in the certificate β€” either as subject or as subjectAltName. Non-negotiable, it's the vibe check the cert has to pass πŸ”₯

The identity can be an IP address, a fully-qualified domain name, an email address or a Distinguished Name β€” the ID type gets figured out automatically and the string is converted to the appropriate encoding. But if you wanna force a specific identity type, slap a prefix on it followed by a colon (:).

Now the cute trick: if the number sign (#) follows the colon, the rest of the data is interpreted as hex encoding. Otherwise the string is used as-is as the identification data. Which means β€” plot twist β€” no conversion is performed for non-string identities. So like, ipv4:10.0.0.1 does not create a valid ID_IPV4_ADDR IKE identity, because it never gets converted to binary 0x0a000001. 😭 Instead you could write ipv4:#0a000001 to get a valid identity β€” but honestly just using the implicit type with automatic conversion is usually simpler. Same whole situation applies to the ASN1 encoded types, iykyk.

The prefixes that are known: ipv4, ipv6, rfc822, email, userfqdn, fqdn, dns, asn1dn, asn1gn and keyid. And you can specify custom type prefixes by surrounding the numerical type value with curly brackets πŸ’«

  • connections.<conn>.local<suffix>.eap_id [id] β€” the client EAP-Identity to use in the EAP-Identity exchange and in the EAP method. Both. Same string. Slay πŸŽ€
  • connections.<conn>.local<suffix>.aaa_id [remote-id] β€” the server side EAP-Identity to expect in the EAP method. Some EAP methods β€” EAP-TLS, looking at you β€” use an identity for the server to do mutual authentication. And lowkey this identity may differ from the IKE identity, especially when EAP authentication is delegated from the IKE responder to an AAA backend. Different identity, same trust, it's fine πŸ¦‹

For EAP-(T)TLS, this defines the identity for which the server must provide a certificate in the TLS exchange. No cert, no entry πŸ’…

  • connections.<conn>.local<suffix>.xauth_id [id] β€” the client XAuth username used in the XAuth exchange. Old school but iconic.

<h2>remote sections β€” the other side of the story πŸ’œ</h2>

  • connections.<conn>.remote<suffix> β€” a whole section for a remote authentication round. A remote authentication round defines the constraints on how the peers must authenticate to use this connection. You can define multiple rounds to use IKEv2 RFC 4739 Multiple Authentication, or IKEv1 XAuth. Main character energy, honestly.

Each round lives in a section with remote as the prefix plus an optional unique suffix. If you just want a single authentication round, skip the suffix entirely β€” easy ✨

  • connections.<conn>.remote<suffix>.round [0] β€” optional numeric identifier that sorts the authentication rounds. If you don't specify it, rounds are ordered by their position in the config file / VICI message. Order matters, bestie 🫢
  • connections.<conn>.remote<suffix>.id [%any] β€” the IKE identity to expect for this authentication round. Head over to the local section's id keyword for the details, it's the same deal.

Now this one's extra: you can use wildcards to match remote identities β€” like *@strongswan.org, *.strongswan.org, or C=CH,O=strongSwan,CN=*. Connections with exact matches are preferred, so being specific pays off πŸ‘‘. When you're using distinguished names with wildcards, the charon.rdn_matching option in strongswan.conf(5) decides how RDNs get matched.

Extended POSIX regular expressions are also supported for remote identity matching πŸ”₯! Rules: they must start with an explicit type prefix, then a caret character ('^'), and end with a dollar sign ('$') to mark it as an anchored pattern. And please escape backslash characters when you configure identities inside double quotes β€” future you will thank you 😭. Supported types: rfc822, email, userfqdn, fqdn, dns, and asn1dn. While regular expressions are always matched against the string representation of other identities, the type has to match too. Matching is case insensitive, no cap.

Examples, because examples ate:

email:^(moon|sun)@strongswan\.org$
fqdn:^vpn[0-9]+\.strongswan\.org$
"asn1dn:^.*CN=.+\\.strongswan\\.org$"
  • connections.<conn>.remote<suffix>.eap_id [id] β€” use the EAP-Identity method to request an identity from the client, to match against and then use during EAP authentication. Real talk: there is currently no "best" match β€” configs are matched in the order they're loaded. First come, first served πŸ“

Wildcards and regular expressions are supported here too β€” refer to the id keyword for the details.

  • connections.<conn>.remote<suffix>.groups [] β€” comma separated authorization group memberships to require. The peer must prove membership in at least one of the specified groups πŸ’ͺ. Group membership can be certified by different means β€” for example appropriate Attribute Certificates, or by an AAA backend involved in the authentication.
  • connections.<conn>.remote<suffix>.cert_policy [] β€” comma separated list of certificate policy OIDs that the peer's certificate must have. OIDs are specified using the numerical dotted representation. Dotted. Numerically. You know the drill πŸŽ€
  • connections.<conn>.remote<suffix>.certs [] β€” comma separated list of certificates to accept for authentication. The certificates may use a relative path from the swanctl x509 directory, or an absolute path. Your call 🌸
  • connections.<conn>.remote<suffix>.cert<suffix> [] β€” a section for a certificate to accept for authentication. Certificates in certs get transmitted as binary blobs, but these sections offer more flexibility. Fancy πŸ’…
    • connections.<conn>.remote<suffix>.cert<suffix>.file [] β€” absolute path to the certificate to load. It's passed as-is to the daemon, so it must be readable by it. No guesses, no shortcuts.

Configure either this or handle, but not both, in one section. Pick a lane bestie 🫢

  • connections.<conn>.remote<suffix>.cert<suffix>.handle [] β€” hex-encoded CKA_ID of the certificate on a token.

Configure either this or file, but not both, in one section. Again: one lane 🌈

  • connections.<conn>.remote<suffix>.cert<suffix>.slot [] β€” optional slot number of the token that stores the certificate.
  • connections.<conn>.remote<suffix>.cert<suffix>.module [] β€” optional PKCS#11 module name.
  • connections.<conn>.remote<suffix>.cacerts [] β€” comma separated list of CA certificates to accept for authentication. These may use a relative path from the swanctl x509ca directory, or an absolute path. Note the x509ca, not x509 β€” different folder, don't get it twisted πŸ’€
  • connections.<conn>.remote<suffix>.cacert<suffix> [] β€” a section for a CA certificate to accept for authentication. Certificates in cacerts are transmitted as binary blobs, these sections are the flexible glow-up version ✨
    • connections.<conn>.remote<suffix>.cacert<suffix>.file [] β€” absolute path to the certificate to load. Passed as-is to the daemon, so it must be readable by it.

Configure either this or handle, but not both, in one section.

  • connections.<conn>.remote<suffix>.cacert<suffix>.handle [] β€” hex-encoded CKA_ID of the CA certificate on a token.

Configure either this or file, but not both, in one section.

  • connections.<conn>.remote<suffix>.cacert<suffix>.slot [] β€” optional slot number of the token that stores the CA certificate.
  • connections.<conn>.remote<suffix>.cacert<suffix>.module [] β€” optional PKCS#11 module name.
  • connections.<conn>.remote<suffix>.ca_id [] β€” the specified identity must be contained in one (intermediate) CA of the remote peer's trustchain, either as subject or as subjectAltName. This has the same effect as specifying cacerts to force clients under a CA into specific connections β€” except it doesn't require the CA certificate to be available locally, and it can be received from the peer during the IKE exchange. Free CA delivery, we love to see it πŸ¦‹
  • connections.<conn>.remote<suffix>.pubkeys [] β€” comma separated list of raw public keys to accept for authentication. The public keys may use a relative path from the swanctl pubkey directory, or an absolute path. Raw. Unfiltered. Public πŸ”₯
  • connections.<conn>.remote<suffix>.revocation [relaxed] β€” certificate revocation policy for CRL or OCSP revocation. Three moods, choose wisely:

A strict revocation policy fails if no revocation information is available β€” i.e. the certificate is not known to be unrevoked. Ignorance is not bliss here 😭

ifuri fails only if a CRL/OCSP URI is available but certificate revocation checking fails β€” i.e. there should have been revocation info available, but it couldn't be obtained.

The default, relaxed, fails only if a certificate is revoked β€” i.e. it's explicitly known to be bad. Live and let live, until the cert is caught being messy πŸ’€

  • connections.<conn>.remote<suffix>.auth [pubkey] β€” the authentication to expect from the remote. See the local section's auth keyword description for the details of the supported mechanisms. Default is pubkey, as the manpage says, and it's lowkey the safest vibe πŸ‘‘

So like, to require a trustchain public key strength for the remote side, you specify the key type and then the minimum strength in bits after it β€” for example ecdsa-384 or rsa-2048-ecdsa-256. And if you want to limit the acceptable set of hashing algorithms for trustchain validation? You just append hash algorithms to pubkey or to a key strength definition, like pubkey-sha256-sha512, rsa-2048-sha256-sha384-sha512 or rsa-2048-sha256-ecdsa-256-sha256-sha384. 🫢

Unless it's disabled in strongswan.conf(5), or explicit IKEv2 signature constraints are configured (peep the description of the local section's auth keyword for the deets), those key types and hash algorithms also get applied as constraints against IKEv2 signature authentication schemes used by the remote side. Also, if you want to require RSASSA-PSS signatures, use rsa/pss instead of pubkey or rsa, like rsa/pss-sha256 for example. And heads up: if pubkey or rsa constraints are configured, RSASSA-PSS signatures will only be accepted if enabled in strongswan.conf(5). πŸ’…

To specify trust chain constraints for EAP-(T)TLS, you append a colon to the EAP method, then the key type/size and hash algorithm like we talked about above (e.g. eap-tls:ecdsa-384-sha384). Slay.


connections.<conn>.children.<child>

Okay so this is the CHILD_SA configuration sub-section, and it's kind of a big deal. Each connection definition may have one or more sections in its children subsection. The section name is literally what defines the name of the CHILD_SA configuration, and it must be unique within the connection β€” no duplicates, bestie, the vibe check will fail. πŸ’€


connections.<conn>.children.<child>.ah_proposals []

AH proposals to offer for the CHILD_SA. A proposal is a set of algorithms. For AH, that includes an integrity algorithm and an optional key exchange method. If a KE method is specified, CHILD_SA/Quick Mode rekeying and initial negotiation uses a separate key exchange using the negotiated method (refer to esp_proposals for the details, iykyk).

With peers that support multiple IKEv2 key exchanges (RFC 9370), up to seven additional key exchanges may be negotiated. You configure them by prefixing the algorithm keyword with keX_ (where X is a number between 1 and 7). ✨

For IKEv2, multiple algorithms of the same kind can be specified in a single proposal, and one gets selected from them. For IKEv1 though? Only one algorithm per kind is allowed per proposal, and more algorithms get implicitly stripped. So use multiple proposals to offer different algorithm combinations with IKEv1. 😭

Algorithm keywords get separated using dashes. Multiple proposals may be separated by commas. The special value default forms a default proposal of supported algorithms considered safe, and is usually a good choice for interoperability. By default no AH proposals are included β€” instead ESP is proposed. Periodt.


connections.<conn>.children.<child>.esp_proposals [default]

ESP proposals to offer for the CHILD_SA. A proposal is a set of algorithms. For non-AEAD ESP proposals, this includes an integrity algorithm, an encryption algorithm, an optional key exchange method and an optional Extended Sequence Number Mode indicator. For AEAD proposals, a combined mode algorithm is used instead of the separate encryption/integrity algorithms. πŸŽ€

If a key exchange method is negotiated, CHILD_SA/Quick Mode rekeying and initial negotiation use a separate key exchange using the specified method. However β€” and this is the important bit β€” for IKEv2, the keys of the CHILD_SA created implicitly with the IKE_SA will always be derived from the IKE_SA's key material. So any key exchange method specified here will only apply when the CHILD_SA is later rekeyed or is created with a separate CREATE_CHILD_SA exchange. A proposal mismatch might, therefore, not immediately be noticed when the SA is established, but may later cause rekeying to fail. 😭 Sneaky. If one or more key exchange methods are configured in a proposal, the key exchange can be made optional by also adding none.

With peers that support multiple IKEv2 key exchanges (RFC 9370), up to seven additional key exchanges may be negotiated. They can be configured by prefixing the algorithm keyword with keX_ (where X is a number between 1 and 7). Additional key exchanges can be made optional by adding keX_none to a proposal.

Extended Sequence Number support may be indicated with the esn and noesn values, and both may be included to indicate support for both modes. If omitted, noesn is assumed.

For IKEv2, multiple algorithms of the same kind can be specified in a single proposal, from which one gets selected. For IKEv1, only one algorithm per kind is allowed per proposal, more algorithms get implicitly stripped. Use multiple proposals to offer different algorithm combinations with IKEv1.

Algorithm keywords get separated using dashes. Multiple proposals may be separated by commas. The special value default forms a default proposal of supported algorithms considered safe, and is usually a good choice for interoperability. If no algorithms are specified for AH nor ESP, the default set of algorithms for ESP is included. πŸ¦‹


connections.<conn>.children.<child>.sha256_96 [no]

HMAC-SHA-256 is used with 128-bit truncation with IPsec. For compatibility with implementations that incorrectly use 96-bit truncation, this option may be enabled to configure the shorter truncation length in the kernel. Just know this is not negotiated, so it only works with peers that use the incorrect truncation length (or have this option enabled). πŸ™ˆ


connections.<conn>.children.<child>.local_ts [dynamic]

Comma separated list of local traffic selectors to include in CHILD_SA. Each selector is a CIDR subnet definition, followed by an optional proto/port selector. The special value dynamic may be used instead of a subnet definition, which gets replaced by the tunnel outer address or the virtual IP, if negotiated. This is the default, bestie. πŸ’–

A protocol/port selector is surrounded by opening and closing square brackets. Between these brackets, a numeric or getservent(3) protocol name may be specified. After the optional protocol restriction, an optional port restriction may be specified, separated by a slash. The port restriction may be numeric, a getservent(3) service name, or the special value opaque for RFC 4301 OPAQUE selectors. Port ranges may be specified as well β€” none of the kernel backends currently support port ranges, though, so like… don't count on it. If the protocol is icmp or ipv6-icmp, the port is interpreted as ICMP message type if it is less than 256, or as type and code if it is greater or equal to 256, with the type in the most significant 8 bits and the code in the least significant 8 bits. Math era. πŸ”₯

When IKEv1 is used only the first selector is interpreted, except if the Cisco Unity extension plugin is used. This is due to a limitation of the IKEv1 protocol, which only allows a single pair of selectors per CHILD_SA. So to tunnel traffic matched by several pairs of selectors when using IKEv1, several children (CHILD_SAs) have to be defined that cover the selectors. Annoying but iconic.

The IKE daemon uses traffic selector narrowing for IKEv1, the same way it is standardized and implemented for IKEv2. However, this may lead to problems with other implementations. To avoid that, configure identical selectors in such scenarios. πŸ’…


connections.<conn>.children.<child>.remote_ts [dynamic]

Comma separated list of remote selectors to include in CHILD_SA. See local_ts for a description of the selector syntax. That's it, that's the whole thing. 🌸


connections.<conn>.children.<child>.rekey_time [1h or life_time - 10%]

Time to schedule CHILD_SA rekeying. CHILD_SA rekeying refreshes key material, optionally using a Diffie-Hellman exchange if a group is specified in the proposal. πŸ”„

To avoid rekey collisions initiated by both ends simultaneously, a value in the range of rand_time gets subtracted to form the effective soft lifetime.

If life_time is explicitly configured, rekey_time defaults to 10% less than that, otherwise CHILD_SA rekeying is scheduled every hour, minus rand_time.


connections.<conn>.children.<child>.life_time [rekey_time + 10%]

Maximum lifetime before CHILD_SA gets closed. Usually this hard lifetime is never reached, because the CHILD_SA gets rekeyed before. If that fails for whatever reason, this limit closes the CHILD_SA. 🫢

The default is 10% more than the rekey_time.


connections.<conn>.children.<child>.rand_time [life_time - rekey_time]

Time range from which to choose a random value to subtract from rekey_time. The default is the difference between life_time and rekey_time.


connections.<conn>.children.<child>.rekey_bytes [0 or life_bytes - 10%]

Number of bytes processed before initiating CHILD_SA rekeying. CHILD_SA rekeying refreshes key material, optionally using a Diffie-Hellman exchange if a group is specified in the proposal. ✨

To avoid rekey collisions initiated by both ends simultaneously, a value in the range of rand_bytes gets subtracted to form the effective soft volume limit.

Volume based CHILD_SA rekeying is disabled by default. If life_bytes is explicitly configured, rekey_bytes defaults to 10% less than that.


connections.<conn>.children.<child>.life_bytes [rekey_bytes + 10%]

Maximum bytes processed before CHILD_SA gets closed. Usually this hard volume limit is never reached, because the CHILD_SA gets rekeyed before. If that fails for whatever reason, this limit closes the CHILD_SA.

The default is 10% more than rekey_bytes.


connections.<conn>.children.<child>.rand_bytes [life_bytes - rekey_bytes]

Byte range from which to choose a random value to subtract from rekey_bytes. The default is the difference between life_bytes and rekey_bytes.


connections.<conn>.children.<child>.rekey_packets [0 or life_packets - 10%]

Number of packets processed before initiating CHILD_SA rekeying. CHILD_SA rekeying refreshes key material, optionally using a Diffie-Hellman exchange if a group is specified in the proposal. πŸ¦‹

okay so bestie, when both ends start rekeying at the exact same time, that's a whole rekey collision moment πŸ’€. To avoid rekey collisions initiated by both ends simultaneously, a value in the range of rand_packets gets subtracted to form the effective soft packet count limit. ✨

Packet count based CHILD_SA rekeying is disabled by default. If life_packets is explicitly configured, rekey_packets defaults to 10% less than that. periodt.

  • connections.<conn>.children.<child>.life_packets [rekey_packets + 10%] β€” Maximum number of packets processed before CHILD_SA gets closed. Usually this hard packets limit is never reached, because the CHILD_SA gets rekeyed before. If that fails for whatever reason, this limit closes the CHILD_SA.

The default is 10% more than rekey_bytes.

  • connections.<conn>.children.<child>.rand_packets [life_packets - rekey_packets] β€” Packet range from which to choose a random value to subtract from rekey_packets. The default is the difference between life_packets and rekey_packets.
  • connections.<conn>.children.<child>.updown [] β€” Updown script to invoke on CHILD_SA up and down events.
  • connections.<conn>.children.<child>.hostaccess [no] β€” Hostaccess variable to pass to updown script.
  • connections.<conn>.children.<child>.mode [tunnel] β€” IPsec Mode to establish CHILD_SA with. tunnel negotiates the CHILD_SA in IPsec Tunnel Mode, whereas transport uses IPsec Transport Mode. transport_proxy signifying the special Mobile IPv6 Transport Proxy Mode. iptfs is IP-TFS tunnel mode with aggregation and fragmentation. beet is the Bound End to End Tunnel mixture mode, working with fixed inner addresses without the need to include them in each packet. πŸ¦‹

The transport, iptfs and beet modes are subject to mode negotiation; tunnel mode is negotiated if the preferred mode is not available.

pass and drop are used to install shunt policies which explicitly bypass the defined traffic from IPsec processing or drop it, respectively. no cap.

  • connections.<conn>.children.<child>.policies [yes] β€” Whether to install IPsec policies or not. Disabling this can be useful in some scenarios e.g. MIPv6, where policies are not managed by the IKE daemon.
  • connections.<conn>.children.<child>.policies_fwd_out [no] β€” Whether to install outbound FWD IPsec policies or not. Enabling this is required in case there is a drop policy that would match and block forwarded traffic for this CHILD_SA.
  • connections.<conn>.children.<child>.dpd_action [clear] β€” Action to perform for this CHILD_SA on DPD timeout. The default clear closes the CHILD_SA and does not take further action. trap installs a trap policy, which will catch matching traffic and tries to re-negotiate the tunnel on-demand (note that this is redundant if start_action includes trap). restart immediately tries to re-negotiate the CHILD_SA under a fresh IKE_SA.
  • connections.<conn>.children.<child>.ipcomp [no] β€” Enable IPComp compression before encryption. If enabled, IKE tries to negotiate IPComp compression to compress ESP payload data prior to encryption.
  • connections.<conn>.children.<child>.inactivity [0s] β€” Timeout before closing CHILD_SA after inactivity. If no traffic has been processed in either direction for the configured timeout, the CHILD_SA gets closed due to inactivity. The default value of 0 disables inactivity checks. 🫢
  • connections.<conn>.children.<child>.reqid [0] β€” Fixed reqid to use for this CHILD_SA. This might be helpful in some scenarios, but works only if each CHILD_SA configuration is instantiated not more than once. The default of 0 uses dynamic reqids, allocated incrementally.
  • connections.<conn>.children.<child>.priority [0] β€” Optional fixed priority for IPsec policies. This could be useful to install high-priority drop policies. The default of 0 uses dynamically calculated priorities based on the size of the traffic selectors.
  • connections.<conn>.children.<child>.interface [] β€” Optional interface name to restrict IPsec policies.
  • connections.<conn>.children.<child>.mark_in [0/0x00000000] β€” Netfilter mark and mask for input traffic. On Linux, Netfilter may require marks on each packet to match an SA/policy having that option set. This allows installing duplicate policies and enables Netfilter rules to select specific SAs/policies for incoming traffic. Note that inbound marks are only set on policies, by default, unless mark_in_sa is enabled. The special value %unique sets a unique mark on each CHILD_SA instance, beyond that the value %unique-dir assigns a different unique mark for each CHILD_SA direction (in/out). πŸ‘‘

An additional mask may be appended to the mark, separated by /. The default mask if omitted is 0xffffffff.

  • connections.<conn>.children.<child>.mark_in_sa [no] β€” Whether to set mark_in on the inbound SA. By default, the inbound mark is only set on the inbound policy. The tuple destination address, protocol and SPI is unique and the mark is not required to find the correct SA, allowing to mark traffic after decryption instead (where more specific selectors may be used) to match different policies. Marking packets before decryption is still possible, even if no mark is set on the SA. πŸ’…
  • connections.<conn>.children.<child>.mark_out [0/0x00000000] β€” Netfilter mark and mask for output traffic. On Linux, Netfilter may require marks on each packet to match a policy/SA having that option set. This allows installing duplicate policies and enables Netfilter rules to select specific policies/SAs for outgoing traffic. The special value %unique sets a unique mark on each CHILD_SA instance, beyond that the value %unique-dir assigns a different unique mark for each CHILD_SA direction (in/out).

An additional mask may be appended to the mark, separated by /. The default mask if omitted is 0xffffffff.

  • connections.<conn>.children.<child>.set_mark_in [0/0x00000000] β€” Netfilter mark applied to packets after the inbound IPsec SA processed them. This way it's not necessary to mark packets via Netfilter before decryption or right afterwards to match policies or process them differently (e.g. via policy routing). 🌈

An additional mask may be appended to the mark, separated by /. The default mask if omitted is 0xffffffff. The special value %same uses the value (but not the mask) from mark_in as mark value, which can be fixed, %unique or %unique-dir.

Setting marks in XFRM input requires Linux 4.19 or higher.

  • connections.<conn>.children.<child>.set_mark_out [0/0x00000000] β€” Netfilter mark applied to packets after the outbound IPsec SA processed them. This allows processing ESP packets differently than the original traffic (e.g. via policy routing).

An additional mask may be appended to the mark, separated by /. The default mask if omitted is 0xffffffff. The special value %same uses the value (but not the mask) from mark_out as mark value, which can be fixed, %unique or %unique-dir.

Setting marks in XFRM output is supported since Linux 4.14. Setting a mask requires at least Linux 4.19.

  • connections.<conn>.children.<child>.if_id_in [0] β€” XFRM interface ID set on inbound policies/SA. This allows installing duplicate policies/SAs and associates them with an interface with the same ID. The special value %unique sets a unique interface ID on each CHILD_SA instance, beyond that the value %unique-dir assigns a different unique interface ID for each CHILD_SA direction (in/out).
  • connections.<conn>.children.<child>.if_id_out [0] β€” XFRM interface ID set on outbound policies/SA. This allows installing duplicate policies/SAs and associates them with an interface with the same ID. The special value %unique sets a unique interface ID on each CHILD_SA instance, beyond that the value %unique-dir assigns a different unique interface ID for each CHILD_SA direction (in/out).

The daemon will not install routes for CHILD_SAs that have this option set.

  • connections.<conn>.children.<child>.label [] β€” Optional security label (e.g. SELinux context), IKEv2 only. Refer to label_mode for details on how labels are processed.
  • connections.<conn>.children.<child>.label_mode [system] β€” Defines the mode in which the configured security label is used. The default value of system selects selinux if strongSwan was built with SELinux support and SELinux is enabled by the kernel, otherwise, simple will be selected. 🧚

If set to simple, the label will be used as is as an additional identifier/selector on the IKEv2 level when negotiating CHILD_SAs and selecting configs, labels are not installed in the kernel and received labels have to match exactly.

If set to selinux, which is only allowed if SELinux is usable on the system, the configured label is expected to be a generic context (e.g. system_u:object_r:ipsec_spd_t:s0) for which flows, whose context match it via association:polmatch, will trigger an acquire if no SA exists yet for the flow's specific context. The configured label is installed on (trap) policies, so this should generally be combined with trap in start_action. However, if the connection is initiated directly, without acquire, a childless IKE_SA is established and appropriate trap policies are installed on both ends. Labels received from peers are accepted if they match the configured label via association:polmatch.

  • connections.<conn>.children.<child>.tfc_padding [0] β€” Pads ESP packets with additional data to have a consistent ESP packet size for improved Traffic Flow Confidentiality. The padding defines the minimum size of all ESP packets sent.

The default value of 0 disables TFC padding, the special value mtu adds TFC padding to create a packet size equal to the Path Maximum Transfer Unit.

  • connections.<conn>.children.<child>.replay_window [32] β€” IPsec replay window to configure for this CHILD_SA. Larger values than the default of 32 are supported using the Netlink backend only, a value of 0 disables IPsec replay protection. πŸŽ€
  • connections.<conn>.children.<child>.per_cpu_sas [no] β€” turn on per-CPU CHILD_SAs ✨ heads up though: this literally requires trap in start_action, no cap.

The value encap enables a special type of UDP encapsulation (and yeah, you gotta enable encap for the connection too if there's no NAT 🫢), where a random source port gets used for every outbound per-CPU SA β€” the destination port for all of them stays 4500 forever. Why? So you can use the port for RSS if the SPI can't be used πŸ’…. But bestie, listen: this behavior is not standardized and not negotiated. So regardless of whether the option is enabled, inbound per-CPU SAs with UDP-encapsulation always have the source port set to 0, because the peer's random port is unknown if it has this option enabled 😭.

  • connections.<conn>.children.<child>.hw_offload [no] β€” enable hardware offload for this CHILD_SA, if your IPsec implementation supports it πŸ”₯. The value crypto or packet enforces crypto or full packet offloading, and the installation will fail if the selected mode isn't supported by either the kernel or the device πŸ’€. On Linux, packet also offloads policies, including trap policies πŸ‘‘. The value auto enables full packet or crypto offloading if either one is supported, but the installation does not fail otherwise β€” it's giving chill vibes only 🌸.
  • connections.<conn>.children.<child>.copy_df [yes] β€” whether to copy the DF bit to the outer IPv4 header in tunnel mode. This effectively disables Path MTU discovery (PMTUD) πŸ™ˆ. Controlling this behavior is not supported by all kernel interfaces, iykyk.
  • connections.<conn>.children.<child>.copy_ecn [yes] β€” whether to copy the ECN (Explicit Congestion Notification) header field to/from the outer IP header in tunnel mode πŸ¦‹. Same deal: controlling this behavior is not supported by all kernel interfaces.
  • connections.<conn>.children.<child>.copy_dscp [out] β€” whether to copy the DSCP (Differentiated Services Field Codepoint) header field to/from the outer IP header in tunnel mode. Let's break the values down, because there's a lot going on here πŸ‘€:
    • out only copies the field from the inner to the outer header.
    • in does the opposite β€” it only copies the field from the outer to the inner header when decapsulating.
    • yes copies the field in both directions.
    • no disables copying the field altogether.

Setting this to yes or in could allow an attacker to adversely affect other traffic at the receiver, which is why the default is out ⚠️. And once again: controlling this behavior is not supported by all kernel interfaces.

  • connections.<conn>.children.<child>.icmp [no] β€” okay so ICMP error messages (think Destination Unreachable, Time Exceeded, or Fragmentation Needed) may be generated by a host whose IP address isn't included in the negotiated traffic selectors and therefore doesn't match the IPsec policies 😬. If this option is enabled and the kernel supports it, such packets may still be forwarded πŸ’–. And since ICMP errors contain parts of the IP packet that triggered them, the kernel will base its decision on a reverse policy lookup using that IP header. Cute, right? πŸŽ€
  • connections.<conn>.children.<child>.start_action [none] β€” the action to perform after loading the configuration. The default of none loads the connection only, which then can be manually initiated or used as a responder configuration.

The value trap installs a trap policy, which triggers the tunnel as soon as matching traffic has been detected πŸ‘€. The value start initiates the connection actively πŸ”₯. These two modes can be combined with trap|start, to immediately initiate a connection for which trap policies have been installed β€” yes, you can have both, main character energy πŸ’….

When unloading or replacing a CHILD_SA configuration having a start_action different from none, the inverse action is performed. Configurations with start get closed, while such with trap get uninstalled (both happens for connections with trap|start).

  • connections.<conn>.children.<child>.close_action [none] β€” what to do after a CHILD_SA gets closed by the peer. The default of none does not take any action, trap installs a trap policy for the CHILD_SA (note that this is redundant if start_action includes trap πŸ™ˆ), and start tries to immediately re-create the CHILD_SA.
Big caveat, bestie: close_action does not provide any guarantee that the CHILD_SA is kept alive 😭. It acts on explicit close messages only, but not on negotiation failures. Use trap policies to reliably re-create failed CHILD_SAs, fr fr.
  • secrets β€” the section defining secrets for IKE/EAP/XAuth authentication and private key decryption πŸ”. The secrets section takes sub-sections having a specific prefix which defines the secret type.
It is not recommended to define any private key decryption passphrases, as then there is no real security benefit in having encrypted keys πŸ’€. Either store the key unencrypted or enter the keys manually when loading credentials. Periodt.
  • secrets.eap<suffix> β€” EAP secret section for a specific secret. Each EAP secret is defined in a unique section having the eap prefix. EAP secrets are used for XAuth authentication as well 🫢.
  • secrets.eap<suffix>.secret [] β€” value of the EAP/XAuth secret. It may either be an ASCII string, a hex encoded string if it has a 0x prefix, or a Base64 encoded string if it has a 0s prefix in its value ✨.
  • secrets.eap<suffix>.id<suffix> [] β€” identity the EAP/XAuth secret belongs to. Multiple unique identities may be specified, each having an id prefix, if a secret is shared between multiple users πŸ‘―.
  • secrets.xauth<suffix> β€” XAuth secret section for a specific secret. Honestly xauth is just an alias for eap β€” secrets under both section prefixes are used for both EAP and XAuth authentication πŸ’….
  • secrets.ntlm<suffix> β€” NTLM secret section for a specific secret. Each NTLM secret is defined in a unique section having the ntlm prefix. NTLM secrets may only be used for EAP-MSCHAPv2 authentication.
  • secrets.ntlm<suffix>.secret [] β€” value of the NTLM secret, which is the NT Hash of the actual secret, that is, MD4(UTF-16LE(secret)) 🧚. The resulting 16-byte value may either be given as a hex encoded string with a 0x prefix or as a Base64 encoded string with a 0s prefix.
  • secrets.ntlm<suffix>.id<suffix> [] β€” identity the NTLM secret belongs to. Multiple unique identities may be specified, each having an id prefix, if a secret is shared between multiple users 🌈.
  • secrets.ike<suffix> β€” IKE preshared secret section for a specific secret. Each IKE PSK is defined in a unique section having the ike prefix πŸ”‘.
  • secrets.ike<suffix>.secret [] β€” value of the IKE preshared secret. It may either be an ASCII string, a hex encoded string if it has a 0x prefix, or a Base64 encoded string if it has a 0s prefix in its value.
  • secrets.ike<suffix>.id<suffix> [] β€” IKE identity the IKE preshared secret belongs to. Multiple unique identities may be specified, each having an id prefix, if a secret is shared between multiple peers πŸ’œ.
  • secrets.ppk<suffix> β€” Postquantum Preshared Key (PPK) section for a specific secret. Each PPK is defined in a unique section having the ppk prefix 🌸.
  • secrets.ppk<suffix>.secret [] β€” value of the PPK. It may either be an ASCII string, a hex encoded string if it has a 0x prefix, or a Base64 encoded string if it has a 0s prefix in its value. Should have at least 256 bits of entropy for 128-bit security πŸ”₯.
  • secrets.ppk<suffix>.id<suffix> [] β€” PPK identity the PPK belongs to. Multiple unique identities may be specified, each having an id prefix, if a secret is shared between multiple peers.
  • secrets.private<suffix> β€” private key decryption passphrase for a key in the private folder πŸ—‚οΈ.
  • secrets.private<suffix>.file [] β€” file name in the private folder for which this passphrase should be used.
  • secrets.private<suffix>.secret [] β€” value of decryption passphrase for private key.
  • secrets.rsa<suffix> β€” private key decryption passphrase for a key in the rsa folder.
  • secrets.rsa<suffix>.file [] β€” file name in the rsa folder for which this passphrase should be used.
  • secrets.rsa<suffix>.secret [] β€” value of decryption passphrase for RSA key.
  • secrets.ecdsa<suffix> β€” private key decryption passphrase for a key in the ecdsa folder 🌿.
  • secrets.ecdsa<suffix>.file [] β€” file name in the ecdsa folder for which this passphrase should be used.
  • secrets.ecdsa<suffix>.secret [] β€” value of decryption passphrase for ECDSA key.
  • secrets.pkcs8<suffix> β€” private key decryption passphrase for a key in the pkcs8 folder πŸ“¦.
  • secrets.pkcs8<suffix>.file [] β€” file name in the pkcs8 folder for which this passphrase should be used.
  • secrets.pkcs8<suffix>.secret [] β€” value of decryption passphrase for PKCS#8 key.
  • secrets.pkcs12<suffix> β€” PKCS#12 decryption passphrase for a container in the pkcs12 folder πŸŽ€.
  • secrets.pkcs12<suffix>.file [] β€” file name in the pkcs12 folder for which this passphrase should be used.
  • secrets.pkcs12<suffix>.secret [] β€” value of decryption passphrase for PKCS#12 container.
  • secrets.token<suffix> β€” definition for a private key that's stored on a token/smartcard πŸ’³βœ¨.
  • secrets.token<suffix>.handle [] β€” hex-encoded CKA_ID of the private key on the token.
  • secrets.token<suffix>.slot [] β€” optional slot number to access the token.
  • secrets.token<suffix>.module [] β€” optional PKCS#11 module name to access the token.
  • secrets.token<suffix>.pin [] β€” optional PIN required to access the key on the token. If none is provided, the user is prompted during an interactive --load-creds call πŸ™ˆ.
  • pools β€” the section defining named pools 🌊. Named pools may be referenced by connections with the pools option to assign virtual IPs and other configuration attributes. Very handy, ngl.
  • pools.<name> β€” section defining a single pool with a unique name πŸ‘‘.

okay bestie, we're still deep in the config sauce, so let's keep the pool-and-authority lore going ✨

  • pools.<name>.addrs [] β€” this is the subnet or range that defines the addresses allocated in the pool. It accepts a single CIDR subnet defining the pool to allocate addresses from, or an address range in the form <from>-<to>. If the address in CIDR notation isn't the network ID of the subnet β€” like 10.1.0.5/24 instead of 10.1.0.0/24 β€” then addresses below it won't be allocated to clients. Those could, for example, be assigned manually to internal hosts like the VPN server itself. Pools must be unique and non-overlapping, periodt.
  • pools.<name>.<attr> [] β€” a comma separated list of additional attributes of type <attr>. The attribute type may be one of dns, nbns, dhcp, netmask, server, subnet, p_cscf, split_include and split_exclude to define addresses or CIDR subnets for the corresponding attribute types. Alternatively, <attr> can be a numerical identifier, and for that, string attribute values are accepted as well. iykyk 🫢
  • authorities β€” section defining attributes of certification authorities. This is where the CA lore lives πŸ‘‘
  • authorities.<name> β€” section defining a certification authority with a unique name. main character energy, but make it unique ✨
  • authorities.<name>.cacert [] β€” the CA certificate belonging to the certification authority. The certificates may use a relative path from the swanctl x509ca directory or an absolute path.

Configure one of cacert, file, or handle per section.

  • authorities.<name>.file [] β€” absolute path to the certificate to load. It's passed as-is to the daemon, so it must be readable by it.

Configure one of cacert, file, or handle per section.

  • authorities.<name>.handle [] β€” hex-encoded CKA_ID of the CA certificate on a token.

Configure one of cacert, file, or handle per section.

  • authorities.<name>.slot [] β€” optional slot number of the token that stores the CA certificate.
  • authorities.<name>.module [] β€” optional PKCS#11 module name.
  • authorities.<name>.crl_uris [] β€” comma-separated list of CRL distribution points (ldap, http, or file URI).
  • authorities.<name>.ocsp_uris [] β€” comma-separated list of OCSP URIs.
  • authorities.<name>.cert_uri_base [] β€” defines the base URI for the Hash and URL feature supported by IKEv2. Instead of exchanging complete certificates, IKEv2 allows one to send an URI that resolves to the DER encoded certificate. The certificate URIs are built by appending the SHA1 hash of the DER encoded certificates to this base URI. literally certificate-URI math, bestie 🧚
⚠️ little vibe check: pools must be unique and non-overlapping, and file certs have to be readable by the daemon because they're passed as-is. No cap.

πŸ—‚οΈ FILES πŸ—‚οΈ

  • /etc/swanctl/swanctl.conf β€” configuration file πŸ’–

πŸ‘€ SEE ALSO πŸ‘€


and that's the whole page, bestie πŸ’… the footer's serving version 6.1.0 and the SWANCTL.CONF(5) manual page label β€” no separate date line printed, so I'm not inventing one πŸ˜­πŸ’–

πŸ“¦ where this page comes from