Commit 9dfee192 authored by Ad Schellevis's avatar Ad Schellevis

(openvpn, csc) add tunnel_networkv6 for https://github.com/opnsense/core/issues/1161

parent 6abb99d0
...@@ -940,6 +940,15 @@ function openvpn_resync_csc_conf($settings, $server) ...@@ -940,6 +940,15 @@ function openvpn_resync_csc_conf($settings, $server)
$conf .= "ifconfig-push {$clientip} " . gen_subnet_mask($mask) . "\n"; $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'])) { if (!empty($settings['local_network'])) {
$conf .= openvpn_gen_routes($settings['local_network'], "ipv4", true); $conf .= openvpn_gen_routes($settings['local_network'], "ipv4", true);
......
...@@ -35,7 +35,7 @@ require_once("plugins.inc"); ...@@ -35,7 +35,7 @@ require_once("plugins.inc");
// define all fields used in this form // define all fields used in this form
$all_form_fields = "custom_options,disable,common_name,block,description $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 ,remote_networkv6,gwredir,push_reset,dns_domain,dns_server1
,dns_server2,dns_server3,dns_server4,ntp_server1,ntp_server2 ,dns_server2,dns_server3,dns_server4,ntp_server1,ntp_server2
,netbios_enable,netbios_ntype,netbios_scope,wins_server1 ,netbios_enable,netbios_ntype,netbios_scope,wins_server1
...@@ -131,6 +131,9 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -131,6 +131,9 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
if ($result = openvpn_validate_cidr($pconfig['tunnel_network'], 'IPv4 Tunnel Network')) { if ($result = openvpn_validate_cidr($pconfig['tunnel_network'], 'IPv4 Tunnel Network')) {
$input_errors[] = $result; $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")) { if ($result = openvpn_validate_cidr($pconfig['local_network'], 'IPv4 Local Network', true, "ipv4")) {
$input_errors[] = $result; $input_errors[] = $result;
} }
...@@ -466,6 +469,21 @@ if ($act!="new" && $act!="edit") { ...@@ -466,6 +469,21 @@ if ($act!="new" && $act!="edit") {
</div> </div>
</td> </td>
</tr> </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"> <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><a id="help_for_local_network" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("IPv4 Local Network"); ?></td>
<td> <td>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment