Projet

Général

Profil

« Précédent | Suivant » 

Révision 20452c68

Ajouté par Ermal il y a presque 10 ans

Allow to select IKE version to be used.

Voir les différences:

usr/local/www/vpn_ipsec_phase1.php
79 79
	else
80 80
		$pconfig['remotegw'] = $a_phase1[$p1index]['remote-gateway'];
81 81

  
82
	$pconfig['iketype'] = $a_phase1[$p1index]['iketype'];
82 83
	$pconfig['mode'] = $a_phase1[$p1index]['mode'];
83 84
	$pconfig['protocol'] = $a_phase1[$p1index]['protocol'];
84 85
	$pconfig['myid_type'] = $a_phase1[$p1index]['myid_type'];
......
125 126
	$pconfig['lifetime'] = "28800";
126 127
	$pconfig['nat_traversal'] = "on";
127 128
	$pconfig['dpd_enable'] = true;
129
	$pconfig['iketype'] = "ikev1";
128 130

  
129 131
	/* mobile client */
130 132
	if($_GET['mobile'])
......
297 299
			$input_errors[] = gettext("A numeric value must be specified for DPD retries.");
298 300
	}
299 301

  
302
	if (!empty($pconfig['iketype']) && $pconfig['iketype'] != "ikev1" && $pconfig['iketype'] != "ikev2")
303
		$input_errors[] = gettext("Valid arguments for IKE type is v1 or v2");
304

  
300 305
	/* build our encryption algorithms array */
301 306
	$pconfig['ealgo'] = array();
302 307
	$pconfig['ealgo']['name'] = $_POST['ealgo'];
......
305 310

  
306 311
	if (!$input_errors) {
307 312
		$ph1ent['ikeid'] = $pconfig['ikeid'];
313
		$ph1ent['iketype'] = $pconfig['iketype'];
308 314
		$ph1ent['disabled'] = $pconfig['disabled'] ? true : false;
309 315
		$ph1ent['interface'] = $pconfig['interface'];
310 316
		/* if the remote gateway changed and the interface is not WAN then remove route */
......
529 535
							</span>
530 536
						</td>
531 537
					</tr>
538
					<tr>
539
						<td width="22%" valign="top" class="vncellreq"><?=gettext("Key Exchange version"); ?></td>
540
						<td width="78%" class="vtable">
541
							<select name="iketype" class="formselect">
542
							<?php
543
								$keyexchange = array("ikev1" => "V1", "ikev2" => "V2");
544
								foreach ($keyexchange as $kidx => $name):
545
							?>
546
								<option value="<?=$kidx;?>" <?php if ($kidx == $pconfig['iketype']) echo "selected"; ?>>
547
									<?=htmlspecialchars($name);?>
548
								</option>
549
							<?php endforeach; ?>
550
							</select> <br /> <span class="vexpl"><?=gettext("Select the KeyExchange Protocol version to be used. Usually known as IKEv1 or IKEv2."); ?>.</span>
551
						</td>
552
					</tr>
532 553
					<tr>
533 554
						<td width="22%" valign="top" class="vncellreq"><?=gettext("Internet Protocol"); ?></td>
534 555
						<td width="78%" class="vtable">

Formats disponibles : Unified diff