diff options
author | marjohn56 <martin@queens-park.com> | 2016-12-21 15:26:17 +0000 |
---|---|---|
committer | marjohn56 <martin@queens-park.com> | 2016-12-21 15:26:17 +0000 |
commit | 7be23d53705ccbcee64d3236bf74b34c513da686 (patch) | |
tree | fd0af042ad225b942c1ca42972d7b3e689b42e72 /src/usr/local/www/system_advanced_network.php | |
parent | d6df09d0f2da7ed36dc9c68816ddc914f46d6522 (diff) | |
download | pfsense-7be23d53705ccbcee64d3236bf74b34c513da686.zip pfsense-7be23d53705ccbcee64d3236bf74b34c513da686.tar.gz |
User Defined DUID
User may define a DUID to use in System->Advanced->Networking. The
entered DUID is validated for composition and length, if valid it is
stored in the config.xml. On call of wan_dhcp6_configure() the DUID is
written to file to be read by dhcp6c on launch.
Diffstat (limited to 'src/usr/local/www/system_advanced_network.php')
-rw-r--r-- | src/usr/local/www/system_advanced_network.php | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/usr/local/www/system_advanced_network.php b/src/usr/local/www/system_advanced_network.php index 06a4e2d..b453045 100644 --- a/src/usr/local/www/system_advanced_network.php +++ b/src/usr/local/www/system_advanced_network.php @@ -40,6 +40,7 @@ require_once("shaper.inc"); $pconfig['ipv6nat_enable'] = isset($config['diag']['ipv6nat']['enable']); $pconfig['ipv6nat_ipaddr'] = $config['diag']['ipv6nat']['ipaddr']; $pconfig['ipv6allow'] = isset($config['system']['ipv6allow']); +$pconfig['global-v6duid'] = $config['system']['global-v6duid']; $pconfig['prefer_ipv4'] = isset($config['system']['prefer_ipv4']); $pconfig['sharednet'] = $config['system']['sharednet']; $pconfig['disablechecksumoffloading'] = isset($config['system']['disablechecksumoffloading']); @@ -83,6 +84,18 @@ if ($_POST) { unset($config['system']['prefer_ipv4']); } + if (!empty($_POST['global-v6duid'])) { + $_POST['global-v6duid'] = strtolower(str_replace("-", ":", $_POST['global-v6duid'])); + if (!is_duid($_POST['global-v6duid'])) { + $input_errors[] = gettext("A valid DUID must be specified"); + } else { + $config['system']['global-v6duid'] = $_POST['global-v6duid']; + } + } + else { + unset($config['system']['global-v6duid']); + } + if ($_POST['sharednet'] == "yes") { $config['system']['sharednet'] = true; system_disable_arp_wrong_if(); @@ -186,6 +199,15 @@ $section->addInput(new Form_Checkbox( ))->setHelp('By default, if IPv6 is configured and a hostname resolves IPv6 and IPv4 addresses, '. 'IPv6 will be used. If this option is selected, IPv4 will be preferred over IPv6.'); +$section->addInput(new Form_Input( + 'global-v6duid', + 'DHCP6 DUID', + 'text', + $pconfig['global-v6duid'], + ['placeholder' => 'xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx'] + ))->setWidth(9)->sethelp('Enter the DUID to use here. Use this option if using RAM Disk, as the DUID will be lost on reboot. The existing DUID may be found in var/db/dhcp6_duid.' .'<br />' . + 'NOTE: Do not use this option with multiple DHCP6 interfaces.'); + $form->add($section); $section = new Form_Section('Network Interfaces'); |