1
|
<?php
|
2
|
/* $Id$ */
|
3
|
/*
|
4
|
interfaces_opt.php
|
5
|
Copyright (C) 2007 Scott Ullrich
|
6
|
All rights reserved.
|
7
|
|
8
|
interfaces_opt.php
|
9
|
part of m0n0wall (http://m0n0.ch/wall)
|
10
|
|
11
|
Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
|
12
|
All rights reserved.
|
13
|
|
14
|
Redistribution and use in source and binary forms, with or without
|
15
|
modification, are permitted provided that the following conditions are met:
|
16
|
|
17
|
1. Redistributions of source code must retain the above copyright notice,
|
18
|
this list of conditions and the following disclaimer.
|
19
|
|
20
|
2. Redistributions in binary form must reproduce the above copyright
|
21
|
notice, this list of conditions and the following disclaimer in the
|
22
|
documentation and/or other materials provided with the distribution.
|
23
|
|
24
|
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
25
|
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
26
|
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
27
|
AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
|
28
|
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
29
|
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
30
|
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
31
|
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
32
|
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
33
|
POSSIBILITY OF SUCH DAMAGE.
|
34
|
*/
|
35
|
|
36
|
require("guiconfig.inc");
|
37
|
|
38
|
unset($index);
|
39
|
if ($_GET['index'])
|
40
|
$index = $_GET['index'];
|
41
|
else if ($_POST['index'])
|
42
|
$index = $_POST['index'];
|
43
|
|
44
|
if (!$index)
|
45
|
exit;
|
46
|
|
47
|
function remove_bad_chars($string) {
|
48
|
return preg_replace('/[^a-z|_|0-9]/i','',$string);
|
49
|
}
|
50
|
|
51
|
if (!is_array($config['gateways']['gateway_item']))
|
52
|
$config['gateways']['gateway_item'] = array();
|
53
|
$a_gateways = &$config['gateways']['gateway_item'];
|
54
|
|
55
|
$optcfg = &$config['interfaces']['opt' . $index];
|
56
|
$optcfg['descr'] = remove_bad_chars($optcfg['descr']);
|
57
|
|
58
|
foreach($config['aliases']['alias'] as $alias)
|
59
|
if($alias['name'] == $optcfg['descr'])
|
60
|
$input_errors[] = gettext("Sorry, an alias with the name {$optcfg['descr']} already exists.");
|
61
|
|
62
|
$pconfig['descr'] = $optcfg['descr'];
|
63
|
$pconfig['bridge'] = $optcfg['bridge'];
|
64
|
|
65
|
$pconfig['enable'] = isset($optcfg['enable']);
|
66
|
|
67
|
$pconfig['blockpriv'] = isset($optcfg['blockpriv']);
|
68
|
$pconfig['blockbogons'] = isset($optcfg['blockbogons']);
|
69
|
$pconfig['spoofmac'] = $optcfg['spoofmac'];
|
70
|
$pconfig['mtu'] = $optcfg['mtu'];
|
71
|
|
72
|
$pconfig['disableftpproxy'] = isset($optcfg['disableftpproxy']);
|
73
|
|
74
|
/* Wireless interface? */
|
75
|
if (isset($optcfg['wireless'])) {
|
76
|
require("interfaces_wlan.inc");
|
77
|
wireless_config_init();
|
78
|
}
|
79
|
|
80
|
if ($optcfg['ipaddr'] == "dhcp") {
|
81
|
$pconfig['type'] = "DHCP";
|
82
|
$pconfig['dhcphostname'] = $optcfg['dhcphostname'];
|
83
|
$pconfig['alias-address'] = $optcfg['alias-address'];
|
84
|
$pconfig['alias-subnet'] = $optcfg['alias-subnet'];
|
85
|
} else {
|
86
|
$pconfig['type'] = "Static";
|
87
|
$pconfig['ipaddr'] = $optcfg['ipaddr'];
|
88
|
$pconfig['subnet'] = $optcfg['subnet'];
|
89
|
$pconfig['gateway'] = $optcfg['gateway'];
|
90
|
$pconfig['pointtopoint'] = $optcfg['pointtopoint'];
|
91
|
$pconfig['ap'] = $optcfg['ap'];
|
92
|
$pconfig['phone'] = $optcfg['phone'];
|
93
|
}
|
94
|
|
95
|
if ($_POST) {
|
96
|
|
97
|
unset($input_errors);
|
98
|
|
99
|
/* filter out spaces from descriptions */
|
100
|
$POST['descr'] = remove_bad_chars($POST['descr']);
|
101
|
|
102
|
if($_POST['gateway'] and $pconfig['gateway'] <> $_POST['gateway']) {
|
103
|
/* enumerate slbd gateways and make sure we are not creating a route loop */
|
104
|
if(is_array($config['load_balancer']['lbpool'])) {
|
105
|
foreach($config['load_balancer']['lbpool'] as $lbpool) {
|
106
|
if($lbpool['type'] == "gateway") {
|
107
|
foreach ((array) $lbpool['servers'] as $server) {
|
108
|
$svr = split("\|", $server);
|
109
|
if($svr[1] == $pconfig['gateway']) {
|
110
|
$_POST['gateway'] = $pconfig['gateway'];
|
111
|
$input_errors[] = "Cannot change {$svr[1]} gateway. It is currently referenced by the load balancer pools.";
|
112
|
break;
|
113
|
}
|
114
|
}
|
115
|
}
|
116
|
}
|
117
|
foreach($config['filter']['rule'] as $rule) {
|
118
|
if($rule['gateway'] == $_POST['gateway']) {
|
119
|
$input_errors[] = "Cannot change {$_POST['gateway']} gateway. It is currently referenced by the filter rules via policy based routing.";
|
120
|
break;
|
121
|
}
|
122
|
}
|
123
|
}
|
124
|
}
|
125
|
|
126
|
$pconfig = $_POST;
|
127
|
|
128
|
/* input validation */
|
129
|
if ($_POST['enable']) {
|
130
|
|
131
|
/* description unique? */
|
132
|
for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++) {
|
133
|
if ($i != $index) {
|
134
|
if ($config['interfaces']['opt' . $i]['descr'] == $_POST['descr']) {
|
135
|
$input_errors[] = "An interface with the specified description already exists.";
|
136
|
}
|
137
|
}
|
138
|
}
|
139
|
|
140
|
if ($_POST['bridge']) {
|
141
|
/* double bridging? */
|
142
|
for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++) {
|
143
|
if ($i != $index) {
|
144
|
if ($config['interfaces']['opt' . $i]['bridge'] == $_POST['bridge']) {
|
145
|
//$input_errors[] = "Optional interface {$i} " .
|
146
|
// "({$config['interfaces']['opt' . $i]['descr']}) is already bridged to " .
|
147
|
// "the specified interface.";
|
148
|
} else if ($config['interfaces']['opt' . $i]['bridge'] == "opt{$index}") {
|
149
|
//$input_errors[] = "Optional interface {$i} " .
|
150
|
// "({$config['interfaces']['opt' . $i]['descr']}) is already bridged to " .
|
151
|
// "this interface.";
|
152
|
}
|
153
|
}
|
154
|
}
|
155
|
if ($config['interfaces'][$_POST['bridge']]['bridge']) {
|
156
|
//$input_errors[] = "The specified interface is already bridged to " .
|
157
|
// "another interface.";
|
158
|
}
|
159
|
/* captive portal on? */
|
160
|
if (isset($config['captiveportal']['enable'])) {
|
161
|
//$input_errors[] = "Interfaces cannot be bridged while the captive portal is enabled.";
|
162
|
}
|
163
|
} else {
|
164
|
if ($_POST['type'] <> "DHCP") {
|
165
|
$reqdfields = explode(" ", "descr ipaddr subnet");
|
166
|
$reqdfieldsn = explode(",", "Description,IP address,Subnet bit count");
|
167
|
do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
|
168
|
if (($_POST['ipaddr'] && !is_ipaddr($_POST['ipaddr']))) {
|
169
|
$input_errors[] = "A valid IP address must be specified.";
|
170
|
}
|
171
|
if (($_POST['subnet'] && !is_numeric($_POST['subnet']))) {
|
172
|
$input_errors[] = "A valid subnet bit count must be specified.";
|
173
|
}
|
174
|
if ($_POST['gateway']) {
|
175
|
$match = false;
|
176
|
foreach($a_gateways as $gateway) {
|
177
|
if(in_array($_POST['gateway'], $gateway)) {
|
178
|
$match = true;
|
179
|
}
|
180
|
}
|
181
|
if(!$match)
|
182
|
$input_errors[] = "A valid gateway must be specified.";
|
183
|
}
|
184
|
}
|
185
|
}
|
186
|
if (($_POST['alias-address'] && !is_ipaddr($_POST['alias-address']))) {
|
187
|
$input_errors[] = "A valid alias IP address must be specified.";
|
188
|
}
|
189
|
if (($_POST['alias-subnet'] && !is_numeric($_POST['alias-subnet']))) {
|
190
|
$input_errors[] = "A valid alias subnet bit count must be specified.";
|
191
|
}
|
192
|
|
193
|
if ($_POST['mtu'] && (($_POST['mtu'] < 576) || ($_POST['mtu'] > 1500))) {
|
194
|
$input_errors[] = "The MTU must be between 576 and 1500 bytes.";
|
195
|
}
|
196
|
if (($_POST['spoofmac'] && !is_macaddr($_POST['spoofmac']))) {
|
197
|
$input_errors[] = "A valid MAC address must be specified.";
|
198
|
}
|
199
|
}
|
200
|
|
201
|
if($_POST['mtu']) {
|
202
|
if($_POST['mtu'] < 24 or $_POST['mtu'] > 1501)
|
203
|
$input_errors[] = "A valid MTU is required 24-1500.";
|
204
|
}
|
205
|
|
206
|
/* Wireless interface? */
|
207
|
if (isset($optcfg['wireless'])) {
|
208
|
$wi_input_errors = wireless_config_post();
|
209
|
if ($wi_input_errors) {
|
210
|
$input_errors = array_merge($input_errors, $wi_input_errors);
|
211
|
}
|
212
|
}
|
213
|
|
214
|
if (!$input_errors) {
|
215
|
|
216
|
$bridge = discover_bridge($optcfg['if'], filter_translate_type_to_real_interface($optcfg['bridge']));
|
217
|
if($bridge <> "-1") {
|
218
|
destroy_bridge($bridge);
|
219
|
}
|
220
|
|
221
|
unset($optcfg['dhcphostname']);
|
222
|
unset($optcfg['disableftpproxy']);
|
223
|
|
224
|
/* per interface pftpx helper */
|
225
|
if($_POST['disableftpproxy'] == "yes") {
|
226
|
$optcfg['disableftpproxy'] = true;
|
227
|
system_start_ftp_helpers();
|
228
|
} else {
|
229
|
system_start_ftp_helpers();
|
230
|
}
|
231
|
|
232
|
$optcfg['descr'] = remove_bad_chars($_POST['descr']);
|
233
|
$optcfg['bridge'] = $_POST['bridge'];
|
234
|
$optcfg['enable'] = $_POST['enable'] ? true : false;
|
235
|
|
236
|
if ($_POST['type'] == "Static") {
|
237
|
$optcfg['ipaddr'] = $_POST['ipaddr'];
|
238
|
$optcfg['subnet'] = $_POST['subnet'];
|
239
|
$optcfg['gateway'] = $_POST['gateway'];
|
240
|
if (isset($optcfg['ispointtopoint'])) {
|
241
|
$optcfg['pointtopoint'] = $_POST['pointtopoint'];
|
242
|
$optcfg['ap'] = $_POST['ap'];
|
243
|
$optcfg['phone'] = $_POST['phone'];
|
244
|
}
|
245
|
} else if ($_POST['type'] == "DHCP") {
|
246
|
$optcfg['ipaddr'] = "dhcp";
|
247
|
$optcfg['dhcphostname'] = $_POST['dhcphostname'];
|
248
|
$optcfg['alias-address'] = $_POST['alias-address'];
|
249
|
$optcfg['alias-subnet'] = $_POST['alias-subnet'];
|
250
|
}
|
251
|
|
252
|
$optcfg['blockpriv'] = $_POST['blockpriv'] ? true : false;
|
253
|
$optcfg['blockbogons'] = $_POST['blockbogons'] ? true : false;
|
254
|
$optcfg['spoofmac'] = $_POST['spoofmac'];
|
255
|
$optcfg['mtu'] = $_POST['mtu'];
|
256
|
|
257
|
write_config();
|
258
|
|
259
|
$savemsg = get_std_save_message($retval);
|
260
|
}
|
261
|
}
|
262
|
|
263
|
|
264
|
$pgtitle = array("Interfaces","Optional {$index} (" . htmlspecialchars($optcfg['descr']) . ")");
|
265
|
include("head.inc");
|
266
|
|
267
|
?>
|
268
|
|
269
|
<script language="JavaScript">
|
270
|
<!--
|
271
|
function enable_change(enable_over) {
|
272
|
var endis;
|
273
|
endis = !((document.iform.bridge.selectedIndex == 0) || enable_over);
|
274
|
document.iform.ipaddr.disabled = endis;
|
275
|
document.iform.subnet.disabled = endis;
|
276
|
}
|
277
|
function ipaddr_change() {
|
278
|
document.iform.subnet.selectedIndex = gen_bits_opt(document.iform.ipaddr.value);
|
279
|
}
|
280
|
function type_change(enable_change,enable_change_pptp) {
|
281
|
switch (document.iform.type.selectedIndex) {
|
282
|
case 0:
|
283
|
document.iform.ipaddr.type.disabled = 0;
|
284
|
document.iform.ipaddr.disabled = 0;
|
285
|
document.iform.subnet.disabled = 0;
|
286
|
document.iform.gateway.disabled = 0;
|
287
|
break;
|
288
|
case 1:
|
289
|
document.iform.ipaddr.type.disabled = 1;
|
290
|
document.iform.ipaddr.disabled = 1;
|
291
|
document.iform.subnet.disabled = 1;
|
292
|
document.iform.gateway.disabled = 1;
|
293
|
break;
|
294
|
}
|
295
|
}
|
296
|
|
297
|
function show_mon_config() {
|
298
|
document.getElementById("showmonbox").innerHTML='';
|
299
|
aodiv = document.getElementById('showmon');
|
300
|
aodiv.style.display = "block";
|
301
|
}
|
302
|
|
303
|
//-->
|
304
|
</script>
|
305
|
|
306
|
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
|
307
|
<?php include("fbegin.inc"); ?>
|
308
|
<?php if ($input_errors) print_input_errors($input_errors); ?>
|
309
|
<?php if ($savemsg) print_info_box($savemsg); ?>
|
310
|
<?php if ($optcfg['if']): ?>
|
311
|
<form action="interfaces_opt.php" method="post" name="iform" id="iform">
|
312
|
<table width="100%" border="0" cellpadding="6" cellspacing="0">
|
313
|
<tr>
|
314
|
<td colspan="2" valign="top" class="listtopic">Optional Interface Configuration</td>
|
315
|
</tr>
|
316
|
<tr>
|
317
|
<td width="22%" valign="top" class="vtable"> </td>
|
318
|
<td width="78%" class="vtable">
|
319
|
<input name="enable" type="checkbox" value="yes" <?php if ($pconfig['enable']) echo "checked"; ?> onClick="enable_change(false)">
|
320
|
<strong>Enable Optional <?=$index;?> interface</strong></td>
|
321
|
</tr>
|
322
|
<tr>
|
323
|
<td width="22%" valign="top" class="vncell">Description</td>
|
324
|
<td width="78%" class="vtable">
|
325
|
<input name="descr" type="text" class="formfld unknown" id="descr" size="30" value="<?=htmlspecialchars($pconfig['descr']);?>">
|
326
|
<br> <span class="vexpl">Enter a description (name) for the interface here.</span>
|
327
|
</td>
|
328
|
</tr>
|
329
|
|
330
|
<tr>
|
331
|
<td colspan="2" valign="top" height="16"></td>
|
332
|
</tr>
|
333
|
<tr>
|
334
|
<td colspan="2" valign="top" class="listtopic">General configuration</td>
|
335
|
</tr>
|
336
|
<?php if (isset($optcfg['pointtopoint'])): ?>
|
337
|
<tr>
|
338
|
<td width="22%" valign="top" class="vncell">AP Hostname</td>
|
339
|
<td width="78%" class="vtable">
|
340
|
<input name="ap" type="text" class="formfld" id="ap" size="40" value="<?=htmlspecialchars($pconfig['ap']);?>">
|
341
|
</td>
|
342
|
</tr>
|
343
|
<tr>
|
344
|
<td width="22%" valign="top" class="vncell">Phone Number</td>
|
345
|
<td width="78%" class="vtable">
|
346
|
<input name="phone" type="text" class="formfld" id="phone" size="40" value="<?=htmlspecialchars($pconfig['phone']);?>">
|
347
|
</td>
|
348
|
</tr>
|
349
|
<tr>
|
350
|
<td width="22%" valign="top" class="vncell">Remote IP</td>
|
351
|
<td width="78%" class="vtable">
|
352
|
<input name="gateway" type="text" class="formfld" id="gateway" size="40" value="<?=htmlspecialchars($pconfig['gateway']);?>">
|
353
|
</td>
|
354
|
</tr>
|
355
|
|
356
|
<input name="type" type="hidden" value="Static">
|
357
|
<input name="ipaddr" type="hidden" value="0.0.0.0">
|
358
|
<input name="subnet" type="hidden" value="32">
|
359
|
<?php else: ?>
|
360
|
<tr>
|
361
|
<td valign="middle" class="vncell"><strong>Type</strong></td>
|
362
|
<td class="vtable"> <select name="type" class="formselect" id="type" onchange="type_change()">
|
363
|
<?php $opts = split(" ", "Static DHCP");
|
364
|
foreach ($opts as $opt): ?>
|
365
|
<option <?php if ($opt == $pconfig['type']) echo "selected";?>>
|
366
|
<?=htmlspecialchars($opt);?>
|
367
|
</option>
|
368
|
<?php endforeach; ?>
|
369
|
</select></td>
|
370
|
</tr>
|
371
|
<tr>
|
372
|
<td valign="top" class="vncell">MAC address</td>
|
373
|
<td class="vtable"> <input name="spoofmac" type="text" class="formfld unknown" id="spoofmac" size="30" value="<?=htmlspecialchars($pconfig['spoofmac']);?>">
|
374
|
<?php
|
375
|
$ip = getenv('REMOTE_ADDR');
|
376
|
$mac = `/usr/sbin/arp -an | grep {$ip} | cut -d" " -f4`;
|
377
|
$mac = str_replace("\n","",$mac);
|
378
|
?>
|
379
|
<a OnClick="document.forms[0].spoofmac.value='<?=$mac?>';" href="#">Copy my MAC address</a>
|
380
|
<br>
|
381
|
This field can be used to modify ("spoof") the MAC
|
382
|
address of the WAN interface<br>
|
383
|
(may be required with some cable connections)<br>
|
384
|
Enter a MAC address in the following format: xx:xx:xx:xx:xx:xx
|
385
|
or leave blank</td>
|
386
|
</tr>
|
387
|
<tr>
|
388
|
<td valign="top" class="vncell">MTU</td>
|
389
|
<td class="vtable"> <input name="mtu" type="text" class="formfld unknown" id="mtu" size="8" value="<?=htmlspecialchars($pconfig['mtu']);?>">
|
390
|
<br>
|
391
|
If you enter a value in this field, then MSS clamping for
|
392
|
TCP connections to the value entered above minus 40 (TCP/IP
|
393
|
header size) will be in effect. If you leave this field blank,
|
394
|
an MTU of 1492 bytes for PPPoE and 1500 bytes for all other
|
395
|
connection types will be assumed.</td>
|
396
|
</tr>
|
397
|
|
398
|
<tr>
|
399
|
<td colspan="2" valign="top" height="16"></td>
|
400
|
</tr>
|
401
|
<tr>
|
402
|
<td colspan="2" valign="top" class="listtopic">IP configuration</td>
|
403
|
</tr>
|
404
|
<tr>
|
405
|
<td width="22%" valign="top" class="vncellreq">Bridge with</td>
|
406
|
<td width="78%" class="vtable">
|
407
|
<select name="bridge" class="formselect" id="bridge" onChange="enable_change(false)">
|
408
|
<option <?php if (!$pconfig['bridge']) echo "selected";?> value="">none</option>
|
409
|
<?php $opts = array('lan' => "LAN", 'wan' => "WAN");
|
410
|
for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++) {
|
411
|
if ($i != $index)
|
412
|
$opts['opt' . $i] = "Optional " . $i . " (" .
|
413
|
$config['interfaces']['opt' . $i]['descr'] . ")";
|
414
|
}
|
415
|
foreach ($opts as $opt => $optname): ?>
|
416
|
<option <?php if ($opt == $pconfig['bridge']) echo "selected";?> value="<?=htmlspecialchars($opt);?>">
|
417
|
<?=htmlspecialchars($optname);?>
|
418
|
</option>
|
419
|
<?php endforeach; ?>
|
420
|
</select> </td>
|
421
|
</tr>
|
422
|
<tr>
|
423
|
<td width="22%" valign="top" class="vncellreq">IP address</td>
|
424
|
<td width="78%" class="vtable">
|
425
|
<input name="ipaddr" type="text" class="formfld unknown" id="ipaddr" size="20" value="<?=htmlspecialchars($pconfig['ipaddr']);?>">
|
426
|
/
|
427
|
<select name="subnet" class="formselect" id="subnet">
|
428
|
<?php
|
429
|
for ($i = 32; $i > 0; $i--) {
|
430
|
if($i <> 31) {
|
431
|
echo "<option value=\"{$i}\" ";
|
432
|
if ($i == $pconfig['subnet']) echo "selected";
|
433
|
echo ">" . $i . "</option>";
|
434
|
}
|
435
|
}
|
436
|
?> </select>
|
437
|
</td>
|
438
|
</tr>
|
439
|
<tr>
|
440
|
<td valign="top" class="vncellreq">Gateway</td>
|
441
|
<td class="vtable"><select name="gateway" class="formselect" id="gateway">
|
442
|
<?php
|
443
|
if(count($a_gateways) > 0) {
|
444
|
foreach ($a_gateways as $gateway) {
|
445
|
if($gateway['interface'] == "opt{$index}") {
|
446
|
?>
|
447
|
<option value="<?=$gateway['name'];?>" <?php if ($gateway['name'] == $pconfig['gateway']) echo "selected"; ?>>
|
448
|
<?=htmlspecialchars($gateway['name']);?>
|
449
|
</option>
|
450
|
<?php
|
451
|
}
|
452
|
}
|
453
|
}
|
454
|
?>
|
455
|
</select>Select a existing Gateway from the list or add one on the <a href="/system_gateways.php">Gateways</a> page<br>
|
456
|
</td>
|
457
|
</tr>
|
458
|
<?php endif;?>
|
459
|
<tr>
|
460
|
<td colspan="2" valign="top" height="16"></td>
|
461
|
</tr>
|
462
|
<tr>
|
463
|
<td colspan="2" valign="top" class="listtopic">Other</td>
|
464
|
</tr>
|
465
|
<tr>
|
466
|
<td width="22%" valign="top" class="vncell">FTP Helper</td>
|
467
|
<td width="78%" class="vtable">
|
468
|
<input name="disableftpproxy" type="checkbox" id="disableftpproxy" value="yes" <?php if ($pconfig['disableftpproxy']) echo "checked"; ?> onclick="enable_change(false)" />
|
469
|
<strong>Disable the userland FTP-Proxy application</strong>
|
470
|
<br />
|
471
|
</td>
|
472
|
</tr>
|
473
|
<?php /* Wireless interface? */
|
474
|
if (isset($optcfg['wireless']))
|
475
|
wireless_config_print();
|
476
|
?>
|
477
|
<tr>
|
478
|
<td colspan="2" valign="top" height="16"></td>
|
479
|
</tr>
|
480
|
<tr>
|
481
|
<td colspan="2" valign="top" class="listtopic">DHCP client configuration</td>
|
482
|
</tr>
|
483
|
<tr>
|
484
|
<td valign="top" class="vncell">Hostname</td>
|
485
|
<td class="vtable"> <input name="dhcphostname" type="text" class="formfld unknown" id="dhcphostname" size="40" value="<?=htmlspecialchars($pconfig['dhcphostname']);?>">
|
486
|
<br>
|
487
|
The value in this field is sent as the DHCP client identifier
|
488
|
and hostname when requesting a DHCP lease. Some ISPs may require
|
489
|
this (for client identification).</td>
|
490
|
</tr>
|
491
|
<tr>
|
492
|
<td width="100" valign="top" class="vncellreq">Alias IP address</td>
|
493
|
<td class="vtable"> <input name="alias-address" type="text" class="formfld unknown" id="alias-address" size="20" value="<?=htmlspecialchars($pconfig['alias-address']);?>">
|
494
|
<select name="alias-subnet" class="formselect" id="alias-subnet">
|
495
|
<?php
|
496
|
for ($i = 32; $i > 0; $i--) {
|
497
|
if($i <> 31) {
|
498
|
echo "<option value=\"{$i}\" ";
|
499
|
if ($i == $pconfig['alias-subnet']) echo "selected";
|
500
|
echo ">" . $i . "</option>";
|
501
|
}
|
502
|
}
|
503
|
?>
|
504
|
</select>
|
505
|
The value in this field is used as a fixed alias IP address by the
|
506
|
DHCP client.</td>
|
507
|
</tr>
|
508
|
<tr>
|
509
|
<td colspan="2" valign="top" height="16"></td>
|
510
|
</tr>
|
511
|
<tr>
|
512
|
<td width="22%" valign="top"> </td>
|
513
|
<td width="78%">
|
514
|
<input name="index" type="hidden" value="<?=$index;?>">
|
515
|
<input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)">
|
516
|
</td>
|
517
|
</tr>
|
518
|
<tr>
|
519
|
<td width="22%" valign="top"> </td>
|
520
|
<td width="78%"><span class="vexpl"><span class="red"><strong>Note:<br>
|
521
|
</strong></span>be sure to add <a href="firewall_rules.php">firewall rules</a> to permit traffic
|
522
|
through the interface. You also need firewall rules for an interface in
|
523
|
bridged mode as the firewall acts as a filtering bridge.</span></td>
|
524
|
</tr>
|
525
|
</table>
|
526
|
</form>
|
527
|
<script language="JavaScript">
|
528
|
<!--
|
529
|
enable_change(false);
|
530
|
//-->
|
531
|
</script>
|
532
|
<?php else: ?>
|
533
|
<p><strong>Optional <?=$index;?> has been disabled because there is no OPT<?=$index;?> interface.</strong></p>
|
534
|
<?php endif; ?>
|
535
|
<?php include("fend.inc"); ?>
|
536
|
</body>
|
537
|
</html>
|
538
|
|
539
|
<?php
|
540
|
if ($_POST) {
|
541
|
|
542
|
if (!$input_errors) {
|
543
|
|
544
|
ob_flush();
|
545
|
flush();
|
546
|
sleep(1);
|
547
|
|
548
|
interfaces_optional_configure_if($index);
|
549
|
|
550
|
reset_carp();
|
551
|
|
552
|
/* load graphing functions */
|
553
|
enable_rrd_graphing();
|
554
|
|
555
|
/* sync filter configuration */
|
556
|
filter_configure();
|
557
|
|
558
|
/* set up static routes */
|
559
|
system_routing_configure();
|
560
|
|
561
|
}
|
562
|
}
|
563
|
?>
|