TheDocumentation 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.
--terminate command instructs the strongSwan IKE daemon to delete one or more Security Associations. It sends an IKEv2 INFORMATIONAL exchange with a DELETE payload to the remote peer, then removes the local SA and associated kernel policies.
Synopsis
You must specify exactly one of
--child, --ike, --child-id, or --ike-id.
Terminating an IKE_SA also tears down all CHILD_SAs within it.Options
Terminate all CHILD_SAs that match the given configuration name. All active
CHILD_SAs derived from this config across any IKE_SA will be deleted.
Terminate the IKE_SA matching the given configuration name, including all of
its CHILD_SAs.
Terminate a single CHILD_SA by its unique numeric identifier. Use
swanctl --list-sas to find the ID (shown as #<id> in the CHILD_SA line).Terminate a single IKE_SA by its unique numeric identifier. The ID is shown
as
#<id> in the IKE_SA header from swanctl --list-sas.Tear down the SA locally without waiting for the DELETE exchange to complete.
Use this when the remote peer is unreachable or unresponsive.
Seconds to wait for the DELETE exchange to finish before detaching.
0
(default) waits indefinitely. When combined with --force, the daemon still
sends the DELETE but does not wait for acknowledgement.Verbosity of log messages streamed back over the
control-log VICI event.
Range: 0 (errors only) to 4 (full debug).Print the raw VICI response message.
Print the raw VICI response with pretty-print indentation. Implies
--raw.VICI socket URI. Overrides the default
unix:///var/run/charon.vici.Examples
Terminate an IKE_SA by config name
This closes the IKE_SA and all CHILD_SAs belonging to thenet-net connection:
Terminate a specific CHILD_SA by config name
Only the CHILD_SA is removed; the parent IKE_SA remains active:Terminate by unique ID
Use the numeric ID fromswanctl --list-sas output when multiple SAs share
the same config name:
Force-delete an unreachable peer
When the remote gateway is down and you need to clean up local state immediately:Exit codes
| Code | Meaning |
|---|---|
0 | SA terminated successfully |
1 | Termination failed (error message printed to stderr) |
| other | Connection to VICI socket failed or unexpected error |
See also
swanctl --initiate— establish a new SAswanctl --list-sas— find SA names and IDs before terminatingswanctl --rekey— rekey instead of tearing down