Documentation Index
Fetch the complete documentation index at: https://mintlify.com/strongswan/strongswan/llms.txt
Use this file to discover all available pages before exploring further.
swanctl.conf is the main configuration file for the swanctl VPN manager. It uses a hierarchical key-value syntax. The top-level sections are connections, pools, secrets, and authorities.
connections
Defines IKE connection configurations. Each connection is a named subsection.connections.<conn> — IKE connection settings
IKE major version.
1 = IKEv1, 2 = IKEv2. The default 0 accepts both IKEv1 and IKEv2 as responder, and initiates with IKEv2.Local address(es) for IKE communication, comma-separated. Accepts IPs, DNS names, CIDR subnets, or ranges.
%any matches all addresses.Remote address(es) for IKE communication, comma-separated. To initiate a connection, at least one specific address or DNS name must be set.
Local UDP port for IKE. When port 500 is used, automatic IKE port floating to port 4500 is enabled to handle NAT.
Remote UDP port for IKE. Floating to port 4500 applies when this is 500.
Comma-separated IKE proposals to accept. Algorithms are separated by dashes within a proposal.
default uses a safe set of supported algorithms.Comma-separated virtual IPs to request via IKEv2 configuration payloads or IKEv1 Mode Config. Use
0.0.0.0 or :: to request any address.Comma-separated list of named IP pools (from the
pools section or an external pool) to allocate virtual IPs from.Time to schedule IKE SA rekeying. Refreshes key material using a Diffie-Hellman exchange without re-checking credentials. Set to
0 to disable.Time to schedule IKE reauthentication. Recreates the IKE SA from scratch and re-evaluates credentials. Disabled by default.
Hard IKE SA lifetime. If rekeying or reauthentication does not complete in time, the IKE SA is closed.
Random time subtracted from
rekey_time / reauth_time to avoid simultaneous rekeying on both peers.Enable MOBIKE on IKEv2 connections. MOBIKE allows client mobility and server multi-homing. Has no effect on IKEv1.
Use Aggressive Mode in IKEv1. Aggressive Mode is less secure because peer identities are exchanged unprotected. Avoid unless required for compatibility.
Interval for Dead Peer Detection (DPD) liveness checks.
0 disables active DPD.DPD timeout for IKEv1 only. IKEv2 uses the standard retransmission mechanism.
Send certificate request payloads to offer trusted CA certificates to the peer. Disabling reduces initial packet size when many CAs are installed.
Control when certificate payloads are sent. Accepted values:
ifasked (only when a certificate request is received), always, never.IKE fragmentation support. Accepted values:
yes, accept, force (IKEv1 only), no.Enforce UDP encapsulation of ESP packets by faking NAT-D payloads.
Number of retransmission sequences during initial connect.
0 retries indefinitely until established or a permanent error occurs.Connection uniqueness policy. Accepted values:
never, no, keep, replace.Default inbound XFRM interface ID inherited by child SAs.
%unique allocates a unique ID per IKE SA.Default outbound XFRM interface ID inherited by child SAs.
connections.<conn>.local / .remote — authentication rounds
Each connection can have one or morelocal and remote subsections. Suffix them (e.g. local-eap, remote1) for multiple authentication rounds.
Authentication method. Accepted values:
pubkey— certificate-based public key authenticationpsk— pre-shared keyeap/eap-<method>— EAP (IKEv2 only)xauth/xauth-<backend>— XAuth (IKEv1 only)
IKE identity for this authentication round. When using certificate authentication, this must appear in the certificate’s subject or SAN. For
remote, supports wildcards (e.g. *@strongswan.org) and regex.Comma-separated list of certificate files to use (local) or accept (remote). Relative paths are resolved from the swanctl
x509 directory.Comma-separated list of CA certificate files to accept for authentication. Relative paths are resolved from the swanctl
x509ca directory. (remote only)EAP identity. On the client side, this is the identity sent in the EAP-Identity exchange.
XAuth username used in the XAuth exchange. (local / client side only)
Comma-separated authorization group memberships required from the remote peer. (remote only)
Certificate revocation policy. Accepted values:
relaxed— fail only if the certificate is explicitly revoked (default)ifuri— fail if a CRL/OCSP URI is present but checking failsstrict— fail if no revocation information is available
connections.<conn>.children.<child> — CHILD SA settings
Local traffic selectors, comma-separated CIDR subnets.
dynamic resolves to the tunnel outer address or negotiated virtual IP.Remote traffic selectors, comma-separated CIDR subnets.
ESP proposals for the CHILD SA, comma-separated.
default uses a safe set of algorithms.AH proposals for the CHILD SA. ESP is used by default when neither is specified.
IPsec mode. Accepted values:
tunnel— IPsec Tunnel Mode (default)transport— IPsec Transport Modebeet— Bound End-to-End Tunnel modeiptfs— IP-TFS tunnel modepass— bypass traffic from IPsec processingdrop— drop matched traffic
Action after loading the configuration.
none— load only; initiate manually or act as respondertrap— install a trap policy, triggering the tunnel on matching trafficstart— initiate the connection immediatelytrap|start— combine both
Action when the CHILD SA is closed by the peer.
none, trap, or start.Action on DPD timeout. Accepted values:
clear (close and take no action), trap (install trap policy), restart (immediately re-negotiate).Time to schedule CHILD SA rekeying.
Maximum CHILD SA lifetime before closure.
Bytes processed before initiating CHILD SA rekeying.
0 disables volume-based rekeying.Packets processed before initiating CHILD SA rekeying.
0 disables packet-count-based rekeying.Close the CHILD SA after this period of inactivity in either direction.
0 disables inactivity checks.Path to a script invoked on CHILD SA up/down events.
Enable IPComp compression before ESP encryption.
IPsec replay window size.
0 disables replay protection.pools
Defines named IP address pools for virtual IP allocation.CIDR subnet or address range (
<from>-<to>) to allocate from. Pools must be unique and non-overlapping.Comma-separated DNS server addresses pushed to clients.
Comma-separated NBNS/WINS server addresses pushed to clients.
DHCP server address for dynamic attribute assignment.
Comma-separated subnets pushed as split-include routes.
Comma-separated subnets pushed as split-exclude routes.
secrets
Defines secrets for IKE PSK, EAP/XAuth, and private key decryption.IKE pre-shared keys
Value of the IKE PSK. ASCII string,
0x-prefixed hex, or 0s-prefixed Base64.IKE identity the PSK belongs to. Multiple
id entries are allowed.EAP / XAuth secrets
EAP or XAuth password.
xauth is an alias for eap; both are interchangeable.EAP/XAuth identity the secret belongs to. Multiple
id entries are allowed.Private key passphrases
Filename in the swanctl
private directory for which this passphrase applies.Decryption passphrase for the private key.
Token (HSM/smartcard) keys
Hex-encoded CKA_ID of the private key on the token.
Optional token slot number.
Optional PKCS#11 module name.
Optional PIN to access the key. If omitted, the PIN is prompted interactively during
swanctl --load-creds.authorities
Defines certification authority attributes for revocation checking and certificate URI base.CA certificate filename, relative to the swanctl
x509ca directory, or an absolute path.Absolute path to the CA certificate. Use instead of
cacert for paths outside the swanctl directory.Hex-encoded CKA_ID of the CA certificate on a token.
Comma-separated CRL distribution point URIs (LDAP, HTTP, or file).
Comma-separated OCSP responder URIs.
Base URI for Hash-and-URL certificate exchange (IKEv2). Certificates are retrieved by appending their SHA-1 hash to this URI.