Project

General

Profile

Download (26.1 KB) Statistics
| Branch: | Tag: | Revision:
1
<?php
2
/* $Id$ */
3
/*
4
	services_dhcp_edit.php
5
	part of m0n0wall (http://m0n0.ch/wall)
6

    
7
	Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
8
	Copyright (C) 2013-2015 Electric Sheep Fencing, LP
9
	All rights reserved.
10

    
11
	Redistribution and use in source and binary forms, with or without
12
	modification, are permitted provided that the following conditions are met:
13

    
14
	1. Redistributions of source code must retain the above copyright notice,
15
	   this list of conditions and the following disclaimer.
16

    
17
	2. Redistributions in binary form must reproduce the above copyright
18
	   notice, this list of conditions and the following disclaimer in the
19
	   documentation and/or other materials provided with the distribution.
20

    
21
	THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
22
	INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
23
	AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
24
	AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
25
	OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26
	SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27
	INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28
	CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29
	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30
	POSSIBILITY OF SUCH DAMAGE.
31
*/
32
/*
33
	pfSense_BUILDER_BINARIES:	/usr/sbin/arp
34
	pfSense_MODULE:	dhcpserver
35
*/
36

    
37
##|+PRIV
38
##|*IDENT=page-services-dhcpserver-editstaticmapping
39
##|*NAME=Services: DHCP Server : Edit static mapping page
40
##|*DESCR=Allow access to the 'Services: DHCP Server : Edit static mapping' page.
41
##|*MATCH=services_dhcp_edit.php*
42
##|-PRIV
43

    
44
function staticmapcmp($a, $b) {
45
	return ipcmp($a['ipaddr'], $b['ipaddr']);
46
}
47

    
48
function staticmaps_sort($ifgui) {
49
	global $g, $config;
50

    
51
	usort($config['dhcpd'][$ifgui]['staticmap'], "staticmapcmp");
52
}
53

    
54
require_once('globals.inc');
55

    
56
if (!$g['services_dhcp_server_enable']) {
57
	header("Location: /");
58
	exit;
59
}
60

    
61
require("guiconfig.inc");
62

    
63
if (isset($_POST['referer'])) {
64
	$referer = $_POST['referer'];
65
} else {
66
	$referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/services_dhcp.php');
67
}
68

    
69
$if = $_GET['if'];
70
if ($_POST['if']) {
71
	$if = $_POST['if'];
72
}
73

    
74
if (!$if) {
75
	header("Location: services_dhcp.php");
76
	exit;
77
}
78

    
79
if (!is_array($config['dhcpd'])) {
80
	$config['dhcpd'] = array();
81
}
82
if (!is_array($config['dhcpd'][$if])) {
83
	$config['dhcpd'][$if] = array();
84
}
85
if (!is_array($config['dhcpd'][$if]['staticmap'])) {
86
	$config['dhcpd'][$if]['staticmap'] = array();
87
}
88

    
89
if (!is_array($config['dhcpd'][$if]['pool'])) {
90
	$config['dhcpd'][$if]['pool'] = array();
91
}
92
$a_pools = &$config['dhcpd'][$if]['pool'];
93

    
94
$static_arp_enabled=isset($config['dhcpd'][$if]['staticarp']);
95
$netboot_enabled=isset($config['dhcpd'][$if]['netboot']);
96
$a_maps = &$config['dhcpd'][$if]['staticmap'];
97
$ifcfgip = get_interface_ip($if);
98
$ifcfgsn = get_interface_subnet($if);
99
$ifcfgdescr = convert_friendly_interface_to_friendly_descr($if);
100

    
101
if (is_numericint($_GET['id'])) {
102
	$id = $_GET['id'];
103
}
104
if (isset($_POST['id']) && is_numericint($_POST['id'])) {
105
	$id = $_POST['id'];
106
}
107

    
108
if (isset($id) && $a_maps[$id]) {
109
	$pconfig['mac'] = $a_maps[$id]['mac'];
110
	$pconfig['cid'] = $a_maps[$id]['cid'];
111
	$pconfig['hostname'] = $a_maps[$id]['hostname'];
112
	$pconfig['ipaddr'] = $a_maps[$id]['ipaddr'];
113
	$pconfig['filename'] = $a_maps[$id]['filename'];
114
	$pconfig['rootpath'] = $a_maps[$id]['rootpath'];
115
	$pconfig['descr'] = $a_maps[$id]['descr'];
116
	$pconfig['arp_table_static_entry'] = isset($a_maps[$id]['arp_table_static_entry']);
117
	$pconfig['deftime'] = $a_maps[$id]['defaultleasetime'];
118
	$pconfig['maxtime'] = $a_maps[$id]['maxleasetime'];
119
	$pconfig['gateway'] = $a_maps[$id]['gateway'];
120
	$pconfig['domain'] = $a_maps[$id]['domain'];
121
	$pconfig['domainsearchlist'] = $a_maps[$id]['domainsearchlist'];
122
	list($pconfig['wins1'], $pconfig['wins2']) = $a_maps[$id]['winsserver'];
123
	list($pconfig['dns1'], $pconfig['dns2'], $pconfig['dns3'], $pconfig['dns4']) = $a_maps[$id]['dnsserver'];
124
	$pconfig['ddnsdomain'] = $a_maps[$id]['ddnsdomain'];
125
	$pconfig['ddnsdomainprimary'] = $a_maps[$id]['ddnsdomainprimary'];
126
	$pconfig['ddnsdomainkeyname'] = $a_maps[$id]['ddnsdomainkeyname'];
127
	$pconfig['ddnsdomainkey'] = $a_maps[$id]['ddnsdomainkey'];
128
	$pconfig['ddnsupdate'] = isset($a_maps[$id]['ddnsupdate']);
129
	list($pconfig['ntp1'], $pconfig['ntp2']) = $a_maps[$id]['ntpserver'];
130
	$pconfig['tftp'] = $a_maps[$id]['tftp'];
131
} else {
132
	$pconfig['mac'] = $_GET['mac'];
133
	$pconfig['cid'] = $_GET['cid'];
134
	$pconfig['hostname'] = $_GET['hostname'];
135
	$pconfig['filename'] = $_GET['filename'];
136
	$pconfig['rootpath'] = $_GET['rootpath'];
137
	$pconfig['descr'] = $_GET['descr'];
138
	$pconfig['arp_table_static_entry'] = $_GET['arp_table_static_entry'];
139
	$pconfig['deftime'] = $_GET['defaultleasetime'];
140
	$pconfig['maxtime'] = $_GET['maxleasetime'];
141
	$pconfig['gateway'] = $_GET['gateway'];
142
	$pconfig['domain'] = $_GET['domain'];
143
	$pconfig['domainsearchlist'] = $_GET['domainsearchlist'];
144
	$pconfig['wins1'] = $_GET['wins1'];
145
	$pconfig['wins2'] = $_GET['wins2'];
146
	$pconfig['dns1'] = $_GET['dns1'];
147
	$pconfig['dns2'] = $_GET['dns2'];
148
	$pconfig['dns3'] = $_GET['dns3'];
149
	$pconfig['dns4'] = $_GET['dns4'];
150
	$pconfig['ddnsdomain'] = $_GET['ddnsdomain'];
151
	$pconfig['ddnsdomainprimary'] = $_GET['ddnsdomainprimary'];
152
	$pconfig['ddnsdomainkeyname'] = $_GET['ddnsdomainkeyname'];
153
	$pconfig['ddnsdomainkey'] = $_GET['ddnsdomainkey'];
154
	$pconfig['ddnsupdate'] = isset($_GET['ddnsupdate']);
155
	$pconfig['ntp1'] = $_GET['ntp1'];
156
	$pconfig['ntp2'] = $_GET['ntp2'];
157
	$pconfig['tftp'] = $_GET['tftp'];
158
}
159

    
160
if ($_POST) {
161

    
162
	unset($input_errors);
163
	$pconfig = $_POST;
164

    
165
	/* input validation */
166
	$reqdfields = array();
167
	$reqdfieldsn = array();
168

    
169
	do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
170

    
171
	/* either MAC or Client-ID must be specified */
172
	if (empty($_POST['mac']) && empty($_POST['cid'])) {
173
		$input_errors[] = gettext("Either MAC address or Client identifier must be specified");
174
	}
175

    
176
	/* normalize MAC addresses - lowercase and convert Windows-ized hyphenated MACs to colon delimited */
177
	$_POST['mac'] = strtolower(str_replace("-", ":", $_POST['mac']));
178

    
179
	if ($_POST['hostname']) {
180
		preg_match("/\-\$/", $_POST['hostname'], $matches);
181
		if ($matches) {
182
			$input_errors[] = gettext("The hostname cannot end with a hyphen according to RFC952");
183
		}
184
		if (!is_hostname($_POST['hostname'])) {
185
			$input_errors[] = gettext("The hostname can only contain the characters A-Z, 0-9 and '-'.");
186
		} else {
187
			if (!is_unqualified_hostname($_POST['hostname'])) {
188
				$input_errors[] = gettext("A valid hostname is specified, but the domain name part should be omitted");
189
			}
190
		}
191
	}
192
	if (($_POST['ipaddr'] && !is_ipaddr($_POST['ipaddr']))) {
193
		$input_errors[] = gettext("A valid IP address must be specified.");
194
	}
195
	if (($_POST['mac'] && !is_macaddr($_POST['mac']))) {
196
		$input_errors[] = gettext("A valid MAC address must be specified.");
197
	}
198
	if ($static_arp_enabled && !$_POST['ipaddr']) {
199
		$input_errors[] = gettext("Static ARP is enabled.  You must specify an IP address.");
200
	}
201

    
202
	/* check for overlaps */
203
	foreach ($a_maps as $mapent) {
204
		if (isset($id) && ($a_maps[$id]) && ($a_maps[$id] === $mapent)) {
205
			continue;
206
		}
207
		/* The fully qualified hostname (hostname + '.' + domainname) must be unique.
208
		 * The unqualified hostname does not have to be unique as long as the fully
209
		 * qualified hostname is unique. */
210
		$existingFqn = "{$mapent['hostname']}.{$mapent['domain']}";
211
		$candidateFqn = "{$_POST['hostname']}.{$_POST['domain']}";
212
		if ((($existingFqn == $candidateFqn) && $mapent['hostname']) ||
213
		    (($mapent['mac'] == $_POST['mac']) && $mapent['mac']) ||
214
		    (($mapent['ipaddr'] == $_POST['ipaddr']) && $mapent['ipaddr']) ||
215
		    (($mapent['cid'] == $_POST['cid']) && $mapent['cid'])) {
216
			$input_errors[] = gettext("This fully qualified hostname (Hostname + Domainname), IP, MAC address or Client identifier already exists.");
217
			break;
218
		}
219
	}
220

    
221
	/* make sure it's not within the dynamic subnet */
222
	if ($_POST['ipaddr']) {
223
		$dynsubnet_start = ip2ulong($config['dhcpd'][$if]['range']['from']);
224
		$dynsubnet_end = ip2ulong($config['dhcpd'][$if]['range']['to']);
225
		if ((ip2ulong($_POST['ipaddr']) >= $dynsubnet_start) &&
226
		    (ip2ulong($_POST['ipaddr']) <= $dynsubnet_end)) {
227
			$input_errors[] = sprintf(gettext("The IP address must not be within the DHCP range for this interface."));
228
		}
229

    
230
		foreach ($a_pools as $pidx => $p) {
231
			if (is_inrange_v4($_POST['ipaddr'], $p['range']['from'], $p['range']['to'])) {
232
				$input_errors[] = gettext("The IP address must not be within the range configured on a DHCP pool for this interface.");
233
				break;
234
			}
235
		}
236

    
237
		$lansubnet_start = ip2ulong(long2ip32(ip2long($ifcfgip) & gen_subnet_mask_long($ifcfgsn)));
238
		$lansubnet_end = ip2ulong(long2ip32(ip2long($ifcfgip) | (~gen_subnet_mask_long($ifcfgsn))));
239
		if ((ip2ulong($_POST['ipaddr']) < $lansubnet_start) ||
240
		    (ip2ulong($_POST['ipaddr']) > $lansubnet_end)) {
241
			$input_errors[] = sprintf(gettext("The IP address must lie in the %s subnet."), $ifcfgdescr);
242
		}
243
	}
244

    
245
	if (($_POST['gateway'] && !is_ipaddrv4($_POST['gateway']))) {
246
		$input_errors[] = gettext("A valid IP address must be specified for the gateway.");
247
	}
248
	if (($_POST['wins1'] && !is_ipaddrv4($_POST['wins1'])) || ($_POST['wins2'] && !is_ipaddrv4($_POST['wins2']))) {
249
		$input_errors[] = gettext("A valid IP address must be specified for the primary/secondary WINS servers.");
250
	}
251

    
252
	$parent_ip = get_interface_ip($POST['if']);
253
	if (is_ipaddrv4($parent_ip) && $_POST['gateway']) {
254
		$parent_sn = get_interface_subnet($_POST['if']);
255
		if (!ip_in_subnet($_POST['gateway'], gen_subnet($parent_ip, $parent_sn) . "/" . $parent_sn) && !ip_in_interface_alias_subnet($_POST['if'], $_POST['gateway'])) {
256
			$input_errors[] = sprintf(gettext("The gateway address %s does not lie within the chosen interface's subnet."), $_POST['gateway']);
257
		}
258
	}
259
	if (($_POST['dns1'] && !is_ipaddrv4($_POST['dns1'])) ||
260
	    ($_POST['dns2'] && !is_ipaddrv4($_POST['dns2'])) ||
261
	    ($_POST['dns3'] && !is_ipaddrv4($_POST['dns3'])) ||
262
	    ($_POST['dns4'] && !is_ipaddrv4($_POST['dns4']))) {
263
		$input_errors[] = gettext("A valid IP address must be specified for each of the DNS servers.");
264
	}
265

    
266
	if ($_POST['deftime'] && (!is_numeric($_POST['deftime']) || ($_POST['deftime'] < 60))) {
267
		$input_errors[] = gettext("The default lease time must be at least 60 seconds.");
268
	}
269
	if ($_POST['maxtime'] && (!is_numeric($_POST['maxtime']) || ($_POST['maxtime'] < 60) || ($_POST['maxtime'] <= $_POST['deftime']))) {
270
		$input_errors[] = gettext("The maximum lease time must be at least 60 seconds and higher than the default lease time.");
271
	}
272
	if (($_POST['ddnsdomain'] && !is_domain($_POST['ddnsdomain']))) {
273
		$input_errors[] = gettext("A valid domain name must be specified for the dynamic DNS registration.");
274
	}
275
	if (($_POST['ddnsdomain'] && !is_ipaddrv4($_POST['ddnsdomainprimary']))) {
276
		$input_errors[] = gettext("A valid primary domain name server IP address must be specified for the dynamic domain name.");
277
	}
278
	if (($_POST['ddnsdomainkey'] && !$_POST['ddnsdomainkeyname']) ||
279
	    ($_POST['ddnsdomainkeyname'] && !$_POST['ddnsdomainkey'])) {
280
		$input_errors[] = gettext("You must specify both a valid domain key and key name.");
281
	}
282
	if ($_POST['domainsearchlist']) {
283
		$domain_array=preg_split("/[ ;]+/", $_POST['domainsearchlist']);
284
		foreach ($domain_array as $curdomain) {
285
			if (!is_domain($curdomain)) {
286
				$input_errors[] = gettext("A valid domain search list must be specified.");
287
				break;
288
			}
289
		}
290
	}
291

    
292
	if (($_POST['ntp1'] && !is_ipaddrv4($_POST['ntp1'])) || ($_POST['ntp2'] && !is_ipaddrv4($_POST['ntp2']))) {
293
		$input_errors[] = gettext("A valid IP address must be specified for the primary/secondary NTP servers.");
294
	}
295
	if ($_POST['tftp'] && !is_ipaddrv4($_POST['tftp']) && !is_domain($_POST['tftp']) && !is_URL($_POST['tftp'])) {
296
		$input_errors[] = gettext("A valid IP address or hostname must be specified for the TFTP server.");
297
	}
298
	if (($_POST['nextserver'] && !is_ipaddrv4($_POST['nextserver']))) {
299
		$input_errors[] = gettext("A valid IP address must be specified for the network boot server.");
300
	}
301

    
302
	if (!$input_errors) {
303
		$mapent = array();
304
		$mapent['mac'] = $_POST['mac'];
305
		$mapent['cid'] = $_POST['cid'];
306
		$mapent['ipaddr'] = $_POST['ipaddr'];
307
		$mapent['hostname'] = $_POST['hostname'];
308
		$mapent['descr'] = $_POST['descr'];
309
		$mapent['arp_table_static_entry'] = ($_POST['arp_table_static_entry']) ? true : false;
310
		$mapent['filename'] = $_POST['filename'];
311
		$mapent['rootpath'] = $_POST['rootpath'];
312
		$mapent['defaultleasetime'] = $_POST['deftime'];
313
		$mapent['maxleasetime'] = $_POST['maxtime'];
314

    
315
		unset($mapent['winsserver']);
316
		if ($_POST['wins1']) {
317
			$mapent['winsserver'][] = $_POST['wins1'];
318
		}
319
		if ($_POST['wins2']) {
320
			$mapent['winsserver'][] = $_POST['wins2'];
321
		}
322

    
323
		unset($mapent['dnsserver']);
324
		if ($_POST['dns1']) {
325
			$mapent['dnsserver'][] = $_POST['dns1'];
326
		}
327
		if ($_POST['dns2']) {
328
			$mapent['dnsserver'][] = $_POST['dns2'];
329
		}
330
		if ($_POST['dns3']) {
331
			$mapent['dnsserver'][] = $_POST['dns3'];
332
		}
333
		if ($_POST['dns4']) {
334
			$mapent['dnsserver'][] = $_POST['dns4'];
335
		}
336

    
337
		$mapent['gateway'] = $_POST['gateway'];
338
		$mapent['domain'] = $_POST['domain'];
339
		$mapent['domainsearchlist'] = $_POST['domainsearchlist'];
340
		$mapent['ddnsdomain'] = $_POST['ddnsdomain'];
341
		$mapent['ddnsdomainprimary'] = $_POST['ddnsdomainprimary'];
342
		$mapent['ddnsdomainkeyname'] = $_POST['ddnsdomainkeyname'];
343
		$mapent['ddnsdomainkey'] = $_POST['ddnsdomainkey'];
344
		$mapent['ddnsupdate'] = ($_POST['ddnsupdate']) ? true : false;
345

    
346
		unset($mapent['ntpserver']);
347
		if ($_POST['ntp1']) {
348
			$mapent['ntpserver'][] = $_POST['ntp1'];
349
		}
350
		if ($_POST['ntp2']) {
351
			$mapent['ntpserver'][] = $_POST['ntp2'];
352
		}
353

    
354
		$mapent['tftp'] = $_POST['tftp'];
355
		$mapent['ldap'] = $_POST['ldap'];
356

    
357
		if (isset($id) && $a_maps[$id]) {
358
			$a_maps[$id] = $mapent;
359
		} else {
360
			$a_maps[] = $mapent;
361
		}
362
		staticmaps_sort($if);
363

    
364
		write_config();
365

    
366
		if (isset($config['dhcpd'][$if]['enable'])) {
367
			mark_subsystem_dirty('staticmaps');
368
			if (isset($config['dnsmasq']['enable']) && isset($config['dnsmasq']['regdhcpstatic'])) {
369
				mark_subsystem_dirty('hosts');
370
			}
371
			if (isset($config['unbound']['enable']) && isset($config['unbound']['regdhcpstatic'])) {
372
				mark_subsystem_dirty('unbound');
373
			}
374
		}
375

    
376
		header("Location: services_dhcp.php?if={$if}");
377
		exit;
378
	}
379
}
380

    
381
$closehead = false;
382
$pgtitle = array(gettext("Services"), gettext("DHCP"), gettext("Edit static mapping"));
383
$shortcut_section = "dhcp";
384

    
385
include("head.inc");
386

    
387
?>
388

    
389
<script type="text/javascript">
390
//<![CDATA[
391
	function show_ddns_config() {
392
		document.getElementById("showddnsbox").innerHTML='';
393
		aodiv = document.getElementById('showddns');
394
		aodiv.style.display = "block";
395
	}
396

    
397
	function show_ntp_config() {
398
		document.getElementById("showntpbox").innerHTML='';
399
		aodiv = document.getElementById('showntp');
400
		aodiv.style.display = "block";
401
	}
402

    
403
	function show_tftp_config() {
404
		document.getElementById("showtftpbox").innerHTML='';
405
		aodiv = document.getElementById('showtftp');
406
		aodiv.style.display = "block";
407
	}
408
//]]>
409
</script>
410
</head>
411

    
412
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
413
<?php include("fbegin.inc"); ?>
414
<?php if ($input_errors) print_input_errors($input_errors); ?>
415
<form action="services_dhcp_edit.php" method="post" name="iform" id="iform">
416
	<table class="tabcont" width="100%" border="0" cellpadding="6" cellspacing="0" summary="static mapping">
417
		<tr>
418
			<td colspan="2" valign="top" class="listtopic"><?=sprintf(gettext("Static DHCP Mapping on %s"), $ifcfgdescr);?></td>
419
		</tr>
420
		<tr>
421
			<td width="22%" valign="top" class="vncell"><?=gettext("MAC address");?></td>
422
			<td width="78%" class="vtable">
423
				<input name="mac" type="text" class="formfld unknown" id="mac" size="30" value="<?=htmlspecialchars($pconfig['mac']);?>" />
424
				<?php
425
					$ip = getenv('REMOTE_ADDR');
426
					$mac = `/usr/sbin/arp -an | grep {$ip} | cut -d" " -f4`;
427
					$mac = str_replace("\n", "", $mac);
428
				?>
429
				<a onclick="document.forms[0].mac.value='<?=$mac?>';" href="#"><?=gettext("Copy my MAC address");?></a>
430
				<br />
431
				<span class="vexpl">
432
					<?=gettext("Enter a MAC address in the following format: xx:xx:xx:xx:xx:xx");?>
433
				</span>
434
			</td>
435
		</tr>
436
		<tr>
437
			<td width="22%" valign="top" class="vncell"><?=gettext("Client identifier");?></td>
438
			<td width="78%" class="vtable">
439
				<input name="cid" type="text" class="formfld unknown" id="cid" size="30" value="<?=htmlspecialchars($pconfig['cid']);?>" />
440
			</td>
441
		</tr>
442
		<tr>
443
			<td width="22%" valign="top" class="vncell"><?=gettext("IP address");?></td>
444
			<td width="78%" class="vtable">
445
				<input name="ipaddr" type="text" class="formfld unknown" id="ipaddr" size="20" value="<?=htmlspecialchars($pconfig['ipaddr']);?>" />
446
				<br />
447
				<?=gettext("If an IPv4 address is entered, the address must be outside of the pool.");?>
448
				<br />
449
				<?=gettext("If no IPv4 address is given, one will be dynamically allocated from the pool.");?>
450
			</td>
451
		</tr>
452
		<tr>
453
			<td width="22%" valign="top" class="vncell"><?=gettext("Hostname");?></td>
454
			<td width="78%" class="vtable">
455
				<input name="hostname" type="text" class="formfld unknown" id="hostname" size="20" value="<?=htmlspecialchars($pconfig['hostname']);?>" />
456
				<br />
457
				<span class="vexpl">
458
					<?=gettext("Name of the host, without domain part.");?>
459
				</span>
460
			</td>
461
		</tr>
462
<?php
463
	if ($netboot_enabled) {
464
?>
465
		<tr>
466
			<td width="22%" valign="top" class="vncell">Netboot Filename</td>
467
			<td width="78%" class="vtable">
468
				<input name="filename" type="text" class="formfld unknown" id="filename" size="20" value="<?=htmlspecialchars($pconfig['filename']);?>" />
469
				<br />
470
				<span class="vexpl">Name of the file that should be loaded when this host boots off of the network, overrides setting on main page.</span>
471
			</td>
472
		</tr>
473
		<tr>
474
			<td width="22%" valign="top" class="vncell">Root Path</td>
475
			<td width="78%" class="vtable">
476
				<input name="rootpath" type="text" class="formfld unknown" id="rootpath" size="90" value="<?=htmlspecialchars($pconfig['rootpath']);?>" />
477
				<br />
478
				<span class="vexpl">
479
					<?=gettext("Enter the"); ?> <b><?=gettext("root-path"); ?></b>-<?=gettext("string");?>, overrides setting on main page.
480
				</span>
481
			</td>
482
		</tr>
483
<?php
484
	}
485
?>
486
		<tr>
487
			<td width="22%" valign="top" class="vncell"><?=gettext("Description");?></td>
488
			<td width="78%" class="vtable">
489
				<input name="descr" type="text" class="formfld unknown" id="descr" size="40" value="<?=htmlspecialchars($pconfig['descr']);?>" />
490
				<br />
491
				<span class="vexpl">
492
					<?=gettext("You may enter a description here for your reference (not parsed).");?>
493
				</span>
494
			</td>
495
		</tr>
496
		<tr>
497
			<td width="22%" valign="top" class="vncell"><?=gettext("ARP Table Static Entry");?></td>
498
			<td width="78%" class="vtable">
499
				<input name="arp_table_static_entry" id="arp_table_static_entry" type="checkbox" value="yes" <?php if ($pconfig['arp_table_static_entry']) echo "checked=\"checked\""; ?> />
500
				<br />
501
				<span class="vexpl">
502
					<?=gettext("Create an ARP Table Static Entry for this MAC &amp; IP Address pair. ");?>
503
				</span>
504
			</td>
505
		</tr>
506
		<tr>
507
			<td width="22%" valign="top" class="vncell"><?=gettext("WINS servers");?></td>
508
			<td width="78%" class="vtable">
509
				<input name="wins1" type="text" class="formfld unknown" id="wins1" size="20" value="<?=htmlspecialchars($pconfig['wins1']);?>" /><br />
510
				<input name="wins2" type="text" class="formfld unknown" id="wins2" size="20" value="<?=htmlspecialchars($pconfig['wins2']);?>" />
511
			</td>
512
		</tr>
513
		<tr>
514
			<td width="22%" valign="top" class="vncell"><?=gettext("DNS servers");?></td>
515
			<td width="78%" class="vtable">
516
				<input name="dns1" type="text" class="formfld unknown" id="dns1" size="20" value="<?=htmlspecialchars($pconfig['dns1']);?>" /><br />
517
				<input name="dns2" type="text" class="formfld unknown" id="dns2" size="20" value="<?=htmlspecialchars($pconfig['dns2']);?>" /><br />
518
				<input name="dns3" type="text" class="formfld unknown" id="dns3" size="20" value="<?=htmlspecialchars($pconfig['dns3']);?>" /><br />
519
				<input name="dns4" type="text" class="formfld unknown" id="dns4" size="20" value="<?=htmlspecialchars($pconfig['dns4']);?>" /><br />
520
				<?=gettext("NOTE: leave blank to use the system default DNS servers - this interface's IP if DNS Forwarder or Resolver is enabled, otherwise the servers configured on the General page.");?>
521
			</td>
522
		</tr>
523
		<tr>
524
			<td width="22%" valign="top" class="vncell"><?=gettext("Gateway");?></td>
525
			<td width="78%" class="vtable">
526
				<input name="gateway" type="text" class="formfld host" id="gateway" size="20" value="<?=htmlspecialchars($pconfig['gateway']);?>" /><br />
527
				<?=gettext("The default is to use the IP on this interface of the firewall as the gateway. Specify an alternate gateway here if this is not the correct gateway for your network.");?>
528
			</td>
529
		</tr>
530
		<tr>
531
			<td width="22%" valign="top" class="vncell"><?=gettext("Domain name");?></td>
532
			<td width="78%" class="vtable">
533
				<input name="domain" type="text" class="formfld unknown" id="domain" size="20" value="<?=htmlspecialchars($pconfig['domain']);?>" /><br />
534
				 <?=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.");?>
535
			</td>
536
		</tr>
537
		<tr>
538
			<td width="22%" valign="top" class="vncell"><?=gettext("Domain search list");?></td>
539
			<td width="78%" class="vtable">
540
				<input name="domainsearchlist" type="text" class="formfld unknown" id="domainsearchlist" size="20" value="<?=htmlspecialchars($pconfig['domainsearchlist']);?>" /><br />
541
				<?=gettext("The DHCP server can optionally provide a domain search list. Use the semicolon character as separator ");?>
542
			</td>
543
		</tr>
544
		<tr>
545
			<td width="22%" valign="top" class="vncell"><?=gettext("Default lease time");?></td>
546
			<td width="78%" class="vtable">
547
				<input name="deftime" type="text" class="formfld unknown" id="deftime" size="10" value="<?=htmlspecialchars($pconfig['deftime']);?>" />
548
				<?=gettext("seconds");?><br />
549
				<?=gettext("This is used for clients that do not ask for a specific expiration time."); ?><br />
550
				<?=gettext("The default is 7200 seconds.");?>
551
			</td>
552
		</tr>
553
		<tr>
554
			<td width="22%" valign="top" class="vncell"><?=gettext("Maximum lease time");?></td>
555
			<td width="78%" class="vtable">
556
				<input name="maxtime" type="text" class="formfld unknown" id="maxtime" size="10" value="<?=htmlspecialchars($pconfig['maxtime']);?>" />
557
				<?=gettext("seconds");?><br />
558
				<?=gettext("This is the maximum lease time for clients that ask for a specific expiration time."); ?><br />
559
				<?=gettext("The default is 86400 seconds.");?>
560
			</td>
561
		</tr>
562
		<tr>
563
			<td width="22%" valign="top" class="vncell"><?=gettext("Dynamic DNS");?></td>
564
			<td width="78%" class="vtable">
565
				<div id="showddnsbox">
566
					<input type="button" onclick="show_ddns_config()" value="<?=gettext("Advanced");?>" /> - <?=gettext("Show Dynamic DNS");?>
567
				</div>
568
				<div id="showddns" style="display:none">
569
					<input style="vertical-align:middle" type="checkbox" value="yes" name="ddnsupdate" id="ddnsupdate" <?php if ($pconfig['ddnsupdate']) echo "checked=\"checked\""; ?> />&nbsp;
570
					<b><?=gettext("Enable registration of DHCP client names in DNS.");?></b><br />
571
					<p>
572
						<input name="ddnsdomain" type="text" class="formfld unknown" id="ddnsdomain" size="20" value="<?=htmlspecialchars($pconfig['ddnsdomain']);?>" /><br />
573
						<?=gettext("Note: Leave blank to disable dynamic DNS registration.");?><br />
574
						<?=gettext("Enter the dynamic DNS domain which will be used to register client names in the DNS server.");?><br />
575
						<input name="ddnsdomainprimary" type="text" class="formfld unknown" id="ddnsdomainprimary" size="20" value="<?=htmlspecialchars($pconfig['ddnsdomainprimary']);?>" /><br />
576
						<?=gettext("Enter the primary domain name server IP address for the dynamic domain name.");?><br />
577
						<input name="ddnsdomainkeyname" type="text" class="formfld unknown" id="ddnsdomainkeyname" size="20" value="<?=htmlspecialchars($pconfig['ddnsdomainkeyname']);?>" /><br />
578
						<?=gettext("Enter the dynamic DNS domain key name which will be used to register client names in the DNS server.");?><br />
579
						<input name="ddnsdomainkey" type="text" class="formfld unknown" id="ddnsdomainkey" size="20" value="<?=htmlspecialchars($pconfig['ddnsdomainkey']);?>" /><br />
580
						<?=gettext("Enter the dynamic DNS domain key secret which will be used to register client names in the DNS server.");?>
581
					</p>
582
				</div>
583
			</td>
584
		</tr>
585
		<tr>
586
			<td width="22%" valign="top" class="vncell"><?=gettext("NTP servers");?></td>
587
			<td width="78%" class="vtable">
588
				<div id="showntpbox">
589
					<input type="button" onclick="show_ntp_config()" value="<?=gettext("Advanced");?>" /> - <?=gettext("Show NTP configuration");?>
590
				</div>
591
				<div id="showntp" style="display:none">
592
					<input name="ntp1" type="text" class="formfld unknown" id="ntp1" size="20" value="<?=htmlspecialchars($pconfig['ntp1']);?>" /><br />
593
					<input name="ntp2" type="text" class="formfld unknown" id="ntp2" size="20" value="<?=htmlspecialchars($pconfig['ntp2']);?>" />
594
				</div>
595
			</td>
596
		</tr>
597
		<tr>
598
			<td width="22%" valign="top" class="vncell"><?=gettext("TFTP server");?></td>
599
			<td width="78%" class="vtable">
600
			<div id="showtftpbox">
601
				<input type="button" onclick="show_tftp_config()" value="<?=gettext("Advanced");?>" /> - <?=gettext("Show TFTP configuration");?>
602
			</div>
603
			<div id="showtftp" style="display:none">
604
				<input name="tftp" type="text" class="formfld unknown" id="tftp" size="50" value="<?=htmlspecialchars($pconfig['tftp']);?>" /><br />
605
				<?=gettext("Leave blank to disable.  Enter a full hostname or IP for the TFTP server.");?>
606
			</div>
607
			</td>
608
		</tr>
609
		<tr>
610
			<td width="22%" valign="top">&nbsp;</td>
611
			<td width="78%">
612
				<input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" />
613
				<input type="button" class="formbtn" value="<?=gettext("Cancel");?>" onclick="window.location.href='<?=$referer;?>'" />
614
				<input name="referer" type="hidden" value="<?=$referer;?>" />
615
				<?php if (isset($id) && $a_maps[$id]): ?>
616
				<input name="id" type="hidden" value="<?=htmlspecialchars($id);?>" />
617
				<?php endif; ?>
618
				<input name="if" type="hidden" value="<?=htmlspecialchars($if);?>" />
619
			</td>
620
		</tr>
621
	</table>
622
</form>
623
<?php include("fend.inc"); ?>
624
</body>
625
</html>
(147-147/252)