mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-13 08:09:41 +00:00
(openvpn, csc) add tunnel_networkv6 for https://github.com/opnsense/core/issues/1161
This commit is contained in:
parent
6abb99d072
commit
9dfee192dd
@ -940,6 +940,15 @@ function openvpn_resync_csc_conf($settings, $server)
|
||||
$conf .= "ifconfig-push {$clientip} " . gen_subnet_mask($mask) . "\n";
|
||||
}
|
||||
}
|
||||
if (!empty($settings['tunnel_networkv6'])) {
|
||||
list($ipv6, $prefix) = explode('/', $settings['tunnel_networkv6']);
|
||||
list($ipv6_1, $ipv6_2) = openvpn_get_interface_ipv6($ipv6, $prefix);
|
||||
if ($server['dev_mode'] == 'tun' && empty($server['topology_subnet'])) {
|
||||
$conf .= "ifconfig-ipv6-push {$ipv6_2} {$ipv6_1}\n";
|
||||
} else {
|
||||
$conf .= "ifconfig-ipv6-push {$ipv6_2} {$prefix}\n";
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($settings['local_network'])) {
|
||||
$conf .= openvpn_gen_routes($settings['local_network'], "ipv4", true);
|
||||
|
||||
@ -35,7 +35,7 @@ require_once("plugins.inc");
|
||||
|
||||
// define all fields used in this form
|
||||
$all_form_fields = "custom_options,disable,common_name,block,description
|
||||
,tunnel_network,local_network,local_networkv6,remote_network
|
||||
,tunnel_network,tunnel_networkv6,local_network,local_networkv6,remote_network
|
||||
,remote_networkv6,gwredir,push_reset,dns_domain,dns_server1
|
||||
,dns_server2,dns_server3,dns_server4,ntp_server1,ntp_server2
|
||||
,netbios_enable,netbios_ntype,netbios_scope,wins_server1
|
||||
@ -131,6 +131,9 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
|
||||
if ($result = openvpn_validate_cidr($pconfig['tunnel_network'], 'IPv4 Tunnel Network')) {
|
||||
$input_errors[] = $result;
|
||||
}
|
||||
if ($result = openvpn_validate_cidr($pconfig['tunnel_networkv6'], 'IPv6 Tunnel Network', false, "ipv6")) {
|
||||
$input_errors[] = $result;
|
||||
}
|
||||
if ($result = openvpn_validate_cidr($pconfig['local_network'], 'IPv4 Local Network', true, "ipv4")) {
|
||||
$input_errors[] = $result;
|
||||
}
|
||||
@ -466,6 +469,21 @@ if ($act!="new" && $act!="edit") {
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a id="help_for_tunnel_networkv6" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("IPv6 Tunnel Network"); ?></td>
|
||||
<td>
|
||||
<input name="tunnel_networkv6" type="text" value="<?=$pconfig['tunnel_networkv6'];?>" />
|
||||
<div class="hidden" for="help_for_tunnel_networkv6">
|
||||
<?=gettext("This is the IPv6 virtual network used for private " .
|
||||
"communications between this server and client " .
|
||||
"hosts expressed using CIDR (eg. fe80::/64). " .
|
||||
"The first network address will be assigned to " .
|
||||
"the server virtual interface. The remaining " .
|
||||
"network addresses can optionally be assigned " .
|
||||
"to connecting clients. (see Address Pool)"); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="local_optsv4">
|
||||
<td><a id="help_for_local_network" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("IPv4 Local Network"); ?></td>
|
||||
<td>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user