Project

General

Profile

Download (26 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
$referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/services_dhcp.php');
64

    
65
$if = $_GET['if'];
66
if ($_POST['if'])
67
	$if = $_POST['if'];
68

    
69
if (!$if) {
70
	header("Location: services_dhcp.php");
71
	exit;
72
}
73

    
74
if (!is_array($config['dhcpd']))
75
	$config['dhcpd'] = array();
76
if (!is_array($config['dhcpd'][$if]))
77
	$config['dhcpd'][$if] = array();
78
if (!is_array($config['dhcpd'][$if]['staticmap']))
79
	$config['dhcpd'][$if]['staticmap'] = array();
80

    
81
if (!is_array($config['dhcpd'][$if]['pool']))
82
	$config['dhcpd'][$if]['pool'] = array();
83
$a_pools = &$config['dhcpd'][$if]['pool'];
84

    
85
$static_arp_enabled=isset($config['dhcpd'][$if]['staticarp']);
86
$netboot_enabled=isset($config['dhcpd'][$if]['netboot']);
87
$a_maps = &$config['dhcpd'][$if]['staticmap'];
88
$ifcfgip = get_interface_ip($if);
89
$ifcfgsn = get_interface_subnet($if);
90
$ifcfgdescr = convert_friendly_interface_to_friendly_descr($if);
91

    
92
if (is_numericint($_GET['id']))
93
	$id = $_GET['id'];
94
if (isset($_POST['id']) && is_numericint($_POST['id']))
95
	$id = $_POST['id'];
96

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

    
149
if ($_POST) {
150

    
151
	unset($input_errors);
152
	$pconfig = $_POST;
153

    
154
	/* input validation */
155
	$reqdfields = array();
156
	$reqdfieldsn = array();
157

    
158
	do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
159

    
160
    /* either MAC or Client-ID must be specified */
161
    if (empty($_POST['mac']) && empty($_POST['cid']))
162
        $input_errors[] = gettext("Either MAC address or Client identifier must be specified");
163

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

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

    
189
	/* check for overlaps */
190
	foreach ($a_maps as $mapent) {
191
		if (isset($id) && ($a_maps[$id]) && ($a_maps[$id] === $mapent))
192
			continue;
193

    
194
		if ((($mapent['hostname'] == $_POST['hostname']) && $mapent['hostname'])  || (($mapent['mac'] == $_POST['mac']) && $mapent['mac']) || (($mapent['ipaddr'] == $_POST['ipaddr']) && $mapent['ipaddr'] ) || (($mapent['cid'] == $_POST['cid']) && $mapent['cid'])) {
195
			$input_errors[] = gettext("This Hostname, IP, MAC address or Client identifier already exists.");
196
			break;
197
		}
198
	}
199

    
200
	/* make sure it's not within the dynamic subnet */
201
	if ($_POST['ipaddr']) {
202
		$dynsubnet_start = ip2ulong($config['dhcpd'][$if]['range']['from']);
203
		$dynsubnet_end = ip2ulong($config['dhcpd'][$if]['range']['to']);
204
		if ((ip2ulong($_POST['ipaddr']) >= $dynsubnet_start) &&
205
			(ip2ulong($_POST['ipaddr']) <= $dynsubnet_end)) {
206
			$input_errors[] = sprintf(gettext("The IP address must not be within the DHCP range for this interface."));
207
		}
208

    
209
		foreach ($a_pools as $pidx => $p) {
210
			if (is_inrange_v4($_POST['ipaddr'], $p['range']['from'], $p['range']['to'])) {
211
				$input_errors[] = gettext("The IP address must not be within the range configured on a DHCP pool for this interface.");
212
				break;
213
			}
214
		}
215

    
216
		$lansubnet_start = ip2ulong(long2ip32(ip2long($ifcfgip) & gen_subnet_mask_long($ifcfgsn)));
217
		$lansubnet_end = ip2ulong(long2ip32(ip2long($ifcfgip) | (~gen_subnet_mask_long($ifcfgsn))));
218
		if ((ip2ulong($_POST['ipaddr']) < $lansubnet_start) ||
219
			(ip2ulong($_POST['ipaddr']) > $lansubnet_end)) {
220
			$input_errors[] = sprintf(gettext("The IP address must lie in the %s subnet."),$ifcfgdescr);
221
		}
222
	}
223

    
224
	if (($_POST['gateway'] && !is_ipaddrv4($_POST['gateway'])))
225
		$input_errors[] = gettext("A valid IP address must be specified for the gateway.");
226
	if (($_POST['wins1'] && !is_ipaddrv4($_POST['wins1'])) || ($_POST['wins2'] && !is_ipaddrv4($_POST['wins2'])))
227
		$input_errors[] = gettext("A valid IP address must be specified for the primary/secondary WINS servers.");
228

    
229
	$parent_ip = get_interface_ip($POST['if']);
230
	if (is_ipaddrv4($parent_ip) && $_POST['gateway']) {
231
		$parent_sn = get_interface_subnet($_POST['if']);
232
		if(!ip_in_subnet($_POST['gateway'], gen_subnet($parent_ip, $parent_sn) . "/" . $parent_sn) && !ip_in_interface_alias_subnet($_POST['if'], $_POST['gateway']))
233
			$input_errors[] = sprintf(gettext("The gateway address %s does not lie within the chosen interface's subnet."), $_POST['gateway']);
234
	}
235
	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'])))
236
		$input_errors[] = gettext("A valid IP address must be specified for each of the DNS servers.");
237

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

    
259
	if (($_POST['ntp1'] && !is_ipaddrv4($_POST['ntp1'])) || ($_POST['ntp2'] && !is_ipaddrv4($_POST['ntp2'])))
260
		$input_errors[] = gettext("A valid IP address must be specified for the primary/secondary NTP servers.");
261
	if ($_POST['tftp'] && !is_ipaddrv4($_POST['tftp']) && !is_domain($_POST['tftp']) && !is_URL($_POST['tftp']))
262
		$input_errors[] = gettext("A valid IP address or hostname must be specified for the TFTP server.");
263
	if (($_POST['nextserver'] && !is_ipaddrv4($_POST['nextserver'])))
264
		$input_errors[] = gettext("A valid IP address must be specified for the network boot server.");
265

    
266
	if (!$input_errors) {
267
		$mapent = array();
268
		$mapent['mac'] = $_POST['mac'];
269
		$mapent['cid'] = $_POST['cid'];
270
		$mapent['ipaddr'] = $_POST['ipaddr'];
271
		$mapent['hostname'] = $_POST['hostname'];
272
		$mapent['descr'] = $_POST['descr'];
273
		$mapent['arp_table_static_entry'] = ($_POST['arp_table_static_entry']) ? true : false;
274
		$mapent['filename'] = $_POST['filename'];
275
		$mapent['rootpath'] = $_POST['rootpath'];
276
		$mapent['defaultleasetime'] = $_POST['deftime'];
277
		$mapent['maxleasetime'] = $_POST['maxtime'];
278

    
279
		unset($mapent['winsserver']);
280
		if ($_POST['wins1'])
281
			$mapent['winsserver'][] = $_POST['wins1'];
282
		if ($_POST['wins2'])
283
			$mapent['winsserver'][] = $_POST['wins2'];
284

    
285
		unset($mapent['dnsserver']);
286
		if ($_POST['dns1'])
287
			$mapent['dnsserver'][] = $_POST['dns1'];
288
		if ($_POST['dns2'])
289
			$mapent['dnsserver'][] = $_POST['dns2'];
290
		if ($_POST['dns3'])
291
			$mapent['dnsserver'][] = $_POST['dns3'];
292
		if ($_POST['dns4'])
293
			$mapent['dnsserver'][] = $_POST['dns4'];
294

    
295
		$mapent['gateway'] = $_POST['gateway'];
296
		$mapent['domain'] = $_POST['domain'];
297
		$mapent['domainsearchlist'] = $_POST['domainsearchlist'];
298
		$mapent['ddnsdomain'] = $_POST['ddnsdomain'];
299
		$mapent['ddnsdomainprimary'] = $_POST['ddnsdomainprimary'];
300
		$mapent['ddnsdomainkeyname'] = $_POST['ddnsdomainkeyname'];
301
		$mapent['ddnsdomainkey'] = $_POST['ddnsdomainkey'];
302
		$mapent['ddnsupdate'] = ($_POST['ddnsupdate']) ? true : false;
303

    
304
		unset($mapent['ntpserver']);
305
		if ($_POST['ntp1'])
306
			$mapent['ntpserver'][] = $_POST['ntp1'];
307
		if ($_POST['ntp2'])
308
			$mapent['ntpserver'][] = $_POST['ntp2'];
309

    
310
		$mapent['tftp'] = $_POST['tftp'];
311
		$mapent['ldap'] = $_POST['ldap'];
312

    
313
		if (isset($id) && $a_maps[$id])
314
			$a_maps[$id] = $mapent;
315
		else
316
			$a_maps[] = $mapent;
317
		staticmaps_sort($if);
318

    
319
		write_config();
320

    
321
		if(isset($config['dhcpd'][$if]['enable'])) {
322
			mark_subsystem_dirty('staticmaps');
323
			if (isset($config['dnsmasq']['enable']) && isset($config['dnsmasq']['regdhcpstatic']))
324
				mark_subsystem_dirty('hosts');
325
			if (isset($config['unbound']['enable']) && isset($config['unbound']['regdhcpstatic']))
326
				mark_subsystem_dirty('unbound');
327
		}
328

    
329
		header("Location: services_dhcp.php?if={$if}");
330
		exit;
331
	}
332
}
333

    
334
$closehead = false;
335
$pgtitle = array(gettext("Services"),gettext("DHCP"),gettext("Edit static mapping"));
336
$shortcut_section = "dhcp";
337

    
338
include("head.inc");
339

    
340
?>
341

    
342
<script type="text/javascript">
343
//<![CDATA[
344
	function show_ddns_config() {
345
		document.getElementById("showddnsbox").innerHTML='';
346
		aodiv = document.getElementById('showddns');
347
		aodiv.style.display = "block";
348
	}
349

    
350
	function show_ntp_config() {
351
		document.getElementById("showntpbox").innerHTML='';
352
		aodiv = document.getElementById('showntp');
353
		aodiv.style.display = "block";
354
	}
355

    
356
	function show_tftp_config() {
357
		document.getElementById("showtftpbox").innerHTML='';
358
		aodiv = document.getElementById('showtftp');
359
		aodiv.style.display = "block";
360
	}
361
//]]>
362
</script>
363
</head>
364

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