1
|
<?php
|
2
|
/*
|
3
|
vpn_ipsec_phase1.php
|
4
|
part of m0n0wall (http://m0n0.ch/wall)
|
5
|
|
6
|
Copyright (C) 2008 Shrew Soft Inc
|
7
|
Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
|
8
|
Copyright (C) 2014 Ermal LUÇI
|
9
|
All rights reserved.
|
10
|
|
11
|
Redistribution and use in source and binary forms, with or without
|
12
|
modification, are permitted provided that the following conditions are met:
|
13
|
|
14
|
1. Redistributions of source code must retain the above copyright notice,
|
15
|
this list of conditions and the following disclaimer.
|
16
|
|
17
|
2. Redistributions in binary form must reproduce the above copyright
|
18
|
notice, this list of conditions and the following disclaimer in the
|
19
|
documentation and/or other materials provided with the distribution.
|
20
|
|
21
|
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
22
|
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
23
|
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
24
|
AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
|
25
|
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
26
|
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
27
|
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
28
|
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
29
|
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
30
|
POSSIBILITY OF SUCH DAMAGE.
|
31
|
*/
|
32
|
|
33
|
##|+PRIV
|
34
|
##|*IDENT=page-vpn-ipsec-editphase1
|
35
|
##|*NAME=VPN: IPsec: Edit Phase 1 page
|
36
|
##|*DESCR=Allow access to the 'VPN: IPsec: Edit Phase 1' page.
|
37
|
##|*MATCH=vpn_ipsec_phase1.php*
|
38
|
##|-PRIV
|
39
|
|
40
|
require("functions.inc");
|
41
|
require("guiconfig.inc");
|
42
|
require_once("ipsec.inc");
|
43
|
require_once("vpn.inc");
|
44
|
|
45
|
if (!is_array($config['ipsec']['phase1']))
|
46
|
$config['ipsec']['phase1'] = array();
|
47
|
|
48
|
if (!is_array($config['ipsec']['phase2']))
|
49
|
$config['ipsec']['phase2'] = array();
|
50
|
|
51
|
$a_phase1 = &$config['ipsec']['phase1'];
|
52
|
$a_phase2 = &$config['ipsec']['phase2'];
|
53
|
|
54
|
if (is_numericint($_GET['p1index']))
|
55
|
$p1index = $_GET['p1index'];
|
56
|
if (isset($_POST['p1index']) && is_numericint($_POST['p1index']))
|
57
|
$p1index = $_POST['p1index'];
|
58
|
|
59
|
if (isset($_GET['dup']) && is_numericint($_GET['dup']))
|
60
|
$p1index = $_GET['dup'];
|
61
|
|
62
|
if (isset($p1index) && $a_phase1[$p1index]) {
|
63
|
// don't copy the ikeid on dup
|
64
|
if (!isset($_GET['dup']) || !is_numericint($_GET['dup']))
|
65
|
$pconfig['ikeid'] = $a_phase1[$p1index]['ikeid'];
|
66
|
|
67
|
$old_ph1ent = $a_phase1[$p1index];
|
68
|
|
69
|
$pconfig['disabled'] = isset($a_phase1[$p1index]['disabled']);
|
70
|
|
71
|
if ($a_phase1[$p1index]['interface'])
|
72
|
$pconfig['interface'] = $a_phase1[$p1index]['interface'];
|
73
|
else
|
74
|
$pconfig['interface'] = "wan";
|
75
|
|
76
|
list($pconfig['remotenet'],$pconfig['remotebits']) = explode("/", $a_phase1[$p1index]['remote-subnet']);
|
77
|
|
78
|
if (isset($a_phase1[$p1index]['mobile']))
|
79
|
$pconfig['mobile'] = 'true';
|
80
|
else
|
81
|
$pconfig['remotegw'] = $a_phase1[$p1index]['remote-gateway'];
|
82
|
|
83
|
if (empty($a_phase1[$p1index]['iketype']))
|
84
|
$pconfig['iketype'] = "ikev1";
|
85
|
else
|
86
|
$pconfig['iketype'] = $a_phase1[$p1index]['iketype'];
|
87
|
$pconfig['mode'] = $a_phase1[$p1index]['mode'];
|
88
|
$pconfig['protocol'] = $a_phase1[$p1index]['protocol'];
|
89
|
$pconfig['myid_type'] = $a_phase1[$p1index]['myid_type'];
|
90
|
$pconfig['myid_data'] = $a_phase1[$p1index]['myid_data'];
|
91
|
$pconfig['peerid_type'] = $a_phase1[$p1index]['peerid_type'];
|
92
|
$pconfig['peerid_data'] = $a_phase1[$p1index]['peerid_data'];
|
93
|
$pconfig['ealgo'] = $a_phase1[$p1index]['encryption-algorithm'];
|
94
|
$pconfig['halgo'] = $a_phase1[$p1index]['hash-algorithm'];
|
95
|
$pconfig['dhgroup'] = $a_phase1[$p1index]['dhgroup'];
|
96
|
$pconfig['lifetime'] = $a_phase1[$p1index]['lifetime'];
|
97
|
$pconfig['authentication_method'] = $a_phase1[$p1index]['authentication_method'];
|
98
|
|
99
|
if (($pconfig['authentication_method'] == "pre_shared_key") ||
|
100
|
($pconfig['authentication_method'] == "xauth_psk_server")) {
|
101
|
$pconfig['pskey'] = $a_phase1[$p1index]['pre-shared-key'];
|
102
|
} else {
|
103
|
$pconfig['certref'] = $a_phase1[$p1index]['certref'];
|
104
|
$pconfig['caref'] = $a_phase1[$p1index]['caref'];
|
105
|
}
|
106
|
|
107
|
$pconfig['descr'] = $a_phase1[$p1index]['descr'];
|
108
|
$pconfig['nat_traversal'] = $a_phase1[$p1index]['nat_traversal'];
|
109
|
|
110
|
if (!isset($a_phase1[$p1index]['reauth_enable']))
|
111
|
$pconfig['reauth_enable'] = true;
|
112
|
if (!isset($a_phase1[$p1index]['rekey_enable']))
|
113
|
$pconfig['rekey_enable'] = true;
|
114
|
|
115
|
if ($a_phase1[$p1index]['dpd_delay'] && $a_phase1[$p1index]['dpd_maxfail']) {
|
116
|
$pconfig['dpd_enable'] = true;
|
117
|
$pconfig['dpd_delay'] = $a_phase1[$p1index]['dpd_delay'];
|
118
|
$pconfig['dpd_maxfail'] = $a_phase1[$p1index]['dpd_maxfail'];
|
119
|
}
|
120
|
} else {
|
121
|
/* defaults */
|
122
|
$pconfig['interface'] = "wan";
|
123
|
if($config['interfaces']['lan'])
|
124
|
$pconfig['localnet'] = "lan";
|
125
|
$pconfig['mode'] = "aggressive";
|
126
|
$pconfig['protocol'] = "inet";
|
127
|
$pconfig['myid_type'] = "myaddress";
|
128
|
$pconfig['peerid_type'] = "peeraddress";
|
129
|
$pconfig['authentication_method'] = "pre_shared_key";
|
130
|
$pconfig['ealgo'] = array( name => "3des" );
|
131
|
$pconfig['halgo'] = "sha1";
|
132
|
$pconfig['dhgroup'] = "2";
|
133
|
$pconfig['lifetime'] = "28800";
|
134
|
$pconfig['nat_traversal'] = "on";
|
135
|
$pconfig['dpd_enable'] = true;
|
136
|
$pconfig['iketype'] = "ikev1";
|
137
|
|
138
|
/* mobile client */
|
139
|
if($_GET['mobile'])
|
140
|
$pconfig['mobile']=true;
|
141
|
}
|
142
|
|
143
|
if (isset($_GET['dup']) && is_numericint($_GET['dup']))
|
144
|
unset($p1index);
|
145
|
|
146
|
if ($_POST) {
|
147
|
unset($input_errors);
|
148
|
$pconfig = $_POST;
|
149
|
|
150
|
/* input validation */
|
151
|
|
152
|
$method = $pconfig['authentication_method'];
|
153
|
// Unset ca and cert if not required to avaoid storing in config
|
154
|
if ($method == "pre_shared_key" || $method == "xauth_psk_server"){
|
155
|
unset($pconfig['caref']);
|
156
|
unset($pconfig['certref']);
|
157
|
}
|
158
|
|
159
|
// Only require PSK here for normal PSK tunnels (not mobile) or xauth.
|
160
|
// For RSA methods, require the CA/Cert.
|
161
|
switch ($method) {
|
162
|
case "eap-tls":
|
163
|
if ($pconfig['iketype'] != 'ikev2')
|
164
|
$input_errors[] = gettext("EAP-TLS can only be used with IKEv2 type VPNs.");
|
165
|
break;
|
166
|
case "pre_shared_key":
|
167
|
// If this is a mobile PSK tunnel the user PSKs go on
|
168
|
// the PSK tab, not here, so skip the check.
|
169
|
if ($pconfig['mobile'])
|
170
|
break;
|
171
|
case "xauth_psk_server":
|
172
|
$reqdfields = explode(" ", "pskey");
|
173
|
$reqdfieldsn = array(gettext("Pre-Shared Key"));
|
174
|
break;
|
175
|
case "hybrid_rsa_server":
|
176
|
case "xauth_rsa_server":
|
177
|
case "rsasig":
|
178
|
$reqdfields = explode(" ", "caref certref");
|
179
|
$reqdfieldsn = array(gettext("Certificate Authority"),gettext("Certificate"));
|
180
|
break;
|
181
|
}
|
182
|
if (!$pconfig['mobile']) {
|
183
|
$reqdfields[] = "remotegw";
|
184
|
$reqdfieldsn[] = gettext("Remote gateway");
|
185
|
}
|
186
|
|
187
|
do_input_validation($pconfig, $reqdfields, $reqdfieldsn, $input_errors);
|
188
|
|
189
|
if (($pconfig['lifetime'] && !is_numeric($pconfig['lifetime'])))
|
190
|
$input_errors[] = gettext("The P1 lifetime must be an integer.");
|
191
|
|
192
|
if ($pconfig['remotegw']) {
|
193
|
if (!is_ipaddr($pconfig['remotegw']) && !is_domain($pconfig['remotegw']))
|
194
|
$input_errors[] = gettext("A valid remote gateway address or host name must be specified.");
|
195
|
elseif (is_ipaddrv4($pconfig['remotegw']) && ($pconfig['protocol'] != "inet"))
|
196
|
$input_errors[] = gettext("A valid remote gateway IPv4 address must be specified or you need to change protocol to IPv6");
|
197
|
elseif (is_ipaddrv6($pconfig['remotegw']) && ($pconfig['protocol'] != "inet6"))
|
198
|
$input_errors[] = gettext("A valid remote gateway IPv6 address must be specified or you need to change protocol to IPv4");
|
199
|
}
|
200
|
|
201
|
if (($pconfig['remotegw'] && is_ipaddr($pconfig['remotegw']) && !isset($pconfig['disabled']) )) {
|
202
|
$t = 0;
|
203
|
foreach ($a_phase1 as $ph1tmp) {
|
204
|
if ($p1index <> $t) {
|
205
|
$tremotegw = $pconfig['remotegw'];
|
206
|
if (($ph1tmp['remote-gateway'] == $tremotegw) && !isset($ph1tmp['disabled'])) {
|
207
|
$input_errors[] = sprintf(gettext('The remote gateway "%1$s" is already used by phase1 "%2$s".'), $tremotegw, $ph1tmp['descr']);
|
208
|
}
|
209
|
}
|
210
|
$t++;
|
211
|
}
|
212
|
}
|
213
|
|
214
|
if (is_array($a_phase2) && (count($a_phase2))) {
|
215
|
foreach ($a_phase2 as $phase2) {
|
216
|
if($phase2['ikeid'] == $pconfig['ikeid']) {
|
217
|
if (($pconfig['protocol'] == "inet") && ($phase2['mode'] == "tunnel6")) {
|
218
|
$input_errors[] = gettext("There is a Phase 2 using IPv6, you cannot use IPv4.");
|
219
|
break;
|
220
|
}
|
221
|
if (($pconfig['protocol'] == "inet6") && ($phase2['mode'] == "tunnel")) {
|
222
|
$input_errors[] = gettext("There is a Phase 2 using IPv4, you cannot use IPv6.");
|
223
|
break;
|
224
|
}
|
225
|
}
|
226
|
}
|
227
|
}
|
228
|
|
229
|
/* My identity */
|
230
|
|
231
|
if ($pconfig['myid_type'] == "myaddress")
|
232
|
$pconfig['myid_data'] = "";
|
233
|
|
234
|
if ($pconfig['myid_type'] == "address" and $pconfig['myid_data'] == "")
|
235
|
$input_errors[] = gettext("Please enter an address for 'My Identifier'");
|
236
|
|
237
|
if ($pconfig['myid_type'] == "keyid tag" and $pconfig['myid_data'] == "")
|
238
|
$input_errors[] = gettext("Please enter a keyid tag for 'My Identifier'");
|
239
|
|
240
|
if ($pconfig['myid_type'] == "fqdn" and $pconfig['myid_data'] == "")
|
241
|
$input_errors[] = gettext("Please enter a fully qualified domain name for 'My Identifier'");
|
242
|
|
243
|
if ($pconfig['myid_type'] == "user_fqdn" and $pconfig['myid_data'] == "")
|
244
|
$input_errors[] = gettext("Please enter a user and fully qualified domain name for 'My Identifier'");
|
245
|
|
246
|
if ($pconfig['myid_type'] == "dyn_dns" and $pconfig['myid_data'] == "")
|
247
|
$input_errors[] = gettext("Please enter a dynamic domain name for 'My Identifier'");
|
248
|
|
249
|
if ((($pconfig['myid_type'] == "address") && !is_ipaddr($pconfig['myid_data'])))
|
250
|
$input_errors[] = gettext("A valid IP address for 'My identifier' must be specified.");
|
251
|
|
252
|
if ((($pconfig['myid_type'] == "fqdn") && !is_domain($pconfig['myid_data'])))
|
253
|
$input_errors[] = gettext("A valid domain name for 'My identifier' must be specified.");
|
254
|
|
255
|
if ($pconfig['myid_type'] == "fqdn")
|
256
|
if (is_domain($pconfig['myid_data']) == false)
|
257
|
$input_errors[] = gettext("A valid FQDN for 'My identifier' must be specified.");
|
258
|
|
259
|
if ($pconfig['myid_type'] == "user_fqdn") {
|
260
|
$user_fqdn = explode("@",$pconfig['myid_data']);
|
261
|
if (is_domain($user_fqdn[1]) == false)
|
262
|
$input_errors[] = gettext("A valid User FQDN in the form of user@my.domain.com for 'My identifier' must be specified.");
|
263
|
}
|
264
|
|
265
|
if ($pconfig['myid_type'] == "dyn_dns")
|
266
|
if (is_domain($pconfig['myid_data']) == false)
|
267
|
$input_errors[] = gettext("A valid Dynamic DNS address for 'My identifier' must be specified.");
|
268
|
|
269
|
/* Peer identity */
|
270
|
|
271
|
if ($pconfig['myid_type'] == "peeraddress")
|
272
|
$pconfig['peerid_data'] = "";
|
273
|
|
274
|
// Only enforce peer ID if we are not dealing with a pure-psk mobile config.
|
275
|
if (!(($pconfig['authentication_method'] == "pre_shared_key") && ($pconfig['mobile']))) {
|
276
|
if ($pconfig['peerid_type'] == "address" and $pconfig['peerid_data'] == "")
|
277
|
$input_errors[] = gettext("Please enter an address for 'Peer Identifier'");
|
278
|
|
279
|
if ($pconfig['peerid_type'] == "keyid tag" and $pconfig['peerid_data'] == "")
|
280
|
$input_errors[] = gettext("Please enter a keyid tag for 'Peer Identifier'");
|
281
|
|
282
|
if ($pconfig['peerid_type'] == "fqdn" and $pconfig['peerid_data'] == "")
|
283
|
$input_errors[] = gettext("Please enter a fully qualified domain name for 'Peer Identifier'");
|
284
|
|
285
|
if ($pconfig['peerid_type'] == "user_fqdn" and $pconfig['peerid_data'] == "")
|
286
|
$input_errors[] = gettext("Please enter a user and fully qualified domain name for 'Peer Identifier'");
|
287
|
|
288
|
if ((($pconfig['peerid_type'] == "address") && !is_ipaddr($pconfig['peerid_data'])))
|
289
|
$input_errors[] = gettext("A valid IP address for 'Peer identifier' must be specified.");
|
290
|
|
291
|
if ((($pconfig['peerid_type'] == "fqdn") && !is_domain($pconfig['peerid_data'])))
|
292
|
$input_errors[] = gettext("A valid domain name for 'Peer identifier' must be specified.");
|
293
|
|
294
|
if ($pconfig['peerid_type'] == "fqdn")
|
295
|
if (is_domain($pconfig['peerid_data']) == false)
|
296
|
$input_errors[] = gettext("A valid FQDN for 'Peer identifier' must be specified.");
|
297
|
|
298
|
if ($pconfig['peerid_type'] == "user_fqdn") {
|
299
|
$user_fqdn = explode("@",$pconfig['peerid_data']);
|
300
|
if (is_domain($user_fqdn[1]) == false)
|
301
|
$input_errors[] = gettext("A valid User FQDN in the form of user@my.domain.com for 'Peer identifier' must be specified.");
|
302
|
}
|
303
|
}
|
304
|
|
305
|
if ($pconfig['dpd_enable']) {
|
306
|
if (!is_numeric($pconfig['dpd_delay']))
|
307
|
$input_errors[] = gettext("A numeric value must be specified for DPD delay.");
|
308
|
|
309
|
if (!is_numeric($pconfig['dpd_maxfail']))
|
310
|
$input_errors[] = gettext("A numeric value must be specified for DPD retries.");
|
311
|
}
|
312
|
|
313
|
if (!empty($pconfig['iketype']) && $pconfig['iketype'] != "ikev1" && $pconfig['iketype'] != "ikev2")
|
314
|
$input_errors[] = gettext("Valid arguments for IKE type is v1 or v2");
|
315
|
|
316
|
/* build our encryption algorithms array */
|
317
|
$pconfig['ealgo'] = array();
|
318
|
$pconfig['ealgo']['name'] = $_POST['ealgo'];
|
319
|
if($pconfig['ealgo_keylen'])
|
320
|
$pconfig['ealgo']['keylen'] = $_POST['ealgo_keylen'];
|
321
|
|
322
|
if (!$input_errors) {
|
323
|
$ph1ent['ikeid'] = $pconfig['ikeid'];
|
324
|
$ph1ent['iketype'] = $pconfig['iketype'];
|
325
|
$ph1ent['disabled'] = $pconfig['disabled'] ? true : false;
|
326
|
$ph1ent['interface'] = $pconfig['interface'];
|
327
|
/* if the remote gateway changed and the interface is not WAN then remove route */
|
328
|
/* the vpn_ipsec_configure() handles adding the route */
|
329
|
if ($pconfig['interface'] <> "wan") {
|
330
|
if($old_ph1ent['remote-gateway'] <> $pconfig['remotegw']) {
|
331
|
mwexec("/sbin/route delete -host {$old_ph1ent['remote-gateway']}");
|
332
|
}
|
333
|
}
|
334
|
|
335
|
if ($pconfig['mobile'])
|
336
|
$ph1ent['mobile'] = true;
|
337
|
else
|
338
|
$ph1ent['remote-gateway'] = $pconfig['remotegw'];
|
339
|
|
340
|
$ph1ent['mode'] = $pconfig['mode'];
|
341
|
$ph1ent['protocol'] = $pconfig['protocol'];
|
342
|
|
343
|
$ph1ent['myid_type'] = $pconfig['myid_type'];
|
344
|
$ph1ent['myid_data'] = $pconfig['myid_data'];
|
345
|
$ph1ent['peerid_type'] = $pconfig['peerid_type'];
|
346
|
$ph1ent['peerid_data'] = $pconfig['peerid_data'];
|
347
|
|
348
|
$ph1ent['encryption-algorithm'] = $pconfig['ealgo'];
|
349
|
$ph1ent['hash-algorithm'] = $pconfig['halgo'];
|
350
|
$ph1ent['dhgroup'] = $pconfig['dhgroup'];
|
351
|
$ph1ent['lifetime'] = $pconfig['lifetime'];
|
352
|
$ph1ent['pre-shared-key'] = $pconfig['pskey'];
|
353
|
$ph1ent['private-key'] = base64_encode($pconfig['privatekey']);
|
354
|
$ph1ent['certref'] = $pconfig['certref'];
|
355
|
$ph1ent['caref'] = $pconfig['caref'];
|
356
|
$ph1ent['authentication_method'] = $pconfig['authentication_method'];
|
357
|
$ph1ent['descr'] = $pconfig['descr'];
|
358
|
$ph1ent['nat_traversal'] = $pconfig['nat_traversal'];
|
359
|
|
360
|
if (isset($pconfig['reauth_enable']))
|
361
|
$ph1ent['reauth_enable'] = true;
|
362
|
if (isset($pconfig['rekey_enable']))
|
363
|
$ph1ent['rekey_enable'] = true;
|
364
|
|
365
|
if (isset($pconfig['dpd_enable'])) {
|
366
|
$ph1ent['dpd_delay'] = $pconfig['dpd_delay'];
|
367
|
$ph1ent['dpd_maxfail'] = $pconfig['dpd_maxfail'];
|
368
|
}
|
369
|
|
370
|
/* generate unique phase1 ikeid */
|
371
|
if ($ph1ent['ikeid'] == 0)
|
372
|
$ph1ent['ikeid'] = ipsec_ikeid_next();
|
373
|
|
374
|
if (isset($p1index) && $a_phase1[$p1index])
|
375
|
$a_phase1[$p1index] = $ph1ent;
|
376
|
else
|
377
|
$a_phase1[] = $ph1ent;
|
378
|
|
379
|
write_config();
|
380
|
mark_subsystem_dirty('ipsec');
|
381
|
|
382
|
header("Location: vpn_ipsec.php");
|
383
|
exit;
|
384
|
}
|
385
|
}
|
386
|
|
387
|
if ($pconfig['mobile'])
|
388
|
$pgtitle = array(gettext("VPN"),gettext("IPsec"),gettext("Edit Phase 1"), gettext("Mobile Client"));
|
389
|
else
|
390
|
$pgtitle = array(gettext("VPN"),gettext("IPsec"),gettext("Edit Phase 1"));
|
391
|
$shortcut_section = "ipsec";
|
392
|
|
393
|
|
394
|
include("head.inc");
|
395
|
|
396
|
?>
|
397
|
|
398
|
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
|
399
|
<?php include("fbegin.inc"); ?>
|
400
|
<script type="text/javascript">
|
401
|
//<![CDATA[
|
402
|
|
403
|
function myidsel_change() {
|
404
|
index = document.iform.myid_type.selectedIndex;
|
405
|
value = document.iform.myid_type.options[index].value;
|
406
|
if (value == 'myaddress')
|
407
|
document.getElementById('myid_data').style.visibility = 'hidden';
|
408
|
else
|
409
|
document.getElementById('myid_data').style.visibility = 'visible';
|
410
|
}
|
411
|
|
412
|
function peeridsel_change() {
|
413
|
index = document.iform.peerid_type.selectedIndex;
|
414
|
value = document.iform.peerid_type.options[index].value;
|
415
|
if (value == 'peeraddress')
|
416
|
document.getElementById('peerid_data').style.visibility = 'hidden';
|
417
|
else
|
418
|
document.getElementById('peerid_data').style.visibility = 'visible';
|
419
|
}
|
420
|
|
421
|
function methodsel_change() {
|
422
|
index = document.iform.authentication_method.selectedIndex;
|
423
|
value = document.iform.authentication_method.options[index].value;
|
424
|
|
425
|
switch (value) {
|
426
|
case 'eap-tls':
|
427
|
document.getElementById('opt_psk').style.display = 'none';
|
428
|
document.getElementById('opt_peerid').style.display = '';
|
429
|
document.getElementById('opt_cert').style.display = '';
|
430
|
document.getElementById('opt_ca').style.display = '';
|
431
|
document.getElementById('opt_cert').disabled = false;
|
432
|
document.getElementById('opt_ca').disabled = false;
|
433
|
break;
|
434
|
case 'hybrid_rsa_server':
|
435
|
document.getElementById('opt_psk').style.display = 'none';
|
436
|
document.getElementById('opt_peerid').style.display = '';
|
437
|
document.getElementById('opt_cert').style.display = '';
|
438
|
document.getElementById('opt_ca').style.display = '';
|
439
|
document.getElementById('opt_cert').disabled = false;
|
440
|
document.getElementById('opt_ca').disabled = false;
|
441
|
break;
|
442
|
case 'xauth_rsa_server':
|
443
|
case 'rsasig':
|
444
|
document.getElementById('opt_psk').style.display = 'none';
|
445
|
document.getElementById('opt_peerid').style.display = '';
|
446
|
document.getElementById('opt_cert').style.display = '';
|
447
|
document.getElementById('opt_ca').style.display = '';
|
448
|
document.getElementById('opt_cert').disabled = false;
|
449
|
document.getElementById('opt_ca').disabled = false;
|
450
|
break;
|
451
|
<?php if ($pconfig['mobile']) { ?>
|
452
|
case 'pre_shared_key':
|
453
|
document.getElementById('opt_psk').style.display = 'none';
|
454
|
document.getElementById('opt_peerid').style.display = 'none';
|
455
|
document.getElementById('opt_cert').style.display = 'none';
|
456
|
document.getElementById('opt_ca').style.display = 'none';
|
457
|
document.getElementById('opt_cert').disabled = true;
|
458
|
document.getElementById('opt_ca').disabled = true;
|
459
|
break;
|
460
|
<?php } ?>
|
461
|
default: /* psk modes*/
|
462
|
document.getElementById('opt_psk').style.display = '';
|
463
|
document.getElementById('opt_peerid').style.display = '';
|
464
|
document.getElementById('opt_cert').style.display = 'none';
|
465
|
document.getElementById('opt_ca').style.display = 'none';
|
466
|
document.getElementById('opt_cert').disabled = true;
|
467
|
document.getElementById('opt_ca').disabled = true;
|
468
|
break;
|
469
|
}
|
470
|
}
|
471
|
|
472
|
/* PHP generated java script for variable length keys */
|
473
|
function ealgosel_change(bits) {
|
474
|
switch (document.iform.ealgo.selectedIndex) {
|
475
|
<?php
|
476
|
$i = 0;
|
477
|
foreach ($p1_ealgos as $algo => $algodata) {
|
478
|
if (is_array($algodata['keysel'])) {
|
479
|
echo " case {$i}:\n";
|
480
|
echo " document.iform.ealgo_keylen.style.visibility = 'visible';\n";
|
481
|
echo " document.iform.ealgo_keylen.options.length = 0;\n";
|
482
|
// echo " document.iform.ealgo_keylen.options[document.iform.ealgo_keylen.options.length] = new Option( 'auto', 'auto' );\n";
|
483
|
|
484
|
$key_hi = $algodata['keysel']['hi'];
|
485
|
$key_lo = $algodata['keysel']['lo'];
|
486
|
$key_step = $algodata['keysel']['step'];
|
487
|
|
488
|
for ($keylen = $key_hi; $keylen >= $key_lo; $keylen -= $key_step)
|
489
|
echo " document.iform.ealgo_keylen.options[document.iform.ealgo_keylen.options.length] = new Option( '{$keylen} bits', '{$keylen}' );\n";
|
490
|
echo " break;\n";
|
491
|
} else {
|
492
|
echo " case {$i}:\n";
|
493
|
echo " document.iform.ealgo_keylen.style.visibility = 'hidden';\n";
|
494
|
echo " document.iform.ealgo_keylen.options.length = 0;\n";
|
495
|
echo " break;\n";
|
496
|
}
|
497
|
$i++;
|
498
|
}
|
499
|
?>
|
500
|
}
|
501
|
|
502
|
if( bits )
|
503
|
document.iform.ealgo_keylen.value = bits;
|
504
|
}
|
505
|
|
506
|
function dpdchkbox_change() {
|
507
|
if( document.iform.dpd_enable.checked )
|
508
|
document.getElementById('opt_dpd').style.display = '';
|
509
|
else
|
510
|
document.getElementById('opt_dpd').style.display = 'none';
|
511
|
|
512
|
if (!document.iform.dpd_delay.value)
|
513
|
document.iform.dpd_delay.value = "10";
|
514
|
|
515
|
if (!document.iform.dpd_maxfail.value)
|
516
|
document.iform.dpd_maxfail.value = "5";
|
517
|
}
|
518
|
|
519
|
//]]>
|
520
|
</script>
|
521
|
|
522
|
<form action="vpn_ipsec_phase1.php" method="post" name="iform" id="iform">
|
523
|
|
524
|
<?php
|
525
|
if ($input_errors)
|
526
|
print_input_errors($input_errors);
|
527
|
?>
|
528
|
|
529
|
<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="vpn ipsec phase-1">
|
530
|
<tr class="tabnavtbl">
|
531
|
<td id="tabnav">
|
532
|
<?php
|
533
|
$tab_array = array();
|
534
|
$tab_array[0] = array(gettext("Tunnels"), true, "vpn_ipsec.php");
|
535
|
$tab_array[1] = array(gettext("Mobile clients"), false, "vpn_ipsec_mobile.php");
|
536
|
$tab_array[2] = array(gettext("Pre-Shared Keys"), false, "vpn_ipsec_keys.php");
|
537
|
$tab_array[3] = array(gettext("Advanced Settings"), false, "vpn_ipsec_settings.php");
|
538
|
display_top_tabs($tab_array);
|
539
|
?>
|
540
|
</td>
|
541
|
</tr>
|
542
|
<tr>
|
543
|
<td id="mainarea">
|
544
|
<div class="tabcont">
|
545
|
<table width="100%" border="0" cellpadding="6" cellspacing="0" summary="main area">
|
546
|
<tr>
|
547
|
<td colspan="2" valign="top" class="listtopic"><?=gettext("General information"); ?></td>
|
548
|
</tr>
|
549
|
<tr>
|
550
|
<td width="22%" valign="top" class="vncellreq"><?=gettext("Disabled"); ?></td>
|
551
|
<td width="78%" class="vtable">
|
552
|
<input name="disabled" type="checkbox" id="disabled" value="yes" <?php if ($pconfig['disabled']) echo "checked=\"checked\""; ?> />
|
553
|
<strong><?=gettext("Disable this phase1 entry"); ?></strong><br />
|
554
|
<span class="vexpl">
|
555
|
<?=gettext("Set this option to disable this phase1 without " .
|
556
|
"removing it from the list"); ?>.
|
557
|
</span>
|
558
|
</td>
|
559
|
</tr>
|
560
|
<tr>
|
561
|
<td width="22%" valign="top" class="vncellreq"><?=gettext("Key Exchange version"); ?></td>
|
562
|
<td width="78%" class="vtable">
|
563
|
<select name="iketype" class="formselect">
|
564
|
<?php
|
565
|
$keyexchange = array("ikev1" => "V1", "ikev2" => "V2");
|
566
|
foreach ($keyexchange as $kidx => $name):
|
567
|
?>
|
568
|
<option value="<?=$kidx;?>" <?php if ($kidx == $pconfig['iketype']) echo "selected=\"selected\""; ?>>
|
569
|
<?=htmlspecialchars($name);?>
|
570
|
</option>
|
571
|
<?php endforeach; ?>
|
572
|
</select> <br /> <span class="vexpl"><?=gettext("Select the KeyExchange Protocol version to be used. Usually known as IKEv1 or IKEv2."); ?>.</span>
|
573
|
</td>
|
574
|
</tr>
|
575
|
<tr>
|
576
|
<td width="22%" valign="top" class="vncellreq"><?=gettext("Internet Protocol"); ?></td>
|
577
|
<td width="78%" class="vtable">
|
578
|
<select name="protocol" class="formselect">
|
579
|
<?php
|
580
|
$protocols = array("inet" => "IPv4", "inet6" => "IPv6");
|
581
|
foreach ($protocols as $protocol => $name):
|
582
|
?>
|
583
|
<option value="<?=$protocol;?>" <?php if ($protocol == $pconfig['protocol']) echo "selected=\"selected\""; ?>>
|
584
|
<?=htmlspecialchars($name);?>
|
585
|
</option>
|
586
|
<?php endforeach; ?>
|
587
|
</select> <br /> <span class="vexpl"><?=gettext("Select the Internet Protocol family from this dropdown"); ?>.</span>
|
588
|
</td>
|
589
|
</tr>
|
590
|
<tr>
|
591
|
<td width="22%" valign="top" class="vncellreq"><?=gettext("Interface"); ?></td>
|
592
|
<td width="78%" class="vtable">
|
593
|
<select name="interface" class="formselect">
|
594
|
<?php
|
595
|
$interfaces = get_configured_interface_with_descr();
|
596
|
|
597
|
$carplist = get_configured_carp_interface_list();
|
598
|
foreach ($carplist as $cif => $carpip)
|
599
|
$interfaces[$cif] = $carpip." (".get_vip_descr($carpip).")";
|
600
|
|
601
|
$aliaslist = get_configured_ip_aliases_list();
|
602
|
foreach ($aliaslist as $aliasip => $aliasif)
|
603
|
$interfaces[$aliasip] = $aliasip." (".get_vip_descr($aliasip).")";
|
604
|
|
605
|
$grouplist = return_gateway_groups_array();
|
606
|
foreach ($grouplist as $name => $group) {
|
607
|
if($group[0]['vip'] <> "")
|
608
|
$vipif = $group[0]['vip'];
|
609
|
else
|
610
|
$vipif = $group[0]['int'];
|
611
|
$interfaces[$name] = "GW Group {$name}";
|
612
|
}
|
613
|
|
614
|
|
615
|
foreach ($interfaces as $iface => $ifacename):
|
616
|
?>
|
617
|
<option value="<?=$iface;?>" <?php if ($iface == $pconfig['interface']) echo "selected=\"selected\""; ?>>
|
618
|
<?=htmlspecialchars($ifacename);?>
|
619
|
</option>
|
620
|
<?php endforeach; ?>
|
621
|
</select>
|
622
|
<br />
|
623
|
<span class="vexpl"><?=gettext("Select the interface for the local endpoint of this phase1 entry"); ?>.</span>
|
624
|
</td>
|
625
|
</tr>
|
626
|
|
627
|
<?php if (!$pconfig['mobile']): ?>
|
628
|
|
629
|
<tr>
|
630
|
<td width="22%" valign="top" class="vncellreq"><?=gettext("Remote gateway"); ?></td>
|
631
|
<td width="78%" class="vtable">
|
632
|
<?=$mandfldhtml;?><input name="remotegw" type="text" class="formfld unknown" id="remotegw" size="28" value="<?=htmlspecialchars($pconfig['remotegw']);?>" />
|
633
|
<br />
|
634
|
<?=gettext("Enter the public IP address or host name of the remote gateway"); ?>
|
635
|
</td>
|
636
|
</tr>
|
637
|
|
638
|
<?php endif; ?>
|
639
|
|
640
|
<tr>
|
641
|
<td width="22%" valign="top" class="vncell"><?=gettext("Description"); ?></td>
|
642
|
<td width="78%" class="vtable">
|
643
|
<input name="descr" type="text" class="formfld unknown" id="descr" size="40" value="<?=htmlspecialchars($pconfig['descr']);?>" />
|
644
|
<br />
|
645
|
<span class="vexpl">
|
646
|
<?=gettext("You may enter a description here " .
|
647
|
"for your reference (not parsed)"); ?>.
|
648
|
</span>
|
649
|
</td>
|
650
|
</tr>
|
651
|
<tr>
|
652
|
<td colspan="2" class="list" height="12"></td>
|
653
|
</tr>
|
654
|
<tr>
|
655
|
<td colspan="2" valign="top" class="listtopic">
|
656
|
<?=gettext("Phase 1 proposal (Authentication)"); ?>
|
657
|
</td>
|
658
|
</tr>
|
659
|
<tr>
|
660
|
<td width="22%" valign="top" class="vncellreq"><?=gettext("Authentication method"); ?></td>
|
661
|
<td width="78%" class="vtable">
|
662
|
<select name="authentication_method" class="formselect" onchange="methodsel_change()">
|
663
|
<?php
|
664
|
foreach ($p1_authentication_methods as $method_type => $method_params):
|
665
|
if (!$pconfig['mobile'] && $method_params['mobile'])
|
666
|
continue;
|
667
|
?>
|
668
|
<option value="<?=$method_type;?>" <?php if ($method_type == $pconfig['authentication_method']) echo "selected=\"selected\""; ?>>
|
669
|
<?=htmlspecialchars($method_params['name']);?>
|
670
|
</option>
|
671
|
<?php endforeach; ?>
|
672
|
</select>
|
673
|
<br />
|
674
|
<span class="vexpl">
|
675
|
<?=gettext("Must match the setting chosen on the remote side"); ?>.
|
676
|
</span>
|
677
|
</td>
|
678
|
</tr>
|
679
|
<tr>
|
680
|
<td width="22%" valign="top" class="vncellreq"><?=gettext("Negotiation mode"); ?></td>
|
681
|
<td width="78%" class="vtable">
|
682
|
<select name="mode" class="formselect">
|
683
|
<?php
|
684
|
$modes = array("main" => "Main", "aggressive" => "Aggressive");
|
685
|
foreach ($modes as $mode => $mdescr):
|
686
|
?>
|
687
|
<option value="<?=$mode;?>" <?php if ($mode == $pconfig['mode']) echo "selected=\"selected\""; ?>>
|
688
|
<?=htmlspecialchars($mdescr);?>
|
689
|
</option>
|
690
|
<?php endforeach; ?>
|
691
|
</select> <br /> <span class="vexpl"><?=gettext("Aggressive is more flexible, but less secure"); ?>.</span>
|
692
|
</td>
|
693
|
</tr>
|
694
|
<tr>
|
695
|
<td width="22%" valign="top" class="vncellreq"><?=gettext("My identifier"); ?></td>
|
696
|
<td width="78%" class="vtable">
|
697
|
<select name="myid_type" class="formselect" onchange="myidsel_change()">
|
698
|
<?php foreach ($my_identifier_list as $id_type => $id_params): ?>
|
699
|
<option value="<?=$id_type;?>" <?php if ($id_type == $pconfig['myid_type']) echo "selected=\"selected\""; ?>>
|
700
|
<?=htmlspecialchars($id_params['desc']);?>
|
701
|
</option>
|
702
|
<?php endforeach; ?>
|
703
|
</select>
|
704
|
<input name="myid_data" type="text" class="formfld unknown" id="myid_data" size="30" value="<?=htmlspecialchars($pconfig['myid_data']);?>" />
|
705
|
</td>
|
706
|
</tr>
|
707
|
<tr id="opt_peerid">
|
708
|
<td width="22%" valign="top" class="vncellreq"><?=gettext("Peer identifier"); ?></td>
|
709
|
<td width="78%" class="vtable">
|
710
|
<select name="peerid_type" class="formselect" onchange="peeridsel_change()">
|
711
|
<?php
|
712
|
foreach ($peer_identifier_list as $id_type => $id_params):
|
713
|
if ($pconfig['mobile'] && !$id_params['mobile'])
|
714
|
continue;
|
715
|
?>
|
716
|
<option value="<?=$id_type;?>" <?php if ($id_type == $pconfig['peerid_type']) echo "selected=\"selected\""; ?>>
|
717
|
<?=htmlspecialchars($id_params['desc']);?>
|
718
|
</option>
|
719
|
<?php endforeach; ?>
|
720
|
</select>
|
721
|
<input name="peerid_data" type="text" class="formfld unknown" id="peerid_data" size="30" value="<?=htmlspecialchars($pconfig['peerid_data']);?>" />
|
722
|
<?php if ($pconfig['mobile']) { ?>
|
723
|
<br /><br /><?=gettext("NOTE: This is known as the \"group\" setting on some VPN client implementations"); ?>.
|
724
|
<?php } ?>
|
725
|
</td>
|
726
|
</tr>
|
727
|
<tr id="opt_psk">
|
728
|
<td width="22%" valign="top" class="vncellreq"><?=gettext("Pre-Shared Key"); ?></td>
|
729
|
<td width="78%" class="vtable">
|
730
|
<?=$mandfldhtml;?>
|
731
|
<input name="pskey" type="text" class="formfld unknown" id="pskey" size="40" value="<?=htmlspecialchars($pconfig['pskey']);?>" />
|
732
|
<span class="vexpl">
|
733
|
<br />
|
734
|
<?=gettext("Input your Pre-Shared Key string"); ?>.
|
735
|
</span>
|
736
|
</td>
|
737
|
</tr>
|
738
|
<tr id="opt_cert">
|
739
|
<td width="22%" valign="top" class="vncellreq"><?=gettext("My Certificate"); ?></td>
|
740
|
<td width="78%" class="vtable">
|
741
|
<select name="certref" class="formselect">
|
742
|
<?php
|
743
|
foreach ($config['cert'] as $cert):
|
744
|
$selected = "";
|
745
|
if ($pconfig['certref'] == $cert['refid'])
|
746
|
$selected = "selected=\"selected\"";
|
747
|
?>
|
748
|
<option value="<?=$cert['refid'];?>" <?=$selected;?>><?=$cert['descr'];?></option>
|
749
|
<?php endforeach; ?>
|
750
|
</select>
|
751
|
<br />
|
752
|
<span class="vexpl">
|
753
|
<?=gettext("Select a certificate previously configured in the Certificate Manager"); ?>.
|
754
|
</span>
|
755
|
</td>
|
756
|
</tr>
|
757
|
<tr id="opt_ca">
|
758
|
<td width="22%" valign="top" class="vncellreq"><?=gettext("My Certificate Authority"); ?></td>
|
759
|
<td width="78%" class="vtable">
|
760
|
<select name="caref" class="formselect">
|
761
|
<?php
|
762
|
foreach ($config['ca'] as $ca):
|
763
|
$selected = "";
|
764
|
if ($pconfig['caref'] == $ca['refid'])
|
765
|
$selected = "selected=\"selected\"";
|
766
|
?>
|
767
|
<option value="<?=$ca['refid'];?>" <?=$selected;?>><?=$ca['descr'];?></option>
|
768
|
<?php endforeach; ?>
|
769
|
</select>
|
770
|
<br />
|
771
|
<span class="vexpl">
|
772
|
<?=gettext("Select a certificate authority previously configured in the Certificate Manager"); ?>.
|
773
|
</span>
|
774
|
</td>
|
775
|
</tr>
|
776
|
<tr>
|
777
|
<td colspan="2" valign="top" class="listtopic">
|
778
|
<?=gettext("Phase 1 proposal (Algorithms)"); ?>
|
779
|
</td>
|
780
|
</tr>
|
781
|
<tr>
|
782
|
<td width="22%" valign="top" class="vncellreq"><?=gettext("Encryption algorithm"); ?></td>
|
783
|
<td width="78%" class="vtable">
|
784
|
<select name="ealgo" class="formselect" onchange="ealgosel_change()">
|
785
|
<?php
|
786
|
foreach ($p1_ealgos as $algo => $algodata):
|
787
|
$selected = "";
|
788
|
if ($algo == $pconfig['ealgo']['name'])
|
789
|
$selected = " selected=\"selected\"";
|
790
|
?>
|
791
|
<option value="<?=$algo;?>"<?=$selected?>>
|
792
|
<?=htmlspecialchars($algodata['name']);?>
|
793
|
</option>
|
794
|
<?php endforeach; ?>
|
795
|
</select>
|
796
|
<select name="ealgo_keylen" width="30" class="formselect">
|
797
|
</select>
|
798
|
</td>
|
799
|
</tr>
|
800
|
<tr>
|
801
|
<td width="22%" valign="top" class="vncellreq"><?=gettext("Hash algorithm"); ?></td>
|
802
|
<td width="78%" class="vtable">
|
803
|
<select name="halgo" class="formselect">
|
804
|
<?php foreach ($p1_halgos as $algo => $algoname): ?>
|
805
|
<option value="<?=$algo;?>" <?php if ($algo == $pconfig['halgo']) echo "selected=\"selected\""; ?>>
|
806
|
<?=htmlspecialchars($algoname);?>
|
807
|
</option>
|
808
|
<?php endforeach; ?>
|
809
|
</select>
|
810
|
<br />
|
811
|
<span class="vexpl">
|
812
|
<?=gettext("Must match the setting chosen on the remote side"); ?>.
|
813
|
</span>
|
814
|
</td>
|
815
|
</tr>
|
816
|
<tr>
|
817
|
<td width="22%" valign="top" class="vncellreq"><?=gettext("DH key group"); ?></td>
|
818
|
<td width="78%" class="vtable">
|
819
|
<select name="dhgroup" class="formselect">
|
820
|
<?php foreach ($p1_dhgroups as $keygroup => $keygroupname): ?>
|
821
|
<option value="<?=$keygroup;?>" <?php if ($keygroup == $pconfig['dhgroup']) echo "selected=\"selected\""; ?>>
|
822
|
<?=htmlspecialchars($keygroupname);?>
|
823
|
</option>
|
824
|
<?php endforeach; ?>
|
825
|
</select>
|
826
|
<br />
|
827
|
<span class="vexpl">
|
828
|
<?=gettext("Must match the setting chosen on the remote side"); ?>.
|
829
|
</span>
|
830
|
</td>
|
831
|
</tr>
|
832
|
<tr>
|
833
|
<td width="22%" valign="top" class="vncell"><?=gettext("Lifetime"); ?></td>
|
834
|
<td width="78%" class="vtable">
|
835
|
<input name="lifetime" type="text" class="formfld unknown" id="lifetime" size="20" value="<?=htmlspecialchars($pconfig['lifetime']);?>" />
|
836
|
<?=gettext("seconds"); ?>
|
837
|
</td>
|
838
|
</tr>
|
839
|
<tr>
|
840
|
<td colspan="2" class="list" height="12"></td>
|
841
|
</tr>
|
842
|
<tr>
|
843
|
<td colspan="2" valign="top" class="listtopic"><?=gettext("Advanced Options"); ?></td>
|
844
|
</tr>
|
845
|
<tr>
|
846
|
<td width="22%" valign="top" class="vncell"><?=gettext("Disable Rekey");?></td>
|
847
|
<td width="78%" class="vtable">
|
848
|
<input name="rekey_enable" type="checkbox" id="rekey_enable" value="yes" <?php if (isset($pconfig['rekey_enable'])) echo "checked=\"checked\""; ?> />
|
849
|
<?=gettext("Whether a connection should be renegotiated when it is about to expire."); ?><br />
|
850
|
</td>
|
851
|
</tr>
|
852
|
<tr>
|
853
|
<td width="22%" valign="top" class="vncell"><?=gettext("Disable Reauth");?></td>
|
854
|
<td width="78%" class="vtable">
|
855
|
<input name="reauth_enable" type="checkbox" id="reauth_enable" value="yes" <?php if (isset($pconfig['reauth_enable'])) echo "checked=\"checked\""; ?> />
|
856
|
<?=gettext("Whether rekeying of an IKE_SA should also reauthenticate the peer. In IKEv1, reauthentication is always done."); ?><br />
|
857
|
</td>
|
858
|
</tr>
|
859
|
<tr>
|
860
|
<td width="22%" valign="top" class="vncell"><?=gettext("NAT Traversal"); ?></td>
|
861
|
<td width="78%" class="vtable">
|
862
|
<select name="nat_traversal" class="formselect">
|
863
|
<option value="off" <?php if ($pconfig['nat_traversal'] == "off") echo "selected=\"selected\""; ?>><?=gettext("Disable"); ?></option>
|
864
|
<option value="on" <?php if ($pconfig['nat_traversal'] == "on") echo "selected=\"selected\""; ?>><?=gettext("Enable"); ?></option>
|
865
|
<option value="force" <?php if ($pconfig['nat_traversal'] == "force") echo "selected=\"selected\""; ?>><?=gettext("Force"); ?></option>
|
866
|
</select>
|
867
|
<br />
|
868
|
<span class="vexpl">
|
869
|
<?=gettext("Set this option to enable the use of NAT-T (i.e. the encapsulation of ESP in UDP packets) if needed, " .
|
870
|
"which can help with clients that are behind restrictive firewalls"); ?>.
|
871
|
</span>
|
872
|
</td>
|
873
|
</tr>
|
874
|
<tr>
|
875
|
<td width="22%" valign="top" class="vncell"><?=gettext("Dead Peer Detection"); ?></td>
|
876
|
<td width="78%" class="vtable">
|
877
|
<input name="dpd_enable" type="checkbox" id="dpd_enable" value="yes" <?php if (isset($pconfig['dpd_enable'])) echo "checked=\"checked\""; ?> onclick="dpdchkbox_change()" />
|
878
|
<?=gettext("Enable DPD"); ?><br />
|
879
|
<div id="opt_dpd">
|
880
|
<br />
|
881
|
<input name="dpd_delay" type="text" class="formfld unknown" id="dpd_delay" size="5" value="<?=htmlspecialchars($pconfig['dpd_delay']);?>" />
|
882
|
<?=gettext("seconds"); ?><br />
|
883
|
<span class="vexpl">
|
884
|
<?=gettext("Delay between requesting peer acknowledgement"); ?>.
|
885
|
</span><br />
|
886
|
<br />
|
887
|
<input name="dpd_maxfail" type="text" class="formfld unknown" id="dpd_maxfail" size="5" value="<?=htmlspecialchars($pconfig['dpd_maxfail']);?>" />
|
888
|
<?=gettext("retries"); ?><br />
|
889
|
<span class="vexpl">
|
890
|
<?=gettext("Number of consecutive failures allowed before disconnect"); ?>.
|
891
|
</span>
|
892
|
<br />
|
893
|
</div>
|
894
|
</td>
|
895
|
</tr>
|
896
|
<tr>
|
897
|
<td width="22%" valign="top"> </td>
|
898
|
<td width="78%">
|
899
|
<?php if (isset($p1index) && $a_phase1[$p1index]): ?>
|
900
|
<input name="p1index" type="hidden" value="<?=htmlspecialchars($p1index);?>" />
|
901
|
<?php endif; ?>
|
902
|
<?php if ($pconfig['mobile']): ?>
|
903
|
<input name="mobile" type="hidden" value="true" />
|
904
|
<?php endif; ?>
|
905
|
<input name="ikeid" type="hidden" value="<?=htmlspecialchars($pconfig['ikeid']);?>" />
|
906
|
<input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>" />
|
907
|
</td>
|
908
|
</tr>
|
909
|
</table>
|
910
|
</div>
|
911
|
</td>
|
912
|
</tr>
|
913
|
</table>
|
914
|
</form>
|
915
|
|
916
|
<script type="text/javascript">
|
917
|
//<![CDATA[
|
918
|
<?php
|
919
|
/* determine if we should init the key length */
|
920
|
$keyset = '';
|
921
|
if (isset($pconfig['ealgo']['keylen']))
|
922
|
if (is_numeric($pconfig['ealgo']['keylen']))
|
923
|
$keyset = $pconfig['ealgo']['keylen'];
|
924
|
?>
|
925
|
myidsel_change();
|
926
|
peeridsel_change();
|
927
|
methodsel_change();
|
928
|
ealgosel_change(<?=$keyset;?>);
|
929
|
dpdchkbox_change();
|
930
|
//]]>
|
931
|
</script>
|
932
|
<?php include("fend.inc"); ?>
|
933
|
</body>
|
934
|
</html>
|