summaryrefslogtreecommitdiff
path: root/op-mode-definitions/vpn-ipsec.xml.in
blob: b551af2be9e31548d4c57056dc45787e5bf3c6ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
<?xml version="1.0"  encoding="UTF-8"?>
<interfaceDefinition>
  <node name="reset">
    <children>
      <node name="vpn">
        <properties>
          <help>Reset Virtual Private Network (VPN) information</help>
        </properties>
        <children>
          <node name="ipsec">
            <properties>
              <help>Reset IPSec VPN sessions</help>
            </properties>
            <children>
              <tagNode name="profile">
                <properties>
                  <help>Reset a specific tunnel for given DMVPN profile</help>
                  <completionHelp>
                    <path>vpn ipsec profile</path>
                  </completionHelp>
                </properties>
                <children>
                  <tagNode name="tunnel">
                    <properties>
                      <help>Reset a specific tunnel for given DMVPN profile</help>
                      <completionHelp>
                        <script>sudo ${vyos_completion_dir}/list_ipsec_profile_tunnels.py --profile ${COMP_WORDS[4]}</script>
                      </completionHelp>
                    </properties>
                    <children>
                      <tagNode name="remote-host">
                        <properties>
                          <help>Reset a specific tunnel for given DMVPN NBMA</help>
                          <completionHelp>
                            <list>&lt;x.x.x.x&gt; &lt;h:h:h:h:h:h:h:h&gt;</list>
                          </completionHelp>
                        </properties>
                        <command>sudo ${vyos_op_scripts_dir}/ipsec.py reset_profile_dst --profile="$5" --tunnel="$7" --nbma-dst="$9"</command>
                      </tagNode>
                    </children>
                    <command>sudo ${vyos_op_scripts_dir}/ipsec.py reset_profile_all --profile="$5" --tunnel="$7"</command>
                  </tagNode>
                </children>
              </tagNode>
              <node name="remote-access">
                <properties>
                  <help>Reset remote access IPSec VPN connections</help>
                </properties>
                <children>
                  <node name="all">
                    <properties>
                      <help>Reset all users current remote access IPSec VPN sessions</help>
                    </properties>
                     <command>sudo ${vyos_op_scripts_dir}/ipsec.py reset_ra</command>
                  </node>
                  <tagNode name="user">
                    <properties>
                      <help>Reset specified user current remote access IPsec VPN session(s)</help>
                    </properties>
                    <command>sudo ${vyos_op_scripts_dir}/ipsec.py reset_ra --user="$6"</command>
                  </tagNode>
                </children>
              </node>
              <node name="site-to-site">
                <properties>
                  <help>Reset site-to-site IPSec VPN connections</help>
                </properties>
                <children>
                  <node name="all">
                    <properties>
                      <help>Reset all site-to-site IPSec VPN sessions</help>
                    </properties>
                     <command>sudo ${vyos_op_scripts_dir}/ipsec.py reset_all_peers</command>
                  </node>
                  <tagNode name="peer">
                    <properties>
                      <help>Reset all tunnels for given peer</help>
                      <completionHelp>
                        <path>vpn ipsec site-to-site peer</path>
                      </completionHelp>
                    </properties>
                    <children>
                      <tagNode name="tunnel">
                        <properties>
                          <help>Reset a specific tunnel for given peer</help>
                          <completionHelp>
                            <path>vpn ipsec site-to-site peer ${COMP_WORDS[5]} tunnel</path>
                          </completionHelp>
                        </properties>
                        <command>sudo ${vyos_op_scripts_dir}/ipsec.py reset_peer --peer="$6" --tunnel="$8"</command>
                      </tagNode>
                      <node name="vti">
                        <properties>
                          <help>Reset the VTI tunnel for given peer</help>
                        </properties>
                        <command>sudo ${vyos_op_scripts_dir}/ipsec.py reset_peer --peer="$6" --tunnel="vti"</command>
                      </node>
                    </children>
                    <command>sudo ${vyos_op_scripts_dir}/ipsec.py reset_peer --peer="$6"</command>
                  </tagNode>
                </children>
              </node>
            </children>
          </node>
        </children>
      </node>
    </children>
  </node>
  <node name="restart">
    <children>
      <node name="ipsec">
        <properties>
          <help>Restart the IPsec VPN process</help>
        </properties>
        <command>if systemctl is-active --quiet strongswan; then sudo systemctl restart strongswan ; echo "IPsec process restarted";  else echo "IPsec process not running" ; fi</command>
      </node>
    </children>
  </node>
  <node name="show">
    <children>
      <node name="vpn">
        <properties>
          <help>Show Virtual Private Network (VPN) information</help>
        </properties>
        <children>
          <node name="debug">
            <properties>
              <help>Show VPN debugging information</help>
            </properties>
            <children>
              <tagNode name="peer">
                <properties>
                  <help>Show debugging information for a peer</help>
                  <completionHelp>
                    <path>vpn ipsec site-to-site peer</path>
                  </completionHelp>
                </properties>
                <children>
                  <tagNode name="tunnel">
                    <properties>
                      <help>Show debug information for peer tunnel</help>
                    </properties>
                    <command>sudo ${vyos_op_scripts_dir}/vpn_ipsec.py --action="vpn-debug" --name="$5" --tunnel="$7"</command>
                  </tagNode>
                </children>
                <command>sudo ${vyos_op_scripts_dir}/vpn_ipsec.py --action="vpn-debug" --name="$5" --tunnel="all"</command>
              </tagNode>
            </children>
            <command>sudo ${vyos_op_scripts_dir}/vpn_ipsec.py --action="vpn-debug" --name="all"</command>
          </node>
          <node name="ike">
            <properties>
              <help>Show Internet Key Exchange (IKE) information</help>
            </properties>
            <children>
              <node name="sa">
                <properties>
                  <help>Show all currently active IKE Security Associations (SA)</help>
                </properties>
                <children>
                  <node name="nat-traversal">
                    <properties>
                      <help>Show all currently active IKE Security Associations (SA) that are using NAT Traversal</help>
                    </properties>
                    <command>sudo ${vyos_op_scripts_dir}/vpn_ike_sa.py --nat="yes"</command>
                  </node>
                  <tagNode name="peer">
                    <properties>
                      <help>Show all currently active IKE Security Associations (SA) for a peer</help>
                    </properties>
                    <command>sudo ${vyos_op_scripts_dir}/vpn_ike_sa.py --peer="$6"</command>
                  </tagNode>
                </children>
                <command>sudo ${vyos_op_scripts_dir}/vpn_ike_sa.py</command>
              </node>
              <node name="secrets">
                <properties>
                  <help>Show all the pre-shared key secrets</help>
                </properties>
                <command>${vyos_op_scripts_dir}/ipsec.py show_psk</command>
              </node>
              <node name="status">
                <properties>
                  <help>Show summary of IKE process information</help>
                </properties>
                <command>if systemctl is-active --quiet strongswan ; then systemctl status strongswan ; else echo "Process is not running" ; fi</command>
              </node>
            </children>
          </node>
          <node name="ipsec">
            <properties>
              <help>Show Internet Protocol Security (IPsec) information</help>
            </properties>
            <children>
              <node name="connections">
                <properties>
                  <help>Show VPN connections</help>
                </properties>
                <command>sudo ${vyos_op_scripts_dir}/ipsec.py show_connections</command>
              </node>
              <node name="policy">
                <properties>
                  <help>Show the in-kernel crypto policies</help>
                </properties>
                <command>sudo ip xfrm policy list</command>
              </node>
              <node name="remote-access">
                <properties>
                  <help>Show active VPN server sessions</help>
                </properties>
                <children>
                  <node name="detail">
                    <properties>
                      <help>Show detail active IKEv2 RA sessions</help>
                    </properties>
                    <command>if systemctl is-active --quiet strongswan ; then sudo ${vyos_op_scripts_dir}/ipsec.py show_ra_detail; else echo "IPsec process not running" ; fi</command>
                  </node>
                  <tagNode name="connection-id">
                    <properties>
                      <help>Show detail active IKEv2 RA sessions by connection-id</help>
                    </properties>
                    <command>if systemctl is-active --quiet strongswan ; then sudo ${vyos_op_scripts_dir}/ipsec.py show_ra_detail --conn-id="$6"; else echo "IPsec process not running" ; fi</command>
                  </tagNode>
                  <node name="summary">
                    <properties>
                      <help>Show active IKEv2 RA sessions summary</help>
                    </properties>
                    <command>if systemctl is-active --quiet strongswan ; then sudo ${vyos_op_scripts_dir}/ipsec.py show_ra_summary; else echo "IPsec process not running" ; fi</command>
                  </node>
                  <tagNode name="username">
                    <properties>
                      <help>Show detail active IKEv2 RA sessions by username</help>
                    </properties>
                    <command>if systemctl is-active --quiet strongswan ; then sudo ${vyos_op_scripts_dir}/ipsec.py show_ra_detail --username="$6"; else echo "IPsec process not running" ; fi</command>
                  </tagNode>
                </children>
              </node>
              <node name="sa">
                <properties>
                  <help>Show all active IPsec Security Associations (SA)</help>
                </properties>
                <children>
                  <!--
                  <node name="detail">
                    <properties>
                      <help>Show Detail on all active IPsec Security Associations (SA)</help>
                    </properties>
                    <command></command>
                  </node>
                  <tagNode name="stats">
                    <properties>
                      <help>Show statistics for all currently active IPsec Security Associations (SA)</help>
                      <valueHelp>
                        <format>txt</format>
                        <description>Show Statistics for SAs associated with a specific peer</description>
                      </valueHelp>
                    </properties>
                    <children>
                      <tagNode name="tunnel">
                        <properties>
                          <help>Show Statistics for SAs associated with a specific peer</help>
                        </properties>
                        <command></command>
                      </tagNode>
                    </children>
                    <command></command>
                  </tagNode>
                  -->
                  <node name="detail">
                    <properties>
                      <help>Show Verbose Detail on all active IPsec Security Associations (SA)</help>
                    </properties>
                    <command>if systemctl is-active --quiet strongswan ; then sudo ${vyos_op_scripts_dir}/ipsec.py show_sa_detail ; else echo "IPsec process not running" ; fi</command>
                  </node>
                </children>
                <command>if systemctl is-active --quiet strongswan ; then sudo ${vyos_op_scripts_dir}/ipsec.py show_sa ; else echo "IPsec process not running" ; fi</command>
              </node>
              <node name="state">
                <properties>
                  <help>Show the in-kernel crypto state</help>
                </properties>
                <command>sudo ip xfrm state list</command>
              </node>
              <node name="status">
                <properties>
                  <help>Show status of IPsec process</help>
                </properties>
                <command>if systemctl is-active --quiet strongswan >/dev/null ; then echo -e "IPsec Process Running: $(pgrep charon)\n$(sudo /usr/sbin/ipsec status)" ; else echo "IPsec process not running" ; fi</command>
              </node>
            </children>
          </node>
        </children>
      </node>
    </children>
  </node>
</interfaceDefinition>