true) {
$savemsg = get_std_save_message($retval);
} else {
$savemsg = $retval;
}
}
}
$pgtitle = array(gettext("System"), gettext("Advanced: Firewall and NAT"));
include("head.inc");
if ($input_errors)
print_input_errors($input_errors);
if ($savemsg)
print_info_box($savemsg);
$tab_array = array();
$tab_array[] = array(gettext("Admin Access"), false, "system_advanced_admin.php");
$tab_array[] = array(gettext("Firewall / NAT"), true, "system_advanced_firewall.php");
$tab_array[] = array(gettext("Networking"), false, "system_advanced_network.php");
$tab_array[] = array(gettext("Miscellaneous"), false, "system_advanced_misc.php");
$tab_array[] = array(gettext("System Tunables"), false, "system_advanced_sysctl.php");
$tab_array[] = array(gettext("Notifications"), false, "system_advanced_notifications.php");
display_top_tabs($tab_array);
?>
addInput(new Form_Checkbox(
'scrubnodf',
'IP Do-Not-Fragment compatibility',
'Clear invalid DF bits instead of dropping the packets',
isset($config['system']['scrubnodf'])
))->setHelp('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.');
$section->addInput(new Form_Checkbox(
'scrubrnid',
'IP Random id generation',
'Insert a stronger id into IP header of packets passing through the filter.',
isset($config['system']['scrubrnid'])
))->setHelp('Replaces the IP identification field of packets with random values to '.
'compensate for operating systems that use predictable values. This option only '.
'applies to packets that are not fragmented after the optional packet '.
'reassembly.');
$section->addInput($input = new Form_Select(
'optimization',
'Firewall Optimization Options',
$config['system']['optimization'],
array(
'normal' => 'Normal',
'high-latency' => 'High-latency',
'aggressive' => 'Aggressive',
'conservative' => 'Conservative',
)
))->setHelp('Select the type of state table optimization to use');
$section->addInput(new Form_Checkbox(
'disablefilter',
'Disable Firewall',
'Disable all packet filtering.',
isset($config['system']['disablefilter'])
))->setHelp('Note: This converts %s into a routing only platform!
'.
'Note: This will also turn off NAT! If you only want to disable NAT, '.
'and not firewall rules, visit the
Outbound '.
'NAT page.', [$g["product_name"]]);
$section->addInput(new Form_Checkbox(
'disablescrub',
'Disable Firewall Scrub',
'Disables the PF scrubbing option which can sometimes interfere with NFS and PPTP traffic.',
isset($config['system']['disablescrub'])
));
$group = new Form_Group('Firewall Adaptive Timeouts');
$group->add(new Form_Input(
'adaptivestart',
'Adaptive start',
'number',
$pconfig['adaptivestart'],
['min' => 1]
))->setHelp('When the number of state entries exceeds this value, adaptive '.
'scaling begins. All timeout values are scaled linearly with factor '.
'(adaptive.end - number of states) / (adaptive.end - adaptive.start).');
$group->add(new Form_Input(
'adaptiveend',
'Adaptive end',
'number',
$pconfig['adaptiveend'],
['min' => 1]
))->setHelp('When reaching this number of state entries, all timeout values '.
'become zero, effectively purging all state entries immediately. This '.
'value is used to define the scale factor, it should not actually be '.
'reached (set a lower state limit, see below).');
$group->setHelp('Timeouts for states can be scaled adaptively as the number of '.
'state table entries grows. Leave blank for the default (0)');
$section->add($group);
$section->addInput(new Form_Input(
'maximumstates',
'Firewall Maximum States',
'number',
$pconfig['maximumstates'],
['min' => 1, 'placeholder' => pfsense_default_state_size()]
))->setHelp('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: %d', [pfsense_default_state_size()]);
$section->addInput(new Form_Input(
'maximumtableentries',
'Firewall Maximum Table Entries',
'text',
$pconfig['maximumtableentries'],
['placeholder' => pfsense_default_table_entries_size()]
))->setHelp('Maximum number of table entries for systems such as aliases, '.
'sshlockout, snort, etc, combined.
Note: Leave this blank for the '.
'default. On your system the default size is: %d',
[pfsense_default_table_entries_size()]);
$section->addINput(new Form_Input(
'maximumfrags',
'Firewall Maximum Fragment Entries',
'text',
$pconfig['maximumfrags']
))->setHelp('Maximum number of packet fragments to hold for reassembly by scrub rules. Leave this blank for the default (5000)');
$section->addInput(new Form_Checkbox(
'bypassstaticroutes',
'Static route filtering',
'Bypass firewall rules for traffic on the same interface',
$pconfig['bypassstaticroutes']
))->setHelp('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.');
$section->addInput(new Form_Checkbox(
'disablevpnrules',
'Disable Auto-added VPN rules',
'Disable all auto-added VPN rules.',
isset($config['system']['disablevpnrules'])
))->setHelp('
Note: This disables automatically added rules for IPsec, '.
'PPTP.');
$section->addInput(new Form_Checkbox(
'disablereplyto',
'Disable reply-to',
'Disable reply-to on WAN rules',
$pconfig['disablereplyto']
))->setHelp('With Multi-WAN you generally want to ensure traffic leaves the same '.
'interface it arrives on, hence reply-to is added automatically by default. When '.
'using bridging, you must disable this behavior if the WAN gateway IP is '.
'different from the gateway IP of the hosts behind the bridged interface.');
$section->addInput(new Form_Checkbox(
'disablenegate',
'Disable Negate rules',
'Disable Negate rule on policy routing rules',
$pconfig['disablenegate']
))->setHelp('With Multi-WAN you generally want to ensure traffic reaches directly '.
'connected networks and VPN networks when using policy routing. You can disable '.
'this for special purposes but it requires manually creating rules for these '.
'networks');
$section->addInput(new Form_Input(
'aliasesresolveinterval',
'Aliases Hostnames Resolve Interval',
'text',
$pconfig['aliasesresolveinterval'],
['placeholder' => '300']
))->setHelp('Interval, in seconds, that will be used to resolve hostnames '.
'configured on aliases..
Note: Leave this blank for the default '.
'(300s).');
$section->addInput(new Form_Checkbox(
'checkaliasesurlcert',
'Check certificate of aliases URLs',
'Verify HTTPS certificates when downloading alias URLs',
$pconfig['checkaliasesurlcert']
))->setHelp('Make sure the certificate is valid for all HTTPS addresses on '.
'aliases. If it\'s not valid or is revoked, do not download it.');
$form->add($section);
$section = new Form_Section('Bogon Networks');
$section->addInput(new Form_Select(
'bogonsinterval',
'Update Frequency',
empty($pconfig['bogonsinterval']) ? 'monthly' : $pconfig['bogonsinterval'],
array(
'monthly' => 'Monthly',
'weekly' => 'Weekly',
'daily' => 'Daily',
)
))->setHelp('The frequency of updating the lists of IP addresses that are '.
'reserved (but not RFC 1918) or not yet assigned by IANA.');
$form->add($section);
if (count($config['interfaces']) > 1)
{
$section = new Form_Section('Network Address Translation');
if (isset($config['system']['disablenatreflection']))
$value = 'disable';
elseif (!isset($config['system']['enablenatreflectionpurenat']))
$value = 'proxy';
else
$value = 'purenat';
$section->addInput(new Form_Select(
'natreflection',
'NAT Reflection mode for port forwards',
$value,
array(
'disable' => 'disabled',
'proxy' => 'NAT + proxy',
'purenat' => 'Pure NAT',
)
))->setHelp('
- The pure NAT mode uses a set of NAT rules to direct '.
'packets to the target of the port forward. It has better scalability, '.
'but it must be possible to accurately determine the interface and '.
'gateway IP used for communication with the target at the time the '.
'rules are loaded. There are no inherent limits to the number of ports '.
'other than the limits of the protocols. All protocols available for '.
'port forwards are supported.
- The NAT + proxy mode uses a '.
'helper program to send packets to the target of the port forward. '.
'It is useful in setups where the interface and/or gateway IP used '.
'for communication with the target cannot be accurately determined at '.
'the time the rules are loaded. Reflection rules are not created for '.
'ranges larger than 500 ports and will not be used for more than 1000 '.
'ports total between all port forwards. Only TCP and UDP protocols are '.
'supported.
Individual rules may be configured to override '.
'this system setting on a per-rule basis.');
$section->addInput(new Form_Input(
'reflectiontimeout',
'Reflection Timeout',
'number',
$config['system']['reflectiontimeout'],
['min' => 1]
))->setHelp('Enter value for Reflection timeout in seconds.
Note: Only '.
'applies to Reflection on port forwards in NAT + proxy mode.');
$section->addInput(new Form_Checkbox(
'enablebinatreflection',
'Enable NAT Reflection for 1:1 NAT',
'Automatic creation of additional NAT redirect rules from within your internal networks.',
isset($config['system']['enablebinatreflection'])
))->setHelp('Note: Reflection on 1:1 mappings is only for the inbound component of '.
'the 1:1 mappings. This functions the same as the pure NAT mode for port '.
'forwards. For more details, refer to the pure NAT mode description '.
'above. Individual rules may be configured to override this system setting on a '.
'per-rule basis.');
$section->addInput(new Form_Checkbox(
'enablenatreflectionhelper',
'Enable automatic outbound NAT for Reflection',
'Automatic create outbound NAT rules that direct traffic back out to the same subnet it originated from.',
isset($config['system']['enablenatreflectionhelper'])
))->setHelp('Required for full functionality of the pure NAT mode of NAT '.
'Reflection for port forwards or NAT Reflection for 1:1 NAT. Note: This only works '.
'for assigned interfaces. Other interfaces require manually creating the '.
'outbound NAT rules that direct the reply packets back through the router.');
$section->addInput(new Form_Select(
'tftpinterface',
'TFTP Proxy',
$pconfig['tftpinterface'],
get_configured_interface_with_descr(),
true
))->setHelp('Choose the interfaces where you want TFTP proxy helper to be enabled.');
$form->add($section);
}
$section = new Form_Section('State Timeouts');
$group = new Form_Group('TCP Timeouts');
$tcpTimeouts = array('First', 'Opening', 'Established', 'Closing', 'FIN', 'closed');
foreach ($tcpTimeouts as $name)
{
$group->add(new Form_Input(
'tcp'. strtolower($name) .'timeout',
'TCP '. $name,
'number',
$config['system']['tcp'. strtolower($name) .'timeout']
))->setHelp('Enter value for TCP '. $name .' timeout in seconds. Leave blank for '.
'default (recommended).');
}
$section->add($group);
$group = new Form_Group('UDP Timeouts');
$udpTimeouts = array('First', 'Single', 'Multiple');
foreach ($udpTimeouts as $name)
{
$group->add(new Form_Input(
'udp'. strtolower($name) .'timeout',
'UDP '. $name,
'number',
$config['system']['udo'. strtolower($name) .'timeout']
))->setHelp('Enter value for UDP '. $name .' timeout in seconds. Leave blank for '.
'default (recommended).');
}
$section->add($group);
$group = new Form_Group('ICMP Timeouts');
$udpTimeouts = array('First', 'Error');
foreach ($udpTimeouts as $name)
{
$group->add(new Form_Input(
'icmp'. strtolower($name) .'timeout',
'UDP '. $name,
'number',
$config['system']['icmp'. strtolower($name) .'timeout']
))->setHelp('Enter value for ICMP '. $name .' timeout in seconds. Leave blank for '.
'default (recommended).');
}
$section->add($group);
$group = new Form_Group('Other Timeouts');
foreach ($udpTimeouts as $name)
{
$group->add(new Form_Input(
'other'. strtolower($name) .'timeout',
'Other '. $name,
'number',
$config['system']['other'. strtolower($name) .'timeout']
))->setHelp('Enter value for ICMP '. $name .' timeout in seconds. Leave blank for '.
'default (recommended).');
}
$section->add($group);
print $form;
?>