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.
--initiate command tells the strongSwan IKE daemon (charon) to establish a new Security Association. You can target a specific CHILD_SA configuration by name, optionally scoped to a parent IKE_SA.
Synopsis
Either
--child or --ike must be specified. If only --ike is given, the daemon initiates the IKE_SA itself without bringing up a CHILD_SA.Options
Name of the CHILD_SA configuration to initiate. The CHILD_SA is defined inside
a
connections.<name>.children block in swanctl.conf. Required unless
--ike is given without a CHILD_SA target.Name of the IKE_SA configuration. When used together with
--child, this
scopes the CHILD_SA lookup to a specific IKE connection. When used alone,
initiates only the IKE_SA.Time in seconds to wait for the operation to complete before detaching.
0 (default) waits indefinitely. Use a positive value to detach after the
given number of seconds and let the daemon continue in the background.Verbosity of log messages streamed back over the
control-log VICI event
during the operation. Range: 0 (errors only) to 4 (full debug output).Print the raw VICI response message instead of the formatted summary.
Print the raw VICI response with pretty-print indentation. Implies
--raw.VICI socket URI to connect to. Overrides the default socket path
(
unix:///var/run/charon.vici). Useful when running multiple daemon
instances or connecting over TCP.Examples
Initiate a site-to-site CHILD_SA
Initiate a CHILD_SA under a named IKE_SA
When a connection has multiple CHILD_SA configurations, use--ike to
disambiguate if two connections share a CHILD_SA name:
Initiate with verbose logging
Non-blocking initiation
Pass a short timeout to detach immediately and let the daemon establish the tunnel in the background:Exit codes
| Code | Meaning |
|---|---|
0 | SA established successfully |
1 | Initiation failed (error message printed to stderr) |
| other | Connection to VICI socket failed or unexpected error |
See also
swanctl --terminate— tear down an established SAswanctl --list-sas— verify the SA is active after initiationswanctl --load-all— load configuration before initiating