Projet

Général

Profil

Télécharger (13,5 ko) Statistiques
| Branche: | Tag: | Révision:

univnautes / usr / local / www / system_advanced_network.php @ 6b71ebb7

1
<?php
2
/*
3
	system_advanced_network.php
4
	part of pfSense
5
	Copyright (C) 2005-2007 Scott Ullrich
6

    
7
	Copyright (C) 2008 Shrew Soft Inc
8

    
9
	originally part of m0n0wall (http://m0n0.ch/wall)
10
	Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
11
	All rights reserved.
12

    
13
	Redistribution and use in source and binary forms, with or without
14
	modification, are permitted provided that the following conditions are met:
15

    
16
	1. Redistributions of source code must retain the above copyright notice,
17
	   this list of conditions and the following disclaimer.
18

    
19
	2. Redistributions in binary form must reproduce the above copyright
20
	   notice, this list of conditions and the following disclaimer in the
21
	   documentation and/or other materials provided with the distribution.
22

    
23
	THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
24
	INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
25
	AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
26
	AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
27
	OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28
	SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29
	INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30
	CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31
	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32
	POSSIBILITY OF SUCH DAMAGE.
33
*/
34
/*
35
	pfSense_MODULE:	system
36
*/
37

    
38
##|+PRIV
39
##|*IDENT=page-system-advanced-network
40
##|*NAME=System: Advanced: Network page
41
##|*DESCR=Allow access to the 'System: Advanced: Networking' page.
42
##|*MATCH=system_advanced_network.php*
43
##|-PRIV
44

    
45
require("guiconfig.inc");
46
require_once("functions.inc");
47
require_once("filter.inc");
48
require_once("shaper.inc");
49

    
50

    
51
$pconfig['ipv6nat_enable'] = isset($config['diag']['ipv6nat']['enable']);
52
$pconfig['ipv6nat_ipaddr'] = $config['diag']['ipv6nat']['ipaddr'];
53
$pconfig['ipv6allow'] = isset($config['system']['ipv6allow']);
54
$pconfig['polling_enable'] = isset($config['system']['polling']);
55
$pconfig['sharednet'] = $config['system']['sharednet'];
56
$pconfig['disablechecksumoffloading'] = isset($config['system']['disablechecksumoffloading']);
57
$pconfig['disablesegmentationoffloading'] = isset($config['system']['disablesegmentationoffloading']);
58
$pconfig['disablelargereceiveoffloading'] = isset($config['system']['disablelargereceiveoffloading']);
59
$pconfig['flowtable'] = isset($config['system']['flowtable']);
60

    
61
if ($_POST) {
62

    
63
	unset($input_errors);
64
	$pconfig = $_POST;
65

    
66
	if ($_POST['ipv6nat_enable'] && !is_ipaddr($_POST['ipv6nat_ipaddr']))
67
		$input_errors[] = gettext("You must specify an IP address to NAT IPv6 packets.");
68

    
69
	ob_flush();
70
	flush();
71
	if (!$input_errors) {
72

    
73
		if($_POST['ipv6nat_enable'] == "yes") {
74
			$config['diag']['ipv6nat']['enable'] = true;
75
			$config['diag']['ipv6nat']['ipaddr'] = $_POST['ipv6nat_ipaddr'];
76
		} else {
77
			if($config['diag']) {
78
				if($config['diag']['ipv6nat']) {
79
					unset($config['diag']['ipv6nat']['enable']);
80
					unset($config['diag']['ipv6nat']['ipaddr']);
81
				}
82
			}
83
		}
84

    
85
		if($_POST['ipv6allow'] == "yes") {
86
			$config['system']['ipv6allow'] = true;
87
		} else {
88
			unset($config['system']['ipv6allow']);
89
		}
90

    
91
		if($_POST['sharednet'] == "yes") {
92
			$config['system']['sharednet'] = true;
93
			system_disable_arp_wrong_if();
94
		} else {
95
			unset($config['system']['sharednet']);
96
			system_enable_arp_wrong_if();
97
		}
98

    
99
		if($_POST['polling_enable'] == "yes") {
100
			$config['system']['polling'] = true;
101
			setup_polling();
102
		} else {
103
			unset($config['system']['polling']);
104
			setup_polling();
105
		}
106

    
107
		if($_POST['flowtable'] == "yes") {
108
			$config['system']['flowtable'] = $_POST['flowtable'];
109
		} else {
110
			unset($config['system']['flowtable']);
111
		}
112

    
113
		if($_POST['disablechecksumoffloading'] == "yes") {
114
			$config['system']['disablechecksumoffloading'] = true;
115
		} else {
116
			unset($config['system']['disablechecksumoffloading']);
117
		}
118

    
119
		if($_POST['disablesegmentationoffloading'] == "yes") {
120
			$config['system']['disablesegmentationoffloading'] = true;
121
		} else {
122
			unset($config['system']['disablesegmentationoffloading']);
123
		}
124

    
125
		if($_POST['disablelargereceiveoffloading'] == "yes") {
126
			$config['system']['disablelargereceiveoffloading'] = true;
127
		} else {
128
			unset($config['system']['disablelargereceiveoffloading']);
129
		}
130

    
131
		setup_microcode();
132

    
133
		// Write out configuration (config.xml)
134
		write_config();
135

    
136
		// Configure flowtable support from filter.inc
137
		flowtable_configure();
138

    
139
		$retval = filter_configure();
140
		if(stristr($retval, "error") <> true)
141
			$savemsg = get_std_save_message(gettext($retval));
142
		else
143
			$savemsg = gettext($retval);
144
	}
145
}
146

    
147
$pgtitle = array(gettext("System"),gettext("Advanced: Networking"));
148
include("head.inc");
149

    
150
?>
151

    
152
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
153
<?php include("fbegin.inc"); ?>
154

    
155
<script type="text/javascript">
156
//<![CDATA[
157

    
158
function enable_change(enable_over) {
159
	if (document.iform.ipv6nat_enable.checked || enable_over)
160
		document.iform.ipv6nat_ipaddr.disabled = 0;
161
	else
162
		document.iform.ipv6nat_ipaddr.disabled = 1;
163
}
164

    
165
//]]>
166
</script>
167

    
168

    
169
<?
170
	if ($input_errors)
171
		print_input_errors($input_errors);
172
	if ($savemsg)
173
		print_info_box($savemsg);
174
?>
175
	<form action="system_advanced_network.php" method="post" name="iform" id="iform">
176
		<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="system advanced newtwork">
177
			<tr>
178
				<td>
179
					<?php
180
						$tab_array = array();
181
						$tab_array[] = array(gettext("Admin Access"), false, "system_advanced_admin.php");
182
						$tab_array[] = array(gettext("Firewall / NAT"), false, "system_advanced_firewall.php");
183
						$tab_array[] = array(gettext("Networking"), true, "system_advanced_network.php");
184
						$tab_array[] = array(gettext("Miscellaneous"), false, "system_advanced_misc.php");
185
						$tab_array[] = array(gettext("System Tunables"), false, "system_advanced_sysctl.php");
186
						$tab_array[] = array(gettext("Notifications"), false, "system_advanced_notifications.php");
187
						display_top_tabs($tab_array);
188
					?>
189
				</td>
190
			</tr>
191
			<tr>
192
				<td id="mainarea">
193
					<div class="tabcont">
194
						<span class="vexpl">
195
						<span class="red">
196
								<strong><?=gettext("NOTE:"); ?>&nbsp;</strong>
197
							</span>
198
							<?=gettext("The options on this page are intended for use by advanced users only."); ?>
199
							<br/>
200
						</span>
201
						<br/>
202
						<table width="100%" border="0" cellpadding="6" cellspacing="0" summary="main area">
203
							<tr>
204
								<td colspan="2" valign="top" class="listtopic"><?=gettext("IPv6 Options"); ?></td>
205
							</tr>
206
							<tr>
207
								<td width="22%" valign="top" class="vncell"><?=gettext("Allow IPv6"); ?></td>
208
								<td width="78%" class="vtable">
209
									<input name="ipv6allow" type="checkbox" id="ipv6allow" value="yes" <?php if ($pconfig['ipv6allow']) echo "checked=\"checked\""; ?> onclick="enable_change(false)" />
210
									<strong><?=gettext("Allow IPv6"); ?></strong><br/>
211
									<?=gettext("All IPv6 traffic will be blocked by the firewall unless this box is checked."); ?><br/>
212
									<?=gettext("NOTE: This does not disable any IPv6 features on the firewall, it only blocks traffic."); ?><br/>
213
									<br/>
214
								</td>
215
							</tr>
216
							<tr>
217
								<td width="22%" valign="top" class="vncell"><?=gettext("IPv6 over IPv4 Tunneling"); ?></td>
218
								<td width="78%" class="vtable">
219
									<input name="ipv6nat_enable" type="checkbox" id="ipv6nat_enable" value="yes" <?php if ($pconfig['ipv6nat_enable']) echo "checked=\"checked\""; ?> onclick="enable_change(false)" />
220
									<strong><?=gettext("Enable IPv4 NAT encapsulation of IPv6 packets"); ?></strong><br/>
221
									<?=gettext("This provides an RFC 2893 compatibility mechanism ".
222
									"that can be used to tunneling IPv6 packets over IPv4 ".
223
									"routing infrastructures. If enabled, don't forget to ".
224
									"add a firewall rule to permit IPv6 packets."); ?><br/>
225
									<br/>
226
									<?=gettext("IP address"); ?>&nbsp;:&nbsp;
227
									<input name="ipv6nat_ipaddr" type="text" class="formfld unknown" id="ipv6nat_ipaddr" size="20" value="<?=htmlspecialchars($pconfig['ipv6nat_ipaddr']);?>" />
228
								</td>
229
							</tr>
230
							<tr>
231
								<td colspan="2" class="list" height="12">&nbsp;</td>
232
							</tr>
233
							<tr>
234
								<td colspan="2" valign="top" class="listtopic"><?=gettext("Network Interfaces"); ?></td>
235
							</tr>
236
							<tr>
237
								<td width="22%" valign="top" class="vncell"><?=gettext("Device polling"); ?></td>
238
								<td width="78%" class="vtable">
239
									<input name="polling_enable" type="checkbox" id="polling_enable" value="yes" <?php if ($pconfig['polling_enable']) echo "checked=\"checked\""; ?> />
240
									<strong><?=gettext("Enable device polling"); ?></strong><br />
241
									<?php printf(gettext("Device polling is a technique that lets the system periodically poll network devices for new data instead of relying on interrupts. This prevents your webConfigurator, SSH, etc. from being inaccessible due to interrupt floods when under extreme load. Generally this is not recommended. Not all NICs support polling; see the %s homepage for a list of supported cards."), $g['product_name']); ?>
242
								</td>
243
							</tr>
244
							<tr>
245
								<td width="22%" valign="top" class="vncell"><?=gettext("Hardware Checksum Offloading"); ?></td>
246
								<td width="78%" class="vtable">
247
									<input name="disablechecksumoffloading" type="checkbox" id="disablechecksumoffloading" value="yes" <?php if (isset($config['system']['disablechecksumoffloading'])) echo "checked=\"checked\""; ?> />
248
									<strong><?=gettext("Disable hardware checksum offload"); ?></strong><br />
249
									<?=gettext("Checking this option will disable hardware checksum offloading. Checksum offloading is broken in some hardware, particularly some Realtek cards. Rarely, drivers may have problems with checksum offloading and some specific NICs."); ?>
250
									<br/>
251
									<span class="red"><strong><?=gettext("Note:");?>&nbsp;</strong></span>
252
									<?=gettext("This will take effect after you reboot the machine or re-configure each interface.");?>
253
								</td>
254
							</tr>
255
							<tr>
256
								<td width="22%" valign="top" class="vncell"><?=gettext("Hardware TCP Segmentation Offloading"); ?></td>
257
								<td width="78%" class="vtable">
258
									<input name="disablesegmentationoffloading" type="checkbox" id="disablesegmentationoffloading" value="yes" <?php if (isset($config['system']['disablesegmentationoffloading'])) echo "checked=\"checked\""; ?> />
259
									<strong><?=gettext("Disable hardware TCP segmentation offload"); ?></strong><br />
260
									<?=gettext("Checking this option will disable hardware TCP segmentation offloading (TSO, TSO4, TSO6). This offloading is broken in some hardware drivers, and may impact performance with some specific NICs."); ?>
261
									<br/>
262
									<span class="red"><strong><?=gettext("Note:");?>&nbsp;</strong></span>
263
									<?=gettext("This will take effect after you reboot the machine or re-configure each interface.");?>
264
								</td>
265
							</tr>
266
							<tr>
267
								<td width="22%" valign="top" class="vncell"><?=gettext("Hardware Large Receive Offloading"); ?></td>
268
								<td width="78%" class="vtable">
269
									<input name="disablelargereceiveoffloading" type="checkbox" id="disablelargereceiveoffloading" value="yes" <?php if (isset($config['system']['disablelargereceiveoffloading'])) echo "checked=\"checked\""; ?> />
270
									<strong><?=gettext("Disable hardware large receive offload"); ?></strong><br />
271
									<?=gettext("Checking this option will disable hardware large receive offloading (LRO). This offloading is broken in some hardware drivers, and may impact performance with some specific NICs."); ?>
272
									<br/>
273
									<span class="red"><strong><?=gettext("Note:");?>&nbsp;</strong></span>
274
									<?=gettext("This will take effect after you reboot the machine or re-configure each interface.");?>
275
								</td>
276
							</tr>
277
							<tr>
278
								<td width="22%" valign="top" class="vncell"><?=gettext("ARP Handling"); ?></td>
279
								<td width="78%" class="vtable">
280
									<input name="sharednet" type="checkbox" id="sharednet" value="yes" <?php if (isset($pconfig['sharednet'])) echo "checked=\"checked\""; ?> />
281
									<strong><?=gettext("Suppress ARP messages"); ?></strong><br />
282
									<?=gettext("This option will suppress ARP log messages when multiple interfaces reside on the same broadcast domain"); ?>
283
								</td>
284
							</tr>
285
<?php
286
/*
287
	$version = get_freebsd_version();
288
	if($version == "8"):
289

    
290
							<tr>
291
								<td colspan="2" class="list" height="12">&nbsp;</td>
292
							</tr>
293
							<tr>
294
								<td colspan="2" valign="top" class="listtopic">Flowtable support</td>
295
							</tr>
296
							<tr>
297
								<td width="22%" valign="top" class="vncell">Enable Flowtable</td>
298
								<td width="78%" class="vtable">
299
									<input name="flowtable" type="checkbox" id="polling_enable" value="yes" <?php if ($pconfig['flowtable']) echo "checked=\"checked\""; ?> />
300
									<strong>Enable flowtable support</strong><br />
301
									Enables infrastructure for caching flows as a means of accelerating L3 and L2 lookups
302
									as well as providing stateful load balancing when used with RADIX_MPATH.<br/>
303
								</td>
304
							</tr>
305
<?php endif; ?>
306
*/
307
?>
308
							<tr>
309
								<td colspan="2" class="list" height="12">&nbsp;</td>
310
							</tr>
311
							<tr>
312
								<td width="22%" valign="top">&nbsp;</td>
313
								<td width="78%"><input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" /></td>
314
							</tr>
315
						</table>
316
					</div>
317
				</td>
318
			</tr>
319
		</table>
320
	</form>
321
	<script type="text/javascript">
322
	//<![CDATA[
323
		enable_change(false);
324
	//]]>
325
	</script>
326

    
327
<?php include("fend.inc"); ?>
328
</body>
329
</html>
(199-199/246)