Project

General

Profile

Download (38.2 KB) Statistics
| Branch: | Tag: | Revision:
1 99caa67c Seth Mos
<?php
2
/* $Id$ */
3
/*
4
	services_dhcpv6.php
5
	parts of m0n0wall (http://m0n0.ch/wall)
6
7
	Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
8
	All rights reserved.
9
10
	part of pfSense (http://www.pfsense.org)
11
	Copyright (C) 2010 Seth Mos <seth.mos@dds.nl>.
12
	All rights reserved.
13
14
	Redistribution and use in source and binary forms, with or without
15
	modification, are permitted provided that the following conditions are met:
16
17
	1. Redistributions of source code must retain the above copyright notice,
18
	   this list of conditions and the following disclaimer.
19
20
	2. Redistributions in binary form must reproduce the above copyright
21
	   notice, this list of conditions and the following disclaimer in the
22
	   documentation and/or other materials provided with the distribution.
23
24
	THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
25
	INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
26
	AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27
	AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
28
	OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29
	SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
30
	INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
31
	CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32
	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33
	POSSIBILITY OF SUCH DAMAGE.
34
*/
35
/*
36
	pfSense_BUILDER_BINARIES:	/bin/rm
37
	pfSense_MODULE:	interfaces
38
*/
39
40
##|+PRIV
41
##|*IDENT=page-services-dhcpv6server
42
##|*NAME=Services: DHCPv6 server page
43
##|*DESCR=Allow access to the 'Services: DHCPv6 server' page.
44
##|*MATCH=services_dhcpv6.php*
45
##|-PRIV
46
47
require("guiconfig.inc");
48
49
if(!$g['services_dhcp_server_enable']) {
50
	Header("Location: /");
51
	exit;
52
}
53
54
/*  Fix failover DHCP problem
55
 *  http://article.gmane.org/gmane.comp.security.firewalls.pfsense.support/18749
56
 */
57
ini_set("memory_limit","64M");
58
59
$if = $_GET['if'];
60
if ($_POST['if'])
61
	$if = $_POST['if'];
62
63
/* if OLSRD is enabled, allow WAN to house DHCP. */
64
if($config['installedpackages']['olsrd']) {
65
	foreach($config['installedpackages']['olsrd']['config'] as $olsrd) {
66
			if($olsrd['enable']) {
67
				$is_olsr_enabled = true;
68
				break;
69
			}
70
	}
71
}
72
73
if (!$_GET['if'])
74 1c8dbfbb Darren Embry
	$savemsg = "<p><b>" . gettext("The DHCPv6 Server can only be enabled on interfaces configured with static IP addresses") . ".</b></p>" .
75
		   "<p><b>" . gettext("Only interfaces configured with a static IP will be shown") . ".</b></p>";
76 99caa67c Seth Mos
77
$iflist = get_configured_interface_with_descr();
78 16d9ad13 smos
$iflist = array_merge($iflist, get_configured_pppoe_server_interfaces());
79 99caa67c Seth Mos
80
/* set the starting interface */
81
if (!$if || !isset($iflist[$if])) {
82
	foreach ($iflist as $ifent => $ifname) {
83
		$oc = $config['interfaces'][$ifent];
84 c7255ec1 Pierre POMES
		if ((is_array($config['dhcpdv6'][$ifent]) && !isset($config['dhcpdv6'][$ifent]['enable']) && !(is_ipaddrv6($oc['ipaddrv6']) && (!preg_match("/fe80::/", $oc['ipaddrv6'])))) ||
85
			(!is_array($config['dhcpdv6'][$ifent]) && !(is_ipaddrv6($oc['ipaddrv6']) && (!preg_match("/fe80::/", $oc['ipaddrv6'])))))
86 99caa67c Seth Mos
			continue;
87
		$if = $ifent;
88
		break;
89
	}
90
}
91
92
if (is_array($config['dhcpdv6'][$if])){
93 fe838158 smos
	/* DHCPv6 */
94 99caa67c Seth Mos
	if (is_array($config['dhcpdv6'][$if]['range'])) {
95
		$pconfig['range_from'] = $config['dhcpdv6'][$if]['range']['from'];
96
		$pconfig['range_to'] = $config['dhcpdv6'][$if]['range']['to'];
97
	}
98 bfb3e717 Seth Mos
	if (is_array($config['dhcpdv6'][$if]['prefixrange'])) {
99
		$pconfig['prefixrange_from'] = $config['dhcpdv6'][$if]['prefixrange']['from'];
100
		$pconfig['prefixrange_to'] = $config['dhcpdv6'][$if]['prefixrange']['to'];
101
		$pconfig['prefixrange_length'] = $config['dhcpdv6'][$if]['prefixrange']['prefixlength'];
102
	}
103 99caa67c Seth Mos
	$pconfig['deftime'] = $config['dhcpdv6'][$if]['defaultleasetime'];
104
	$pconfig['maxtime'] = $config['dhcpdv6'][$if]['maxleasetime'];
105
	$pconfig['domain'] = $config['dhcpdv6'][$if]['domain'];
106
	$pconfig['domainsearchlist'] = $config['dhcpdv6'][$if]['domainsearchlist'];
107 13399e17 Seth Mos
	list($pconfig['wins1'],$pconfig['wins2']) = $config['dhcpdv6'][$if]['winsserver'];
108
	list($pconfig['dns1'],$pconfig['dns2']) = $config['dhcpdv6'][$if]['dnsserver'];
109 99caa67c Seth Mos
	$pconfig['enable'] = isset($config['dhcpdv6'][$if]['enable']);
110
	$pconfig['denyunknown'] = isset($config['dhcpdv6'][$if]['denyunknown']);
111
	$pconfig['ddnsdomain'] = $config['dhcpdv6'][$if]['ddnsdomain'];
112
	$pconfig['ddnsupdate'] = isset($config['dhcpdv6'][$if]['ddnsupdate']);
113
	list($pconfig['ntp1'],$pconfig['ntp2']) = $config['dhcpdv6'][$if]['ntpserver'];
114
	$pconfig['tftp'] = $config['dhcpdv6'][$if]['tftp'];
115
	$pconfig['ldap'] = $config['dhcpdv6'][$if]['ldap'];
116
	$pconfig['netboot'] = isset($config['dhcpdv6'][$if]['netboot']);
117 a2578c27 Anthony Wrather
	$pconfig['nextserver'] = $config['dhcpdv6'][$if]['nextserver'];
118 99caa67c Seth Mos
	$pconfig['filename'] = $config['dhcpdv6'][$if]['filename'];
119
	$pconfig['rootpath'] = $config['dhcpdv6'][$if]['rootpath'];
120
	$pconfig['netmask'] = $config['dhcpdv6'][$if]['netmask'];
121
	$pconfig['numberoptions'] = $config['dhcpdv6'][$if]['numberoptions'];
122 138208bf Joecowboy
	$pconfig['dhcpv6leaseinlocaltime'] = $config['dhcpdv6'][$if]['dhcpv6leaseinlocaltime'];
123 99caa67c Seth Mos
	if (!is_array($config['dhcpdv6'][$if]['staticmap']))
124
		$config['dhcpdv6'][$if]['staticmap'] = array();
125
	$a_maps = &$config['dhcpdv6'][$if]['staticmap'];
126
}
127
128
$ifcfgip = get_interface_ipv6($if);
129
$ifcfgsn = get_interface_subnetv6($if);
130
131
/*   set the enabled flag which will tell us if DHCP relay is enabled
132
 *   on any interface. We will use this to disable DHCP server since
133
 *   the two are not compatible with each other.
134
 */
135
136
$dhcrelay_enabled = false;
137 80c88a68 smos
$dhcrelaycfg = $config['dhcrelay6'];
138 99caa67c Seth Mos
139
if(is_array($dhcrelaycfg)) {
140
	foreach ($dhcrelaycfg as $dhcrelayif => $dhcrelayifconf) {
141
		if (isset($dhcrelayifconf['enable']) && isset($iflist[$dhcrelayif]) &&
142
			(!link_interface_to_bridge($dhcrelayif)))
143
			$dhcrelay_enabled = true;
144
	}
145
}
146
147
if ($_POST) {
148
149
	unset($input_errors);
150
151
	$pconfig = $_POST;
152
153
	$numberoptions = array();
154
	for($x=0; $x<99; $x++) {
155
		if(isset($_POST["number{$x}"]) && ctype_digit($_POST["number{$x}"])) {
156
			$numbervalue = array();
157
			$numbervalue['number'] = htmlspecialchars($_POST["number{$x}"]);
158
			$numbervalue['value'] = htmlspecialchars($_POST["value{$x}"]);
159
			$numberoptions['item'][] = $numbervalue;
160
		}
161
	}
162
	// Reload the new pconfig variable that the forum uses.
163
	$pconfig['numberoptions'] = $numberoptions;
164
165
	/* input validation */
166
	if ($_POST['enable']) {
167
		$reqdfields = explode(" ", "range_from range_to");
168
		$reqdfieldsn = array(gettext("Range begin"),gettext("Range end"));
169
170
		do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
171
172 bfb3e717 Seth Mos
		if (($_POST['prefixrange_from'] && !is_ipaddrv6($_POST['prefixrange_from'])))
173
			$input_errors[] = gettext("A valid range must be specified.");
174
		if (($_POST['prefixrange_to'] && !is_ipaddrv6($_POST['prefixrange_to'])))
175
			$input_errors[] = gettext("A valid prefix range must be specified.");
176 cd9fa56b Seth Mos
		if (($_POST['range_from'] && !is_ipaddrv6($_POST['range_from'])))
177 99caa67c Seth Mos
			$input_errors[] = gettext("A valid range must be specified.");
178
		if (($_POST['range_to'] && !is_ipaddrv6($_POST['range_to'])))
179
			$input_errors[] = gettext("A valid range must be specified.");
180
		if (($_POST['gateway'] && !is_ipaddrv6($_POST['gateway'])))
181
			$input_errors[] = gettext("A valid IPv6 address must be specified for the gateway.");
182
		if (($_POST['dns1'] && !is_ipaddrv6($_POST['dns1'])) || ($_POST['dns2'] && !is_ipaddrv6($_POST['dns2'])))
183
			$input_errors[] = gettext("A valid IPv6 address must be specified for the primary/secondary DNS servers.");
184
185
		if ($_POST['deftime'] && (!is_numeric($_POST['deftime']) || ($_POST['deftime'] < 60)))
186
			$input_errors[] = gettext("The default lease time must be at least 60 seconds.");
187
		if ($_POST['maxtime'] && (!is_numeric($_POST['maxtime']) || ($_POST['maxtime'] < 60) || ($_POST['maxtime'] <= $_POST['deftime'])))
188
			$input_errors[] = gettext("The maximum lease time must be at least 60 seconds and higher than the default lease time.");
189
		if (($_POST['ddnsdomain'] && !is_domain($_POST['ddnsdomain'])))
190
			$input_errors[] = gettext("A valid domain name must be specified for the dynamic DNS registration.");
191 a3de8b9e Pierre POMES
		if ($_POST['domainsearchlist']) {
192
			$domain_array=preg_split("/[ ;]+/",$_POST['domainsearchlist']);
193
			foreach ($domain_array as $curdomain) {
194
				if (!is_domain($curdomain)) {
195
					$input_errors[] = gettext("A valid domain search list must be specified.");
196
					break;
197
				}
198
			}
199
		}
200
201 99caa67c Seth Mos
		if (($_POST['ntp1'] && !is_ipaddrv6($_POST['ntp1'])) || ($_POST['ntp2'] && !is_ipaddrv6($_POST['ntp2'])))
202
			$input_errors[] = gettext("A valid IPv6 address must be specified for the primary/secondary NTP servers.");
203
		if (($_POST['domain'] && !is_domain($_POST['domain'])))
204
			$input_errors[] = gettext("A valid domain name must be specified for the DNS domain.");
205
		if ($_POST['tftp'] && !is_ipaddr($_POST['tftp']) && !is_domain($_POST['tftp']) && !is_URL($_POST['tftp']))
206
			$input_errors[] = gettext("A valid IPv6 address or hostname must be specified for the TFTP server.");
207
		if (($_POST['nextserver'] && !is_ipaddrv6($_POST['nextserver'])))
208
			$input_errors[] = gettext("A valid IPv6 address must be specified for the network boot server.");
209
210
		// Disallow a range that includes the virtualip
211
		if (is_array($config['virtualip']['vip'])) {
212
			foreach($config['virtualip']['vip'] as $vip) {
213
				if($vip['interface'] == $if)
214 41b4867e Renato Botelho
					if($vip['subnetv6'] && is_inrange_v6($vip['subnetv6'], $_POST['range_from'], $_POST['range_to']))
215 99caa67c Seth Mos
						$input_errors[] = sprintf(gettext("The subnet range cannot overlap with virtual IPv6 address %s."),$vip['subnetv6']);
216
			}
217
		}
218
219
		$noip = false;
220
		if(is_array($a_maps))
221
			foreach ($a_maps as $map)
222
				if (empty($map['ipaddrv6']))
223
					$noip = true;
224
		if (!$input_errors) {
225
			/* make sure the range lies within the current subnet */
226
			$subnet_start = gen_subnetv6($ifcfgip, $ifcfgsn);
227
			$subnet_end = gen_subnetv6_max($ifcfgip, $ifcfgsn);
228
229 16d9ad13 smos
			if (is_ipaddrv6($ifcfgip)) {
230 41b4867e Renato Botelho
				if ((! is_inrange_v6($_POST['range_from'], $subnet_start, $subnet_end)) ||
231
			   	 (! is_inrange_v6($_POST['range_to'], $subnet_start, $subnet_end))) {
232 16d9ad13 smos
					$input_errors[] = gettext("The specified range lies outside of the current subnet.");
233
				}
234 99caa67c Seth Mos
			}
235 731de711 Pierre POMES
			/* "from" cannot be higher than "to" */
236
			if (inet_pton($_POST['range_from']) > inet_pton($_POST['range_to']))
237 99caa67c Seth Mos
				$input_errors[] = gettext("The range is invalid (first element higher than second element).");
238
239
			/* make sure that the DHCP Relay isn't enabled on this interface */
240
			if (isset($config['dhcrelay'][$if]['enable']))
241
				$input_errors[] = sprintf(gettext("You must disable the DHCP relay on the %s interface before enabling the DHCP server."),$iflist[$if]);
242
243 731de711 Pierre POMES
244
			/* Verify static mappings do not overlap:
245
			   - available DHCP range
246
			   - prefix delegation range (FIXME: still need to be completed) */
247
			$dynsubnet_start = inet_pton($_POST['range_from']);
248
			$dynsubnet_end = inet_pton($_POST['range_to']);
249
250 99caa67c Seth Mos
			if(is_array($a_maps)) {
251
				foreach ($a_maps as $map) {
252
					if (empty($map['ipaddrv6']))
253
						continue;
254 731de711 Pierre POMES
					if ((inet_pton($map['ipaddrv6']) > $dynsubnet_start) &&
255 17aa0c18 Pierre POMES
						(inet_pton($map['ipaddrv6']) < $dynsubnet_end)) {
256 99caa67c Seth Mos
						$input_errors[] = sprintf(gettext("The DHCP range cannot overlap any static DHCP mappings."));
257
						break;
258
					}
259
				}
260
			}
261
		}
262
	}
263
264
	if (!$input_errors) {
265
		if (!is_array($config['dhcpdv6'][$if]))
266
			$config['dhcpdv6'][$if] = array();
267
		if (!is_array($config['dhcpdv6'][$if]['range']))
268
			$config['dhcpdv6'][$if]['range'] = array();
269 bfb3e717 Seth Mos
		if (!is_array($config['dhcpdv6'][$if]['prefixrange']))
270
			$config['dhcpdv6'][$if]['prefixrange'] = array();
271 99caa67c Seth Mos
272
		$config['dhcpdv6'][$if]['range']['from'] = $_POST['range_from'];
273
		$config['dhcpdv6'][$if]['range']['to'] = $_POST['range_to'];
274 bfb3e717 Seth Mos
		$config['dhcpdv6'][$if]['prefixrange']['from'] = $_POST['prefixrange_from'];
275
		$config['dhcpdv6'][$if]['prefixrange']['to'] = $_POST['prefixrange_to'];
276
		$config['dhcpdv6'][$if]['prefixrange']['prefixlength'] = $_POST['prefixrange_length'];
277 99caa67c Seth Mos
		$config['dhcpdv6'][$if]['defaultleasetime'] = $_POST['deftime'];
278
		$config['dhcpdv6'][$if]['maxleasetime'] = $_POST['maxtime'];
279
		$config['dhcpdv6'][$if]['netmask'] = $_POST['netmask'];
280
		$previous = $config['dhcpdv6'][$if]['failover_peerip'];
281
		if($previous <> $_POST['failover_peerip'])
282
			mwexec("/bin/rm -rf /var/dhcpd/var/db/*");
283
284
		$config['dhcpdv6'][$if]['failover_peerip'] = $_POST['failover_peerip'];
285
286
		unset($config['dhcpdv6'][$if]['winsserver']);
287
288
		unset($config['dhcpdv6'][$if]['dnsserver']);
289
		if ($_POST['dns1'])
290
			$config['dhcpdv6'][$if]['dnsserver'][] = $_POST['dns1'];
291
		if ($_POST['dns2'])
292
			$config['dhcpdv6'][$if]['dnsserver'][] = $_POST['dns2'];
293
294
		$config['dhcpdv6'][$if]['domain'] = $_POST['domain'];
295
		$config['dhcpdv6'][$if]['domainsearchlist'] = $_POST['domainsearchlist'];
296
		$config['dhcpdv6'][$if]['denyunknown'] = ($_POST['denyunknown']) ? true : false;
297
		$config['dhcpdv6'][$if]['enable'] = ($_POST['enable']) ? true : false;
298
		$config['dhcpdv6'][$if]['ddnsdomain'] = $_POST['ddnsdomain'];
299
		$config['dhcpdv6'][$if]['ddnsupdate'] = ($_POST['ddnsupdate']) ? true : false;
300
301
		unset($config['dhcpdv6'][$if]['ntpserver']);
302
		if ($_POST['ntp1'])
303
			$config['dhcpdv6'][$if]['ntpserver'][] = $_POST['ntp1'];
304
		if ($_POST['ntp2'])
305
			$config['dhcpdv6'][$if]['ntpserver'][] = $_POST['ntp2'];
306
307
		$config['dhcpdv6'][$if]['tftp'] = $_POST['tftp'];
308
		$config['dhcpdv6'][$if]['ldap'] = $_POST['ldap'];
309
		$config['dhcpdv6'][$if]['netboot'] = ($_POST['netboot']) ? true : false;
310 a2578c27 Anthony Wrather
		$config['dhcpdv6'][$if]['nextserver'] = $_POST['nextserver'];
311 99caa67c Seth Mos
		$config['dhcpdv6'][$if]['filename'] = $_POST['filename'];
312
		$config['dhcpdv6'][$if]['rootpath'] = $_POST['rootpath'];
313 138208bf Joecowboy
		$config['dhcpdv6'][$if]['dhcpv6leaseinlocaltime'] = $_POST['dhcpv6leaseinlocaltime'];
314 99caa67c Seth Mos
315
		// Handle the custom options rowhelper
316
		if(isset($config['dhcpdv6'][$if]['numberoptions']['item']))
317
			unset($config['dhcpdv6'][$if]['numberoptions']['item']);
318
319
		$config['dhcpdv6'][$if]['numberoptions'] = $numberoptions;
320
321
		write_config();
322
323
		$retval = 0;
324
		$retvaldhcp = 0;
325
		$retvaldns = 0;
326
		/* Stop DHCPv6 so we can cleanup leases */
327 e074fb75 Renato Botelho
		killbypid("{$g['dhcpd_chroot_path']}{$g['varrun_path']}/dhcpdv6.pid");
328 2fb056d8 Seth Mos
		// dhcp_clean_leases();
329 99caa67c Seth Mos
		/* dnsmasq_configure calls dhcpd_configure */
330
		/* no need to restart dhcpd twice */
331
		if (isset($config['dnsmasq']['regdhcpstatic']))	{
332
			$retvaldns = services_dnsmasq_configure();
333
			if ($retvaldns == 0) {
334
				clear_subsystem_dirty('hosts');
335
				clear_subsystem_dirty('staticmaps');
336
			}
337
		} else {
338
			$retvaldhcp = services_dhcpd_configure();
339
			if ($retvaldhcp == 0)
340
				clear_subsystem_dirty('staticmaps');
341
		}
342
		if($retvaldhcp == 1 || $retvaldns == 1)
343
			$retval = 1;
344
		$savemsg = get_std_save_message($retval);
345
	}
346
}
347
348
if ($_GET['act'] == "del") {
349
	if ($a_maps[$_GET['id']]) {
350
		unset($a_maps[$_GET['id']]);
351
		write_config();
352
		if(isset($config['dhcpdv6'][$if]['enable'])) {
353
			mark_subsystem_dirty('staticmapsv6');
354
			if (isset($config['dnsmasq']['regdhcpstaticv6']))
355
				mark_subsystem_dirty('hosts');
356
		}
357
		header("Location: services_dhcpv6.php?if={$if}");
358
		exit;
359
	}
360
}
361
362
$pgtitle = array(gettext("Services"),gettext("DHCPv6 server"));
363 b32dd0a6 jim-p
$shortcut_section = "dhcp6";
364 99caa67c Seth Mos
365
include("head.inc");
366
367
?>
368
369
<script type="text/javascript" src="/javascript/row_helper.js">
370
</script>
371
372
<script type="text/javascript">
373
	rowname[0] = "number";
374
	rowtype[0] = "textbox";
375
	rowsize[0] = "10";
376
	rowname[1] = "value";
377
	rowtype[1] = "textbox";
378
	rowsize[1] = "55";
379
</script>
380
381
<script type="text/javascript" language="JavaScript">
382 2fb056d8 Seth Mos
	function enable_change(enable_over) {
383
		var endis;
384
		endis = !(document.iform.enable.checked || enable_over);
385
		document.iform.range_from.disabled = endis;
386
		document.iform.range_to.disabled = endis;
387 bfb3e717 Seth Mos
		document.iform.prefixrange_from.disabled = endis;
388
		document.iform.prefixrange_to.disabled = endis;
389
		document.iform.prefixrange_length.disabled = endis;
390 2fb056d8 Seth Mos
		document.iform.dns1.disabled = endis;
391
		document.iform.dns2.disabled = endis;
392
		document.iform.deftime.disabled = endis;
393
		document.iform.maxtime.disabled = endis;
394 adaa3f75 Joecowboy
		//document.iform.gateway.disabled = endis;
395 2fb056d8 Seth Mos
		document.iform.failover_peerip.disabled = endis;
396 138208bf Joecowboy
		document.iform.dhcpv6leaseinlocaltime.disabled = endis;
397 2fb056d8 Seth Mos
		document.iform.domain.disabled = endis;
398
		document.iform.domainsearchlist.disabled = endis;
399
		document.iform.ddnsdomain.disabled = endis;
400
		document.iform.ddnsupdate.disabled = endis;
401 4096fe5d smos
		document.iform.ntp1.disabled = endis;
402
		document.iform.ntp2.disabled = endis;
403 adaa3f75 Joecowboy
		//document.iform.tftp.disabled = endis;
404 2fb056d8 Seth Mos
		document.iform.ldap.disabled = endis;
405
		document.iform.netboot.disabled = endis;
406
		document.iform.nextserver.disabled = endis;
407
		document.iform.filename.disabled = endis;
408
		document.iform.rootpath.disabled = endis;
409
		document.iform.denyunknown.disabled = endis;
410 99caa67c Seth Mos
	}
411
412
	function show_shownumbervalue() {
413
		document.getElementById("shownumbervaluebox").innerHTML='';
414
		aodiv = document.getElementById('shownumbervalue');
415
		aodiv.style.display = "block";
416
	}
417
418
	function show_ddns_config() {
419
		document.getElementById("showddnsbox").innerHTML='';
420
		aodiv = document.getElementById('showddns');
421
		aodiv.style.display = "block";
422
	}
423
	function show_ntp_config() {
424
		document.getElementById("showntpbox").innerHTML='';
425
		aodiv = document.getElementById('showntp');
426
		aodiv.style.display = "block";
427
	}
428 7d504365 smos
	/*
429 99caa67c Seth Mos
	function show_tftp_config() {
430
		document.getElementById("showtftpbox").innerHTML='';
431
		aodiv = document.getElementById('showtftp');
432
		aodiv.style.display = "block";
433
	}
434 7d504365 smos
	*/
435 99caa67c Seth Mos
	function show_ldap_config() {
436
		document.getElementById("showldapbox").innerHTML='';
437
		aodiv = document.getElementById('showldap');
438
		aodiv.style.display = "block";
439
	}
440
441
	function show_netboot_config() {
442
		document.getElementById("shownetbootbox").innerHTML='';
443
		aodiv = document.getElementById('shownetboot');
444
		aodiv.style.display = "block";
445
	}
446
</script>
447
448
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
449
<?php include("fbegin.inc"); ?>
450
<form action="services_dhcpv6.php" method="post" name="iform" id="iform">
451
<?php if ($input_errors) print_input_errors($input_errors); ?>
452
<?php if ($savemsg) print_info_box($savemsg); ?>
453
<?php
454
	if ($dhcrelay_enabled) {
455
		echo gettext("DHCP Relay is currently enabled. Cannot enable the DHCP Server service while the DHCP Relay is enabled on any interface.");
456
		include("fend.inc");
457
		echo "</body>";
458
		echo "</html>";
459
		exit;
460
	}
461
?>
462
<?php if (is_subsystem_dirty('staticmaps')): ?><p>
463
<?php print_info_box_np(gettext("The static mapping configuration has been changed") . ".<br>" . gettext("You must apply the changes in order for them to take effect."));?><br>
464
<?php endif; ?>
465
<table width="100%" border="0" cellpadding="0" cellspacing="0">
466
<tr><td>
467
<?php
468
	/* active tabs */
469
	$tab_array = array();
470
	$tabscounter = 0;
471
	$i = 0;
472
	foreach ($iflist as $ifent => $ifname) {
473
		$oc = $config['interfaces'][$ifent];
474 0f54c806 Pierre POMES
		if ((is_array($config['dhcpdv6'][$ifent]) && !isset($config['dhcpdv6'][$ifent]['enable']) && !(is_ipaddrv6($oc['ipaddrv6']) && (!preg_match("/fe80::/", $oc['ipaddrv6'])))) ||
475
			(!is_array($config['dhcpdv6'][$ifent]) && !(is_ipaddrv6($oc['ipaddrv6']) && (!preg_match("/fe80::/", $oc['ipaddrv6'])))))
476 99caa67c Seth Mos
			continue;
477
		if ($ifent == $if)
478
			$active = true;
479
		else
480
			$active = false;
481
		$tab_array[] = array($ifname, $active, "services_dhcpv6.php?if={$ifent}");
482
		$tabscounter++;
483
	}
484 16d9ad13 smos
	/* tack on PPPoE or PPtP servers here */
485
	/* pppoe server */
486
	if (is_array($config['pppoes']['pppoe'])) {
487
		foreach($config['pppoes']['pppoe'] as $pppoe) {
488
			if ($pppoe['mode'] == "server") {
489
				$ifent = "poes". $pppoe['pppoeid'];
490
				$ifname = strtoupper($ifent);
491
				if ($ifent == $if)
492
					$active = true;
493
				else
494
					$active = false;
495
				$tab_array[] = array($ifname, $active, "services_dhcpv6.php?if={$ifent}");
496
				$tabscounter++;
497
			}
498
		}
499
	}
500 99caa67c Seth Mos
	if ($tabscounter == 0) {
501
		echo "</td></tr></table></form>";
502
		include("fend.inc");
503
		echo "</body>";
504
		echo "</html>";
505
		exit;
506
	}
507
	display_top_tabs($tab_array);
508
?>
509
</td></tr>
510 1c8dbfbb Darren Embry
<tr><td class="tabnavtbl">
511
<?php
512
$tab_array = array();
513
$tab_array[] = array(gettext("DHCPv6 Server"),         true,  "services_dhcpv6.php?if={$if}");
514
$tab_array[] = array(gettext("Router Advertisements"), false, "services_router_advertisements.php?if={$if}");
515
display_top_tabs($tab_array);
516
?>
517
</td></tr>
518 99caa67c Seth Mos
<tr>
519
<td>
520
	<div id="mainarea">
521 fe838158 smos
		<table class="tabcont" width="100%" border="0" cellpadding="6" cellspacing="0">
522
		<tr>
523
			<td width="22%" valign="top" class="vncellreq"><?=gettext("DHCPv6 Server");?></td>
524 2fb056d8 Seth Mos
			<td width="78%" class="vtable">
525
				<input name="enable" type="checkbox" value="yes" <?php if ($pconfig['enable']) echo "checked"; ?> onClick="enable_change(false);">
526
			<strong><?php printf(gettext("Enable DHCPv6 server on " .
527
			"%s " .
528
			"interface"),htmlspecialchars($iflist[$if]));?></strong></td>
529
			</tr>
530
			<tr>
531
			<td width="22%" valign="top" class="vtable">&nbsp;</td>
532 99caa67c Seth Mos
			<td width="78%" class="vtable">
533
				<input name="denyunknown" id="denyunknown" type="checkbox" value="yes" <?php if ($pconfig['denyunknown']) echo "checked"; ?>>
534
				<strong><?=gettext("Deny unknown clients");?></strong><br>
535
				<?=gettext("If this is checked, only the clients defined below will get DHCP leases from this server. ");?></td>
536
			</tr>
537
			<tr>
538 16d9ad13 smos
			<?php
539
			/* the PPPoE Server could well have no IPv6 address and operate fine with just link-local, just hide these */
540
			if(is_ipaddrv6($ifcfgip)) {
541
			?>
542 99caa67c Seth Mos
			<td width="22%" valign="top" class="vncellreq"><?=gettext("Subnet");?></td>
543
			<td width="78%" class="vtable">
544
				<?=gen_subnetv6($ifcfgip, $ifcfgsn);?>
545
			</td>
546
			</tr>
547
			<tr>
548
			<td width="22%" valign="top" class="vncellreq"><?=gettext("Subnet mask");?></td>
549
			<td width="78%" class="vtable">
550
				<?=$ifcfgsn;?> bits
551
			</td>
552
			</tr>
553
			<tr>
554
			<td width="22%" valign="top" class="vncellreq"><?=gettext("Available range");?></td>
555
			<td width="78%" class="vtable">
556
			<?php
557
				$range_from = gen_subnetv6($ifcfgip, $ifcfgsn);
558
				$range_from++;
559
				echo $range_from;
560
561
			?>
562
			-
563
			<?php
564 47335ae3 Pierre POMES
				$range_to = gen_subnetv6_max($ifcfgip, $ifcfgsn);
565 99caa67c Seth Mos
				echo $range_to;
566
			?>
567
			</td>
568
			</tr>
569 16d9ad13 smos
			<?php } ?>
570
571 99caa67c Seth Mos
			<?php if($is_olsr_enabled): ?>
572
			<tr>
573
			<td width="22%" valign="top" class="vncellreq"><?=gettext("Subnet Mask");?></td>
574
			<td width="78%" class="vtable">
575
				<select name="netmask" class="formselect" id="netmask">
576
				<?php
577 8a3b09ef Seth Mos
				for ($i = 128; $i > 0; $i--) {
578
					if($i <> 127) {
579 99caa67c Seth Mos
						echo "<option value=\"{$i}\" ";
580
						if ($i == $pconfig['netmask']) echo "selected";
581
						echo ">" . $i . "</option>";
582
					}
583
				}
584
				?>
585
				</select>
586
			</td>
587
			</tr>
588
			<?php endif; ?>
589
			<tr>
590
			<td width="22%" valign="top" class="vncellreq"><?=gettext("Range");?></td>
591
			<td width="78%" class="vtable">
592 8a3b09ef Seth Mos
				<input name="range_from" type="text" class="formfld unknown" id="range_from" size="28" value="<?=htmlspecialchars($pconfig['range_from']);?>">
593
				&nbsp;<?=gettext("to"); ?>&nbsp; <input name="range_to" type="text" class="formfld unknown" id="range_to" size="28" value="<?=htmlspecialchars($pconfig['range_to']);?>">
594 99caa67c Seth Mos
			</td>
595
			</tr>
596
			<tr>
597 cd9fa56b Seth Mos
			<td width="22%" valign="top" class="vncell"><?=gettext("Prefix Delegation Range");?></td>
598 bfb3e717 Seth Mos
			<td width="78%" class="vtable">
599
				<input name="prefixrange_from" type="text" class="formfld unknown" id="prefixrange_from" size="28" value="<?=htmlspecialchars($pconfig['prefixrange_from']);?>">
600
				&nbsp;<?=gettext("to"); ?>&nbsp; <input name="prefixrange_to" type="text" class="formfld unknown" id="prefixrange_to" size="28" value="<?=htmlspecialchars($pconfig['prefixrange_to']);?>">
601 8707707e jim-p
				&nbsp;<br/><?=gettext("Prefix Delegation Size"); ?>:&nbsp; <select name="prefixrange_length" class="formselect" id="prefixrange_length">
602 bfb3e717 Seth Mos
					<option value="48" <?php if($pconfig['prefixrange_length'] == 48) echo "selected"; ?>>48</option>
603 50a6400f smos
					<option value="52" <?php if($pconfig['prefixrange_length'] == 52) echo "selected"; ?>>52</option>
604 bfb3e717 Seth Mos
					<option value="56" <?php if($pconfig['prefixrange_length'] == 56) echo "selected"; ?>>56</option>
605
					<option value="60" <?php if($pconfig['prefixrange_length'] == 60) echo "selected"; ?>>60</option>
606 50a6400f smos
					<option value="62" <?php if($pconfig['prefixrange_length'] == 62) echo "selected"; ?>>62</option>
607 79909926 smos
					<option value="63" <?php if($pconfig['prefixrange_length'] == 63) echo "selected"; ?>>63</option>
608
					<option value="64" <?php if($pconfig['prefixrange_length'] == 64) echo "selected"; ?>>64</option>
609 bfb3e717 Seth Mos
				</select> <br/>
610
				<?php echo gettext("You can define a Prefix range here for DHCP Prefix Delegation. This allows for 
611 e1cc1f6d smos
					assigning networks to subrouters. The start and end of the range must end on boundaries of the prefix delegation size."); ?>
612 bfb3e717 Seth Mos
			</td>
613
			</tr>
614
			<tr>
615 99caa67c Seth Mos
			<td width="22%" valign="top" class="vncell"><?=gettext("DNS servers");?></td>
616
			<td width="78%" class="vtable">
617 8a3b09ef Seth Mos
				<input name="dns1" type="text" class="formfld unknown" id="dns1" size="28" value="<?=htmlspecialchars($pconfig['dns1']);?>"><br>
618
				<input name="dns2" type="text" class="formfld unknown" id="dns2" size="28" value="<?=htmlspecialchars($pconfig['dns2']);?>"><br>
619 99caa67c Seth Mos
				<?=gettext("NOTE: leave blank to use the system default DNS servers - this interface's IP if DNS forwarder is enabled, otherwise the servers configured on the General page.");?>
620
			</td>
621
			</tr>
622
			<tr>
623
			<td width="22%" valign="top" class="vncell"><?=gettext("Domain name");?></td>
624
			<td width="78%" class="vtable">
625 8a3b09ef Seth Mos
				<input name="domain" type="text" class="formfld unknown" id="domain" size="28" value="<?=htmlspecialchars($pconfig['domain']);?>"><br>
626 99caa67c Seth Mos
				 <?=gettext("The default is to use the domain name of this system as the default domain name provided by DHCP. You may specify an alternate domain name here.");?>
627
			 </td>
628
			</tr>
629
			<tr>
630
			<td width="22%" valign="top" class="vncell"><?=gettext("Domain search list");?></td>
631
			<td width="78%" class="vtable">
632 8a3b09ef Seth Mos
				<input name="domainsearchlist" type="text" class="formfld unknown" id="domainsearchlist" size="28" value="<?=htmlspecialchars($pconfig['domainsearchlist']);?>"><br>
633 a3de8b9e Pierre POMES
				<?=gettext("The DHCP server can optionally provide a domain search list. Use the semicolon character as seperator");?>
634 99caa67c Seth Mos
			</td>
635
			</tr>
636
			<tr>
637
			<td width="22%" valign="top" class="vncell"><?=gettext("Default lease time");?></td>
638
			<td width="78%" class="vtable">
639
				<input name="deftime" type="text" class="formfld unknown" id="deftime" size="10" value="<?=htmlspecialchars($pconfig['deftime']);?>">
640
				<?=gettext("seconds");?><br>
641
				<?=gettext("This is used for clients that do not ask for a specific " .
642
				"expiration time."); ?><br>
643
				<?=gettext("The default is 7200 seconds.");?>
644
			</td>
645
			</tr>
646
			<tr>
647
			<td width="22%" valign="top" class="vncell"><?=gettext("Maximum lease time");?></td>
648
			<td width="78%" class="vtable">
649
				<input name="maxtime" type="text" class="formfld unknown" id="maxtime" size="10" value="<?=htmlspecialchars($pconfig['maxtime']);?>">
650
				<?=gettext("seconds");?><br>
651
				<?=gettext("This is the maximum lease time for clients that ask".
652
				" for a specific expiration time."); ?><br>
653
				<?=gettext("The default is 86400 seconds.");?>
654
			</td>
655
			</tr>
656
			<tr>
657
			<td width="22%" valign="top" class="vncell"><?=gettext("Failover peer IP:");?></td>
658
			<td width="78%" class="vtable">
659 8a3b09ef Seth Mos
				<input name="failover_peerip" type="text" class="formfld host" id="failover_peerip" size="28" value="<?=htmlspecialchars($pconfig['failover_peerip']);?>"><br>
660 99caa67c Seth Mos
				<?=gettext("Leave blank to disable.  Enter the interface IP address of the other machine.  Machines must be using CARP.");?>
661
			</td>
662
			</tr>
663 7d0ad4ec Joecowboy
			<tr>
664
				<td width="22%" valign="top" class="vncell"><?=gettext("Time format change"); ?></td>
665
				<td width="78%" class="vtable">
666
				<table>
667
					<tr>
668
					<td>
669 138208bf Joecowboy
						<input name="dhcpv6leaseinlocaltime" type="checkbox" id="dhcpv6leaseinlocaltime" value="yes" <?php if ($pconfig['dhcpv6leaseinlocaltime']) echo "checked"; ?>>
670 7d0ad4ec Joecowboy
					</td>
671
					<td>
672
						<strong>
673
							<?=gettext("Change DHCPv6 display lease time from UTC to local time."); ?>
674
						</strong>
675
					</td>
676
					</tr>
677
					<tr>
678
					<td>&nbsp;</td>
679
					<td>
680
						<span class="red"><strong><?=gettext("Note:");?></strong></span> <?=gettext("By default DHCPv6 leases are displayed in UTC time.  By checking this 
681
						box DHCPv6 lease time will be displayed in local time and set to time zone selected.  This will be used for all DHCPv6 interfaces lease time."); ?>
682
					
683
					</td>
684
					</tr>
685
				</table>
686
				</td>
687
			</tr>
688 99caa67c Seth Mos
			<tr>
689
			<td width="22%" valign="top" class="vncell"><?=gettext("Dynamic DNS");?></td>
690
			<td width="78%" class="vtable">
691
				<div id="showddnsbox">
692
					<input type="button" onClick="show_ddns_config()" value="<?=gettext("Advanced");?>"></input> - <?=gettext("Show Dynamic DNS");?></a>
693
				</div>
694
				<div id="showddns" style="display:none">
695
					<input valign="middle" type="checkbox" value="yes" name="ddnsupdate" id="ddnsupdate" <?php if($pconfig['ddnsupdate']) echo " checked"; ?>>&nbsp;
696
					<b><?=gettext("Enable registration of DHCP client names in DNS.");?></b><br />
697
					<p>
698 8a3b09ef Seth Mos
					<input name="ddnsdomain" type="text" class="formfld unknown" id="ddnsdomain" size="28" value="<?=htmlspecialchars($pconfig['ddnsdomain']);?>"><br />
699 99caa67c Seth Mos
					<?=gettext("Note: Leave blank to disable dynamic DNS registration.");?><br />
700
					<?=gettext("Enter the dynamic DNS domain which will be used to register client names in the DNS server.");?>
701
				</div>
702
			</td>
703
			</tr>
704
			<tr>
705
			<td width="22%" valign="top" class="vncell"><?=gettext("NTP servers");?></td>
706
			<td width="78%" class="vtable">
707
				<div id="showntpbox">
708
					<input type="button" onClick="show_ntp_config()" value="<?=gettext("Advanced");?>"></input> - <?=gettext("Show NTP configuration");?></a>
709
				</div>
710
				<div id="showntp" style="display:none">
711 8a3b09ef Seth Mos
					<input name="ntp1" type="text" class="formfld unknown" id="ntp1" size="28" value="<?=htmlspecialchars($pconfig['ntp1']);?>"><br>
712
					<input name="ntp2" type="text" class="formfld unknown" id="ntp2" size="28" value="<?=htmlspecialchars($pconfig['ntp2']);?>">
713 99caa67c Seth Mos
				</div>
714
			</td>
715
			</tr>
716 7d504365 smos
			<!-- ISC dhcpd does not support tftp for ipv6 yet. See redmine #2016
717 99caa67c Seth Mos
			<tr>
718
			<td width="22%" valign="top" class="vncell"><?=gettext("TFTP server");?></td>
719
			<td width="78%" class="vtable">
720
			<div id="showtftpbox">
721
				<input type="button" onClick="show_tftp_config()" value="<?=gettext("Advanced");?>"></input> - <?=gettext("Show TFTP configuration");?></a>
722
			</div>
723
			<div id="showtftp" style="display:none">
724
				<input name="tftp" type="text" class="formfld unknown" id="tftp" size="50" value="<?=htmlspecialchars($pconfig['tftp']);?>"><br>
725
				<?=gettext("Leave blank to disable.  Enter a full hostname or IP for the TFTP server.");?>
726
			</div>
727
			</td>
728
			</tr>
729 7d504365 smos
			-->
730 99caa67c Seth Mos
			<tr>
731
			<td width="22%" valign="top" class="vncell"><?=gettext("LDAP URI");?></td>
732
			<td width="78%" class="vtable">
733
				<div id="showldapbox">
734
					<input type="button" onClick="show_ldap_config()" value="<?=gettext("Advanced");?>"></input> - <?=gettext("Show LDAP configuration");?></a>
735
				</div>
736
				<div id="showldap" style="display:none">
737
					<input name="ldap" type="text" class="formfld unknown" id="ldap" size="80" value="<?=htmlspecialchars($pconfig['ldap']);?>"><br>
738
					<?=gettext("Leave blank to disable.  Enter a full URI for the LDAP server in the form ldap://ldap.example.com/dc=example,dc=com");?>
739
				</div>
740
			</td>
741
			</tr>
742
			<tr>
743
			<td width="22%" valign="top" class="vncell"><?=gettext("Enable network booting");?></td>
744
			<td width="78%" class="vtable">
745
				<div id="shownetbootbox">
746
					<input type="button" onClick="show_netboot_config()" value="<?=gettext("Advanced");?>"></input> - <?=gettext("Show Network booting");?></a>
747
				</div>
748
				<div id="shownetboot" style="display:none">
749
					<input valign="middle" type="checkbox" value="yes" name="netboot" id="netboot" <?php if($pconfig['netboot']) echo " checked"; ?>>&nbsp;
750
					<b><?=gettext("Enables network booting.");?></b>
751
					<p>
752
					<?=gettext("Enter the IP of the"); ?> <b><?=gettext("next-server"); ?></b>
753 8a3b09ef Seth Mos
					<input name="nextserver" type="text" class="formfld unknown" id="nextserver" size="28" value="<?=htmlspecialchars($pconfig['nextserver']);?>">
754 99caa67c Seth Mos
					<?=gettext("and the filename");?>
755 8a3b09ef Seth Mos
					<input name="filename" type="text" class="formfld unknown" id="filename" size="28" value="<?=htmlspecialchars($pconfig['filename']);?>"><br>
756 99caa67c Seth Mos
					<?=gettext("Note: You need both a filename and a boot server configured for this to work!");?>
757
					<p>
758
					<?=gettext("Enter the"); ?> <b><?=gettext("root-path"); ?></b>-<?=gettext("string");?>
759
					<input name="rootpath" type="text" class="formfld unknown" id="rootpath" size="90" value="<?=htmlspecialchars($pconfig['rootpath']);?>"><br>
760
					<?=gettext("Note: string-format: iscsi:(servername):(protocol):(port):(LUN):targetname");?>
761
				</div>
762
			</td>
763
			</tr>
764
			<tr>
765
			<td width="22%" valign="top" class="vncell"><?=gettext("Additional BOOTP/DHCP Options");?></td>
766
			<td width="78%" class="vtable">
767
				<div id="shownumbervaluebox">
768
					<input type="button" onClick="show_shownumbervalue()" value="<?=gettext("Advanced");?>"></input> - <?=gettext("Show Additional BOOTP/DHCP Options");?></a>
769
				</div>
770
				<div id="shownumbervalue" style="display:none">
771
				<table id="maintable">
772
				<tbody>
773
				<tr>
774
				<td colspan="3">
775
					<div style="padding:5px; margin-top: 16px; margin-bottom: 16px; border:1px dashed #000066; background-color: #ffffff; color: #000000; font-size: 8pt;" id="itemhelp">
776
					<?=gettext("Enter the DHCP option number and the value for each item you would like to include in the DHCP lease information.  For a list of available options please visit this"); ?> <a href="http://www.iana.org/assignments/bootp-dhcp-parameters/" target="_new"><?=gettext("URL"); ?></a>
777
					</div>
778
				</td>
779
				</tr>
780
				<tr>
781
				<td><div id="onecolumn"><?=gettext("Number");?></div></td>
782
				<td><div id="twocolumn"><?=gettext("Value");?></div></td>
783
				</tr>
784
				<?php $counter = 0; ?>
785
				<?php
786
					if($pconfig['numberoptions'])
787
						foreach($pconfig['numberoptions']['item'] as $item):
788
				?>
789
					<?php
790
						$number = $item['number'];
791
						$value = $item['value'];
792
					?>
793
				<tr>
794
				<td>
795
					<input autocomplete="off" name="number<?php echo $counter; ?>" type="text" class="formfld" id="number<?php echo $counter; ?>" size="10" value="<?=htmlspecialchars($number);?>" />
796
				</td>
797
				<td>
798
					<input autocomplete="off" name="value<?php echo $counter; ?>" type="text" class="formfld" id="value<?php echo $counter; ?>" size="55" value="<?=htmlspecialchars($value);?>" />
799
				</td>
800
				<td>
801
					<input type="image" src="/themes/<?echo $g['theme'];?>/images/icons/icon_x.gif" onclick="removeRow(this); return false;" value="<?=gettext("Delete");?>" />
802
				</td>
803
				</tr>
804
				<?php $counter++; ?>
805
				<?php endforeach; ?>
806
				</tbody>
807
				<tfoot>
808
				</tfoot>
809
				</table>
810
				<a onclick="javascript:addRowTo('maintable', 'formfldalias'); return false;" href="#">
811
					<img border="0" src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" alt="" title="<?=gettext("add another entry");?>" />
812
				</a>
813
				<script type="text/javascript">
814
					field_counter_js = 2;
815
					rows = 1;
816
					totalrows = <?php echo $counter; ?>;
817
					loaded = <?php echo $counter; ?>;
818
				</script>
819
				</div>
820
821
				</td>
822
			</tr>
823
			<tr>
824
			<td width="22%" valign="top">&nbsp;</td>
825
			<td width="78%">
826
				<input name="if" type="hidden" value="<?=$if;?>">
827 2fb056d8 Seth Mos
				<input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" onclick="enable_change(true)">
828 99caa67c Seth Mos
			</td>
829
			</tr>
830
			<tr>
831
			<td width="22%" valign="top">&nbsp;</td>
832
			<td width="78%"> <p><span class="vexpl"><span class="red"><strong><?=gettext("Note:");?><br>
833
				</strong></span><?=gettext("The DNS servers entered in"); ?> <a href="system.php"><?=gettext("System: " .
834
				"General setup"); ?></a> <?=gettext("(or the"); ?> <a href="services_dnsmasq.php"><?=gettext("DNS " .
835
				"forwarder"); ?></a>, <?=gettext("if enabled)"); ?> </span><span class="vexpl"><?=gettext("will " .
836
				"be assigned to clients by the DHCP server."); ?><br>
837
				<br>
838 bfb00534 jim-p
				<?=gettext("The DHCP lease table can be viewed on the"); ?> <a href="status_dhcpv6_leases.php"><?=gettext("Status: " .
839
				"DHCPv6 leases"); ?></a> <?=gettext("page."); ?><br>
840 99caa67c Seth Mos
				</span></p>
841
			</td>
842
			</tr>
843
		</table>
844
		<table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
845 f2ea45ef jim-p
		<tr>
846
			<td colspan="4" valign="top" class="listtopic"><?=gettext("DHCPv6 Static Mappings for this interface.");?></td>
847
			<td>&nbsp;</td>
848
		</tr>
849 99caa67c Seth Mos
		<tr>
850 2fb056d8 Seth Mos
			<td width="25%" class="listhdrr"><?=gettext("DUID");?></td>
851
			<td width="15%" class="listhdrr"><?=gettext("IPv6 address");?></td>
852 99caa67c Seth Mos
			<td width="20%" class="listhdrr"><?=gettext("Hostname");?></td>
853
			<td width="30%" class="listhdr"><?=gettext("Description");?></td>
854
			<td width="10%" class="list">
855
			<table border="0" cellspacing="0" cellpadding="1">
856
			<tr>
857
			<td valign="middle" width="17"></td>
858 aed47758 Seth Mos
			<td valign="middle"><a href="services_dhcpv6_edit.php?if=<?=$if;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0"></a></td>
859 99caa67c Seth Mos
			</tr>
860
			</table>
861
			</td>
862
		</tr>
863
			<?php if(is_array($a_maps)): ?>
864
			<?php $i = 0; foreach ($a_maps as $mapent): ?>
865 2fb056d8 Seth Mos
			<?php if($mapent['duid'] <> "" or $mapent['ipaddrv6'] <> ""): ?>
866 99caa67c Seth Mos
		<tr>
867 aed47758 Seth Mos
		<td class="listlr" ondblclick="document.location='services_dhcpv6_edit.php?if=<?=$if;?>&id=<?=$i;?>';">
868 2fb056d8 Seth Mos
			<?=htmlspecialchars($mapent['duid']);?>
869 99caa67c Seth Mos
		</td>
870 aed47758 Seth Mos
		<td class="listr" ondblclick="document.location='services_dhcpv6_edit.php?if=<?=$if;?>&id=<?=$i;?>';">
871 4e8e7662 Seth Mos
			<?=htmlspecialchars($mapent['ipaddrv6']);?>&nbsp;
872 99caa67c Seth Mos
		</td>
873 aed47758 Seth Mos
		<td class="listr" ondblclick="document.location='services_dhcpv6_edit.php?if=<?=$if;?>&id=<?=$i;?>';">
874 99caa67c Seth Mos
			<?=htmlspecialchars($mapent['hostname']);?>&nbsp;
875
		</td>
876 aed47758 Seth Mos
		<td class="listbg" ondblclick="document.location='services_dhcpv6_edit.php?if=<?=$if;?>&id=<?=$i;?>';">
877 99caa67c Seth Mos
			<?=htmlspecialchars($mapent['descr']);?>&nbsp;
878
		</td>
879 1c8dbfbb Darren Embry
		<td valign="middle" nowrap="nowrap" class="list">
880 99caa67c Seth Mos
			<table border="0" cellspacing="0" cellpadding="1">
881
			<tr>
882 aed47758 Seth Mos
			<td valign="middle"><a href="services_dhcpv6_edit.php?if=<?=$if;?>&id=<?=$i;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0"></a></td>
883 d2627d7c Seth Mos
			<td valign="middle"><a href="services_dhcpv6.php?if=<?=$if;?>&act=del&id=<?=$i;?>" onclick="return confirm('<?=gettext("Do you really want to delete this mapping?");?>')"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0"></a></td>
884 99caa67c Seth Mos
			</tr>
885
			</table>
886
		</td>
887
		</tr>
888
		<?php endif; ?>
889
		<?php $i++; endforeach; ?>
890
		<?php endif; ?>
891
		<tr>
892
		<td class="list" colspan="4"></td>
893
		<td class="list">
894
			<table border="0" cellspacing="0" cellpadding="1">
895
			<tr>
896
			<td valign="middle" width="17"></td>
897 aed47758 Seth Mos
			<td valign="middle"><a href="services_dhcpv6_edit.php?if=<?=$if;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0"></a></td>
898 99caa67c Seth Mos
			</tr>
899
			</table>
900
		</td>
901
		</tr>
902
		</table>
903
	</div>
904
</td>
905
</tr>
906
</table>
907
</form>
908
<script language="JavaScript">
909
<!--
910
enable_change(false);
911
//-->
912
</script>
913
<?php include("fend.inc"); ?>
914
</body>
915
</html>