These commands control the lifecycle of IKE and CHILD Security Associations (SAs) in the running daemon.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.
initiate
Initiate a CHILD_SA while streamingcontrol-log events. The command blocks (or times out) until the initiation completes or fails.
Input
Name of the CHILD_SA configuration to initiate.
Name of the IKE_SA configuration to initiate, or to search under when looking up
child.Timeout in milliseconds before returning.
0 (default) waits indefinitely. -1 returns immediately without waiting for a result.Set to
yes to allow configured limits (e.g. half-open SA limits) to prevent initiation.Log level (0–4) at which to emit
control-log events during initiation.yes if the CHILD_SA was established, no on failure or timeout.Human-readable error description on failure or timeout.
terminate
Terminate one or more SAs while streamingcontrol-log events. You can select SAs by configuration name or unique identifier.
Input
Terminate all CHILD_SAs with this configuration name.
Terminate the IKE_SA with this configuration name (and its CHILD_SAs).
Terminate the CHILD_SA with this unique numeric identifier.
Terminate the IKE_SA with this unique numeric identifier.
Set to
yes to terminate the IKE_SA without waiting for a proper DELETE exchange. If timeout is also given, waits for a response until the timeout is reached.Timeout in milliseconds before returning.
0 (default) waits indefinitely. -1 returns immediately.Log level (0–4) at which to emit
control-log events during termination.yes on success, no on failure.Number of SAs that matched the selection criteria.
Number of SAs that were actually terminated.
Human-readable error description on failure or timeout.
rekey
Initiate rekeying of an existing SA. For IKEv2 IKE_SAs, reauthentication can be triggered instead of rekeying. InputRekey the CHILD_SA with this configuration name.
Rekey the IKE_SA with this configuration name.
Rekey the CHILD_SA with this unique identifier.
Rekey the IKE_SA with this unique identifier.
Set to
yes to trigger reauthentication instead of rekeying for an IKEv2 IKE_SA.yes on success, no on failure.Number of SAs that matched the selection criteria.
Human-readable error description on failure.
redirect
Redirect a client-initiated IKE_SA to another gateway. Only applies to IKEv2 and requires peer support. InputRedirect the IKE_SA with this configuration name.
Redirect the IKE_SA with this unique identifier.
Redirect IKE_SAs with a matching peer IP address. Accepts a single IP, a CIDR subnet, or an IP range.
Redirect IKE_SAs with a matching peer IKE identity. Wildcards are supported.
yes on success, no on failure.Number of IKE_SAs that matched the selection criteria.
Human-readable error description on failure.
install
Install a trap, drop, or bypass policy defined by a CHILD_SA configuration without initiating an IKE exchange. InputName of the CHILD_SA configuration whose policy to install.
Optional IKE_SA configuration name to narrow the search for
child.yes on success, no on failure.Human-readable error description on failure.
uninstall
Uninstall a trap, drop, or bypass policy previously installed for a CHILD_SA configuration. InputName of the CHILD_SA configuration whose policy to uninstall.
Optional IKE_SA configuration name. If omitted, the first matching policy for
child is removed.yes on success, no on failure.Human-readable error description on failure.
list-sas
Stream all active IKE_SAs and their CHILD_SAs aslist-sa events.
This is a streaming command. Register for the list-sa event before issuing this command.
Input
Set to any value to use non-blocking mode (skip locked SAs instead of waiting).
Filter results to IKE_SAs with this configuration name.
Filter results to the IKE_SA with this unique identifier.
Filter results to IKE_SAs containing a CHILD_SA with this name.
Filter results to IKE_SAs containing a CHILD_SA with this unique identifier.
{}). All SA data arrives via list-sa events.
Python example
list-policies
Stream all installed trap, drop, and bypass policies aslist-policy events.
This is a streaming command. Register for the list-policy event before issuing this command.
Input
Set to
yes to include drop policies.Set to
yes to include bypass (pass) policies.Set to
yes to include trap policies.Filter by CHILD_SA configuration name.
Filter by IKE_SA configuration name.
{}). All policy data arrives via list-policy events.