. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ ##|+PRIV ##|*IDENT=page-system-advanced-firewall ##|*NAME=System: Advanced: Firewall and NAT page ##|*DESCR=Allow access to the 'System: Advanced: Firewall and NAT' page. ##|*MATCH=system_advanced.php* ##|-PRIV require("guiconfig.inc"); $pconfig['disablefilter'] = $config['system']['disablefilter']; $pconfig['rfc959workaround'] = $config['system']['rfc959workaround']; $pconfig['scrubnodf'] = $config['system']['scrubnodf']; $pconfig['scrubrnid'] = $config['system']['scrubrnid']; $pconfig['tcpidletimeout'] = $config['filter']['tcpidletimeout']; $pconfig['optimization'] = $config['filter']['optimization']; $pconfig['maximumstates'] = $config['system']['maximumstates']; $pconfig['disablenatreflection'] = $config['system']['disablenatreflection']; $pconfig['reflectiontimeout'] = $config['system']['reflectiontimeout']; $pconfig['bypassstaticroutes'] = isset($config['filter']['bypassstaticroutes']); $pconfig['disablescrub'] = isset($config['system']['disablescrub']); if ($_POST) { unset($input_errors); $pconfig = $_POST; /* input validation */ if ($_POST['maximumstates'] && !is_numericint($_POST['maximumstates'])) { $input_errors[] = "The Firewall Maximum States value must be an integer."; } if ($_POST['tcpidletimeout'] && !is_numericint($_POST['tcpidletimeout'])) { $input_errors[] = "The TCP idle timeout must be an integer."; } if ($_POST['reflectiontimeout'] && !is_numericint($_POST['reflectiontimeout'])) { $input_errors[] = "The Reflection timeout must be an integer."; } ob_flush(); flush(); if (!$input_errors) { if($_POST['disablefilter'] == "yes") $config['system']['disablefilter'] = "enabled"; else unset($config['system']['disablefilter']); if($_POST['rfc959workaround'] == "yes") $config['system']['rfc959workaround'] = "enabled"; else unset($config['system']['rfc959workaround']); if($_POST['scrubnodf'] == "yes") $config['system']['scrubnodf'] = "enabled"; else unset($config['system']['scrubnodf']); if($_POST['scrubrnid'] == "yes") $config['system']['scrubrnid'] = "enabled"; else unset($config['system']['scrubrnid']); $config['system']['optimization'] = $_POST['optimization']; $config['system']['maximumstates'] = $_POST['maximumstates']; if($_POST['disablenatreflection'] == "yes") $config['system']['disablenatreflection'] = $_POST['disablenatreflection']; else unset($config['system']['disablenatreflection']); $config['system']['reflectiontimeout'] = $_POST['reflectiontimeout']; if($_POST['bypassstaticroutes'] == "yes") $config['filter']['bypassstaticroutes'] = $_POST['bypassstaticroutes']; else unset($config['filter']['bypassstaticroutes']); if($_POST['disablescrub'] == "yes") $config['system']['disablescrub'] = $_POST['disablescrub']; else unset($config['system']['disablescrub']); write_config(); $retval = 0; config_lock(); $retval = filter_configure(); if(stristr($retval, "error") <> true) $savemsg = get_std_save_message($retval); else $savemsg = $retval; } } $pgtitle = array("System","Advanced: Firewall and NAT"); include("head.inc"); ?>
NOTE:  The options on this page are intended for use by advanced users only.

Firewall Advanced
IP Do-Not-Fragment compatibility /> Clear invalid DF bits instead of dropping the packets
This allows for communications with hosts that generate fragmented packets with the don't fragment (DF) bit set. Linux NFS is known to do this. This will cause the filter to not drop such packets but instead clear the don't fragment bit.
IP Random id generation /> Insert a stronger id into IP header of packets passing through the filter.
Replaces the IP identification field of packets with random values to compensate for operating systems that use predicatable values. This option only applies to packets that are not fragmented after the optional packet reassembly.
Firewall Optimization Options

Select which type of state table optimization your would like to use
Disable Firewall /> Disable all packet filtering.
Note: This converts into a routing only platform!
Note: This will turn off NAT!
Disable Firewall Scrub /> Disables the PF scrubbing option which can sometimes interfere with NFS and PPTP traffic.
Click here for more information.
Firewall Maximum States
Maximum number of connections to hold in the firewall state table.
Note: Leave this blank for the default. On your system the default size is:
Static route filtering /> Bypass firewall rules for traffic on the same interface
This option only applies if you have defined one or more static routes. If it is enabled, traffic that enters and leaves through the same interface will not be checked by the firewall. This may be desirable in some situations where multiple subnets are connected to the same interface.
 
Network Address Translation
Disable NAT Reflection /> Disables the automatic creation of NAT redirect rules for access to your public IP addresses from within your internal networks. Note: Reflection only works on port forward type items and does not work for large ranges > 500 ports.
Reflection Timeout
Enter value for Reflection timeout in seconds.