dhcpv6 static leases with tracked interface: apply prefix to fixed IPv6 address

PR: https://github.com/opnsense/core/pull/2859
This commit is contained in:
Raimar Sandner 2018-10-28 16:36:08 +01:00 committed by Franco Fichtner
parent 7f267551bb
commit 26705ee022
2 changed files with 11 additions and 0 deletions

View File

@ -1385,6 +1385,14 @@ host s_{$dhcpv6if}_{$i} {
host-identifier option dhcp6.client-id {$sm['duid']};
EOD;
if (!empty($sm['ipaddrv6'])) {
if (isset($config['interfaces'][$dhcpv6if]['dhcpd6track6allowoverride']) && is_ipaddrv6($ifcfgipv6)) {
$sm['ipaddrv6'] = make_ipv6_64_address($ifcfgipv6, $sm['ipaddrv6']);
} else {
unset($sm['ipaddrv6']);
}
}
if (!empty($sm['ipaddrv6'])) {
$dhcpdv6conf .= " fixed-address6 {$sm['ipaddrv6']};\n";
}

View File

@ -180,6 +180,9 @@ include("head.inc");
<?=gettext("If an IPv6 address is entered, the address must be outside of the pool.");?>
<br />
<?=gettext("If no IPv6 address is given, one will be dynamically allocated from the pool.");?>
<br />
<?= gettext("When using a static WAN address, this should be entered using the full IPv6 address. " .
"When using a dynamic WAN address, only enter the suffix part (i.e. ::1:2:3:4)."); ?>
</div>
</td>
</tr>