Projet

Général

Profil

Télécharger (25,3 ko) Statistiques
| Branche: | Tag: | Révision:

univnautes / usr / local / www / services_dhcp_edit.php @ 62424bdb

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
	All rights reserved.
9

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

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

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

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

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

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

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

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

    
53
require_once('globals.inc');
54

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

    
60
require("guiconfig.inc");
61

    
62
$referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/services_dhcp.php');
63

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

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

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

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

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

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

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

    
146
if ($_POST) {
147

    
148
	unset($input_errors);
149
	$pconfig = $_POST;
150

    
151
	/* input validation */
152
	$reqdfields = array();
153
	$reqdfieldsn = array();
154

    
155
	do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
156

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

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

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

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

    
191
		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'])) {
192
			$input_errors[] = gettext("This Hostname, IP, MAC address or Client identifier already exists.");
193
			break;
194
		}
195
	}
196

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

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

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

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

    
226
	$parent_ip = get_interface_ip($POST['if']);
227
	if (is_ipaddrv4($parent_ip) && $_POST['gateway']) {
228
		$parent_sn = get_interface_subnet($_POST['if']);
229
		if(!ip_in_subnet($_POST['gateway'], gen_subnet($parent_ip, $parent_sn) . "/" . $parent_sn) && !ip_in_interface_alias_subnet($_POST['if'], $_POST['gateway']))
230
			$input_errors[] = sprintf(gettext("The gateway address %s does not lie within the chosen interface's subnet."), $_POST['gateway']);
231
	}
232
	if (($_POST['dns1'] && !is_ipaddrv4($_POST['dns1'])) || ($_POST['dns2'] && !is_ipaddrv4($_POST['dns2'])))
233
		$input_errors[] = gettext("A valid IP address must be specified for the primary/secondary DNS servers.");
234

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

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

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

    
276
		unset($mapent['winsserver']);
277
		if ($_POST['wins1'])
278
			$mapent['winsserver'][] = $_POST['wins1'];
279
		if ($_POST['wins2'])
280
			$mapent['winsserver'][] = $_POST['wins2'];
281

    
282
		unset($mapent['dnsserver']);
283
		if ($_POST['dns1'])
284
			$mapent['dnsserver'][] = $_POST['dns1'];
285
		if ($_POST['dns2'])
286
			$mapent['dnsserver'][] = $_POST['dns2'];
287

    
288
		$mapent['gateway'] = $_POST['gateway'];
289
		$mapent['domain'] = $_POST['domain'];
290
		$mapent['domainsearchlist'] = $_POST['domainsearchlist'];
291
		$mapent['ddnsdomain'] = $_POST['ddnsdomain'];
292
		$mapent['ddnsdomainprimary'] = $_POST['ddnsdomainprimary'];
293
		$mapent['ddnsdomainkeyname'] = $_POST['ddnsdomainkeyname'];
294
		$mapent['ddnsdomainkey'] = $_POST['ddnsdomainkey'];
295
		$mapent['ddnsupdate'] = ($_POST['ddnsupdate']) ? true : false;
296

    
297
		unset($mapent['ntpserver']);
298
		if ($_POST['ntp1'])
299
			$mapent['ntpserver'][] = $_POST['ntp1'];
300
		if ($_POST['ntp2'])
301
			$mapent['ntpserver'][] = $_POST['ntp2'];
302

    
303
		$mapent['tftp'] = $_POST['tftp'];
304
		$mapent['ldap'] = $_POST['ldap'];
305

    
306
		if (isset($id) && $a_maps[$id])
307
			$a_maps[$id] = $mapent;
308
		else
309
			$a_maps[] = $mapent;
310
		staticmaps_sort($if);
311

    
312
		write_config();
313

    
314
		if(isset($config['dhcpd'][$if]['enable'])) {
315
			mark_subsystem_dirty('staticmaps');
316
			if (isset($config['dnsmasq']['enable']) && isset($config['dnsmasq']['regdhcpstatic']))
317
				mark_subsystem_dirty('hosts');
318
			if (isset($config['unbound']['enable']) && isset($config['unbound']['regdhcpstatic']))
319
				mark_subsystem_dirty('unbound');
320
		}
321

    
322
		header("Location: services_dhcp.php?if={$if}");
323
		exit;
324
	}
325
}
326

    
327
$closehead = false;
328
$pgtitle = array(gettext("Services"),gettext("DHCP"),gettext("Edit static mapping"));
329
$shortcut_section = "dhcp";
330

    
331
include("head.inc");
332

    
333
?>
334

    
335
<script type="text/javascript">
336
//<![CDATA[
337
	function show_ddns_config() {
338
		document.getElementById("showddnsbox").innerHTML='';
339
		aodiv = document.getElementById('showddns');
340
		aodiv.style.display = "block";
341
	}
342

    
343
	function show_ntp_config() {
344
		document.getElementById("showntpbox").innerHTML='';
345
		aodiv = document.getElementById('showntp');
346
		aodiv.style.display = "block";
347
	}
348

    
349
	function show_tftp_config() {
350
		document.getElementById("showtftpbox").innerHTML='';
351
		aodiv = document.getElementById('showtftp');
352
		aodiv.style.display = "block";
353
	}
354
//]]>
355
</script>
356
</head>
357

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