Project

General

Profile

Download (17 KB) Statistics
| Branch: | Tag: | Revision:
1 03b92764 Scott Ullrich
<?php
2 b46bfcf5 Bill Marquette
/* $Id$ */
3 5b237745 Scott Ullrich
/*
4
	interfaces_opt.php
5
	part of m0n0wall (http://m0n0.ch/wall)
6 03b92764 Scott Ullrich
7 5b237745 Scott Ullrich
	Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
8
	All rights reserved.
9 03b92764 Scott Ullrich
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 03b92764 Scott Ullrich
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 03b92764 Scott Ullrich
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 03b92764 Scott Ullrich
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
32
require("guiconfig.inc");
33
34
unset($index);
35
if ($_GET['index'])
36
	$index = $_GET['index'];
37
else if ($_POST['index'])
38
	$index = $_POST['index'];
39 03b92764 Scott Ullrich
40 5b237745 Scott Ullrich
if (!$index)
41
	exit;
42
43 6cec4795 Scott Ullrich
function remove_bad_chars($string) {
44 ab72b53b Scott Ullrich
	return preg_replace('/[^a-z|_|0-9]/i','',$string);
45 6cec4795 Scott Ullrich
}
46
47 5b237745 Scott Ullrich
$optcfg = &$config['interfaces']['opt' . $index];
48 6cec4795 Scott Ullrich
$optcfg['descr'] = remove_bad_chars($optcfg['descr']);
49 fc959b55 Scott Ullrich
50 6cec4795 Scott Ullrich
$pconfig['descr'] = $optcfg['descr'];
51 5b237745 Scott Ullrich
$pconfig['bridge'] = $optcfg['bridge'];
52 03b92764 Scott Ullrich
53 5b237745 Scott Ullrich
$pconfig['enable'] = isset($optcfg['enable']);
54
55 0311dbd5 Scott Ullrich
$pconfig['blockpriv'] = isset($optcfg['blockpriv']);
56
$pconfig['blockbogons'] = isset($optcfg['blockbogons']);
57
$pconfig['spoofmac'] = $optcfg['spoofmac'];
58
$pconfig['mtu'] = $optcfg['mtu'];
59
60 c1ec2c2f Scott Ullrich
$pconfig['disableftpproxy'] = isset($optcfg['disableftpproxy']);
61 99586fca Scott Ullrich
62 5b237745 Scott Ullrich
/* Wireless interface? */
63
if (isset($optcfg['wireless'])) {
64
	require("interfaces_wlan.inc");
65
	wireless_config_init();
66
}
67
68 0311dbd5 Scott Ullrich
if ($optcfg['ipaddr'] == "dhcp") {
69
	$pconfig['type'] = "DHCP";
70 99586fca Scott Ullrich
	$pconfig['dhcphostname'] = $optcfg['dhcphostname'];
71 0311dbd5 Scott Ullrich
} else {
72
	$pconfig['type'] = "Static";
73
	$pconfig['ipaddr'] = $optcfg['ipaddr'];
74
	$pconfig['subnet'] = $optcfg['subnet'];
75
	$pconfig['gateway'] = $optcfg['gateway'];
76
	$pconfig['pointtopoint'] = $optcfg['pointtopoint'];
77
}
78
79 5b237745 Scott Ullrich
if ($_POST) {
80
81
	unset($input_errors);
82
83 8698218d Scott Ullrich
	/* filter out spaces from descriptions  */
84 6cec4795 Scott Ullrich
	$POST['descr'] = remove_bad_chars($POST['descr']);
85 8698218d Scott Ullrich
86 ee968e4f Scott Ullrich
	if($_POST['gateway'] and $pconfig['gateway'] <> $_POST['gateway']) {
87 6fc5bf35 Scott Ullrich
		/* enumerate slbd gateways and make sure we are not creating a route loop */
88
		if(is_array($config['load_balancer']['lbpool'])) {
89
			foreach($config['load_balancer']['lbpool'] as $lbpool) {
90
				if($lbpool['type'] == "gateway") {
91
				    foreach ((array) $lbpool['servers'] as $server) {
92
			            $svr = split("\|", $server);
93 8bddc5b7 Scott Ullrich
			            if($svr[1] == $pconfig['gateway'])  {
94
			            		$_POST['gateway']  = $pconfig['gateway'];
95 de42a08e Scott Ullrich
			            		$input_errors[] = "Cannot change {$svr[1]} gateway.  It is currently referenced by the load balancer pools.";
96 3955baf1 Scott Ullrich
			            		break;
97 8bddc5b7 Scott Ullrich
			            }
98 6fc5bf35 Scott Ullrich
					}
99
				}
100 8bddc5b7 Scott Ullrich
			}
101
			foreach($config['filter']['rule'] as $rule) {
102 423cd2f4 Scott Ullrich
				if($rule['gateway'] == $_POST['gateway']) {
103 3955baf1 Scott Ullrich
	            		$input_errors[] = "Cannot change {$_POST['gateway']} gateway.  It is currently referenced by the filter rules via policy based routing.";
104
	            		break;
105 8bddc5b7 Scott Ullrich
				}
106
			}
107 6fc5bf35 Scott Ullrich
		}
108
	}
109
110 ee968e4f Scott Ullrich
	$pconfig = $_POST;
111
112 5b237745 Scott Ullrich
	/* input validation */
113
	if ($_POST['enable']) {
114 03b92764 Scott Ullrich
115 5b237745 Scott Ullrich
		/* description unique? */
116
		for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++) {
117
			if ($i != $index) {
118
				if ($config['interfaces']['opt' . $i]['descr'] == $_POST['descr']) {
119
					$input_errors[] = "An interface with the specified description already exists.";
120
				}
121
			}
122
		}
123 03b92764 Scott Ullrich
124 5b237745 Scott Ullrich
		if ($_POST['bridge']) {
125
			/* double bridging? */
126
			for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++) {
127
				if ($i != $index) {
128
					if ($config['interfaces']['opt' . $i]['bridge'] == $_POST['bridge']) {
129 62ce3b9a Scott Ullrich
						//$input_errors[] = "Optional interface {$i} " .
130
						//	"({$config['interfaces']['opt' . $i]['descr']}) is already bridged to " .
131
						//	"the specified interface.";
132 5b237745 Scott Ullrich
					} else if ($config['interfaces']['opt' . $i]['bridge'] == "opt{$index}") {
133 62ce3b9a Scott Ullrich
						//$input_errors[] = "Optional interface {$i} " .
134
						//	"({$config['interfaces']['opt' . $i]['descr']}) is already bridged to " .
135
						//	"this interface.";
136 5b237745 Scott Ullrich
					}
137
				}
138
			}
139
			if ($config['interfaces'][$_POST['bridge']]['bridge']) {
140 62ce3b9a Scott Ullrich
				//$input_errors[] = "The specified interface is already bridged to " .
141
				//	"another interface.";
142 5b237745 Scott Ullrich
			}
143
			/* captive portal on? */
144
			if (isset($config['captiveportal']['enable'])) {
145 c2c399a4 Scott Ullrich
				//$input_errors[] = "Interfaces cannot be bridged while the captive portal is enabled.";
146 5b237745 Scott Ullrich
			}
147
		} else {
148 e4065f5b Scott Ullrich
			if ($_POST['type'] <> "DHCP") {
149
				$reqdfields = explode(" ", "descr ipaddr subnet");
150
				$reqdfieldsn = explode(",", "Description,IP address,Subnet bit count");
151
				do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
152
				if (($_POST['ipaddr'] && !is_ipaddr($_POST['ipaddr']))) {
153
					$input_errors[] = "A valid IP address must be specified.";
154
				}
155
				if (($_POST['subnet'] && !is_numeric($_POST['subnet']))) {
156
					$input_errors[] = "A valid subnet bit count must be specified.";
157
				}
158
				if($_POST['gateway'] <> "" && !is_ipaddr($_POST['gateway'])) {
159
					$input_errors[] = "A valid gateway must be specified.";
160
				}
161 92b17aed Scott Ullrich
			}
162 5b237745 Scott Ullrich
		}
163 3cb6ab88 Bill Marquette
	        if ($_POST['mtu'] && (($_POST['mtu'] < 576) || ($_POST['mtu'] > 1500))) {
164
			$input_errors[] = "The MTU must be between 576 and 1500 bytes.";
165 0138d492 Scott Ullrich
		}		
166 3a843b96 Scott Ullrich
		if (($_POST['spoofmac'] && !is_macaddr($_POST['spoofmac']))) {
167
			$input_errors[] = "A valid MAC address must be specified.";
168
		}		
169 5b237745 Scott Ullrich
	}
170 03b92764 Scott Ullrich
171 f691bc2f Scott Ullrich
	if($_POST['mtu']) {
172
		if($_POST['mtu'] < 24 or $_POST['mtu'] > 1501)
173
			$input_errors[] = "A valid MTU is required 24-1500.";
174
	}
175
	
176 5b237745 Scott Ullrich
	/* Wireless interface? */
177
	if (isset($optcfg['wireless'])) {
178
		$wi_input_errors = wireless_config_post();
179
		if ($wi_input_errors) {
180
			$input_errors = array_merge($input_errors, $wi_input_errors);
181
		}
182
	}
183 03b92764 Scott Ullrich
184 5b237745 Scott Ullrich
	if (!$input_errors) {
185 0311dbd5 Scott Ullrich
186 9a6757a1 Scott Ullrich
		$bridge = discover_bridge($optcfg['if'], filter_translate_type_to_real_interface($optcfg['bridge']));
187 0d429e43 Scott Ullrich
		if($bridge <> "-1") {
188 1665e79c Scott Ullrich
			destroy_bridge($bridge);
189 91e8aab2 Scott Ullrich
		}
190
191 99586fca Scott Ullrich
		unset($optcfg['dhcphostname']);
192 c1ec2c2f Scott Ullrich
		unset($optcfg['disableftpproxy']);
193
		
194
		/* per interface pftpx helper */
195
		if($_POST['disableftpproxy'] == "yes") {
196
			$optcfg['disableftpproxy'] = true;
197
			system_start_ftp_helpers();
198
		} else {			
199
			system_start_ftp_helpers();
200
		}		
201 99586fca Scott Ullrich
202 6cec4795 Scott Ullrich
		$optcfg['descr'] = remove_bad_chars($_POST['descr']);
203 5b237745 Scott Ullrich
		$optcfg['bridge'] = $_POST['bridge'];
204
		$optcfg['enable'] = $_POST['enable'] ? true : false;
205 0311dbd5 Scott Ullrich
206
		if ($_POST['type'] == "Static") {
207
			$optcfg['ipaddr'] = $_POST['ipaddr'];
208
			$optcfg['subnet'] = $_POST['subnet'];
209
			$optcfg['gateway'] = $_POST['gateway'];
210
			if (isset($optcfg['ispointtopoint']))
211
				$optcfg['pointtopoint'] = $_POST['pointtopoint'];
212
		} else if ($_POST['type'] == "DHCP") {
213
			$optcfg['ipaddr'] = "dhcp";
214
			$optcfg['dhcphostname'] = $_POST['dhcphostname'];
215
		}
216 a12d2145 Scott Ullrich
217 2dfb79a4 Scott Ullrich
		$optcfg['blockpriv'] = $_POST['blockpriv'] ? true : false;
218
		$optcfg['blockbogons'] = $_POST['blockbogons'] ? true : false;
219
		$optcfg['spoofmac'] = $_POST['spoofmac'];
220
		$optcfg['mtu'] = $_POST['mtu'];
221
222 5b237745 Scott Ullrich
		write_config();
223 1f8caa36 Scott Ullrich
		
224 824edb6c Scott Ullrich
		$savemsg = get_std_save_message($retval);
225 5b237745 Scott Ullrich
	}
226
}
227 7f43ca88 Scott Ullrich
228
229 931066a8 Bill Marquette
$pgtitle = "Interfaces: Optional {$index} (" . htmlspecialchars($optcfg['descr']) . ")";
230 7f43ca88 Scott Ullrich
include("head.inc");
231
232 5b237745 Scott Ullrich
?>
233 b9e255dd Bill Marquette
234 5b237745 Scott Ullrich
<script language="JavaScript">
235
<!--
236
function enable_change(enable_over) {
237 a23d7248 Scott Ullrich
	var endis;
238
	endis = !((document.iform.bridge.selectedIndex == 0) || enable_over);
239
	document.iform.ipaddr.disabled = endis;
240
	document.iform.subnet.disabled = endis;
241 5b237745 Scott Ullrich
}
242
function ipaddr_change() {
243 6846116e Scott Ullrich
	document.iform.subnet.selectedIndex = gen_bits_opt(document.iform.ipaddr.value);
244 5b237745 Scott Ullrich
}
245 0311dbd5 Scott Ullrich
function type_change(enable_change,enable_change_pptp) {
246
	switch (document.iform.type.selectedIndex) {
247
		case 0:
248 57e97d71 Scott Ullrich
			document.iform.ipaddr.type.disabled = 0;
249 0311dbd5 Scott Ullrich
			document.iform.ipaddr.disabled = 0;
250
			document.iform.subnet.disabled = 0;
251
			document.iform.gateway.disabled = 0;
252
			break;
253
		case 1:
254 57e97d71 Scott Ullrich
			document.iform.ipaddr.type.disabled = 1;
255 0311dbd5 Scott Ullrich
			document.iform.ipaddr.disabled = 1;
256
			document.iform.subnet.disabled = 1;
257
			document.iform.gateway.disabled = 1;
258
			break;
259
	}
260
}
261 5b237745 Scott Ullrich
//-->
262
</script>
263 b9e255dd Bill Marquette
264 5b237745 Scott Ullrich
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
265
<?php include("fbegin.inc"); ?>
266 931066a8 Bill Marquette
<p class="pgtitle"><?=$pgtitle?></p>
267 5b237745 Scott Ullrich
<?php if ($input_errors) print_input_errors($input_errors); ?>
268
<?php if ($savemsg) print_info_box($savemsg); ?>
269
<?php if ($optcfg['if']): ?>
270
            <form action="interfaces_opt.php" method="post" name="iform" id="iform">
271
              <table width="100%" border="0" cellpadding="6" cellspacing="0">
272 7e45fdf4 Scott Ullrich
                <tr>
273 386e9c57 Seth Mos
                  <td colspan="2" valign="top" class="listtopic">Optional Interface Configuration</td>
274 7e45fdf4 Scott Ullrich
                </tr>	      
275 03b92764 Scott Ullrich
                <tr>
276 5b237745 Scott Ullrich
                  <td width="22%" valign="top" class="vtable">&nbsp;</td>
277
                  <td width="78%" class="vtable">
278 007be4f3 Scott Ullrich
			<input name="enable" type="checkbox" value="yes" <?php if ($pconfig['enable']) echo "checked"; ?> onClick="enable_change(false)">
279 5b237745 Scott Ullrich
                    <strong>Enable Optional <?=$index;?> interface</strong></td>
280 0311dbd5 Scott Ullrich
		</tr>
281 03b92764 Scott Ullrich
                <tr>
282 5b237745 Scott Ullrich
                  <td width="22%" valign="top" class="vncell">Description</td>
283 03b92764 Scott Ullrich
                  <td width="78%" class="vtable">
284 5b237745 Scott Ullrich
                    <input name="descr" type="text" class="formfld" id="descr" size="30" value="<?=htmlspecialchars($pconfig['descr']);?>">
285
					<br> <span class="vexpl">Enter a description (name) for the interface here.</span>
286 0311dbd5 Scott Ullrich
		  </td>
287
		</tr>
288
289
                <tr>
290
                  <td colspan="2" valign="top" height="16"></td>
291
                </tr>
292
                <tr>
293
                  <td colspan="2" valign="top" class="listtopic">General configuration</td>
294
                </tr>
295
                <tr>
296
                  <td valign="middle" class="vncell"><strong>Type</strong></td>
297
                  <td class="vtable"> <select name="type" class="formfld" id="type" onchange="type_change()">
298
                      <?php $opts = split(" ", "Static DHCP");
299
				foreach ($opts as $opt): ?>
300
                      <option <?php if ($opt == $pconfig['type']) echo "selected";?>>
301
                      <?=htmlspecialchars($opt);?>
302
                      </option>
303
                      <?php endforeach; ?>
304
                    </select></td>
305
                </tr>
306
                <tr>
307
                  <td valign="top" class="vncell">MAC address</td>
308
                  <td class="vtable"> <input name="spoofmac" type="text" class="formfld" id="spoofmac" size="30" value="<?=htmlspecialchars($pconfig['spoofmac']);?>">
309
		    <?php
310
			$ip = getenv('REMOTE_ADDR');
311
			$mac = `/usr/sbin/arp -an | grep {$ip} | cut -d" " -f4`;
312
			$mac = str_replace("\n","",$mac);
313
		    ?>
314
		    <a OnClick="document.forms[0].spoofmac.value='<?=$mac?>';" href="#">Copy my MAC address</a>   
315
		    <br>
316
                    This field can be used to modify (&quot;spoof&quot;) the MAC
317
                    address of the WAN interface<br>
318
                    (may be required with some cable connections)<br>
319
                    Enter a MAC address in the following format: xx:xx:xx:xx:xx:xx
320
                    or leave blank</td>
321
                </tr>
322
                <tr>
323
                  <td valign="top" class="vncell">MTU</td>
324
                  <td class="vtable"> <input name="mtu" type="text" class="formfld" id="mtu" size="8" value="<?=htmlspecialchars($pconfig['mtu']);?>">
325
                    <br>
326
                    If you enter a value in this field, then MSS clamping for
327
                    TCP connections to the value entered above minus 40 (TCP/IP
328
                    header size) will be in effect. If you leave this field blank,
329
                    an MTU of 1492 bytes for PPPoE and 1500 bytes for all other
330
                    connection types will be assumed.</td>
331
                </tr>
332
		
333 03b92764 Scott Ullrich
                <tr>
334 5b237745 Scott Ullrich
                  <td colspan="2" valign="top" height="16"></td>
335 5b80d869 Scott Ullrich
		</tr>
336
		<tr>
337 a23d7248 Scott Ullrich
                  <td colspan="2" valign="top" class="listtopic">IP configuration</td>
338 5b80d869 Scott Ullrich
		</tr>
339 6d6d0f14 Scott Ullrich
		<tr>
340 5b237745 Scott Ullrich
                  <td width="22%" valign="top" class="vncellreq">Bridge with</td>
341
                  <td width="78%" class="vtable">
342 007be4f3 Scott Ullrich
			<select name="bridge" class="formfld" id="bridge" onChange="enable_change(false)">
343 5b237745 Scott Ullrich
				  	<option <?php if (!$pconfig['bridge']) echo "selected";?> value="">none</option>
344
                      <?php $opts = array('lan' => "LAN", 'wan' => "WAN");
345
					  	for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++) {
346
							if ($i != $index)
347
								$opts['opt' . $i] = "Optional " . $i . " (" .
348
									$config['interfaces']['opt' . $i]['descr'] . ")";
349
						}
350
					foreach ($opts as $opt => $optname): ?>
351 03b92764 Scott Ullrich
                      <option <?php if ($opt == $pconfig['bridge']) echo "selected";?> value="<?=htmlspecialchars($opt);?>">
352 5b237745 Scott Ullrich
                      <?=htmlspecialchars($optname);?>
353
                      </option>
354
                      <?php endforeach; ?>
355
                    </select> </td>
356 6d6d0f14 Scott Ullrich
		</tr>
357 03b92764 Scott Ullrich
                <tr>
358 5b237745 Scott Ullrich
                  <td width="22%" valign="top" class="vncellreq">IP address</td>
359 03b92764 Scott Ullrich
                  <td width="78%" class="vtable">
360 8d8c6030 Scott Ullrich
                    <input name="ipaddr" type="text" class="formfld" id="ipaddr" size="20" value="<?=htmlspecialchars($pconfig['ipaddr']);?>">
361 5b237745 Scott Ullrich
                    /
362
                	<select name="subnet" class="formfld" id="subnet">
363 21ab1cde Scott Ullrich
					<?php
364
					for ($i = 32; $i > 0; $i--) {
365
						if($i <> 31) {
366
							echo "<option value=\"{$i}\" ";
367
							if ($i == $pconfig['subnet']) echo "selected";
368
							echo ">" . $i . "</option>";
369
						}
370
					}
371
					?>                    </select>
372 5b237745 Scott Ullrich
				 </td>
373
				</tr>
374 007be4f3 Scott Ullrich
		<tr>
375 1aaa2a5f Scott Ullrich
                  <td width="22%" valign="top" class="vncell">Gateway</td>
376 007be4f3 Scott Ullrich
                  <td width="78%" class="vtable">
377
			<input name="gateway" value="<?php echo $pconfig['gateway']; ?>">
378 a12d2145 Scott Ullrich
			<br>
379 8b7a1670 cbuechler
			If you have multiple WAN connections, enter the next hop gateway (router) IP address here.  Otherwise, leave this option blank.
380 007be4f3 Scott Ullrich
		  </td>
381
		</tr>
382 3c393400 Scott Ullrich
                <tr>
383
                  <td colspan="2" valign="top" height="16"></td>
384
                </tr>
385
                <tr>
386
                  <td colspan="2" valign="top" class="listtopic">FTP Helper</td>
387
                </tr>		
388
		<tr>
389
			<td width="22%" valign="top" class="vncell">FTP Helper</td>
390
			<td width="78%" class="vtable">
391 0135299b Scott Ullrich
				<input name="disableftpproxy" type="checkbox" id="disableftpproxy" value="yes" <?php if ($pconfig['disableftpproxy']) echo "checked"; ?> onclick="enable_change(false)" />
392 3c393400 Scott Ullrich
				<strong>Disable the userland FTP-Proxy application</strong>
393
				<br />
394
			</td>
395
		</tr>			
396 c435798f Scott Ullrich
				<?php /* Wireless interface? */
397
				if (isset($optcfg['wireless']))
398
					wireless_config_print();
399
				?>		
400 af539d78 Scott Ullrich
                <tr>
401
                  <td colspan="2" valign="top" height="16"></td>
402
                </tr>
403 99586fca Scott Ullrich
                <tr>
404
                  <td colspan="2" valign="top" class="listtopic">DHCP client configuration</td>
405
                </tr>
406
                <tr>
407
                  <td valign="top" class="vncell">Hostname</td>
408
                  <td class="vtable"> <input name="dhcphostname" type="text" class="formfld" id="dhcphostname" size="40" value="<?=htmlspecialchars($pconfig['dhcphostname']);?>">
409
                    <br>
410
                    The value in this field is sent as the DHCP client identifier
411
                    and hostname when requesting a DHCP lease. Some ISPs may require
412
                    this (for client identification).</td>
413
                </tr>
414
                <tr>
415
                  <td colspan="2" valign="top" height="16"></td>
416
                </tr>		
417 c1ec2c2f Scott Ullrich
		<tr>
418 5b237745 Scott Ullrich
                  <td width="22%" valign="top">&nbsp;</td>
419 03b92764 Scott Ullrich
                  <td width="78%">
420
                    <input name="index" type="hidden" value="<?=$index;?>">
421
				  <input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)">
422 5b237745 Scott Ullrich
                  </td>
423
                </tr>
424 03b92764 Scott Ullrich
                <tr>
425 5b237745 Scott Ullrich
                  <td width="22%" valign="top">&nbsp;</td>
426
                  <td width="78%"><span class="vexpl"><span class="red"><strong>Note:<br>
427 c55a8ab9 Holger Bauer
                    </strong></span>be sure to add <a href="firewall_rules.php">firewall rules</a> to permit traffic
428
                    through the interface. You also need firewall rules for an interface in
429
                    bridged mode as the firewall acts as a filtering bridge.</span></td>
430 5b237745 Scott Ullrich
                </tr>
431
              </table>
432
</form>
433
<script language="JavaScript">
434
<!--
435
enable_change(false);
436
//-->
437
</script>
438
<?php else: ?>
439
<p><strong>Optional <?=$index;?> has been disabled because there is no OPT<?=$index;?> interface.</strong></p>
440
<?php endif; ?>
441
<?php include("fend.inc"); ?>
442
</body>
443
</html>
444 e4e8c30f Scott Ullrich
445
<?php
446
if ($_POST) {
447
448
	if (!$input_errors) {
449 2e70a096 Scott Ullrich
		
450
		ob_flush();
451
		flush();
452
		sleep(1);		
453
		
454 e4e8c30f Scott Ullrich
		interfaces_optional_configure_if($index);
455 fd4ce0e0 Scott Ullrich
		
456 610b1136 Scott Ullrich
		reset_carp();
457 f8a059cb Scott Ullrich
458
		/* load graphing functions */
459
		enable_rrd_graphing();	
460 e4e8c30f Scott Ullrich
		
461
		/* sync filter configuration */
462
		filter_configure();
463
	}
464
}
465
?>