ipsec » History » Version 31
Tobias Brunner, 14.01.2022 09:37
Note about established connections
1 | 12 | Martin Willi | h1. ipsec |
---|---|---|---|
2 | 1 | Martin Willi | |
3 | 24 | Tobias Brunner | {{>toc}} |
4 | 1 | Martin Willi | |
5 | 30 | Tobias Brunner | @ipsec@ is an umbrella command comprising a collection of individual sub commands that can be used to control and monitor IPsec connections as well as the IKE daemon. |
6 | 1 | Martin Willi | |
7 | 30 | Tobias Brunner | > *Important:* The @ipsec@ command controls the legacy [[Ipsecstarter|starter]] daemon and [[Ipsecstroke|stroke]] plugin. A more modern and flexible interface is provided via [[vici]] plugin and [[swanctl]] command since version:5.2.0. |
8 | 1 | Martin Willi | |
9 | 1 | Martin Willi | |
10 | 30 | Tobias Brunner | h2. Synopsis |
11 | 1 | Martin Willi | |
12 | 30 | Tobias Brunner | <pre> |
13 | 30 | Tobias Brunner | ipsec <command> [ <argument> ] [ <options> ] |
14 | 30 | Tobias Brunner | </pre> |
15 | 30 | Tobias Brunner | |
16 | 30 | Tobias Brunner | *Note*: Some distributions (e.g. Fedora and its offsprings) rename the @ipsec@ command to *@strongswan@* |
17 | 30 | Tobias Brunner | |
18 | 30 | Tobias Brunner | |
19 | 12 | Martin Willi | h2. Control Commands |
20 | 1 | Martin Willi | |
21 | 1 | Martin Willi | |
22 | 1 | Martin Willi | *ipsec start [ _<starter options>_ ]* |
23 | 15 | Daniel Mentz | |
24 | 19 | Tobias Brunner | p((. calls [[IpsecStarter|ipsec starter]] [ _<starter options>_ ] which in turn parses [[IpsecConf|ipsec.conf]] and starts the IKE daemon charon. |
25 | 12 | Martin Willi | |
26 | 12 | Martin Willi | *ipsec stop* |
27 | 15 | Daniel Mentz | |
28 | 19 | Tobias Brunner | p((. terminates all IPsec connection and stops the IKE daemon charon by sending a _TERM_ signal to [[IpsecStarter|ipsec starter]]. |
29 | 1 | Martin Willi | |
30 | 12 | Martin Willi | *ipsec restart [ _<starter options>_ ]* |
31 | 15 | Daniel Mentz | |
32 | 13 | Tobias Brunner | p((. is equivalent to *ipsec stop* followed by *ipsec start [ _<starter options>_ ]* after a guard period of 2 seconds. |
33 | 1 | Martin Willi | |
34 | 1 | Martin Willi | *ipsec update* |
35 | 15 | Daniel Mentz | |
36 | 31 | Tobias Brunner | p((. sends a _HUP_ signal to [[IpsecStarter|ipsec starter]] which in turn determines any changes in [[IpsecConf|ipsec.conf]] and updates the configuration on the running IKE daemon charon. This generally does not affect established connections, except those for which the configuration has changed (see #129). Such connections should be restarted manually. |
37 | 1 | Martin Willi | |
38 | 12 | Martin Willi | *ipsec reload* |
39 | 15 | Daniel Mentz | |
40 | 31 | Tobias Brunner | p((. sends a _USR1_ signal to [[IpsecStarter|ipsec starter]] which in turn reloads the whole configuration on the running IKE daemon charon based on the actual [[IpsecConf|ipsec.conf]]. All currently established connections could be affected by this (see #129), so using *ipsec update* is generally preferred. |
41 | 1 | Martin Willi | |
42 | 13 | Tobias Brunner | *ipsec up _<name>_* |
43 | 15 | Daniel Mentz | |
44 | 19 | Tobias Brunner | p((. tells the IKE daemon to start up connection _<name>_. Implemented by calling the [[IpsecStroke|ipsec stroke]] up _<name>_ command. |
45 | 12 | Martin Willi | |
46 | 13 | Tobias Brunner | *ipsec down _<name>_* |
47 | 15 | Daniel Mentz | |
48 | 19 | Tobias Brunner | p((. tells the IKE daemon to terminate connection _<name>_. Implemented by calling the [[IpsecStroke|ipsec stroke]] down _<name>_ command. |
49 | 12 | Martin Willi | |
50 | 16 | Daniel Mentz | *ipsec down _<name>{n}_* |
51 | 16 | Daniel Mentz | |
52 | 22 | Tobias Brunner | p((. terminates CHILD_SA instance n of connection <name>. Since _{n}_ uniquely identifis a CHILD_SA the name is optional. |
53 | 16 | Daniel Mentz | |
54 | 16 | Daniel Mentz | *ipsec down _<name>{<notextile>*</notextile>}_* |
55 | 16 | Daniel Mentz | |
56 | 19 | Tobias Brunner | p((. terminates all CHILD_SA instances of connection <name>. |
57 | 16 | Daniel Mentz | |
58 | 16 | Daniel Mentz | *ipsec down _<name>[n]_* |
59 | 1 | Martin Willi | |
60 | 22 | Tobias Brunner | p((. terminates IKE_SA instance n of connection <name> plus dependent CHILD_SAs. Since _[n]_ uniquely identifis an IKE_SA the name is optional. |
61 | 22 | Tobias Brunner | |
62 | 16 | Daniel Mentz | |
63 | 16 | Daniel Mentz | *ipsec down _<name>[<notextile>*</notextile>]_* |
64 | 16 | Daniel Mentz | |
65 | 19 | Tobias Brunner | p((. terminates all IKE_SA instances of connection <name>. |
66 | 16 | Daniel Mentz | |
67 | 13 | Tobias Brunner | *ipsec route _<name>_* |
68 | 15 | Daniel Mentz | |
69 | 19 | Tobias Brunner | p((. tells the IKE daemon to insert [[IpsecPolicy|IPsec policies]] in the kernel for connection _<name>_. The first payload packet matching the [[IpsecPolicy|IPsec policies]] will automatically trigger an IKE connection setup. Implemented by calling the [[IpsecStroke|ipsec stroke]] route _<name>_ command. |
70 | 1 | Martin Willi | |
71 | 13 | Tobias Brunner | *ipsec unroute _<name>_* |
72 | 15 | Daniel Mentz | |
73 | 19 | Tobias Brunner | p((. remove the [[IpsecPolicy|IPsec policies]] in the kernel for connection _<name>_. Implemented by calling the [[IpsecStroke|ipsec stroke]] unroute _<name>_ command. |
74 | 5 | Martin Willi | |
75 | 13 | Tobias Brunner | *ipsec status [ _<name>_ ]* |
76 | 15 | Daniel Mentz | |
77 | 19 | Tobias Brunner | p((. returns concise status information either on connection _<name>_ or if the argument is lacking, on all connections. Implemented by calling the [[IpsecStroke|ipsec stroke]] status [ _<name>_ ] command. |
78 | 13 | Tobias Brunner | |
79 | 12 | Martin Willi | *ipsec statusall [ _<name>_ ]* |
80 | 15 | Daniel Mentz | |
81 | 19 | Tobias Brunner | p((. returns detailed status information either on connection _<name>_ or if the argument is lacking, on all connections. Implemented by calling the [[IpsecStroke|ipsec stroke]] statusall [ _<name>_ ] command. |
82 | 12 | Martin Willi | |
83 | 1 | Martin Willi | |
84 | 1 | Martin Willi | h2. Info Commands |
85 | 12 | Martin Willi | |
86 | 1 | Martin Willi | *ipsec version* |
87 | 15 | Daniel Mentz | |
88 | 1 | Martin Willi | p((. returns the ipsec version in the form of *Linux strongSwan U<strongSwan userland version>/K<Linux kernel version>* if strongSwan uses the native NETKEY IPsec stack of the Linux kernel it is running on. |
89 | 1 | Martin Willi | |
90 | 1 | Martin Willi | *ipsec copyright* |
91 | 15 | Daniel Mentz | |
92 | 13 | Tobias Brunner | p((. returns the copyright information. |
93 | 1 | Martin Willi | |
94 | 12 | Martin Willi | *ipsec --confdir* |
95 | 15 | Daniel Mentz | |
96 | 13 | Tobias Brunner | p((. returns the _SYSCONFDIR_ directory as defined by the [[InstallationDocumentation|configure]] options. |
97 | 1 | Martin Willi | |
98 | 1 | Martin Willi | *ipsec --directory* |
99 | 15 | Daniel Mentz | |
100 | 13 | Tobias Brunner | p((. returns the _LIBEXECDIR_ directory as defined by the [[InstallationDocumentation|configure]] options. |
101 | 1 | Martin Willi | |
102 | 1 | Martin Willi | *ipsec --help* |
103 | 15 | Daniel Mentz | |
104 | 13 | Tobias Brunner | p((. returns the usage information for the ipsec command. |
105 | 1 | Martin Willi | |
106 | 1 | Martin Willi | *ipsec --versioncode* |
107 | 10 | Martin Willi | |
108 | 12 | Martin Willi | p((. returns the ipsec version number in the form of *U<strongSwan userland version>/K<Linux kernel version>* if strongSwan uses the native NETKEY IPsec stack of the Linux kernel it is running on. |
109 | 1 | Martin Willi | |
110 | 10 | Martin Willi | h2. List Commands |
111 | 1 | Martin Willi | |
112 | 26 | Tobias Brunner | *ipsec leases [ [ <poolname> [ <address> ] ]* |
113 | 26 | Tobias Brunner | |
114 | 26 | Tobias Brunner | p((. returns the status of all or the selected IP address pools (or even a single virtual IP address). |
115 | 26 | Tobias Brunner | |
116 | 13 | Tobias Brunner | *ipsec listaacerts [ --utc ]* |
117 | 1 | Martin Willi | |
118 | 19 | Tobias Brunner | p((. returns a list of X.509 Authorization Authority (AA) certificates that were loaded locally by the IKE daemon from the [[IpsecDirectoryAacerts|/etc/ipsec.d/aacerts]] directory. Implemented by calling the [[IpsecStroke|ipsec stroke]] listaacerts command. |
119 | 15 | Daniel Mentz | |
120 | 13 | Tobias Brunner | *ipsec listacerts [ --utc ]* |
121 | 1 | Martin Willi | |
122 | 21 | Tobias Brunner | p((. returns a list of X.509 Attribute certificates that were loaded locally by the IKE daemon from the [[IpsecDirectoryAcerts|/etc/ipsec.d/acerts]] directory. Implemented by calling the [[IpsecStroke|ipsec stroke]] listacerts command. |
123 | 1 | Martin Willi | |
124 | 21 | Tobias Brunner | *ipsec listalgs* |
125 | 21 | Tobias Brunner | |
126 | 21 | Tobias Brunner | p((. returns a list of all supported IKE encryption and hash algorithms, and the available Diffie-Hellman groups. Implemented by calling the [[IpsecStroke|ipsec stroke]] listalgs command. |
127 | 21 | Tobias Brunner | |
128 | 13 | Tobias Brunner | *ipsec listcacerts [ --utc ]* |
129 | 1 | Martin Willi | |
130 | 19 | Tobias Brunner | p((. returns a list of X.509 Certification Authority (CA) certificates that were loaded locally by the IKE daemon from the [[IpsecDirectoryCacerts|/etc/ipsec.d/cacerts]] directory or received via the IKE protocol. Implemented by calling the [[IpsecStroke|ipsec stroke]] listcacerts command. |
131 | 15 | Daniel Mentz | |
132 | 13 | Tobias Brunner | *ipsec listcainfos [ --utc ]* |
133 | 1 | Martin Willi | |
134 | 19 | Tobias Brunner | p((. returns Certification Authority information (CRL distribution points, OCSP URIs, LDAP servers) that were defined by [[CaSection|ca sections]] in [[IpsecConf|ipsec.conf]]. Implemented by calling the [[IpsecStroke|ipsec stroke]] listcainfos command. |
135 | 13 | Tobias Brunner | |
136 | 1 | Martin Willi | *ipsec listcerts [ --utc ]* |
137 | 1 | Martin Willi | |
138 | 1 | Martin Willi | p((. returns a list of X.509 and/or OpenPGP certificates that were either loaded locally by the IKE daemon or received via the IKE protocol. Implemented by calling the [[IpsecStroke|ipsec stroke]] listcerts command. |
139 | 1 | Martin Willi | |
140 | 25 | Tobias Brunner | *ipsec listcounters [ <name> ]* |
141 | 25 | Tobias Brunner | |
142 | 25 | Tobias Brunner | p((. returns a list of global or connection specific counter values about received and sent IKE messages and rekeyings. Connection specific ounters are available since [[5.0.3]]. Implemented by calling the [[IpsecStroke|ipsec stroke]] listcounters command. |
143 | 25 | Tobias Brunner | |
144 | 25 | Tobias Brunner | *ipsec listcrls [ --utc ]* |
145 | 25 | Tobias Brunner | |
146 | 28 | Lauri Võsandi | p((. returns a list of Certificate Revocation Lists (CRLs) that were either loaded by the IKE daemon from the [[IpsecDirectoryCrls|/etc/ipsec.d/crls]] directory or fetched from an HTTP- or LDAP-based CRL distribution point. Implemented by calling the [[IpsecStroke|ipsec stroke]] listcrls command. Note that X.509 Authority Key Identifier extension is used to associate CRL with a particular CA, otherwise CRL is listed but not applied. |
147 | 25 | Tobias Brunner | |
148 | 13 | Tobias Brunner | *ipsec listgroups [ --utc ]* |
149 | 1 | Martin Willi | |
150 | 19 | Tobias Brunner | p((. returns a list of all groups that are used to define user authorization profiles. Currently not supported. |
151 | 15 | Daniel Mentz | |
152 | 13 | Tobias Brunner | *ipsec listocsp [ --utc ]* |
153 | 1 | Martin Willi | |
154 | 19 | Tobias Brunner | p((. returns cached revocation information fetched from OCSP servers. Implemented by calling the [[IpsecStroke|ipsec stroke]] listocsp command. |
155 | 15 | Daniel Mentz | |
156 | 18 | Tobias Brunner | *ipsec listocspcerts [ --utc ]* |
157 | 1 | Martin Willi | |
158 | 1 | Martin Willi | p((. returns a list of X.509 OCSP Signer certificates that were either loaded locally by the IKE daemon from the [[IpsecDirectoryOcspcerts|/etc/ipsec.d/ocspcerts]] directory or were sent by an OCSP server. Implemented by calling the [[IpsecStroke|ipsec stroke]] listocspcerts command. |
159 | 1 | Martin Willi | |
160 | 21 | Tobias Brunner | *ipsec listplugins* |
161 | 21 | Tobias Brunner | |
162 | 21 | Tobias Brunner | p((. returns a list of all loaded plugin features. Implemented by calling the [[IpsecStroke|ipsec stroke]] listplugins command. |
163 | 21 | Tobias Brunner | |
164 | 13 | Tobias Brunner | *ipsec listpubkeys [ --utc ]* |
165 | 2 | Martin Willi | |
166 | 25 | Tobias Brunner | p((. returns a list of public keys that were loaded in raw key format. Implemented by calling the [[IpsecStroke|ipsec stroke]] listpubkeys command. |
167 | 1 | Martin Willi | |
168 | 12 | Martin Willi | *ipsec listall [ --utc ]* |
169 | 19 | Tobias Brunner | |
170 | 18 | Tobias Brunner | p((. returns all information generated by the list commands above. Each list command can be called with the @--utc@ option which displays all dates in UTC instead of local time. Implemented by calling the [[IpsecStroke|ipsec stroke]] listall command. |
171 | 1 | Martin Willi | |
172 | 1 | Martin Willi | h2. Reread Commands |
173 | 12 | Martin Willi | |
174 | 1 | Martin Willi | *ipsec rereadaacerts* |
175 | 1 | Martin Willi | |
176 | 19 | Tobias Brunner | p((. reads all certificate files contained in the [[IpsecDirectoryAacerts|/etc/ipsec.d/aacerts]] directory and adds them to the list of Authorization Authority (AA) certificates. Implemented by calling the [[IpsecStroke|ipsec stroke]] rereadaacerts command. |
177 | 1 | Martin Willi | |
178 | 13 | Tobias Brunner | *ipsec rereadacerts* |
179 | 1 | Martin Willi | |
180 | 19 | Tobias Brunner | p((. reads all certificate files contained in the [[IpsecDirectoryAcerts|/etc/ipsec.d/acerts]] directory and adds them to the list of attribute certificates. Implemented by calling the [[IpsecStroke|ipsec stroke]] rereadacerts command. |
181 | 1 | Martin Willi | |
182 | 1 | Martin Willi | *ipsec rereadcacerts* |
183 | 1 | Martin Willi | |
184 | 19 | Tobias Brunner | p((. reads all certificate files contained in the [[IpsecDirectoryCacerts|/etc/ipsec.d/cacerts]] directory and adds them to the list of Certification Authority (CA) certificates. Implemented by calling the [[IpsecStroke|ipsec stroke]] rereadcacerts command. |
185 | 1 | Martin Willi | |
186 | 1 | Martin Willi | *ipsec rereadcrls* |
187 | 1 | Martin Willi | |
188 | 19 | Tobias Brunner | p((. reads all Certificate Revocation Lists (CRLs) contained in the [[IpsecDirectoryCrls|/etc/ipsec.d/crls]] directory and adds them to the list of CRLs. Older CRLs are replaced by newer ones. Implemented by calling the [[IpsecStroke|ipsec stroke]] rereadcrls command. |
189 | 1 | Martin Willi | |
190 | 1 | Martin Willi | *ipsec rereadocspcerts* |
191 | 15 | Daniel Mentz | |
192 | 19 | Tobias Brunner | p((. reads all certificate files contained in the [[IpsecDirectoryOcspcerts|/etc/ipsec.d/ocspcerts]] directory and adds them to the list of OCSP signer certificates. Implemented by calling the [[IpsecStroke|ipsec stroke]] rereadocspcerts command. |
193 | 1 | Martin Willi | |
194 | 12 | Martin Willi | *ipsec rereadsecrets* |
195 | 15 | Daniel Mentz | |
196 | 19 | Tobias Brunner | p((. flushes and rereads all secrets defined in [[IpsecSecrets|ipsec.secrets]]. Implemented by calling the [[IpsecStroke|ipsec stroke]] rereadsecrets command. |
197 | 1 | Martin Willi | |
198 | 12 | Martin Willi | *ipsec secrets* |
199 | 15 | Daniel Mentz | |
200 | 13 | Tobias Brunner | p((. is equivalent to *ipsec rereadsecrets*. |
201 | 1 | Martin Willi | |
202 | 1 | Martin Willi | *ipsec rereadall* |
203 | 1 | Martin Willi | |
204 | 1 | Martin Willi | p((. executes all reread commands listed above. Implemented by calling the [[IpsecStroke|ipsec stroke]] rereadall command. |
205 | 1 | Martin Willi | |
206 | 24 | Tobias Brunner | h2. Reset Commands |
207 | 24 | Tobias Brunner | |
208 | 24 | Tobias Brunner | *ipsec resetcounters [ <name> ]* |
209 | 24 | Tobias Brunner | |
210 | 24 | Tobias Brunner | p((. resets global or connection specific counters. Since [[5.0.3]]. Implemented by calling the [[IpsecStroke|ipsec stroke]] resetcounters command. |
211 | 1 | Martin Willi | |
212 | 15 | Daniel Mentz | h2. Purge Commands |
213 | 13 | Tobias Brunner | |
214 | 20 | Tobias Brunner | *ipsec purgecerts* |
215 | 20 | Tobias Brunner | |
216 | 20 | Tobias Brunner | p((. purges all cached certificates. Implemented by calling the [[IpsecStroke|ipsec stroke]] purgecerts command. |
217 | 20 | Tobias Brunner | |
218 | 29 | Tobias Brunner | *ipsec purgecrls* |
219 | 20 | Tobias Brunner | |
220 | 29 | Tobias Brunner | p((. purges all cached CRLs. Implemented by calling the [[IpsecStroke|ipsec stroke]] purgecrls command. |
221 | 20 | Tobias Brunner | |
222 | 1 | Martin Willi | *ipsec purgeike* |
223 | 20 | Tobias Brunner | |
224 | 13 | Tobias Brunner | p((. purges IKE_SAs that don't have a CHILD_SA. Implemented by calling the [[IpsecStroke|ipsec stroke]] purgeike command. |
225 | 1 | Martin Willi | |
226 | 1 | Martin Willi | *ipsec purgeocsp* |
227 | 1 | Martin Willi | |
228 | 19 | Tobias Brunner | p((. purges all cached OCSP information records. Implemented by calling the [[IpsecStroke|ipsec stroke]] purgeocsp command. |
229 | 19 | Tobias Brunner | |
230 | 19 | Tobias Brunner | h2. Before 5.0.0 |
231 | 19 | Tobias Brunner | |
232 | 30 | Tobias Brunner | In releases before [[5.0.0]] IKEv1 connections were handled by the separate [[pluto]] keying daemon. The ipsec command then used the [[IpsecWhack|ipsec whack]] command in addition to the [[IpsecStroke|ipsec stroke]] command to communicate with pluto. |
233 | 19 | Tobias Brunner | |
234 | 19 | Tobias Brunner | h3. List Commands |
235 | 19 | Tobias Brunner | |
236 | 19 | Tobias Brunner | *ipsec listcards [ --utc ]* |
237 | 19 | Tobias Brunner | |
238 | 19 | Tobias Brunner | p((. lists all certificates found on attached smart cards. Supported by the IKEv1 pluto daemon only. Implemented by calling the [[IpsecWhack|ipsec whack]] --listcards command. |
239 | 19 | Tobias Brunner | |
240 | 19 | Tobias Brunner | h3. PKCS11 Proxy Commands |
241 | 1 | Martin Willi | |
242 | 12 | Martin Willi | *ipsec scencrypt _<value>_ [ --inbase _<base>_ ] [ --outbase _<base>_ ] [ --keyid _<id>_ ]* |
243 | 15 | Daniel Mentz | |
244 | 13 | Tobias Brunner | p((. Supported by the IKEv1 pluto daemon only. Implemented by calling the [[IpsecWhack|ipsec whack]] --scencrypt command. |
245 | 1 | Martin Willi | |
246 | 12 | Martin Willi | *ipsec scdecrypt _<value>_ [ --inbase <base> ] [ --outbase _<base>_ ] [ --keyid _<id>_ ]* |
247 | 15 | Daniel Mentz | |
248 | 13 | Tobias Brunner | p((. Supported by the IKEv1 pluto daemon only. Implemented by calling the [[IpsecWhack|ipsec whack]] --scdecrypt command. |