Project

General

Profile

Download (22.3 KB) Statistics
| Branch: | Tag: | Revision:
1 b75d7fd5 Renato Botelho
<?php
2 b46bfcf5 Bill Marquette
/* $Id$ */
3 5b237745 Scott Ullrich
/*
4
	services_dhcp_edit.php
5
	part of m0n0wall (http://m0n0.ch/wall)
6 b75d7fd5 Renato Botelho
7 5b237745 Scott Ullrich
	Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
8
	All rights reserved.
9 b75d7fd5 Renato Botelho
10 5b237745 Scott Ullrich
	Redistribution and use in source and binary forms, with or without
11
	modification, are permitted provided that the following conditions are met:
12 b75d7fd5 Renato Botelho
13 5b237745 Scott Ullrich
	1. Redistributions of source code must retain the above copyright notice,
14
	   this list of conditions and the following disclaimer.
15 b75d7fd5 Renato Botelho
16 5b237745 Scott Ullrich
	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 b75d7fd5 Renato Botelho
20 5b237745 Scott Ullrich
	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 1d333258 Scott Ullrich
/*
32
	pfSense_BUILDER_BINARIES:	/usr/sbin/arp
33
	pfSense_MODULE:	dhcpserver
34
*/
35 5b237745 Scott Ullrich
36 6b07c15a Matthew Grooms
##|+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 f28a9efd jim-p
function staticmapcmp($a, $b) {
44 b75d7fd5 Renato Botelho
	return ipcmp($a['ipaddr'], $b['ipaddr']);
45 f28a9efd jim-p
}
46
47 0d64af59 Ermal Lu?i
function staticmaps_sort($ifgui) {
48 b75d7fd5 Renato Botelho
	global $g, $config;
49 0d64af59 Ermal Lu?i
50 b75d7fd5 Renato Botelho
	usort($config['dhcpd'][$ifgui]['staticmap'], "staticmapcmp");
51 0d64af59 Ermal Lu?i
}
52
53 4b559908 Ermal Luçi
require_once('globals.inc');
54
55 2ee0410f Scott Ullrich
if(!$g['services_dhcp_server_enable']) {
56
	Header("Location: /");
57
	exit;
58
}
59 6b07c15a Matthew Grooms
60 5b237745 Scott Ullrich
require("guiconfig.inc");
61
62
$if = $_GET['if'];
63
if ($_POST['if'])
64
	$if = $_POST['if'];
65 b75d7fd5 Renato Botelho
66 5b237745 Scott Ullrich
if (!$if) {
67
	header("Location: services_dhcp.php");
68
	exit;
69
}
70
71 5b668994 Erik Fonnesbeck
if (!is_array($config['dhcpd']))
72
	$config['dhcpd'] = array();
73
if (!is_array($config['dhcpd'][$if]))
74
	$config['dhcpd'][$if] = array();
75
if (!is_array($config['dhcpd'][$if]['staticmap']))
76 5b237745 Scott Ullrich
	$config['dhcpd'][$if]['staticmap'] = array();
77 0baa37c5 Scott Ullrich
78 f657f5e1 Renato Botelho
if (!is_array($config['dhcpd'][$if]['pool']))
79
	$config['dhcpd'][$if]['pool'] = array();
80
$a_pools = &$config['dhcpd'][$if]['pool'];
81
82 01292dc2 jim-p
$static_arp_enabled=isset($config['dhcpd'][$if]['staticarp']);
83 d6d50244 Ermal
$netboot_enabled=isset($config['dhcpd'][$if]['netboot']);
84 5b237745 Scott Ullrich
$a_maps = &$config['dhcpd'][$if]['staticmap'];
85 a55e9c70 Ermal Lu?i
$ifcfgip = get_interface_ip($if);
86
$ifcfgsn = get_interface_subnet($if);
87
$ifcfgdescr = convert_friendly_interface_to_friendly_descr($if);
88 5b237745 Scott Ullrich
89
$id = $_GET['id'];
90
if (isset($_POST['id']))
91
	$id = $_POST['id'];
92
93
if (isset($id) && $a_maps[$id]) {
94 b75d7fd5 Renato Botelho
	$pconfig['mac'] = $a_maps[$id]['mac'];
95
	$pconfig['hostname'] = $a_maps[$id]['hostname'];
96
	$pconfig['ipaddr'] = $a_maps[$id]['ipaddr'];
97
	$pconfig['filename'] = $a_maps[$id]['filename'];
98
	$pconfig['rootpath'] = $a_maps[$id]['rootpath'];
99
	$pconfig['descr'] = $a_maps[$id]['descr'];
100
	$pconfig['arp_table_static_entry'] = isset($a_maps[$id]['arp_table_static_entry']);
101 7309ff39 Renato Botelho
	$pconfig['deftime'] = $a_maps[$id]['defaultleasetime'];
102
	$pconfig['maxtime'] = $a_maps[$id]['maxleasetime'];
103
	$pconfig['gateway'] = $a_maps[$id]['gateway'];
104
	$pconfig['domain'] = $a_maps[$id]['domain'];
105
	$pconfig['domainsearchlist'] = $a_maps[$id]['domainsearchlist'];
106
	list($pconfig['wins1'],$pconfig['wins2']) = $a_maps[$id]['winsserver'];
107
	list($pconfig['dns1'],$pconfig['dns2']) = $a_maps[$id]['dnsserver'];
108
	$pconfig['ddnsdomain'] = $a_maps[$id]['ddnsdomain'];
109
	$pconfig['ddnsupdate'] = isset($a_maps[$id]['ddnsupdate']);
110
	list($pconfig['ntp1'],$pconfig['ntp2']) = $a_maps[$id]['ntpserver'];
111
	$pconfig['tftp'] = $a_maps[$id]['tftp'];
112 3a32590b Scott Ullrich
} else {
113 b75d7fd5 Renato Botelho
	$pconfig['mac'] = $_GET['mac'];
114
	$pconfig['hostname'] = $_GET['hostname'];
115
	$pconfig['filename'] = $_GET['filename'];
116
	$pconfig['rootpath'] = $_GET['rootpath'];
117
	$pconfig['descr'] = $_GET['descr'];
118
	$pconfig['arp_table_static_entry'] = $_GET['arp_table_static_entry'];
119 7309ff39 Renato Botelho
	$pconfig['deftime'] = $_GET['defaultleasetime'];
120
	$pconfig['maxtime'] = $_GET['maxleasetime'];
121
	$pconfig['gateway'] = $_GET['gateway'];
122
	$pconfig['domain'] = $_GET['domain'];
123
	$pconfig['domainsearchlist'] = $_GET['domainsearchlist'];
124
	$pconfig['wins1'] = $_GET['wins1'];
125
	$pconfig['wins2'] = $_GET['wins2'];
126
	$pconfig['dns1'] = $_GET['dns1'];
127
	$pconfig['dns2'] = $_GET['dns2'];
128
	$pconfig['ddnsdomain'] = $_GET['ddnsdomain'];
129
	$pconfig['ddnsupdate'] = isset($_GET['ddnsupdate']);
130
	$pconfig['ntp1'] = $_GET['ntp1'];
131
	$pconfig['ntp2'] = $_GET['ntp2'];
132
	$pconfig['tftp'] = $_GET['tftp'];
133 5b237745 Scott Ullrich
}
134
135
if ($_POST) {
136
137
	unset($input_errors);
138
	$pconfig = $_POST;
139
140
	/* input validation */
141
	$reqdfields = explode(" ", "mac");
142 8ffadf76 Rafael Lucas
	$reqdfieldsn = array(gettext("MAC address"));
143 b75d7fd5 Renato Botelho
144 5b237745 Scott Ullrich
	do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
145 4f3401e0 Bill Marquette
146
	/* normalize MAC addresses - lowercase and convert Windows-ized hyphenated MACs to colon delimited */
147
	$_POST['mac'] = strtolower(str_replace("-", ":", $_POST['mac']));
148 b75d7fd5 Renato Botelho
149 46c5b763 pierrepomes
	if ($_POST['hostname']) {
150 392687e5 Erik Fonnesbeck
		preg_match("/\-\$/", $_POST['hostname'], $matches);
151 d0ce82a3 Scott Ullrich
		if($matches)
152 b75d7fd5 Renato Botelho
			$input_errors[] = gettext("The hostname cannot end with a hyphen according to RFC952");
153 46c5b763 pierrepomes
		if (!is_hostname($_POST['hostname'])) {
154 8ffadf76 Rafael Lucas
			$input_errors[] = gettext("The hostname can only contain the characters A-Z, 0-9 and '-'.");
155 46c5b763 pierrepomes
		} else {
156
			if (strpos($_POST['hostname'],'.')) {
157 8ffadf76 Rafael Lucas
				$input_errors[] = gettext("A valid hostname is specified, but the domain name part should be omitted");
158 46c5b763 pierrepomes
			}
159
		}
160 6a01ea44 Bill Marquette
	}
161 5b237745 Scott Ullrich
	if (($_POST['ipaddr'] && !is_ipaddr($_POST['ipaddr']))) {
162 8ffadf76 Rafael Lucas
		$input_errors[] = gettext("A valid IP address must be specified.");
163 5b237745 Scott Ullrich
	}
164
	if (($_POST['mac'] && !is_macaddr($_POST['mac']))) {
165 8ffadf76 Rafael Lucas
		$input_errors[] = gettext("A valid MAC address must be specified.");
166 5b237745 Scott Ullrich
	}
167 01292dc2 jim-p
	if($static_arp_enabled && !$_POST['ipaddr']) {
168 f16ba51e Renato Botelho
		$input_errors[] = gettext("Static ARP is enabled.  You must specify an IP address.");
169 0baa37c5 Scott Ullrich
	}
170 b75d7fd5 Renato Botelho
171 5b237745 Scott Ullrich
	/* check for overlaps */
172
	foreach ($a_maps as $mapent) {
173
		if (isset($id) && ($a_maps[$id]) && ($a_maps[$id] === $mapent))
174
			continue;
175
176 f15f4b4d Scott Ullrich
		if ((($mapent['hostname'] == $_POST['hostname']) && $mapent['hostname'])  || ($mapent['mac'] == $_POST['mac'])) {
177 8ffadf76 Rafael Lucas
			$input_errors[] = gettext("This Hostname, IP or MAC address already exists.");
178 5b237745 Scott Ullrich
			break;
179
		}
180
	}
181 b75d7fd5 Renato Botelho
182 5b237745 Scott Ullrich
	/* make sure it's not within the dynamic subnet */
183
	if ($_POST['ipaddr']) {
184 96033063 Erik Fonnesbeck
		$dynsubnet_start = ip2ulong($config['dhcpd'][$if]['range']['from']);
185
		$dynsubnet_end = ip2ulong($config['dhcpd'][$if]['range']['to']);
186 49e4ebf8 jim-p
		if ((ip2ulong($_POST['ipaddr']) >= $dynsubnet_start) &&
187
			(ip2ulong($_POST['ipaddr']) <= $dynsubnet_end)) {
188 ab8d138d jim-p
			$input_errors[] = sprintf(gettext("The IP address must not be within the DHCP range for this interface."));
189
		}
190
191 f657f5e1 Renato Botelho
		foreach ($a_pools as $id => $p) {
192
			if (is_inrange_v4($_POST['ipaddr'], $p['range']['from'], $p['range']['to'])) {
193
				$input_errors[] = gettext("The IP address must not be within the range configured on a DHCP pool for this interface.");
194
				break;
195
			}
196
		}
197
198 96033063 Erik Fonnesbeck
		$lansubnet_start = ip2ulong(long2ip32(ip2long($ifcfgip) & gen_subnet_mask_long($ifcfgsn)));
199
		$lansubnet_end = ip2ulong(long2ip32(ip2long($ifcfgip) | (~gen_subnet_mask_long($ifcfgsn))));
200
		if ((ip2ulong($_POST['ipaddr']) < $lansubnet_start) ||
201
			(ip2ulong($_POST['ipaddr']) > $lansubnet_end)) {
202 8ffadf76 Rafael Lucas
			$input_errors[] = sprintf(gettext("The IP address must lie in the %s subnet."),$ifcfgdescr);
203 5b237745 Scott Ullrich
		}
204
	}
205
206 7309ff39 Renato Botelho
	if (($_POST['gateway'] && !is_ipaddrv4($_POST['gateway'])))
207
		$input_errors[] = gettext("A valid IP address must be specified for the gateway.");
208
	if (($_POST['wins1'] && !is_ipaddrv4($_POST['wins1'])) || ($_POST['wins2'] && !is_ipaddrv4($_POST['wins2'])))
209
		$input_errors[] = gettext("A valid IP address must be specified for the primary/secondary WINS servers.");
210
211
	$parent_ip = get_interface_ip($POST['if']);
212
	if (is_ipaddrv4($parent_ip) && $_POST['gateway']) {
213
		$parent_sn = get_interface_subnet($_POST['if']);
214
		if(!ip_in_subnet($_POST['gateway'], gen_subnet($parent_ip, $parent_sn) . "/" . $parent_sn) && !ip_in_interface_alias_subnet($_POST['if'], $_POST['gateway']))
215
			$input_errors[] = sprintf(gettext("The gateway address %s does not lie within the chosen interface's subnet."), $_POST['gateway']);
216
	}
217
	if (($_POST['dns1'] && !is_ipaddrv4($_POST['dns1'])) || ($_POST['dns2'] && !is_ipaddrv4($_POST['dns2'])))
218
		$input_errors[] = gettext("A valid IP address must be specified for the primary/secondary DNS servers.");
219
220
	if ($_POST['deftime'] && (!is_numeric($_POST['deftime']) || ($_POST['deftime'] < 60)))
221
		$input_errors[] = gettext("The default lease time must be at least 60 seconds.");
222
	if ($_POST['maxtime'] && (!is_numeric($_POST['maxtime']) || ($_POST['maxtime'] < 60) || ($_POST['maxtime'] <= $_POST['deftime'])))
223
		$input_errors[] = gettext("The maximum lease time must be at least 60 seconds and higher than the default lease time.");
224
	if (($_POST['ddnsdomain'] && !is_domain($_POST['ddnsdomain'])))
225
		$input_errors[] = gettext("A valid domain name must be specified for the dynamic DNS registration.");
226
	if ($_POST['domainsearchlist']) {
227
		$domain_array=preg_split("/[ ;]+/",$_POST['domainsearchlist']);
228
		foreach ($domain_array as $curdomain) {
229
			if (!is_domain($curdomain)) {
230
				$input_errors[] = gettext("A valid domain search list must be specified.");
231
				break;
232
			}
233
		}
234
	}
235
236
	if (($_POST['ntp1'] && !is_ipaddrv4($_POST['ntp1'])) || ($_POST['ntp2'] && !is_ipaddrv4($_POST['ntp2'])))
237
		$input_errors[] = gettext("A valid IP address must be specified for the primary/secondary NTP servers.");
238
	if ($_POST['tftp'] && !is_ipaddrv4($_POST['tftp']) && !is_domain($_POST['tftp']) && !is_URL($_POST['tftp']))
239
		$input_errors[] = gettext("A valid IP address or hostname must be specified for the TFTP server.");
240
	if (($_POST['nextserver'] && !is_ipaddrv4($_POST['nextserver'])))
241
		$input_errors[] = gettext("A valid IP address must be specified for the network boot server.");
242
243 5b237745 Scott Ullrich
	if (!$input_errors) {
244
		$mapent = array();
245
		$mapent['mac'] = $_POST['mac'];
246
		$mapent['ipaddr'] = $_POST['ipaddr'];
247 6a01ea44 Bill Marquette
		$mapent['hostname'] = $_POST['hostname'];
248 5b237745 Scott Ullrich
		$mapent['descr'] = $_POST['descr'];
249 25c1ebd5 N0YB
		$mapent['arp_table_static_entry'] = ($_POST['arp_table_static_entry']) ? true : false;
250 a2578c27 Anthony Wrather
		$mapent['filename'] = $_POST['filename'];
251
		$mapent['rootpath'] = $_POST['rootpath'];
252 7309ff39 Renato Botelho
		$mapent['defaultleasetime'] = $_POST['deftime'];
253
		$mapent['maxleasetime'] = $_POST['maxtime'];
254
255
		unset($mapent['winsserver']);
256
		if ($_POST['wins1'])
257
			$mapent['winsserver'][] = $_POST['wins1'];
258
		if ($_POST['wins2'])
259
			$mapent['winsserver'][] = $_POST['wins2'];
260
261
		unset($mapent['dnsserver']);
262
		if ($_POST['dns1'])
263
			$mapent['dnsserver'][] = $_POST['dns1'];
264
		if ($_POST['dns2'])
265
			$mapent['dnsserver'][] = $_POST['dns2'];
266
267
		$mapent['gateway'] = $_POST['gateway'];
268
		$mapent['domain'] = $_POST['domain'];
269
		$mapent['domainsearchlist'] = $_POST['domainsearchlist'];
270
		$mapent['ddnsdomain'] = $_POST['ddnsdomain'];
271
		$mapent['ddnsupdate'] = ($_POST['ddnsupdate']) ? true : false;
272
273
		unset($mapent['ntpserver']);
274
		if ($_POST['ntp1'])
275
			$mapent['ntpserver'][] = $_POST['ntp1'];
276
		if ($_POST['ntp2'])
277
			$mapent['ntpserver'][] = $_POST['ntp2'];
278
279
		$mapent['tftp'] = $_POST['tftp'];
280
		$mapent['ldap'] = $_POST['ldap'];
281 5b237745 Scott Ullrich
282
		if (isset($id) && $a_maps[$id])
283
			$a_maps[$id] = $mapent;
284
		else
285
			$a_maps[] = $mapent;
286 bb9689bd Erik Fonnesbeck
		staticmaps_sort($if);
287 b75d7fd5 Renato Botelho
288 5b237745 Scott Ullrich
		write_config();
289 608ef5e7 Scott Ullrich
290 6a01ea44 Bill Marquette
		if(isset($config['dhcpd'][$if]['enable'])) {
291 a368a026 Ermal Lu?i
			mark_subsystem_dirty('staticmaps');
292 b75d7fd5 Renato Botelho
			if (isset($config['dnsmasq']['regdhcpstatic']))
293 a368a026 Ermal Lu?i
				mark_subsystem_dirty('hosts');
294 6a01ea44 Bill Marquette
		}
295 e4da84d0 Bill Marquette
296 5b237745 Scott Ullrich
		header("Location: services_dhcp.php?if={$if}");
297
		exit;
298
	}
299
}
300 4df96eff Scott Ullrich
301 8ffadf76 Rafael Lucas
$pgtitle = array(gettext("Services"),gettext("DHCP"),gettext("Edit static mapping"));
302 b32dd0a6 jim-p
$shortcut_section = "dhcp";
303 5224b8e7 jim-p
304 4df96eff Scott Ullrich
include("head.inc");
305
306 5b237745 Scott Ullrich
?>
307
308 7309ff39 Renato Botelho
<script type="text/javascript" language="JavaScript">
309
	function show_ddns_config() {
310
		document.getElementById("showddnsbox").innerHTML='';
311
		aodiv = document.getElementById('showddns');
312
		aodiv.style.display = "block";
313
	}
314
315
	function show_ntp_config() {
316
		document.getElementById("showntpbox").innerHTML='';
317
		aodiv = document.getElementById('showntp');
318
		aodiv.style.display = "block";
319
	}
320
321
	function show_tftp_config() {
322
		document.getElementById("showtftpbox").innerHTML='';
323
		aodiv = document.getElementById('showtftp');
324
		aodiv.style.display = "block";
325
	}
326
</script>
327
328 5b237745 Scott Ullrich
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
329
<?php include("fbegin.inc"); ?>
330
<?php if ($input_errors) print_input_errors($input_errors); ?>
331
            <form action="services_dhcp_edit.php" method="post" name="iform" id="iform">
332 7309ff39 Renato Botelho
              <table class="tabcont" width="100%" border="0" cellpadding="6" cellspacing="0">
333 e22987a4 Scott Ullrich
				<tr>
334 8ffadf76 Rafael Lucas
					<td colspan="2" valign="top" class="listtopic"><?=gettext("Static DHCP Mapping");?></td>
335 b75d7fd5 Renato Botelho
				</tr>
336
                <tr>
337 8ffadf76 Rafael Lucas
                  <td width="22%" valign="top" class="vncellreq"><?=gettext("MAC address");?></td>
338 b75d7fd5 Renato Botelho
                  <td width="78%" class="vtable">
339 b5c78501 Seth Mos
                    <input name="mac" type="text" class="formfld unknown" id="mac" size="30" value="<?=htmlspecialchars($pconfig['mac']);?>">
340 f183b092 Scott Ullrich
		    <?php
341
			$ip = getenv('REMOTE_ADDR');
342
			$mac = `/usr/sbin/arp -an | grep {$ip} | cut -d" " -f4`;
343
			$mac = str_replace("\n","",$mac);
344
		    ?>
345 b75d7fd5 Renato Botelho
		    <a OnClick="document.forms[0].mac.value='<?=$mac?>';" href="#"><?=gettext("Copy my MAC address");?></a>
346 5b237745 Scott Ullrich
                    <br>
347 8ffadf76 Rafael Lucas
                    <span class="vexpl"><?=gettext("Enter a MAC address in the following format: ".
348
                    "xx:xx:xx:xx:xx:xx");?></span></td>
349 5b237745 Scott Ullrich
                </tr>
350 b75d7fd5 Renato Botelho
                <tr>
351 8ffadf76 Rafael Lucas
                  <td width="22%" valign="top" class="vncell"><?=gettext("IP address");?></td>
352 b75d7fd5 Renato Botelho
                  <td width="78%" class="vtable">
353 b5c78501 Seth Mos
                    <input name="ipaddr" type="text" class="formfld unknown" id="ipaddr" size="20" value="<?=htmlspecialchars($pconfig['ipaddr']);?>">
354 5b237745 Scott Ullrich
                    <br>
355 dbb1cdb5 jim-p
			<?=gettext("If an IPv4 address is entered, the address must be outside of the pool.");?>
356
			<br/>
357
			<?=gettext("If no IPv4 address is given, one will be dynamically allocated from the pool.");?>
358
			</td>
359 5b237745 Scott Ullrich
                </tr>
360 b75d7fd5 Renato Botelho
                <tr>
361 8ffadf76 Rafael Lucas
                  <td width="22%" valign="top" class="vncell"><?=gettext("Hostname");?></td>
362 b75d7fd5 Renato Botelho
                  <td width="78%" class="vtable">
363 b5c78501 Seth Mos
                    <input name="hostname" type="text" class="formfld unknown" id="hostname" size="20" value="<?=htmlspecialchars($pconfig['hostname']);?>">
364 8ffadf76 Rafael Lucas
                    <br> <span class="vexpl"><?=gettext("Name of the host, without domain part.");?></span></td>
365 b75d7fd5 Renato Botelho
                </tr>
366 d6d50244 Ermal
                <?php if($netboot_enabled) { ?>
367
		<tr>
368 a2578c27 Anthony Wrather
		  <td width="22%" valign="top" class="vncell">Netboot Filename</td>
369 d6d50244 Ermal
		  <td width="78%" class="vtable">
370 a2578c27 Anthony Wrather
		    <input name="filename" type="text" class="formfld unknown" id="filename" size="20" value="<?=htmlspecialchars($pconfig['filename']);?>">
371 d6d50244 Ermal
		    <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>
372
		</tr>
373 a2578c27 Anthony Wrather
		<tr>
374
		  <td width="22%" valign="top" class="vncell">Root Path</td>
375
		  <td width="78%" class="vtable">
376
			<input name="rootpath" type="text" class="formfld unknown" id="rootpath" size="90" value="<?=htmlspecialchars($pconfig['rootpath']);?>">
377
		    <br> <span class="vexpl"><?=gettext("Enter the"); ?> <b><?=gettext("root-path"); ?></b>-<?=gettext("string");?>, overrides setting on main page.</span></td>
378
		</tr>
379 d6d50244 Ermal
		<?php } ?>
380 b75d7fd5 Renato Botelho
                <tr>
381 8ffadf76 Rafael Lucas
                  <td width="22%" valign="top" class="vncell"><?=gettext("Description");?></td>
382 b75d7fd5 Renato Botelho
                  <td width="78%" class="vtable">
383
                    <input name="descr" type="text" class="formfld unknown" id="descr" size="40" value="<?=htmlspecialchars($pconfig['descr']);?>">
384 8ffadf76 Rafael Lucas
                    <br> <span class="vexpl"><?=gettext("You may enter a description here ".
385
                    "for your reference (not parsed).");?></span></td>
386 5b237745 Scott Ullrich
                </tr>
387 b75d7fd5 Renato Botelho
                <tr>
388 25c1ebd5 N0YB
                  <td width="22%" valign="top" class="vncell"><?=gettext("ARP Table Static Entry");?></td>
389 b75d7fd5 Renato Botelho
                  <td width="78%" class="vtable">
390
                    <input name="arp_table_static_entry" id="arp_table_static_entry" type="checkbox" value="yes" <?php if ($pconfig['arp_table_static_entry']) echo "checked"; ?>>
391 25c1ebd5 N0YB
                    <br> <span class="vexpl"><?=gettext("Create an ARP Table Static Entry for this MAC & IP Address pair. ".
392
                    "");?></span></td>
393
                </tr>
394 7309ff39 Renato Botelho
		<tr>
395
		<td width="22%" valign="top" class="vncell"><?=gettext("WINS servers");?></td>
396
		<td width="78%" class="vtable">
397
			<input name="wins1" type="text" class="formfld unknown" id="wins1" size="20" value="<?=htmlspecialchars($pconfig['wins1']);?>"><br>
398
			<input name="wins2" type="text" class="formfld unknown" id="wins2" size="20" value="<?=htmlspecialchars($pconfig['wins2']);?>">
399
		</td>
400
		</tr>
401
		<tr>
402
		<td width="22%" valign="top" class="vncell"><?=gettext("DNS servers");?></td>
403
		<td width="78%" class="vtable">
404
			<input name="dns1" type="text" class="formfld unknown" id="dns1" size="20" value="<?=htmlspecialchars($pconfig['dns1']);?>"><br>
405
			<input name="dns2" type="text" class="formfld unknown" id="dns2" size="20" value="<?=htmlspecialchars($pconfig['dns2']);?>"><br>
406
			<?=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.");?>
407
		</td>
408
		</tr>
409
		<tr>
410
		<td width="22%" valign="top" class="vncell"><?=gettext("Gateway");?></td>
411
		<td width="78%" class="vtable">
412
			<input name="gateway" type="text" class="formfld host" id="gateway" size="20" value="<?=htmlspecialchars($pconfig['gateway']);?>"><br>
413
			 <?=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.");?>
414
		</td>
415
		</tr>
416
		<tr>
417
		<td width="22%" valign="top" class="vncell"><?=gettext("Domain name");?></td>
418
		<td width="78%" class="vtable">
419
			<input name="domain" type="text" class="formfld unknown" id="domain" size="20" value="<?=htmlspecialchars($pconfig['domain']);?>"><br>
420
			 <?=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.");?>
421
		</td>
422
		</tr>
423
		<tr>
424
		<td width="22%" valign="top" class="vncell"><?=gettext("Domain search list");?></td>
425
		<td width="78%" class="vtable">
426
			<input name="domainsearchlist" type="text" class="formfld unknown" id="domainsearchlist" size="20" value="<?=htmlspecialchars($pconfig['domainsearchlist']);?>"><br>
427
			<?=gettext("The DHCP server can optionally provide a domain search list. Use the semicolon character as seperator ");?>
428
		</td>
429
		</tr>
430
		<tr>
431
		<td width="22%" valign="top" class="vncell"><?=gettext("Default lease time");?></td>
432
		<td width="78%" class="vtable">
433
			<input name="deftime" type="text" class="formfld unknown" id="deftime" size="10" value="<?=htmlspecialchars($pconfig['deftime']);?>">
434
			<?=gettext("seconds");?><br>
435
			<?=gettext("This is used for clients that do not ask for a specific " .
436
			"expiration time."); ?><br>
437
			<?=gettext("The default is 7200 seconds.");?>
438
		</td>
439
		</tr>
440
		<tr>
441
		<td width="22%" valign="top" class="vncell"><?=gettext("Maximum lease time");?></td>
442
		<td width="78%" class="vtable">
443
			<input name="maxtime" type="text" class="formfld unknown" id="maxtime" size="10" value="<?=htmlspecialchars($pconfig['maxtime']);?>">
444
			<?=gettext("seconds");?><br>
445
			<?=gettext("This is the maximum lease time for clients that ask".
446
			" for a specific expiration time."); ?><br>
447
			<?=gettext("The default is 86400 seconds.");?>
448
		</td>
449
		</tr>
450
		<tr>
451
		<td width="22%" valign="top" class="vncell"><?=gettext("Dynamic DNS");?></td>
452
		<td width="78%" class="vtable">
453
			<div id="showddnsbox">
454
				<input type="button" onClick="show_ddns_config()" value="<?=gettext("Advanced");?>"></input> - <?=gettext("Show Dynamic DNS");?></a>
455
			</div>
456
			<div id="showddns" style="display:none">
457
				<input valign="middle" type="checkbox" value="yes" name="ddnsupdate" id="ddnsupdate" <?php if($pconfig['ddnsupdate']) echo " checked"; ?>>&nbsp;
458
				<b><?=gettext("Enable registration of DHCP client names in DNS.");?></b><br />
459
				<p>
460
				<input name="ddnsdomain" type="text" class="formfld unknown" id="ddnsdomain" size="20" value="<?=htmlspecialchars($pconfig['ddnsdomain']);?>"><br />
461
				<?=gettext("Note: Leave blank to disable dynamic DNS registration.");?><br />
462
				<?=gettext("Enter the dynamic DNS domain which will be used to register client names in the DNS server.");?>
463
			</div>
464
		</td>
465
		</tr>
466
		<tr>
467
		<td width="22%" valign="top" class="vncell"><?=gettext("NTP servers");?></td>
468
		<td width="78%" class="vtable">
469
			<div id="showntpbox">
470
				<input type="button" onClick="show_ntp_config()" value="<?=gettext("Advanced");?>"></input> - <?=gettext("Show NTP configuration");?></a>
471
			</div>
472
			<div id="showntp" style="display:none">
473
				<input name="ntp1" type="text" class="formfld unknown" id="ntp1" size="20" value="<?=htmlspecialchars($pconfig['ntp1']);?>"><br>
474
				<input name="ntp2" type="text" class="formfld unknown" id="ntp2" size="20" value="<?=htmlspecialchars($pconfig['ntp2']);?>">
475
			</div>
476
		</td>
477
		</tr>
478
		<tr>
479
		<td width="22%" valign="top" class="vncell"><?=gettext("TFTP server");?></td>
480
		<td width="78%" class="vtable">
481
		<div id="showtftpbox">
482
			<input type="button" onClick="show_tftp_config()" value="<?=gettext("Advanced");?>"></input> - <?=gettext("Show TFTP configuration");?></a>
483
		</div>
484
		<div id="showtftp" style="display:none">
485
			<input name="tftp" type="text" class="formfld unknown" id="tftp" size="50" value="<?=htmlspecialchars($pconfig['tftp']);?>"><br>
486
			<?=gettext("Leave blank to disable.  Enter a full hostname or IP for the TFTP server.");?>
487
		</div>
488
		</td>
489
		</tr>
490
		<tr>
491 b75d7fd5 Renato Botelho
                <tr>
492 5b237745 Scott Ullrich
                  <td width="22%" valign="top">&nbsp;</td>
493 b75d7fd5 Renato Botelho
                  <td width="78%">
494 8ffadf76 Rafael Lucas
                    <input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>"> <input class="formbtn" type="button" value="<?=gettext("Cancel");?>" onclick="history.back()">
495 5b237745 Scott Ullrich
                    <?php if (isset($id) && $a_maps[$id]): ?>
496 225a2f0b Scott Ullrich
                    <input name="id" type="hidden" value="<?=htmlspecialchars($id);?>">
497 5b237745 Scott Ullrich
                    <?php endif; ?>
498 b75d7fd5 Renato Botelho
                    <input name="if" type="hidden" value="<?=htmlspecialchars($if);?>">
499 5b237745 Scott Ullrich
                  </td>
500
                </tr>
501
              </table>
502
</form>
503
<?php include("fend.inc"); ?>
504
</body>
505 b75d7fd5 Renato Botelho
</html>