Project

General

Profile

Download (26.5 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
if (!$if) {
74
	header("Location: services_dhcp.php");
75
	exit;
76
}
77

    
78
if (!is_array($config['dhcpd']))
79
	$config['dhcpd'] = array();
80
if (!is_array($config['dhcpd'][$if]))
81
	$config['dhcpd'][$if] = array();
82
if (!is_array($config['dhcpd'][$if]['staticmap']))
83
	$config['dhcpd'][$if]['staticmap'] = array();
84

    
85
if (!is_array($config['dhcpd'][$if]['pool']))
86
	$config['dhcpd'][$if]['pool'] = array();
87
$a_pools = &$config['dhcpd'][$if]['pool'];
88

    
89
$static_arp_enabled=isset($config['dhcpd'][$if]['staticarp']);
90
$netboot_enabled=isset($config['dhcpd'][$if]['netboot']);
91
$a_maps = &$config['dhcpd'][$if]['staticmap'];
92
$ifcfgip = get_interface_ip($if);
93
$ifcfgsn = get_interface_subnet($if);
94
$ifcfgdescr = convert_friendly_interface_to_friendly_descr($if);
95

    
96
if (is_numericint($_GET['id']))
97
	$id = $_GET['id'];
98
if (isset($_POST['id']) && is_numericint($_POST['id']))
99
	$id = $_POST['id'];
100

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

    
153
if ($_POST) {
154

    
155
	unset($input_errors);
156
	$pconfig = $_POST;
157

    
158
	/* input validation */
159
	$reqdfields = array();
160
	$reqdfieldsn = array();
161

    
162
	do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
163

    
164
    /* either MAC or Client-ID must be specified */
165
    if (empty($_POST['mac']) && empty($_POST['cid']))
166
        $input_errors[] = gettext("Either MAC address or Client identifier must be specified");
167

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

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

    
193
	/* check for overlaps */
194
	foreach ($a_maps as $mapent) {
195
		if (isset($id) && ($a_maps[$id]) && ($a_maps[$id] === $mapent))
196
			continue;
197
		/* The fully qualified hostname (hostname + '.' + domainname) must be unique.
198
		 * The unqualified hostname does not have to be unique as long as the fully
199
		 * qualified hostname is unique. */
200
		$existingFqn = "{$mapent['hostname']}.{$mapent['domain']}";
201
		$candidateFqn = "{$_POST['hostname']}.{$_POST['domain']}";
202
		if ((($existingFqn == $candidateFqn) && $mapent['hostname']) || (($mapent['mac'] == $_POST['mac']) && $mapent['mac']) || (($mapent['ipaddr'] == $_POST['ipaddr']) && $mapent['ipaddr'] ) || (($mapent['cid'] == $_POST['cid']) && $mapent['cid'])) {
203
			$input_errors[] = gettext("This fully qualified hostname (Hostname + Domainname), IP, MAC address or Client identifier already exists.");
204
			break;
205
		}
206
	}
207

    
208
	/* make sure it's not within the dynamic subnet */
209
	if ($_POST['ipaddr']) {
210
		$dynsubnet_start = ip2ulong($config['dhcpd'][$if]['range']['from']);
211
		$dynsubnet_end = ip2ulong($config['dhcpd'][$if]['range']['to']);
212
		if ((ip2ulong($_POST['ipaddr']) >= $dynsubnet_start) &&
213
			(ip2ulong($_POST['ipaddr']) <= $dynsubnet_end)) {
214
			$input_errors[] = sprintf(gettext("The IP address must not be within the DHCP range for this interface."));
215
		}
216

    
217
		foreach ($a_pools as $pidx => $p) {
218
			if (is_inrange_v4($_POST['ipaddr'], $p['range']['from'], $p['range']['to'])) {
219
				$input_errors[] = gettext("The IP address must not be within the range configured on a DHCP pool for this interface.");
220
				break;
221
			}
222
		}
223

    
224
		$lansubnet_start = ip2ulong(long2ip32(ip2long($ifcfgip) & gen_subnet_mask_long($ifcfgsn)));
225
		$lansubnet_end = ip2ulong(long2ip32(ip2long($ifcfgip) | (~gen_subnet_mask_long($ifcfgsn))));
226
		if ((ip2ulong($_POST['ipaddr']) < $lansubnet_start) ||
227
			(ip2ulong($_POST['ipaddr']) > $lansubnet_end)) {
228
			$input_errors[] = sprintf(gettext("The IP address must lie in the %s subnet."),$ifcfgdescr);
229
		}
230
	}
231

    
232
	if (($_POST['gateway'] && !is_ipaddrv4($_POST['gateway'])))
233
		$input_errors[] = gettext("A valid IP address must be specified for the gateway.");
234
	if (($_POST['wins1'] && !is_ipaddrv4($_POST['wins1'])) || ($_POST['wins2'] && !is_ipaddrv4($_POST['wins2'])))
235
		$input_errors[] = gettext("A valid IP address must be specified for the primary/secondary WINS servers.");
236

    
237
	$parent_ip = get_interface_ip($POST['if']);
238
	if (is_ipaddrv4($parent_ip) && $_POST['gateway']) {
239
		$parent_sn = get_interface_subnet($_POST['if']);
240
		if(!ip_in_subnet($_POST['gateway'], gen_subnet($parent_ip, $parent_sn) . "/" . $parent_sn) && !ip_in_interface_alias_subnet($_POST['if'], $_POST['gateway']))
241
			$input_errors[] = sprintf(gettext("The gateway address %s does not lie within the chosen interface's subnet."), $_POST['gateway']);
242
	}
243
	if (($_POST['dns1'] && !is_ipaddrv4($_POST['dns1'])) || ($_POST['dns2'] && !is_ipaddrv4($_POST['dns2'])) || ($_POST['dns3'] && !is_ipaddrv4($_POST['dns3'])) || ($_POST['dns4'] && !is_ipaddrv4($_POST['dns4'])))
244
		$input_errors[] = gettext("A valid IP address must be specified for each of the DNS servers.");
245

    
246
	if ($_POST['deftime'] && (!is_numeric($_POST['deftime']) || ($_POST['deftime'] < 60)))
247
		$input_errors[] = gettext("The default lease time must be at least 60 seconds.");
248
	if ($_POST['maxtime'] && (!is_numeric($_POST['maxtime']) || ($_POST['maxtime'] < 60) || ($_POST['maxtime'] <= $_POST['deftime'])))
249
		$input_errors[] = gettext("The maximum lease time must be at least 60 seconds and higher than the default lease time.");
250
	if (($_POST['ddnsdomain'] && !is_domain($_POST['ddnsdomain'])))
251
		$input_errors[] = gettext("A valid domain name must be specified for the dynamic DNS registration.");
252
	if (($_POST['ddnsdomain'] && !is_ipaddrv4($_POST['ddnsdomainprimary'])))
253
		$input_errors[] = gettext("A valid primary domain name server IP address must be specified for the dynamic domain name.");
254
	if (($_POST['ddnsdomainkey'] && !$_POST['ddnsdomainkeyname']) ||
255
		($_POST['ddnsdomainkeyname'] && !$_POST['ddnsdomainkey']))
256
		$input_errors[] = gettext("You must specify both a valid domain key and key name.");
257
	if ($_POST['domainsearchlist']) {
258
		$domain_array=preg_split("/[ ;]+/",$_POST['domainsearchlist']);
259
		foreach ($domain_array as $curdomain) {
260
			if (!is_domain($curdomain)) {
261
				$input_errors[] = gettext("A valid domain search list must be specified.");
262
				break;
263
			}
264
		}
265
	}
266

    
267
	if (($_POST['ntp1'] && !is_ipaddrv4($_POST['ntp1'])) || ($_POST['ntp2'] && !is_ipaddrv4($_POST['ntp2'])))
268
		$input_errors[] = gettext("A valid IP address must be specified for the primary/secondary NTP servers.");
269
	if ($_POST['tftp'] && !is_ipaddrv4($_POST['tftp']) && !is_domain($_POST['tftp']) && !is_URL($_POST['tftp']))
270
		$input_errors[] = gettext("A valid IP address or hostname must be specified for the TFTP server.");
271
	if (($_POST['nextserver'] && !is_ipaddrv4($_POST['nextserver'])))
272
		$input_errors[] = gettext("A valid IP address must be specified for the network boot server.");
273

    
274
	if (!$input_errors) {
275
		$mapent = array();
276
		$mapent['mac'] = $_POST['mac'];
277
		$mapent['cid'] = $_POST['cid'];
278
		$mapent['ipaddr'] = $_POST['ipaddr'];
279
		$mapent['hostname'] = $_POST['hostname'];
280
		$mapent['descr'] = $_POST['descr'];
281
		$mapent['arp_table_static_entry'] = ($_POST['arp_table_static_entry']) ? true : false;
282
		$mapent['filename'] = $_POST['filename'];
283
		$mapent['rootpath'] = $_POST['rootpath'];
284
		$mapent['defaultleasetime'] = $_POST['deftime'];
285
		$mapent['maxleasetime'] = $_POST['maxtime'];
286

    
287
		unset($mapent['winsserver']);
288
		if ($_POST['wins1'])
289
			$mapent['winsserver'][] = $_POST['wins1'];
290
		if ($_POST['wins2'])
291
			$mapent['winsserver'][] = $_POST['wins2'];
292

    
293
		unset($mapent['dnsserver']);
294
		if ($_POST['dns1'])
295
			$mapent['dnsserver'][] = $_POST['dns1'];
296
		if ($_POST['dns2'])
297
			$mapent['dnsserver'][] = $_POST['dns2'];
298
		if ($_POST['dns3'])
299
			$mapent['dnsserver'][] = $_POST['dns3'];
300
		if ($_POST['dns4'])
301
			$mapent['dnsserver'][] = $_POST['dns4'];
302

    
303
		$mapent['gateway'] = $_POST['gateway'];
304
		$mapent['domain'] = $_POST['domain'];
305
		$mapent['domainsearchlist'] = $_POST['domainsearchlist'];
306
		$mapent['ddnsdomain'] = $_POST['ddnsdomain'];
307
		$mapent['ddnsdomainprimary'] = $_POST['ddnsdomainprimary'];
308
		$mapent['ddnsdomainkeyname'] = $_POST['ddnsdomainkeyname'];
309
		$mapent['ddnsdomainkey'] = $_POST['ddnsdomainkey'];
310
		$mapent['ddnsupdate'] = ($_POST['ddnsupdate']) ? true : false;
311

    
312
		unset($mapent['ntpserver']);
313
		if ($_POST['ntp1'])
314
			$mapent['ntpserver'][] = $_POST['ntp1'];
315
		if ($_POST['ntp2'])
316
			$mapent['ntpserver'][] = $_POST['ntp2'];
317

    
318
		$mapent['tftp'] = $_POST['tftp'];
319
		$mapent['ldap'] = $_POST['ldap'];
320

    
321
		if (isset($id) && $a_maps[$id])
322
			$a_maps[$id] = $mapent;
323
		else
324
			$a_maps[] = $mapent;
325
		staticmaps_sort($if);
326

    
327
		write_config();
328

    
329
		if(isset($config['dhcpd'][$if]['enable'])) {
330
			mark_subsystem_dirty('staticmaps');
331
			if (isset($config['dnsmasq']['enable']) && isset($config['dnsmasq']['regdhcpstatic']))
332
				mark_subsystem_dirty('hosts');
333
			if (isset($config['unbound']['enable']) && isset($config['unbound']['regdhcpstatic']))
334
				mark_subsystem_dirty('unbound');
335
		}
336

    
337
		header("Location: services_dhcp.php?if={$if}");
338
		exit;
339
	}
340
}
341

    
342
$closehead = false;
343
$pgtitle = array(gettext("Services"),gettext("DHCP"),gettext("Edit static mapping"));
344
$shortcut_section = "dhcp";
345

    
346
include("head.inc");
347

    
348
?>
349

    
350
<script type="text/javascript">
351
//<![CDATA[
352
	function show_ddns_config() {
353
		document.getElementById("showddnsbox").innerHTML='';
354
		aodiv = document.getElementById('showddns');
355
		aodiv.style.display = "block";
356
	}
357

    
358
	function show_ntp_config() {
359
		document.getElementById("showntpbox").innerHTML='';
360
		aodiv = document.getElementById('showntp');
361
		aodiv.style.display = "block";
362
	}
363

    
364
	function show_tftp_config() {
365
		document.getElementById("showtftpbox").innerHTML='';
366
		aodiv = document.getElementById('showtftp');
367
		aodiv.style.display = "block";
368
	}
369
//]]>
370
</script>
371
</head>
372

    
373
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
374
<?php include("fbegin.inc"); ?>
375
<?php if ($input_errors) print_input_errors($input_errors); ?>
376
            <form action="services_dhcp_edit.php" method="post" name="iform" id="iform">
377
              <table class="tabcont" width="100%" border="0" cellpadding="6" cellspacing="0" summary="static mapping">
378
				<tr>
379
					<td colspan="2" valign="top" class="listtopic"><?=sprintf(gettext("Static DHCP Mapping on %s"),$ifcfgdescr);?></td>
380
				</tr>
381
                <tr>
382
                  <td width="22%" valign="top" class="vncell"><?=gettext("MAC address");?></td>
383
                  <td width="78%" class="vtable">
384
                    <input name="mac" type="text" class="formfld unknown" id="mac" size="30" value="<?=htmlspecialchars($pconfig['mac']);?>" />
385
		    <?php
386
			$ip = getenv('REMOTE_ADDR');
387
			$mac = `/usr/sbin/arp -an | grep {$ip} | cut -d" " -f4`;
388
			$mac = str_replace("\n","",$mac);
389
		    ?>
390
		    <a onclick="document.forms[0].mac.value='<?=$mac?>';" href="#"><?=gettext("Copy my MAC address");?></a>
391
                    <br />
392
                    <span class="vexpl"><?=gettext("Enter a MAC address in the following format: ".
393
                    "xx:xx:xx:xx:xx:xx");?></span></td>
394
                </tr>
395
                <tr>
396
                  <td width="22%" valign="top" class="vncell"><?=gettext("Client identifier");?></td>
397
                  <td width="78%" class="vtable">
398
                    <input name="cid" type="text" class="formfld unknown" id="cid" size="30" value="<?=htmlspecialchars($pconfig['cid']);?>" />
399
                  </td>
400
                </tr>
401
                <tr>
402
                  <td width="22%" valign="top" class="vncell"><?=gettext("IP address");?></td>
403
                  <td width="78%" class="vtable">
404
                    <input name="ipaddr" type="text" class="formfld unknown" id="ipaddr" size="20" value="<?=htmlspecialchars($pconfig['ipaddr']);?>" />
405
                    <br />
406
			<?=gettext("If an IPv4 address is entered, the address must be outside of the pool.");?>
407
			<br />
408
			<?=gettext("If no IPv4 address is given, one will be dynamically allocated from the pool.");?>
409
			</td>
410
                </tr>
411
                <tr>
412
                  <td width="22%" valign="top" class="vncell"><?=gettext("Hostname");?></td>
413
                  <td width="78%" class="vtable">
414
                    <input name="hostname" type="text" class="formfld unknown" id="hostname" size="20" value="<?=htmlspecialchars($pconfig['hostname']);?>" />
415
                    <br /> <span class="vexpl"><?=gettext("Name of the host, without domain part.");?></span></td>
416
                </tr>
417
                <?php if($netboot_enabled) { ?>
418
		<tr>
419
		  <td width="22%" valign="top" class="vncell">Netboot Filename</td>
420
		  <td width="78%" class="vtable">
421
		    <input name="filename" type="text" class="formfld unknown" id="filename" size="20" value="<?=htmlspecialchars($pconfig['filename']);?>" />
422
		    <br /> <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></td>
423
		</tr>
424
		<tr>
425
		  <td width="22%" valign="top" class="vncell">Root Path</td>
426
		  <td width="78%" class="vtable">
427
			<input name="rootpath" type="text" class="formfld unknown" id="rootpath" size="90" value="<?=htmlspecialchars($pconfig['rootpath']);?>" />
428
		    <br /> <span class="vexpl"><?=gettext("Enter the"); ?> <b><?=gettext("root-path"); ?></b>-<?=gettext("string");?>, overrides setting on main page.</span></td>
429
		</tr>
430
		<?php } ?>
431
                <tr>
432
                  <td width="22%" valign="top" class="vncell"><?=gettext("Description");?></td>
433
                  <td width="78%" class="vtable">
434
                    <input name="descr" type="text" class="formfld unknown" id="descr" size="40" value="<?=htmlspecialchars($pconfig['descr']);?>" />
435
                    <br /> <span class="vexpl"><?=gettext("You may enter a description here ".
436
                    "for your reference (not parsed).");?></span></td>
437
                </tr>
438
                <tr>
439
                  <td width="22%" valign="top" class="vncell"><?=gettext("ARP Table Static Entry");?></td>
440
                  <td width="78%" class="vtable">
441
                    <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\""; ?> />
442
                    <br /> <span class="vexpl"><?=gettext("Create an ARP Table Static Entry for this MAC &amp; IP Address pair. ".
443
                    "");?></span></td>
444
                </tr>
445
		<tr>
446
		<td width="22%" valign="top" class="vncell"><?=gettext("WINS servers");?></td>
447
		<td width="78%" class="vtable">
448
			<input name="wins1" type="text" class="formfld unknown" id="wins1" size="20" value="<?=htmlspecialchars($pconfig['wins1']);?>" /><br />
449
			<input name="wins2" type="text" class="formfld unknown" id="wins2" size="20" value="<?=htmlspecialchars($pconfig['wins2']);?>" />
450
		</td>
451
		</tr>
452
		<tr>
453
		<td width="22%" valign="top" class="vncell"><?=gettext("DNS servers");?></td>
454
		<td width="78%" class="vtable">
455
			<input name="dns1" type="text" class="formfld unknown" id="dns1" size="20" value="<?=htmlspecialchars($pconfig['dns1']);?>" /><br />
456
			<input name="dns2" type="text" class="formfld unknown" id="dns2" size="20" value="<?=htmlspecialchars($pconfig['dns2']);?>" /><br />
457
			<input name="dns3" type="text" class="formfld unknown" id="dns3" size="20" value="<?=htmlspecialchars($pconfig['dns3']);?>" /><br />
458
			<input name="dns4" type="text" class="formfld unknown" id="dns4" size="20" value="<?=htmlspecialchars($pconfig['dns4']);?>" /><br />
459
			<?=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.");?>
460
		</td>
461
		</tr>
462
		<tr>
463
		<td width="22%" valign="top" class="vncell"><?=gettext("Gateway");?></td>
464
		<td width="78%" class="vtable">
465
			<input name="gateway" type="text" class="formfld host" id="gateway" size="20" value="<?=htmlspecialchars($pconfig['gateway']);?>" /><br />
466
			 <?=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.");?>
467
		</td>
468
		</tr>
469
		<tr>
470
		<td width="22%" valign="top" class="vncell"><?=gettext("Domain name");?></td>
471
		<td width="78%" class="vtable">
472
			<input name="domain" type="text" class="formfld unknown" id="domain" size="20" value="<?=htmlspecialchars($pconfig['domain']);?>" /><br />
473
			 <?=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.");?>
474
		</td>
475
		</tr>
476
		<tr>
477
		<td width="22%" valign="top" class="vncell"><?=gettext("Domain search list");?></td>
478
		<td width="78%" class="vtable">
479
			<input name="domainsearchlist" type="text" class="formfld unknown" id="domainsearchlist" size="20" value="<?=htmlspecialchars($pconfig['domainsearchlist']);?>" /><br />
480
			<?=gettext("The DHCP server can optionally provide a domain search list. Use the semicolon character as separator ");?>
481
		</td>
482
		</tr>
483
		<tr>
484
		<td width="22%" valign="top" class="vncell"><?=gettext("Default lease time");?></td>
485
		<td width="78%" class="vtable">
486
			<input name="deftime" type="text" class="formfld unknown" id="deftime" size="10" value="<?=htmlspecialchars($pconfig['deftime']);?>" />
487
			<?=gettext("seconds");?><br />
488
			<?=gettext("This is used for clients that do not ask for a specific " .
489
			"expiration time."); ?><br />
490
			<?=gettext("The default is 7200 seconds.");?>
491
		</td>
492
		</tr>
493
		<tr>
494
		<td width="22%" valign="top" class="vncell"><?=gettext("Maximum lease time");?></td>
495
		<td width="78%" class="vtable">
496
			<input name="maxtime" type="text" class="formfld unknown" id="maxtime" size="10" value="<?=htmlspecialchars($pconfig['maxtime']);?>" />
497
			<?=gettext("seconds");?><br />
498
			<?=gettext("This is the maximum lease time for clients that ask".
499
			" for a specific expiration time."); ?><br />
500
			<?=gettext("The default is 86400 seconds.");?>
501
		</td>
502
		</tr>
503
		<tr>
504
		<td width="22%" valign="top" class="vncell"><?=gettext("Dynamic DNS");?></td>
505
		<td width="78%" class="vtable">
506
			<div id="showddnsbox">
507
				<input type="button" onclick="show_ddns_config()" value="<?=gettext("Advanced");?>" /> - <?=gettext("Show Dynamic DNS");?>
508
			</div>
509
			<div id="showddns" style="display:none">
510
				<input style="vertical-align:middle" type="checkbox" value="yes" name="ddnsupdate" id="ddnsupdate" <?php if($pconfig['ddnsupdate']) echo "checked=\"checked\""; ?> />&nbsp;
511
				<b><?=gettext("Enable registration of DHCP client names in DNS.");?></b><br />
512
				<p>
513
				<input name="ddnsdomain" type="text" class="formfld unknown" id="ddnsdomain" size="20" value="<?=htmlspecialchars($pconfig['ddnsdomain']);?>" /><br />
514
				<?=gettext("Note: Leave blank to disable dynamic DNS registration.");?><br />
515
				<?=gettext("Enter the dynamic DNS domain which will be used to register client names in the DNS server.");?><br />
516
				<input name="ddnsdomainprimary" type="text" class="formfld unknown" id="ddnsdomainprimary" size="20" value="<?=htmlspecialchars($pconfig['ddnsdomainprimary']);?>" /><br />
517
				<?=gettext("Enter the primary domain name server IP address for the dynamic domain name.");?><br />
518
				<input name="ddnsdomainkeyname" type="text" class="formfld unknown" id="ddnsdomainkeyname" size="20" value="<?=htmlspecialchars($pconfig['ddnsdomainkeyname']);?>" /><br />
519
				<?=gettext("Enter the dynamic DNS domain key name which will be used to register client names in the DNS server.");?><br />
520
				<input name="ddnsdomainkey" type="text" class="formfld unknown" id="ddnsdomainkey" size="20" value="<?=htmlspecialchars($pconfig['ddnsdomainkey']);?>" /><br />
521
				<?=gettext("Enter the dynamic DNS domain key secret which will be used to register client names in the DNS server.");?>
522
				</p>
523
			</div>
524
		</td>
525
		</tr>
526
		<tr>
527
		<td width="22%" valign="top" class="vncell"><?=gettext("NTP servers");?></td>
528
		<td width="78%" class="vtable">
529
			<div id="showntpbox">
530
				<input type="button" onclick="show_ntp_config()" value="<?=gettext("Advanced");?>" /> - <?=gettext("Show NTP configuration");?>
531
			</div>
532
			<div id="showntp" style="display:none">
533
				<input name="ntp1" type="text" class="formfld unknown" id="ntp1" size="20" value="<?=htmlspecialchars($pconfig['ntp1']);?>" /><br />
534
				<input name="ntp2" type="text" class="formfld unknown" id="ntp2" size="20" value="<?=htmlspecialchars($pconfig['ntp2']);?>" />
535
			</div>
536
		</td>
537
		</tr>
538
		<tr>
539
		<td width="22%" valign="top" class="vncell"><?=gettext("TFTP server");?></td>
540
		<td width="78%" class="vtable">
541
		<div id="showtftpbox">
542
			<input type="button" onclick="show_tftp_config()" value="<?=gettext("Advanced");?>" /> - <?=gettext("Show TFTP configuration");?>
543
		</div>
544
		<div id="showtftp" style="display:none">
545
			<input name="tftp" type="text" class="formfld unknown" id="tftp" size="50" value="<?=htmlspecialchars($pconfig['tftp']);?>" /><br />
546
			<?=gettext("Leave blank to disable.  Enter a full hostname or IP for the TFTP server.");?>
547
		</div>
548
		</td>
549
		</tr>
550
                <tr>
551
                  <td width="22%" valign="top">&nbsp;</td>
552
                  <td width="78%">
553
                    <input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" />
554
                    <input type="button" class="formbtn" value="<?=gettext("Cancel");?>" onclick="window.location.href='<?=$referer;?>'" />
555
                    <input name="referer" type="hidden" value="<?=$referer;?>" />
556
                    <?php if (isset($id) && $a_maps[$id]): ?>
557
                    <input name="id" type="hidden" value="<?=htmlspecialchars($id);?>" />
558
                    <?php endif; ?>
559
                    <input name="if" type="hidden" value="<?=htmlspecialchars($if);?>" />
560
                  </td>
561
                </tr>
562
              </table>
563
</form>
564
<?php include("fend.inc"); ?>
565
</body>
566
</html>
(146-146/251)