Project

General

Profile

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