1 |
5b237745
|
Scott Ullrich
|
<?php
|
2 |
b46bfcf5
|
Bill Marquette
|
/* $Id$ */
|
3 |
5b237745
|
Scott Ullrich
|
/*
|
4 |
|
|
services_dhcp.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 |
b7597d4e
|
Bill Marquette
|
require("guiconfig.inc");
|
33 |
5b237745
|
Scott Ullrich
|
|
34 |
|
|
$if = $_GET['if'];
|
35 |
|
|
if ($_POST['if'])
|
36 |
|
|
$if = $_POST['if'];
|
37 |
|
|
|
38 |
|
|
$iflist = array("lan" => "LAN");
|
39 |
|
|
|
40 |
|
|
for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++) {
|
41 |
|
|
$oc = $config['interfaces']['opt' . $i];
|
42 |
|
|
|
43 |
|
|
if (isset($oc['enable']) && $oc['if'] && (!$oc['bridge'])) {
|
44 |
|
|
$iflist['opt' . $i] = $oc['descr'];
|
45 |
|
|
}
|
46 |
|
|
}
|
47 |
|
|
|
48 |
|
|
if (!$if || !isset($iflist[$if]))
|
49 |
|
|
$if = "lan";
|
50 |
|
|
|
51 |
|
|
$pconfig['range_from'] = $config['dhcpd'][$if]['range']['from'];
|
52 |
|
|
$pconfig['range_to'] = $config['dhcpd'][$if]['range']['to'];
|
53 |
|
|
$pconfig['deftime'] = $config['dhcpd'][$if]['defaultleasetime'];
|
54 |
|
|
$pconfig['maxtime'] = $config['dhcpd'][$if]['maxleasetime'];
|
55 |
31c59d0d
|
Scott Ullrich
|
$pconfig['gateway'] = $config['dhcpd'][$if]['gateway'];
|
56 |
5b237745
|
Scott Ullrich
|
list($pconfig['wins1'],$pconfig['wins2']) = $config['dhcpd'][$if]['winsserver'];
|
57 |
06d754d4
|
Scott Ullrich
|
list($pconfig['dns1'],$pconfig['dns2']) = $config['dhcpd'][$if]['dnsserver'];
|
58 |
5b237745
|
Scott Ullrich
|
$pconfig['enable'] = isset($config['dhcpd'][$if]['enable']);
|
59 |
|
|
$pconfig['denyunknown'] = isset($config['dhcpd'][$if]['denyunknown']);
|
60 |
80933129
|
Bill Marquette
|
$pconfig['staticarp'] = isset($config['dhcpd'][$if]['staticarp']);
|
61 |
ea166a33
|
Scott Ullrich
|
$pconfig['failover_peerip'] = $config['dhcpd'][$if]['failover_peerip'];
|
62 |
31c59d0d
|
Scott Ullrich
|
|
63 |
5b237745
|
Scott Ullrich
|
$ifcfg = $config['interfaces'][$if];
|
64 |
|
|
|
65 |
602ebee3
|
Scott Ullrich
|
if (!is_array($config['dhcpd'][$if]['staticmap'])) {
|
66 |
|
|
$config['dhcpd'][$if]['staticmap'] = array();
|
67 |
|
|
}
|
68 |
|
|
staticmaps_sort($if);
|
69 |
5b237745
|
Scott Ullrich
|
$a_maps = &$config['dhcpd'][$if]['staticmap'];
|
70 |
6f5b2c3e
|
Scott Ullrich
|
|
71 |
0ea7462d
|
Bill Marquette
|
function is_inrange($test, $start, $end) {
|
72 |
dd5b2ec6
|
Bill Marquette
|
if ( (ip2long($test) < ip2long($end)) && (ip2long($test) > ip2long($start)) )
|
73 |
0ea7462d
|
Bill Marquette
|
return true;
|
74 |
|
|
else
|
75 |
|
|
return false;
|
76 |
|
|
}
|
77 |
b7597d4e
|
Bill Marquette
|
|
78 |
5b237745
|
Scott Ullrich
|
if ($_POST) {
|
79 |
|
|
|
80 |
|
|
unset($input_errors);
|
81 |
b7597d4e
|
Bill Marquette
|
|
82 |
5b237745
|
Scott Ullrich
|
$pconfig = $_POST;
|
83 |
|
|
|
84 |
|
|
/* input validation */
|
85 |
|
|
if ($_POST['enable']) {
|
86 |
|
|
$reqdfields = explode(" ", "range_from range_to");
|
87 |
|
|
$reqdfieldsn = explode(",", "Range begin,Range end");
|
88 |
|
|
|
89 |
|
|
do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
|
90 |
0ea7462d
|
Bill Marquette
|
|
91 |
|
|
foreach($a_maps as $mapent) {
|
92 |
|
|
if(is_inrange($mapent['ipaddr'], $_POST['range_from'], $_POST['range_to'])) {
|
93 |
|
|
$input_errors[] = "{$mapent['ipaddr']} is inside the range you specified.";
|
94 |
|
|
}
|
95 |
|
|
|
96 |
|
|
}
|
97 |
5b237745
|
Scott Ullrich
|
|
98 |
|
|
if (($_POST['range_from'] && !is_ipaddr($_POST['range_from']))) {
|
99 |
|
|
$input_errors[] = "A valid range must be specified.";
|
100 |
|
|
}
|
101 |
|
|
if (($_POST['range_to'] && !is_ipaddr($_POST['range_to']))) {
|
102 |
|
|
$input_errors[] = "A valid range must be specified.";
|
103 |
|
|
}
|
104 |
f9261419
|
Bill Marquette
|
if (($_POST['gateway'] && !is_ipaddr($_POST['gateway'])))
|
105 |
|
|
$input_errors[] = "A valid IP address must be specified for the gateway.";
|
106 |
5b237745
|
Scott Ullrich
|
if (($_POST['wins1'] && !is_ipaddr($_POST['wins1'])) || ($_POST['wins2'] && !is_ipaddr($_POST['wins2']))) {
|
107 |
4cab31d0
|
Scott Ullrich
|
$input_errors[] = "A valid IP address must be specified for the primary/secondary WINS servers.";
|
108 |
|
|
}
|
109 |
|
|
if (($_POST['dns1'] && !is_ipaddr($_POST['dns1'])) || ($_POST['dns2'] && !is_ipaddr($_POST['dns2']))) {
|
110 |
|
|
$input_errors[] = "A valid IP address must be specified for the primary/secondary DNS servers.";
|
111 |
5b237745
|
Scott Ullrich
|
}
|
112 |
|
|
if ($_POST['deftime'] && (!is_numeric($_POST['deftime']) || ($_POST['deftime'] < 60))) {
|
113 |
|
|
$input_errors[] = "The default lease time must be at least 60 seconds.";
|
114 |
|
|
}
|
115 |
|
|
if ($_POST['maxtime'] && (!is_numeric($_POST['maxtime']) || ($_POST['maxtime'] < 60) || ($_POST['maxtime'] <= $_POST['deftime']))) {
|
116 |
|
|
$input_errors[] = "The maximum lease time must be at least 60 seconds and higher than the default lease time.";
|
117 |
|
|
}
|
118 |
|
|
|
119 |
|
|
if (!$input_errors) {
|
120 |
|
|
/* make sure the range lies within the current subnet */
|
121 |
|
|
$subnet_start = (ip2long($ifcfg['ipaddr']) & gen_subnet_mask_long($ifcfg['subnet']));
|
122 |
|
|
$subnet_end = (ip2long($ifcfg['ipaddr']) | (~gen_subnet_mask_long($ifcfg['subnet'])));
|
123 |
|
|
|
124 |
|
|
if ((ip2long($_POST['range_from']) < $subnet_start) || (ip2long($_POST['range_from']) > $subnet_end) ||
|
125 |
|
|
(ip2long($_POST['range_to']) < $subnet_start) || (ip2long($_POST['range_to']) > $subnet_end)) {
|
126 |
|
|
$input_errors[] = "The specified range lies outside of the current subnet.";
|
127 |
|
|
}
|
128 |
|
|
|
129 |
|
|
if (ip2long($_POST['range_from']) > ip2long($_POST['range_to']))
|
130 |
|
|
$input_errors[] = "The range is invalid (first element higher than second element).";
|
131 |
|
|
|
132 |
|
|
/* make sure that the DHCP Relay isn't enabled on this interface */
|
133 |
|
|
if (isset($config['dhcrelay'][$if]['enable']))
|
134 |
|
|
$input_errors[] = "You must disable the DHCP relay on the {$iflist[$if]} interface before enabling the DHCP server.";
|
135 |
|
|
}
|
136 |
|
|
}
|
137 |
|
|
|
138 |
|
|
if (!$input_errors) {
|
139 |
|
|
$config['dhcpd'][$if]['range']['from'] = $_POST['range_from'];
|
140 |
|
|
$config['dhcpd'][$if]['range']['to'] = $_POST['range_to'];
|
141 |
|
|
$config['dhcpd'][$if]['defaultleasetime'] = $_POST['deftime'];
|
142 |
|
|
$config['dhcpd'][$if]['maxleasetime'] = $_POST['maxtime'];
|
143 |
d378c59b
|
Scott Ullrich
|
$previous = $config['dhcpd'][$if]['failover_peerip'];
|
144 |
|
|
if($previous <> $_POST['failover_peerip']) {
|
145 |
|
|
mwexec("rm -rf /var/dhcpd/var/db/*");
|
146 |
|
|
}
|
147 |
ea166a33
|
Scott Ullrich
|
$config['dhcpd'][$if]['failover_peerip'] = $_POST['failover_peerip'];
|
148 |
|
|
|
149 |
5b237745
|
Scott Ullrich
|
unset($config['dhcpd'][$if]['winsserver']);
|
150 |
|
|
if ($_POST['wins1'])
|
151 |
|
|
$config['dhcpd'][$if]['winsserver'][] = $_POST['wins1'];
|
152 |
|
|
if ($_POST['wins2'])
|
153 |
|
|
$config['dhcpd'][$if]['winsserver'][] = $_POST['wins2'];
|
154 |
4cab31d0
|
Scott Ullrich
|
|
155 |
94a9cf1a
|
Scott Ullrich
|
unset($config['dhcpd'][$if]['dnsserver']);
|
156 |
|
|
|
157 |
|
|
if ($_POST['dns1'])
|
158 |
06d754d4
|
Scott Ullrich
|
$config['dhcpd'][$if]['dnsserver'][] = $_POST['dns1'];
|
159 |
94a9cf1a
|
Scott Ullrich
|
if ($_POST['dns2'])
|
160 |
06d754d4
|
Scott Ullrich
|
$config['dhcpd'][$if]['dnsserver'][] = $_POST['dns2'];
|
161 |
5b237745
|
Scott Ullrich
|
|
162 |
f9261419
|
Bill Marquette
|
$config['dhcpd'][$if]['gateway'] = $_POST['gateway'];
|
163 |
|
|
|
164 |
8c65eb75
|
Scott Ullrich
|
if($_POST['denyunknown'] == "yes")
|
165 |
|
|
$config['dhcpd'][$if]['denyunknown'] = true;
|
166 |
|
|
else
|
167 |
|
|
unset($config['dhcpd'][$if]['denyunknown']);
|
168 |
|
|
|
169 |
|
|
if($_POST['enable'] == "yes")
|
170 |
|
|
$config['dhcpd'][$if]['enable'] = $_POST['enable'];
|
171 |
|
|
else
|
172 |
|
|
unset($config['dhcpd'][$if]['enable']);
|
173 |
|
|
|
174 |
da0ea352
|
Scott Ullrich
|
if($_POST['staticarp'] == "yes") {
|
175 |
8c65eb75
|
Scott Ullrich
|
$config['dhcpd'][$if]['staticarp'] = true;
|
176 |
da0ea352
|
Scott Ullrich
|
} else {
|
177 |
8c65eb75
|
Scott Ullrich
|
unset($config['dhcpd'][$if]['staticarp']);
|
178 |
da0ea352
|
Scott Ullrich
|
}
|
179 |
9c748b70
|
Scott Ullrich
|
|
180 |
5b237745
|
Scott Ullrich
|
write_config();
|
181 |
80933129
|
Bill Marquette
|
|
182 |
|
|
/* static arp configuration */
|
183 |
|
|
if (isset($config['dhcpd'][$if]['staticarp']))
|
184 |
|
|
interfaces_staticarp_configure($if);
|
185 |
5b237745
|
Scott Ullrich
|
|
186 |
|
|
$retval = 0;
|
187 |
824edb6c
|
Scott Ullrich
|
config_lock();
|
188 |
|
|
$retval = services_dhcpd_configure();
|
189 |
|
|
config_unlock();
|
190 |
5b237745
|
Scott Ullrich
|
$savemsg = get_std_save_message($retval);
|
191 |
|
|
}
|
192 |
|
|
}
|
193 |
|
|
|
194 |
|
|
if ($_GET['act'] == "del") {
|
195 |
|
|
if ($a_maps[$_GET['id']]) {
|
196 |
|
|
unset($a_maps[$_GET['id']]);
|
197 |
|
|
write_config();
|
198 |
|
|
header("Location: services_dhcp.php?if={$if}");
|
199 |
|
|
exit;
|
200 |
|
|
}
|
201 |
|
|
}
|
202 |
4df96eff
|
Scott Ullrich
|
|
203 |
|
|
$pgtitle = "Services: DHCP server";
|
204 |
|
|
include("head.inc");
|
205 |
|
|
|
206 |
5b237745
|
Scott Ullrich
|
?>
|
207 |
4df96eff
|
Scott Ullrich
|
|
208 |
5b237745
|
Scott Ullrich
|
<script language="JavaScript">
|
209 |
|
|
<!--
|
210 |
|
|
function enable_change(enable_over) {
|
211 |
07bd3f83
|
Scott Ullrich
|
var endis;
|
212 |
|
|
endis = !(document.iform.enable.checked || enable_over);
|
213 |
|
|
document.iform.range_from.disabled = endis;
|
214 |
|
|
document.iform.range_to.disabled = endis;
|
215 |
|
|
document.iform.wins1.disabled = endis;
|
216 |
|
|
document.iform.wins2.disabled = endis;
|
217 |
4cab31d0
|
Scott Ullrich
|
document.iform.dns1.disabled = endis;
|
218 |
|
|
document.iform.dns2.disabled = endis;
|
219 |
07bd3f83
|
Scott Ullrich
|
document.iform.deftime.disabled = endis;
|
220 |
|
|
document.iform.maxtime.disabled = endis;
|
221 |
f9261419
|
Bill Marquette
|
document.iform.gateway.disabled = endis;
|
222 |
fcffbd13
|
Scott Ullrich
|
document.iform.failover_peerip.disabled = endis;
|
223 |
db6b2be4
|
Scott Ullrich
|
document.iform.staticarp.disabled = endis;
|
224 |
7ceb4368
|
Scott Ullrich
|
document.iform.denyunknown.disabled = endis;
|
225 |
5b237745
|
Scott Ullrich
|
}
|
226 |
|
|
//-->
|
227 |
|
|
</script>
|
228 |
|
|
|
229 |
|
|
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
|
230 |
b7597d4e
|
Bill Marquette
|
<?php include("fbegin.inc"); ?>
|
231 |
74f446e8
|
Bill Marquette
|
<p class="pgtitle"><?=$pgtitle?></p>
|
232 |
5b237745
|
Scott Ullrich
|
<form action="services_dhcp.php" method="post" name="iform" id="iform">
|
233 |
|
|
<?php if ($input_errors) print_input_errors($input_errors); ?>
|
234 |
|
|
<?php if ($savemsg) print_info_box($savemsg); ?>
|
235 |
|
|
<?php if (file_exists($d_staticmapsdirty_path)): ?><p>
|
236 |
|
|
<?php print_info_box_np("The static mapping configuration has been changed.<br>You must apply the changes in order for them to take effect.");?><br>
|
237 |
|
|
<?php endif; ?>
|
238 |
|
|
<table width="100%" border="0" cellpadding="0" cellspacing="0">
|
239 |
|
|
<tr><td>
|
240 |
f0cdf141
|
Scott Ullrich
|
<?php
|
241 |
|
|
/* active tabs */
|
242 |
|
|
$tab_array = array();
|
243 |
|
|
$tabscounter = 0;
|
244 |
|
|
$i = 0;
|
245 |
|
|
foreach ($iflist as $ifent => $ifname) {
|
246 |
|
|
if ($ifent == $if)
|
247 |
|
|
$active = true;
|
248 |
|
|
else
|
249 |
|
|
$active = false;
|
250 |
|
|
$tab_array[] = array($ifname, $active, "services_dhcp.php?if={$ifent}");
|
251 |
|
|
}
|
252 |
|
|
display_top_tabs($tab_array);
|
253 |
|
|
?>
|
254 |
5b237745
|
Scott Ullrich
|
</td></tr>
|
255 |
|
|
<tr>
|
256 |
d732f186
|
Bill Marquette
|
<td>
|
257 |
|
|
<div id="mainarea">
|
258 |
|
|
<table class="tabcont" width="100%" border="0" cellpadding="6" cellspacing="0">
|
259 |
5b237745
|
Scott Ullrich
|
<tr>
|
260 |
|
|
<td width="22%" valign="top" class="vtable"> </td>
|
261 |
|
|
<td width="78%" class="vtable">
|
262 |
8c65eb75
|
Scott Ullrich
|
<input name="enable" type="checkbox" value="yes" <?php if ($pconfig['enable']) echo "checked"; ?> onClick="enable_change(false)">
|
263 |
5b237745
|
Scott Ullrich
|
<strong>Enable DHCP server on
|
264 |
|
|
<?=htmlspecialchars($iflist[$if]);?>
|
265 |
|
|
interface</strong></td>
|
266 |
|
|
</tr>
|
267 |
|
|
<tr>
|
268 |
|
|
<td width="22%" valign="top" class="vtable"> </td>
|
269 |
|
|
<td width="78%" class="vtable">
|
270 |
8c65eb75
|
Scott Ullrich
|
<input name="denyunknown" id="denyunknown" type="checkbox" value="yes" <?php if ($pconfig['denyunknown']) echo "checked"; ?>>
|
271 |
5b237745
|
Scott Ullrich
|
<strong>Deny unknown clients</strong><br>
|
272 |
|
|
If this is checked, only the clients defined below will get DHCP leases from this server. </td>
|
273 |
|
|
</tr>
|
274 |
|
|
<tr>
|
275 |
|
|
<td width="22%" valign="top" class="vncellreq">Subnet</td>
|
276 |
|
|
<td width="78%" class="vtable">
|
277 |
|
|
<?=gen_subnet($ifcfg['ipaddr'], $ifcfg['subnet']);?>
|
278 |
|
|
</td>
|
279 |
|
|
</tr>
|
280 |
|
|
<tr>
|
281 |
|
|
<td width="22%" valign="top" class="vncellreq">Subnet
|
282 |
|
|
mask</td>
|
283 |
|
|
<td width="78%" class="vtable">
|
284 |
|
|
<?=gen_subnet_mask($ifcfg['subnet']);?>
|
285 |
|
|
</td>
|
286 |
|
|
</tr>
|
287 |
|
|
<tr>
|
288 |
|
|
<td width="22%" valign="top" class="vncellreq">Available
|
289 |
|
|
range</td>
|
290 |
|
|
<td width="78%" class="vtable">
|
291 |
|
|
<?=long2ip(ip2long($ifcfg['ipaddr']) & gen_subnet_mask_long($ifcfg['subnet']));?>
|
292 |
|
|
-
|
293 |
|
|
<?=long2ip(ip2long($ifcfg['ipaddr']) | (~gen_subnet_mask_long($ifcfg['subnet']))); ?>
|
294 |
|
|
</td>
|
295 |
|
|
</tr>
|
296 |
|
|
<tr>
|
297 |
|
|
<td width="22%" valign="top" class="vncellreq">Range</td>
|
298 |
|
|
<td width="78%" class="vtable">
|
299 |
|
|
<input name="range_from" type="text" class="formfld" id="range_from" size="20" value="<?=htmlspecialchars($pconfig['range_from']);?>">
|
300 |
25e031a1
|
Scott Ullrich
|
to <input name="range_to" type="text" class="formfld" id="range_to" size="20" value="<?=htmlspecialchars($pconfig['range_to']);?>">
|
301 |
|
|
</td>
|
302 |
5b237745
|
Scott Ullrich
|
</tr>
|
303 |
|
|
<tr>
|
304 |
|
|
<td width="22%" valign="top" class="vncell">WINS servers</td>
|
305 |
|
|
<td width="78%" class="vtable">
|
306 |
|
|
<input name="wins1" type="text" class="formfld" id="wins1" size="20" value="<?=htmlspecialchars($pconfig['wins1']);?>"><br>
|
307 |
25e031a1
|
Scott Ullrich
|
<input name="wins2" type="text" class="formfld" id="wins2" size="20" value="<?=htmlspecialchars($pconfig['wins2']);?>">
|
308 |
|
|
</td>
|
309 |
5b237745
|
Scott Ullrich
|
</tr>
|
310 |
4cab31d0
|
Scott Ullrich
|
<tr>
|
311 |
|
|
<td width="22%" valign="top" class="vncell">DNS servers</td>
|
312 |
|
|
<td width="78%" class="vtable">
|
313 |
|
|
<input name="dns1" type="text" class="formfld" id="dns1" size="20" value="<?=htmlspecialchars($pconfig['dns1']);?>"><br>
|
314 |
25e031a1
|
Scott Ullrich
|
<input name="dns2" type="text" class="formfld" id="dns2" size="20" value="<?=htmlspecialchars($pconfig['dns2']);?>"><br>
|
315 |
|
|
NOTE: leave blank to use the system default DNS servers. This option is handy when your doing CARP+DHCP Failover, etc.
|
316 |
|
|
</td>
|
317 |
4cab31d0
|
Scott Ullrich
|
</tr>
|
318 |
b7597d4e
|
Bill Marquette
|
<tr>
|
319 |
|
|
<td width="22%" valign="top" class="vncell">Gateway</td>
|
320 |
|
|
<td width="78%" class="vtable">
|
321 |
|
|
<input name="gateway" type="text" class="formfld" id="gateway" size="20" value="<?=htmlspecialchars($pconfig['gateway']);?>"><br>
|
322 |
2af4c579
|
Scott Ullrich
|
The default is to use the IP of the firewall as the gateway. Specify an alternate gateway here if this is not the correct gateway for your network.
|
323 |
|
|
</td>
|
324 |
|
|
</tr>
|
325 |
5b237745
|
Scott Ullrich
|
<tr>
|
326 |
|
|
<td width="22%" valign="top" class="vncell">Default lease
|
327 |
|
|
time</td>
|
328 |
|
|
<td width="78%" class="vtable">
|
329 |
|
|
<input name="deftime" type="text" class="formfld" id="deftime" size="10" value="<?=htmlspecialchars($pconfig['deftime']);?>">
|
330 |
|
|
seconds<br>
|
331 |
|
|
This is used for clients that do not ask for a specific
|
332 |
|
|
expiration time.<br>
|
333 |
2af4c579
|
Scott Ullrich
|
The default is 7200 seconds.
|
334 |
|
|
</td>
|
335 |
5b237745
|
Scott Ullrich
|
</tr>
|
336 |
|
|
<tr>
|
337 |
|
|
<td width="22%" valign="top" class="vncell">Maximum lease
|
338 |
|
|
time</td>
|
339 |
|
|
<td width="78%" class="vtable">
|
340 |
|
|
<input name="maxtime" type="text" class="formfld" id="maxtime" size="10" value="<?=htmlspecialchars($pconfig['maxtime']);?>">
|
341 |
|
|
seconds<br>
|
342 |
|
|
This is the maximum lease time for clients that ask
|
343 |
|
|
for a specific expiration time.<br>
|
344 |
2af4c579
|
Scott Ullrich
|
The default is 86400 seconds.
|
345 |
|
|
</td>
|
346 |
5b237745
|
Scott Ullrich
|
</tr>
|
347 |
ea166a33
|
Scott Ullrich
|
<tr>
|
348 |
|
|
<td width="22%" valign="top" class="vncell">Failover peer IP:</td>
|
349 |
|
|
<td width="78%" class="vtable">
|
350 |
fcffbd13
|
Scott Ullrich
|
<input name="failover_peerip" type="text" class="formfld" id="failover_peerip" size="10" value="<?=htmlspecialchars($pconfig['failover_peerip']);?>"><br>
|
351 |
be586e5f
|
Scott Ullrich
|
Leave blank to disable. Enter the REAL address of the other machine. Machines must be using CARP.
|
352 |
ea166a33
|
Scott Ullrich
|
</td>
|
353 |
|
|
</tr>
|
354 |
f1da88f6
|
Bill Marquette
|
<tr>
|
355 |
|
|
<td width="22%" valign="top" class="vncell">Static ARP</td>
|
356 |
e44a0096
|
Scott Ullrich
|
<td width="78%" class="vtable">
|
357 |
|
|
<table>
|
358 |
2af4c579
|
Scott Ullrich
|
<tr>
|
359 |
|
|
<td>
|
360 |
|
|
<input valign="middle" type="checkbox" value="yes" name="staticarp" id="staticarp" <?php if($pconfig['staticarp']) echo " checked"; ?>>
|
361 |
|
|
</td>
|
362 |
|
|
<td>
|
363 |
|
|
<b>Enable Static ARP entries</b>
|
364 |
|
|
</td>
|
365 |
|
|
</tr>
|
366 |
|
|
<tr>
|
367 |
|
|
<td>
|
368 |
|
|
|
369 |
|
|
</td>
|
370 |
|
|
<td>
|
371 |
|
|
<span class="red"><strong>Note:</strong></span> This feature is under development. Only the machines listed below will be able to communicate with the firewall on this NIC. Disabling this has been tested to be broken, a reboot will be required to disable. Be warned!
|
372 |
|
|
</td>
|
373 |
|
|
</tr>
|
374 |
e44a0096
|
Scott Ullrich
|
</table>
|
375 |
|
|
</td>
|
376 |
f1da88f6
|
Bill Marquette
|
</tr>
|
377 |
5b237745
|
Scott Ullrich
|
<tr>
|
378 |
|
|
<td width="22%" valign="top"> </td>
|
379 |
|
|
<td width="78%">
|
380 |
|
|
<input name="if" type="hidden" value="<?=$if;?>">
|
381 |
|
|
<input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)">
|
382 |
|
|
</td>
|
383 |
|
|
</tr>
|
384 |
|
|
<tr>
|
385 |
|
|
<td width="22%" valign="top"> </td>
|
386 |
|
|
<td width="78%"> <p><span class="vexpl"><span class="red"><strong>Note:<br>
|
387 |
|
|
</strong></span>The DNS servers entered in <a href="system.php">System:
|
388 |
|
|
General setup</a> (or the <a href="services_dnsmasq.php">DNS
|
389 |
|
|
forwarder</a>, if enabled) </span><span class="vexpl">will
|
390 |
|
|
be assigned to clients by the DHCP server.<br>
|
391 |
|
|
<br>
|
392 |
|
|
The DHCP lease table can be viewed on the <a href="diag_dhcp_leases.php">Diagnostics:
|
393 |
|
|
DHCP leases</a> page.<br>
|
394 |
2af4c579
|
Scott Ullrich
|
</span></p>
|
395 |
|
|
</td>
|
396 |
5b237745
|
Scott Ullrich
|
</tr>
|
397 |
|
|
</table>
|
398 |
d732f186
|
Bill Marquette
|
<table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
|
399 |
5b237745
|
Scott Ullrich
|
<tr>
|
400 |
2af4c579
|
Scott Ullrich
|
<td width="35%" class="listhdrr">MAC address</td>
|
401 |
5b237745
|
Scott Ullrich
|
<td width="20%" class="listhdrr">IP address</td>
|
402 |
|
|
<td width="35%" class="listhdr">Description</td>
|
403 |
2af4c579
|
Scott Ullrich
|
<td width="10%" class="list">
|
404 |
|
|
</td>
|
405 |
|
|
</tr>
|
406 |
6f5b2c3e
|
Scott Ullrich
|
<?php if(is_array($a_maps)): ?>
|
407 |
5b237745
|
Scott Ullrich
|
<?php $i = 0; foreach ($a_maps as $mapent): ?>
|
408 |
11c9bb94
|
Scott Ullrich
|
<?php if($mapent['mac'] <> "" or $mapent['ipaddr'] <> ""): ?>
|
409 |
5b237745
|
Scott Ullrich
|
<tr>
|
410 |
2d165eff
|
Bill Marquette
|
<td class="listlr" ondblclick="document.location='services_dhcp_edit.php?if=<?=$if;?>&id=<?=$i;?>';">
|
411 |
5b237745
|
Scott Ullrich
|
<?=htmlspecialchars($mapent['mac']);?>
|
412 |
|
|
</td>
|
413 |
2d165eff
|
Bill Marquette
|
<td class="listr" ondblclick="document.location='services_dhcp_edit.php?if=<?=$if;?>&id=<?=$i;?>';">
|
414 |
5b237745
|
Scott Ullrich
|
<?=htmlspecialchars($mapent['ipaddr']);?>
|
415 |
|
|
</td>
|
416 |
2d165eff
|
Bill Marquette
|
<td class="listbg" ondblclick="document.location='services_dhcp_edit.php?if=<?=$if;?>&id=<?=$i;?>';">
|
417 |
588b7fc5
|
Bill Marquette
|
<font color="#FFFFFF"><?=htmlspecialchars($mapent['descr']);?> </font>
|
418 |
5b237745
|
Scott Ullrich
|
</td>
|
419 |
75a70796
|
Bill Marquette
|
<td valign="middle" nowrap class="list">
|
420 |
|
|
<table border="0" cellspacing="0" cellpadding="1">
|
421 |
|
|
<tr>
|
422 |
677c0869
|
Erik Kristensen
|
<td valign="middle"><a href="services_dhcp_edit.php?if=<?=$if;?>&id=<?=$i;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0"></a></td>
|
423 |
|
|
<td valign="middle"><a href="services_dhcp.php?if=<?=$if;?>&act=del&id=<?=$i;?>" onclick="return confirm('Do you really want to delete this mapping?')"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0"></a></td>
|
424 |
75a70796
|
Bill Marquette
|
</tr>
|
425 |
|
|
</table>
|
426 |
|
|
</td>
|
427 |
|
|
</tr>
|
428 |
6f5b2c3e
|
Scott Ullrich
|
<?php endif; ?>
|
429 |
75a70796
|
Bill Marquette
|
<?php $i++; endforeach; ?>
|
430 |
6f5b2c3e
|
Scott Ullrich
|
<?php endif; ?>
|
431 |
5b237745
|
Scott Ullrich
|
<tr>
|
432 |
|
|
<td class="list" colspan="3"></td>
|
433 |
75a70796
|
Bill Marquette
|
<td class="list">
|
434 |
|
|
<table border="0" cellspacing="0" cellpadding="1">
|
435 |
|
|
<tr>
|
436 |
677c0869
|
Erik Kristensen
|
<td valign="middle"><a href="services_dhcp_edit.php?if=<?=$if;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0"></a></td>
|
437 |
75a70796
|
Bill Marquette
|
</tr>
|
438 |
|
|
</table>
|
439 |
|
|
</td>
|
440 |
|
|
</tr>
|
441 |
5b237745
|
Scott Ullrich
|
</table>
|
442 |
d732f186
|
Bill Marquette
|
</div>
|
443 |
5b237745
|
Scott Ullrich
|
</td>
|
444 |
|
|
</tr>
|
445 |
|
|
</table>
|
446 |
|
|
</form>
|
447 |
|
|
<script language="JavaScript">
|
448 |
|
|
<!--
|
449 |
|
|
enable_change(false);
|
450 |
|
|
//-->
|
451 |
|
|
</script>
|
452 |
b7597d4e
|
Bill Marquette
|
<?php include("fend.inc"); ?>
|
453 |
5b237745
|
Scott Ullrich
|
</body>
|
454 |
|
|
</html>
|