Projet

Général

Profil

« Précédent | Suivant » 

Révision b9e9903d

Ajouté par Dmitriy K. il y a presque 10 ans

patchpack1

-Fix #3401 (Added tun option "Disable IPv6"
-Added new options: route-nopull, route-noexec, verb;

Voir les différences:

usr/local/www/vpn_openvpn_client.php
93 93
	$pconfig['autotls_enable'] = "yes";
94 94
	$pconfig['interface'] = "wan";
95 95
	$pconfig['server_port'] = 1194;
96
	$pconfig['verbosity_level'] = 1; // Default verbosity is 1
96 97
	// OpenVPN Defaults to SHA1
97 98
	$pconfig['digest'] = "SHA1";
98 99
}
......
152 153
		// just in case the modes switch
153 154
		$pconfig['autokey_enable'] = "yes";
154 155
		$pconfig['autotls_enable'] = "yes";
156
		
157
		// New features
158
		$pconfig['no_tun_ipv6'] = $a_client[$id]['no_tun_ipv6'];
159
		$pconfig['route_no_pull'] = $a_client[$id]['route_no_pull'];
160
		$pconfig['route_no_exec'] = $a_client[$id]['route_no_exec'];
161
		$pconfig['verbosity_level'] = $a_client[$id]['verbosity_level'];
155 162
	}
156 163
}
157 164

  
......
311 318
		$client['compression'] = $pconfig['compression'];
312 319
		$client['passtos'] = $pconfig['passtos'];
313 320

  
321
		// New features
322
		$client['no_tun_ipv6'] = $pconfig['no_tun_ipv6'];
323
		$client['route_no_pull'] = $pconfig['route_no_pull'];
324
		$client['route_no_exec'] = $pconfig['route_no_exec'];
325
		$client['verbosity_level'] = $pconfig['verbosity_level'];
326

  
314 327
		if (isset($id) && $a_client[$id])
315 328
			$a_client[$id] = $client;
316 329
		else
......
352 365
	}
353 366
}
354 367

  
368
function dev_mode_change() {
369
	index = document.iform.dev_mode.selectedIndex;
370
	value = document.iform.dev_mode.options[index].value;
371
	switch(value) {
372
		case "tun":
373
			document.getElementById("chkboxNoTunIPv6").style.display="";
374
			break;
375
		case "tap":
376
			document.getElementById("chkboxNoTunIPv6").style.display="none";
377
			break;
378
	}
379
}
380

  
355 381
function autokey_change() {
356 382
	if (document.iform.autokey_enable.checked)
357 383
		document.getElementById("autokey_opts").style.display="none";
......
482 508
					<tr>
483 509
						<td width="22%" valign="top" class="vncellreq"><?=gettext("Device mode");?></td>
484 510
							<td width="78%" class="vtable">
485
							<select name='dev_mode' class="formselect">
511
							<select name='dev_mode' class="formselect" onchange="dev_mode_change()">
486 512
							<?php
487 513
								foreach ($openvpn_dev_mode as $mode):
488 514
									$selected = "";
......
954 980
							</table>
955 981
						</td>
956 982
					</tr>
983

  
984

  
985
					<tr id="chkboxNoTunIPv6">
986
						<td width="22%" valign="top" class="vncell"><?=gettext("Disable IPv6"); ?></td>
987
						<td width="78%" class="vtable">
988
							<table border="0" cellpadding="2" cellspacing="0" summary="disable-ipv6">
989
								<tr>
990
									<td>
991
										<?php set_checked($pconfig['no_tun_ipv6'],$chk); ?>
992
										<input name="no_tun_ipv6" type="checkbox" value="yes" <?=$chk;?> />
993
									</td>
994
									<td>
995
										<span class="vexpl">
996
											<?=gettext("Do not forward IPv6 traffic"); ?>.
997
										</span>
998
									</td>
999
								</tr>
1000
							</table>
1001
						</td>
1002
					</tr>
1003

  
1004
					<tr id="chkboxRouteNoPull">
1005
						<td width="22%" valign="top" class="vncell"><?=gettext("Dont pull routes"); ?></td>
1006
						<td width="78%" class="vtable">
1007
							<table border="0" cellpadding="2" cellspacing="0" summary="dont-pull-routes">
1008
								<tr>
1009
									<td>
1010
										<?php set_checked($pconfig['route_no_pull'],$chk); ?>
1011
										<input name="route_no_pull" type="checkbox" value="yes" <?=$chk;?> />
1012
									</td>
1013
									<td>
1014
										<span class="vexpl">
1015
											<?=gettext("Don't add or remove routes automatically. Instead pass routes to "); ?> <strong>--route-up</strong> <?=gettext("script using environmental variables"); ?>.
1016
										</span>
1017
									</td>
1018
								</tr>
1019
							</table>
1020
						</td>
1021
					</tr>
1022

  
1023
					<tr id="chkboxRouteNoExec">
1024
						<td width="22%" valign="top" class="vncell"><?=gettext("Dont add/remove routes"); ?></td>
1025
						<td width="78%" class="vtable">
1026
							<table border="0" cellpadding="2" cellspacing="0" summary="dont-exec-routes">
1027
								<tr>
1028
									<td>
1029
										<?php set_checked($pconfig['route_no_exec'],$chk); ?>
1030
										<input name="route_no_exec" type="checkbox" value="yes" <?=$chk;?> />
1031
									</td>
1032
									<td>
1033
										<span class="vexpl">
1034
											<?=gettext("This option effectively bars the server from adding routes to the client's routing table, however note that this option still allows the server to set the TCP/IP properties of the client's TUN/TAP interface"); ?>.
1035
										</span>
1036
									</td>
1037
								</tr>
1038
							</table>
1039
						</td>
1040
					</tr>
957 1041
				</table>
958 1042

  
959 1043
				<table width="100%" border="0" cellpadding="6" cellspacing="0" id="client_opts" summary="advance configuration">
......
977 1061
							</table>
978 1062
						</td>
979 1063
					</tr>
1064

  
1065
					<tr id="comboboxVerbosityLevel">
1066
							<td width="22%" valign="top" class="vncell"><?=gettext("Verbosity level");?></td>
1067
							<td width="78%" class="vtable">
1068
							<select name="verbosity_level" class="formselect">
1069
							<?php
1070
								foreach ($openvpn_verbosity_level as $verb_value => $verb_desc):
1071
									$selected = "";
1072
									if ($pconfig['verbosity_level'] == $verb_value)
1073
										$selected = "selected=\"selected\"";
1074
							?>
1075
								<option value="<?=$verb_value;?>" <?=$selected;?>><?=$verb_desc;?></option>
1076
							<?php endforeach; ?>
1077
							</select>
1078
							<br />
1079
							<?=gettext("Each level shows all info from the previous levels. Level 3 is recommended if you want a good summary of what's happening without being swamped by output"); ?>.<br /> <br />
1080
							<strong>none</strong> -- <?=gettext("No output except fatal errors"); ?>. <br />
1081
							<strong>default</strong>-<strong>4</strong> -- <?=gettext("Normal usage range"); ?>. <br />
1082
							<strong>5</strong> -- <?=gettext("Output R and W characters to the console for each packet read and write, uppercase is used for TCP/UDP packets and lowercase is used for TUN/TAP packets"); ?>. <br />
1083
							<strong>6</strong>-<strong>11</strong> -- <?=gettext("Debug info range"); ?>.
1084
							</td>
1085
					</tr>
1086

  
980 1087
				</table>
981 1088

  
982 1089
				<br />

Formats disponibles : Unified diff